123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368 |
- <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
- >
- <CopyButton :copyText="formData.successLoginProject" />
- <el-button v-if="module !== 'detail'" slot="append" @click="handleFocus">引入</el-button>
- </el-input>
- </el-col>
- <template
- v-if="(pageType == 'home' && !isCustomer) || (['frock', 'cross'].includes(pageType) && isTradeExaminer)"
- >
- <el-col :span="7" class="flex-box">
- <div class="flex-box-title">经销商编号</div>
- <el-input
- v-model="formData.successCustomerNumber"
- class="my-input"
- placeholder="请填写"
- size="mini"
- clearable
- />
- <CopyButton :copyText="formData.successCustomerNumber" />
- </el-col>
- <el-col :span="7" class="flex-box">
- <div class="flex-box-title">经销商名称</div>
- <el-input
- v-model="formData.successCustomerName"
- class="my-input"
- placeholder="请填写"
- size="mini"
- clearable
- />
- <CopyButton :copyText="formData.successCustomerName" />
- </el-col>
- </template>
- <el-col v-if="!isCustomer" :span="7" class="flex-box">
- <div class="flex-box-title">业务员编号</div>
- <el-input
- v-model="formData.successServiceNumber"
- class="my-input"
- placeholder="请填写"
- size="mini"
- clearable
- />
- <CopyButton :copyText="formData.successServiceNumber" />
- </el-col>
- <el-col v-if="!isCustomer" :span="7" class="flex-box">
- <div class="flex-box-title">业务员名称</div>
- <el-input
- v-model="formData.successServiceName"
- class="my-input"
- placeholder="请填写"
- size="mini"
- clearable
- />
- <CopyButton :copyText="formData.successServiceName" />
- </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-if="!['frock', 'cross'].includes(pageType)" 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="请填写" size="mini" clearable />
- <CopyButton :copyText="formData.note" />
- </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 />
- <CopyButton :copyText="formData.commonFollowProject" />
- </div>
- </el-col>
- <el-col :xs="24" :sm="24" :lg="24" class="item" v-if="shenheshangchuan">
- <div class="label" style="height: auto">审核上传</div>
- <div class="value" style="height: auto">
- <ImageUpload class="mg-b" :file-list="formData.files" :multiple="true" />
- <div style="margin-left: 20px">注:可上传文件、附件</div>
- </div>
- </el-col>
- <el-col :xs="24" :sm="24" :lg="24" class="item" v-if="formData.oldFileName && formData.oldFileUrl">
- <div class="label" style="height: auto">旧单附件</div>
- <div class="value" style="padding: 10px">
- <el-link :href="formData.oldFileUrl" target="_blank">{{ formData.oldFileName }}</el-link>
- </div>
- </el-col>
- </el-row>
- </div>
- <!-- -->
- <LoginSuccess
- :page-type="pageType"
- :form-data="formData"
- :show-dialog="showDialog"
- @success="handleSuccess"
- @cancel="handleCancel"
- />
- </div>
- </template>
- <script>
- import { getLoginHomeDecorationList } from '@/api/homeDecoration'
- import { getLoginCrossDistrictList } from '@/api/crossDistrict'
- import { getLoginFrockList } from '@/api/frock'
- import { mapGetters } from 'vuex'
- 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
- }
- },
- computed: {
- ...mapGetters(['isTradeExaminer', 'isCustomer']),
- shenheshangchuan() {
- var data = JSON.parse(localStorage.getItem('supply_user') || '{}')
- return data?.isTradeExaminer
- ? true
- : data?.isService && this.$route.name === 'crossDistrictkList'
- ? true
- : this.module === 'detail'
- ? false
- : true
- }
- },
- watch: {
- 'formData.id': {
- immediate: true,
- handler() {
- if (this.formData.id) {
- if (this.formData.files.length) {
- console.log(this.formData.files)
- this.formData.files = this.showImage(this.formData.files)
- }
- this.getData()
- }
- }
- }
- },
- methods: {
- handleSuccess(val) {
- const res = val[0]
- this.formData.successLoginProject = res.projectNo
- this.formData.successCustomerNumber = res.customerNumber
- this.formData.successCustomerName = res.customerName
- this.formData.successServiceName = res.serviceName
- this.formData.successServiceNumber = res.serviceNumber
- },
- handleCancel() {
- this.showDialog = false
- },
- handleFocus() {
- this.showDialog = true
- },
- onSbumit() {},
- showImage(arr = []) {
- const newArr = []
- arr &&
- arr.forEach(k => {
- if (k.fileUrl && k.fileUrl !== '0') {
- newArr.push({
- hover: false,
- name: '',
- url: k.fileUrl
- })
- }
- })
- return newArr
- },
- // 检查文件类型
- 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)
- },
- getData() {
- console.log(333)
- if (!this.formData.successLoginProject) return
- const params = {
- pageNum: 1,
- pageSize: -1,
- params: [
- {
- param: 'a.project_no',
- compare: 'like',
- value: this.formData.successLoginProject
- }
- ]
- }
- const objFn = {
- home: getLoginHomeDecorationList,
- cross: getLoginCrossDistrictList,
- frock: getLoginFrockList
- }
- objFn[this.pageType](params).then(res => {
- if (res.data.records && res.data.records.length) {
- if (!this.formData.successCustomerNumber) {
- this.formData.successCustomerNumber = res.data.records[0].customerNumber
- }
- if (!this.formData.successCustomerName) {
- this.formData.successCustomerName = res.data.records[0].customerName
- }
- if (!this.formData.successServiceName) {
- this.formData.successServiceName = res.data.records[0].serviceName
- }
- if (!this.formData.successServiceNumber) {
- this.formData.successServiceNumber = res.data.records[0].serviceNumber
- }
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .diy-table-1 {
- border: 1px solid #cccc;
- }
- .diy-table-1 .item {
- border-bottom: 1px solid #ccc;
- }
- .diy-table-1 .item .label {
- width: 150px;
- border-right: 1px solid #ccc;
- }
- .diy-table-1 .item .value {
- border-right: 1px solid #ccc;
- }
- ::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;
- }
- ::v-deep .el-radio__inner {
- border: 2px solid #ccc;
- border-radius: 100%;
- width: 14px;
- height: 14px;
- background-color: #fff;
- cursor: pointer;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- }
- </style>
|