lizhenhao 2 lat temu
rodzic
commit
bfb5e65a2b

+ 30 - 4
src/views/modules/cw/workClientInfo/WorkClientAddForm.vue

@@ -1068,12 +1068,38 @@
         // 如果uscCode是空的或者uscCode的数据不存在,再执行保存方法
         if (this.commonJS.isNotEmpty(this.inputForm.uscCode)) {
           this.workClientService.queryUscCodeIsUse(this.inputForm.uscCode).then(({data}) => {
-            if (data.use === 'false') {
-              this.trueSave()
-            }
+            this.workClientService.queryUscCodeById(this.inputForm.id).then((uscCode) => {
+              if (data.use === 'false' || uscCode.data === this.inputForm.uscCode) {
+                this.uscCodeMessage = ''
+                this.workClientService.queryNameIsUse(this.inputForm.name).then((client) => {
+                  this.workClientService.queryNameById(this.inputForm.id).then((name) => {
+                    if (client.data.use === 'false' || name.data === this.inputForm.name) {
+                      this.trueSave()
+                      this.nameMessage = ''
+                    } else {
+                      this.nameMessage = '该客户已存在'
+                      throw new Error()
+                    }
+                  })
+                })
+              } else {
+                this.uscCodeMessage = '该客户已存在'
+                throw new Error()
+              }
+            })
           })
         } else {
-          this.trueSave()
+          this.workClientService.queryNameIsUse(this.inputForm.name).then((client) => {
+            this.workClientService.queryNameById(this.inputForm.id).then((name) => {
+              if (client.data.use === 'false' || name.data === this.inputForm.name) {
+                this.trueSave()
+                this.nameMessage = ''
+              } else {
+                this.nameMessage = '该客户已存在'
+                throw new Error()
+              }
+            })
+          })
         }
       },
       trueSave () {

+ 4 - 3
src/views/modules/cw/workClientInfo/WorkClientUpdateLog.vue

@@ -12,12 +12,13 @@
       <div style="height: calc(100%);">
         <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @submit.native.prevent>
           <!-- 搜索框-->
-          <el-form-item label="" prop="createName">
-            <el-input size="small" v-model="searchForm.createName" @keyup.enter.native="list" placeholder="修改申请发起人" clearable></el-input>
-          </el-form-item>
           <el-form-item label="" prop="clientNo">
             <el-input size="small" v-model="searchForm.clientNo" @keyup.enter.native="list" placeholder="客户编号" clearable></el-input>
           </el-form-item>
+          <el-form-item label="" prop="createName">
+            <el-input size="small" v-model="searchForm.createName" @keyup.enter.native="list" placeholder="修改申请发起人" clearable></el-input>
+          </el-form-item>
+
           <el-form-item label="" prop="status">
             <el-select v-model="searchForm.status" placeholder="申请状态"clearable>
               <el-option