123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- <template>
- <div>
- <h3>{{ title }}</h3>
- <el-divider />
- <div class="diy-table-1">
- <el-row :gutter="0">
- <el-col :xs="24" :sm="24" :lg="24" class="item">
- <div class="label">登录状态</div>
- <div class="value">
- <el-radio-group v-model="formData.loginStatus">
- <el-radio v-for="item in engType" :key="item.value" :label="item.value">
- {{ item.label }}
- </el-radio>
- </el-radio-group>
- </div>
- </el-col>
- <el-col v-if="formData.loginStatus === 'FAIL'" :xs="24" :sm="24" :lg="24" class="item">
- <div class="label" style="height: auto">选择登录成功项目</div>
- <div class="value" style="height: 100%; display: block">
- <el-col :span="7" class="flex-box">
- <div class="flex-box-title">项目编号{{ formData.loginStatus === 'REJECT' ? '*' : '' }}</div>
- <el-input
- v-model="formData.successLoginProject"
- class="my-input"
- placeholder="请填写"
- size="mini"
- clearable
- >
- <el-button slot="append" @click="handleFocus">引入</el-button>
- </el-input>
- </el-col>
- <el-col :span="7" class="flex-box">
- <div class="flex-box-title">经销商编号</div>
- <el-input v-model="formData.customerNumber" class="my-input" placeholder="请填写" size="mini" clearable />
- </el-col>
- <el-col :span="7" class="flex-box">
- <div class="flex-box-title">经销商名称</div>
- <el-input v-model="formData.customerName" class="my-input" placeholder="请填写" size="mini" clearable />
- </el-col>
- <el-col :span="7" class="flex-box">
- <div class="flex-box-title">业务员编号</div>
- <el-input v-model="formData.serviceNumber" class="my-input" placeholder="请填写" size="mini" clearable />
- </el-col>
- <el-col :span="7" class="flex-box">
- <div class="flex-box-title">业务员名称</div>
- <el-input v-model="formData.serviceName" class="my-input" placeholder="请填写" size="mini" clearable />
- </el-col>
- </div>
- </el-col>
- <el-col :xs="12" :sm="12" :lg="12" class="item">
- <div class="label">审核备注{{ formData.loginStatus === 'REJECT' ? '*' : '' }}</div>
- <div class="value">
- <el-select v-model="formData.examineNote" placeholder="请选择" size="mini" clearable style="width: 100%">
- <el-option
- v-for="item in commonData.dict['TRADE_EXAMINE_NOTE']"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- <el-input
- v-model="formData.note"
- placeholder="请填写"
- :disabled="formData.examineNote !== 'NOTE_3' "
- size="mini"
- clearable
- />
- </div>
- </el-col>
- <el-col :xs="12" :sm="12" :lg="12" class="item">
- <div class="label">共同跟进项目编号</div>
- <div class="value">
- <el-input v-model="formData.commonFollowProject" placeholder="请填写" size="mini" clearable />
- </div>
- </el-col>
- <el-col :xs="24" :sm="24" :lg="24" class="item">
- <div class="label" style="height: auto">审核上传</div>
- <div class="value" style="height: auto">
- <ImageUpload v-if="module !== 'detail'" class="mg-b" :file-list="formData.files" />
- <template v-else>
- <div
- v-for="item in formData.files"
- :key="item.fileUrl"
- style="display: flex; width: 120px; height: 120px; align-items: center; justify-content: center"
- >
- <el-image
- v-if="checkFileType(item.fileUrl) == 'image'"
- ref="img"
- :src="$imageUrl + item.fileUrl"
- fit="cover"
- :preview-src-list="[$imageUrl + item.fileUrl]"
- class="elImageClose"
- />
- <div
- style="display: flex; width: 120px; height: 120px; align-items: center; justify-content: center;cursor: pointer;"
- @click="openPdf(item)"
- >
- <img v-if="checkFileType(item.fileUrl) == 'word'" class="file" src="@/assets/common/word.png">
- <img v-if="checkFileType(item.fileUrl) == 'excel'" class="file" src="@/assets/common/excel.png">
- <img v-if="checkFileType(item.fileUrl) == 'ppt'" class="file" src="@/assets/common/ppt.png">
- <img
- v-if="checkFileType(item.fileUrl) == 'pdf'"
- class="file"
- style="cursor: pointer"
- src="@/assets/common/pdf.png"
- >
- <img v-if="checkFileType(item.fileUrl) == 'file'" class="file aaa" src="@/assets/common/zip.jpeg">
- </div>
- </div>
- </template>
- <div style="margin-left: 20px">注:可上传文件、附件</div>
- </div>
- </el-col>
- </el-row>
- </div>
- <!-- -->
- <LoginSuccess
- :page-type="pageType"
- :form-data="formData"
- :show-dialog="showDialog"
- @success="handleSuccess"
- @cancel="handleCancel"
- />
- </div>
- </template>
- <script>
- import ImageUpload from '@/components/Common/image-upload.vue'
- import LoginSuccess from './loginSuccess.vue'
- export default {
- components: {
- ImageUpload,
- LoginSuccess
- },
- props: {
- title: {
- type: String,
- default: '审核信息'
- },
- formData: {
- type: Object,
- default: () => ({})
- },
- // 页面类型
- pageType: {
- type: String,
- default: 'frock'
- },
- // 功能类型
- module: {
- type: String,
- default: 'add'
- },
- commonData: {
- type: Object,
- default: () => {}
- }
- },
- data() {
- return {
- engType: [
- { label: '登录成功', value: 'OK' },
- { label: '登录不成功', value: 'FAIL' },
- { label: '驳回', value: 'REJECT' }
- ],
- showDialog: false
- }
- },
- created() {
- console.log(this.formData, this.module, 8888)
- },
- methods: {
- handleSuccess(val) {
- console.log(val)
- const res = val[0]
- this.formData.successLoginProject = res.projectNo
- this.formData.customerNumber = res.customerNumber
- this.formData.customerName = res.customerName
- this.formData.serviceName = res.serviceName
- this.formData.serviceNumber = res.serviceNumber
- },
- handleCancel() {
- this.showDialog = false
- },
- handleFocus() {
- this.showDialog = true
- },
- onSbumit() {},
- // 检查文件类型
- checkFileType(url) {
- if (!url) return ''
- const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
- if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
- return 'image'
- } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
- return 'word'
- } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
- return 'excel'
- } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
- return 'ppt'
- } else if (['pdf'].includes(fileSuffix)) {
- return 'pdf'
- } else if (['zip', 'rar', 'gz', 'apk'].includes(fileSuffix)) {
- return 'file'
- } else {
- return ''
- }
- },
- openPdf(item) {
- console.log(item, 999)
- const link = document.createElement('a')
- link.style.display = 'none'
- link.href = this.$imageUrl + item.fileUrl
- link.download = item.fileName
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .diy-table-1 .item .label {
- width: 150px;
- }
- ::v-deep .el-radio {
- margin-right: 120px;
- }
- .flex-box {
- display: flex;
- align-items: center;
- margin: 5px 20px;
- &-title {
- width: 100px;
- }
- }
- ::v-deep .my-input > input {
- padding-left: 10px !important;
- border: 1px solid #dcdfe6 !important;
- }
- .mg-b {
- margin: 10px 0;
- }
- ::v-deep .el-image-viewer__close {
- top: 106px;
- right: 40px;
- width: 40px;
- height: 40px;
- font-size: 40px;
- }
- </style>
|