Kaynağa Gözat

竞争对手查重修改

qymljy 2 yıl önce
ebeveyn
işleme
476c2103d6

+ 11 - 3
src/Form/competitor/add.vue

@@ -78,7 +78,7 @@
       </div>
       <div class="fixed__btn__panel">
         <el-button size="small" @click="onClose" class="normal-btn-width inline-16">取 消</el-button>
-        <duplicateCheck  ref="check" :data="form" @onSuccess="onClose"></duplicateCheck>
+        <duplicateCheck  ref="check" :data="form" @onSuccess="onClose" @onCheck="onCheck"></duplicateCheck>
         <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
       </div>
     </el-drawer>
@@ -150,7 +150,7 @@ export default {
       }).then(() => {
         this.businessShow = false
         this.form.enterprisename = val.companyName
-        this.form.address = val.address
+        this.form.address = val.address === "-" ? '' : val.address
         this.form.taxno = val.taxNum
         this.value = [val.regProvince,val.regCity,val.regArea]
         this.form.province = val.regProvince
@@ -158,6 +158,7 @@ export default {
         this.form.county = val.regArea
         this.form.contact = val.legalPerson
       }).catch(() => {
+        this.businessShow = false
         this.$message({
           type: 'info',
           message: '已取消更新'
@@ -171,6 +172,13 @@ export default {
         this.$refs.check.listData()
       })
     },
+    /*查重检查*/
+    onCheck(){
+      this.$refs.form.validate((valid) => {
+        if (!valid) return false
+        this.$refs.check.listData()
+      })
+    },
     async queryEnterpriseArchives () {
       const res = await this.$api.requested({
         "id": 20220920083901,
@@ -243,4 +251,4 @@ export default {
   line-height: 34px;
   font-weight: 500;
 }
-</style>
+</style>

+ 11 - 3
src/Form/competitor/edit.vue

@@ -78,7 +78,7 @@
       </div>
       <div class="fixed__btn__panel">
         <el-button size="small" @click="dialogFormVisible = false" class="normal-btn-width">取 消</el-button>
-        <duplicateCheck  ref="check" :data="form" @onSuccess="onClose"></duplicateCheck>
+        <duplicateCheck  ref="check" :data="form" @onSuccess="onClose" @onCheck="onCheck"></duplicateCheck>
         <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
       </div>
     </el-drawer>
@@ -150,7 +150,7 @@ export default {
       }).then(() => {
         this.businessShow = false
         this.form.enterprisename = val.companyName
-        this.form.address = val.address
+        this.form.address = val.address === "-" ? '' : val.address
         this.form.taxno = val.taxNum
         this.value = [val.regProvince,val.regCity,val.regArea]
         this.form.province = val.regProvince
@@ -158,12 +158,20 @@ export default {
         this.form.county = val.regArea
         this.form.contact = val.legalPerson
       }).catch(() => {
+        this.businessShow = false
         this.$message({
           type: 'info',
           message: '已取消更新'
         });
       })
     },
+    /*查重检查*/
+    onCheck(){
+      this.$refs.form.validate((valid) => {
+        if (!valid) return false
+        this.$refs.check.listData()
+      })
+    },
     onSubmit(){
       this.$refs.form.validate((valid) => {
         if (!valid) return false
@@ -239,4 +247,4 @@ export default {
 .enterprisePanel li:hover{
   background: #f1f2f3;
 }
-</style>
+</style>

+ 5 - 2
src/components/duplicatesCheck/competitorCheck.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-button size="small" type="primary" @click="listData" class="inline-16 normal-btn-width">查 重</el-button>
+    <el-button size="small" type="primary" @click="isCheck" class="inline-16 normal-btn-width">查 重</el-button>
     <el-dialog title="重复竞争对手" :visible.sync="dialogTableVisible" append-to-body width="1000px">
       <div slot="title" class="dialog-title">
         <span class="title-text">重复竞争对手</span>
@@ -61,6 +61,9 @@ export default {
     }
   },
   methods:{
+    isCheck(){
+      this.$emit('onCheck')
+    },
     async listData(){
       this.param.content.sa_competitorid = this.data.sa_competitorid || 0
       this.param.content.enterprisename = this.data.enterprisename
@@ -188,4 +191,4 @@ export default {
 
 <style scoped>
 
-</style>
+</style>