浏览代码

转化客户调整

qymljy 4 月之前
父节点
当前提交
a2d9550332

+ 34 - 4
src/SManagement/orderclue_detail/components/changeCustomer.vue

@@ -471,12 +471,8 @@ export default {
       this.form = Object.assign({},this.form,this.data)
       this.form.phonenumber = ''
       this.form.source = this.form.cluesource
-      this.value = [this.form.province,this.form.city,this.form.county]
       this.form.contactsinfo.name = this.data.name
       this.form.enterprisename = this.form.enterprisename_customer
-      this.form.taxno = this.data.co_taxno
-      this.form.contact = this.data.co_name
-      this.form.phonenumber = this.data.co_phonenumber
       /*this.form.contactsinfo.phonenumber = this.data.phonenumber*/
       if (this.data.phonenumber.indexOf('-') != '-1'){
         this.isPhone = false
@@ -496,6 +492,40 @@ export default {
       this.typeList()
       // this.queryCustomerGrade()
       this.enterpriseContactList()
+      this.businessData(this.form.enterprisename)
+    },
+    /*工商查询*/
+    async businessData(keyWord){
+      const res = await this.$api.requested({
+        "id": "20221208103601",
+        "content": {
+          "keyword":keyWord,
+          "pageNumber":1,
+          "pageSize":5
+        },
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        const res1 = await this.$api.requested({
+          "id": "2024060715002601",
+          "content": {
+            "companyName":res.data[0].companyName
+          },
+        })
+        if (res1.code == 0){
+          this.tool.showMessage(res1,()=>{})
+        }else {
+          this.form.taxno = res1.data.taxNum
+          this.form.contact = res.data[0].legalPerson
+          this.form.phonenumber = res1.data.phone
+          this.form.province = res.data[0].regProvince
+          this.form.city = res1.data.regCity;
+          this.form.county = res1.data.regArea;
+          this.form.address = res1.data.address === "-" ? '' : res1.data.address;
+          this.value = [this.form.province,this.form.city,this.form.county]
+        }
+      }
     },
     /*查重检查*/
     onCheck(){

+ 11 - 53
src/components/duplicatesCheck/customerChangeCheck.vue

@@ -187,60 +187,18 @@ export default {
         this.data.contactsinfo.phonenumber = this.data.contactsinfo.telephone;
         this.data.contactsinfo.telephone = "";
       }
-      if (this.siteid == 'HY' && this.$route.path == '/orderclue_detail'){
-        const res = await this.$api.requested({
-          "id": "20221208103601",
-          "content": {
-            "keyword":this.data.enterprisename_customer,
-            "pageNumber":1,
-            "pageSize":5
-          },
-        })
-        console.log(res.data)
-        if (res.code == 0){
-          this.tool.showMessage(res,()=>{})
-        }else {
-          this.data.province  = res.data[0].regProvince
-          const res1 = await this.$api.requested({
-            "id": "2024060715002601",
-            "content": {
-              "companyName":res.data[0].companyName
-            },
-          })
-          if (res1.code == 0){
-            this.tool.showMessage(res1,()=>{})
-          }else {
-            this.data.city = res1.data.regCity
-            this.data.county = res1.data.regArea
-            this.data.address = res1.data.address === "-" ? '' : res1.data.address;
-            const res = await this.$api.requested({
-              id: 20221216184302,
-              content: this.data,
-            });
-            this.tool.showMessage(res, () => {
-              if (this.duplicates) {
-                this.setTag(res.data.sa_customersid, "疑似重复");
-              } else {
-                this.$emit("onSuccess");
-                /* this.setTag(res.data.sa_customersid,'')*/
-              }
-            });
-          }
+      const res = await this.$api.requested({
+        id: 20221216184302,
+        content: this.data,
+      });
+      this.tool.showMessage(res, () => {
+        if (this.duplicates) {
+          this.setTag(res.data.sa_customersid, "疑似重复");
+        } else {
+          this.$emit("onSuccess");
+          /* this.setTag(res.data.sa_customersid,'')*/
         }
-      }else {
-        const res = await this.$api.requested({
-          id: 20221216184302,
-          content: this.data,
-        });
-        this.tool.showMessage(res, () => {
-          if (this.duplicates) {
-            this.setTag(res.data.sa_customersid, "疑似重复");
-          } else {
-            this.$emit("onSuccess");
-            /* this.setTag(res.data.sa_customersid,'')*/
-          }
-        });
-      }
+      });
 
     },
     async setTag(id, data) {