qymljy 1 rok pred
rodič
commit
7f78b54319

+ 3 - 1
src/Form/EnterpriseArchives/add.vue

@@ -11,7 +11,8 @@
               </el-form-item>
             </el-col>
             <el-col :span="4">
-              <businessInquiry ref="businessRef" @businessData="businessSelect" :keyword="form.enterprisename"></businessInquiry>
+              <businessInquiry ref="businessRef" :keyword="form.enterprisename"
+                               @businessData="businessSelect"></businessInquiry>
             </el-col>
             <el-col :span="12">
               <el-form-item label="联系人" prop="contact">
@@ -223,6 +224,7 @@ export default {
         this.form.city = val.regCity
         this.form.county = val.regArea
         this.form.contact = val.legalPerson
+        this.form.phonenumber = val.phone
       }).catch(() => {
         this.$refs.businessRef.businessShow = false
         this.$message({

+ 1 - 14
src/HDrpManagement/projectChange/modules/modules/contacts/components/add.vue

@@ -43,19 +43,6 @@
                 <el-input  autosize v-model="form.wechatnum" placeholder="请输入微信" ></el-input>
               </el-form-item>
             </el-col>
-<!--            <el-col :span="24">
-              <el-form-item  label="标签:" >
-                <el-select v-model="tags" style="width: 100%" placeholder="请选择标签" size="small" multiple  class="inline-16">
-                  <el-option
-                      v-for="item in tagList"
-                      :key="item.index"
-                      :label="item.tag"
-                      :value="item.tag"
-                      :disabled="hasDisabledTag(item)">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>-->
             <el-col :span="24">
               <el-form-item  label="邮箱:" :rules="[
                 { pattern:/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/, message: '请输入有效的邮箱',trigger: 'blur' }
@@ -265,7 +252,7 @@ export default {
         //   { required: true, validator: validateMobilePhone, trigger: 'blur' },
         // ],
         enterprisename: [
-          { required: true, message: '单位不能为空', trigger: 'blur,change' },
+          { required: false, message: '单位不能为空', trigger: 'blur,change' },
         ],
         telephone:[
           { required: true, validator: telephone, trigger: 'change' }

+ 1 - 14
src/HDrpManagement/projectChange/modules/modules/contacts/components/edit.vue

@@ -43,19 +43,6 @@
                 <el-input  autosize v-model="form.wechatnum" placeholder="请输入微信" ></el-input>
               </el-form-item>
             </el-col>
-<!--            <el-col :span="24">
-              <el-form-item  label="标签:" >
-                <el-select v-model="tags" style="width: 100%" placeholder="请选择标签" size="small" multiple  class="inline-16" @remove-tag="onClear">
-                  <el-option
-                      v-for="item in tagList"
-                      :key="item.index"
-                      :label="item.tag"
-                      :value="item.tag"
-                      :disabled="hasDisabledTag(item)">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>-->
             <el-col :span="24">
               <el-form-item  label="邮箱:" :rules="[
                 { pattern:/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/, message: '请输入有效的邮箱',trigger: 'blur' }
@@ -266,7 +253,7 @@ export default {
         //   { required: true, validator: validateMobilePhone, trigger: 'blur' },
         // ],
         enterprisename: [
-          { required: true, message: '单位不能为空', trigger: 'blur,change' },
+          { required: false, message: '单位不能为空', trigger: 'blur,change' },
         ],
         telephone:[
           { required: true, validator: telephone, trigger: 'change' }

+ 39 - 38
src/HManagement/clueManage/clue_import/detailPage/modules/edit.vue

@@ -17,11 +17,11 @@
             </el-form-item>
           </el-col>
           <el-col :span="4">
-            <businessMessage ref="businessMessage" :keyWord="form.enterprisename" @businessData="businessData" ></businessMessage>
+            <businessInquiry ref="businessRef" :keyword="form.enterprisename"
+                             @businessData="businessSelect"></businessInquiry>
           </el-col>
           <el-col :span="24">
             <el-form-item label="联系人:" prop="name">
-<!--              <contactsTemplate ref="contactsRef" @contactSelect="contactSelect" :name="form.name"></contactsTemplate>-->
               <contactsNewTemplate ownertable="" ownerid=""  @contactData="contactData" :name="form.name" @inputChange="inputChange"></contactsNewTemplate>
             </el-form-item>
           </el-col>
@@ -117,18 +117,6 @@
               </el-date-picker>
             </el-form-item>
           </el-col>
-<!--          <el-col :span="24">
-            <el-form-item label="市场活动:" prop="sat_campaignid">
-              <el-popover
-                  placement="bottom"
-                  trigger="manual"
-                  v-model="activityVisible"
-                  width="400">
-                <selectActivity ref="member" :radio="true" @onSelect="centerChange" @onCancel="activityVisible = false"></selectActivity>
-                <el-input readonly type="text" slot="reference" size="small" @focus="activityVisible=true" v-model="form.campaign_name" placeholder="请填写市场活动"></el-input>
-              </el-popover>
-            </el-form-item>
-          </el-col>-->
           <el-col :span="24">
             <el-form-item label="领域:" prop="tradefield">
               <el-select v-model="form.tradefield" placeholder="请选择领域" style="width: 100%" >
@@ -165,19 +153,21 @@
 import businessMessage from '@/components/businessMessage/index'
 import contactsTemplate from '@/template/contactsTemplate/index'
 import contactsNewTemplate from '@/template/contactsNewTemplate/index'
+import businessInquiry from '@/template/businessInquiry/index'
+
 export default {
-  props:['data','type','disabled'],
-  components: {businessMessage,contactsTemplate,contactsNewTemplate},
-  data () {
-    var telephone = (rule,value,callback) =>{
-      if (this.form.areaCode === '' && this.form.telephone === ''){
+  props: ['data', 'type', 'disabled'],
+  components: {businessMessage, contactsTemplate, contactsNewTemplate, businessInquiry},
+  data() {
+    var telephone = (rule, value, callback) => {
+      if (this.form.areaCode === '' && this.form.telephone === '') {
         callback(new Error('座机电话不能为空'))
       } else {
-        var reg=/^0\d{2,3}-\d{7,8}$/
+        var reg = /^0\d{2,3}-\d{7,8}$/;
         let telephone = this.form.areaCode + '-' + this.form.telephone
-        if (!reg.test(telephone)){
+        if (!reg.test(telephone)) {
           callback(new Error('请输入正确座机电话'))
-        }else {
+        } else {
           callback();
         }
       }
@@ -323,9 +313,6 @@ export default {
       }else {
         this.form.enddate_due = ''
       }
-     /* this.form.city = this.form.province[1]
-      this.form.county = this.form.province[2]
-      this.form.province = this.form.province[0]*/
       this.$refs['form'].validate(async (valid) => {
         if (!valid) {
           this.$notify({
@@ -361,33 +348,47 @@ export default {
         })
       });
     },
-    cascaderChange (val) {
+    cascaderChange(val) {
       this.form.province = val
       console.log(this.form.province);
 
     },
     /*工商信息*/
-    businessData(val){
-      console.log(val)
-      this.form.enterprisename = val.companyName
-      this.form.address = val.address
-      this.areaSelectResult = [val.regProvince,val.regCity,val.regArea]
-      this.form.province = [val.regProvince,val.regCity,val.regArea]
+    businessSelect(val, regProvince) {
+      this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.form.enterprisename = val.companyName;
+        this.form.address = val.address === "-" ? '' : val.address;
+        this.form.province = [regProvince, val.regCity, val.regArea];
+        this.form.city = val.regCity;
+        this.form.county = val.regArea;
+        this.form.contact = val.legalPerson
+      }).catch(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.$message({
+          type: 'info',
+          message: '已取消更新'
+        });
+      })
     },
-    onClose(){
+    onClose() {
       this.drawer = false
       this.$refs.businessMessage.businessShow = false
     },
     /*获取领域*/
-    queryTradefield(){
-      this.$store.dispatch('optiontypeselect','tradefield').then(res=>{
+    queryTradefield() {
+      this.$store.dispatch('optiontypeselect', 'tradefield').then(res => {
         this.tradefieldSelect = res.data
       })
     },
     /*获取单位*/
-    queryUnitname(){
-      this.$store.dispatch('optiontypeselect','scaleunitname').then(res=>{
-        if (this.form.scale === ''){
+    queryUnitname() {
+      this.$store.dispatch('optiontypeselect', 'scaleunitname').then(res => {
+        if (this.form.scale === '') {
           this.form.unitname = res.data[0].value
         }
         this.unitnameList = res.data

+ 51 - 32
src/HManagement/clueManage/clue_private/modules/add.vue

@@ -20,19 +20,15 @@
               </el-form-item>
             </el-col>
             <el-col :span="4">
-              <el-form-item label-width="0" >
-                <businessMessage ref="businessMessage" :keyWord="param.content.enterprisename" @businessData="businessData"></businessMessage>
-              </el-form-item>
+              <businessInquiry ref="businessRef" :keyword="param.content.enterprisename"
+                               @businessData="businessSelect"></businessInquiry>
             </el-col>
             <el-col :span="24">
               <el-form-item label="联系人:" prop="name" v-if="param.content.isuppictured === 1" :rules="{required:true,message:'请填写联系人',trigger:'blur'}">
-<!--                <contactsTemplate ref="contactsRef" @contactSelect="contactSelect" :name="param.content.name"></contactsTemplate>-->
                 <contactsNewTemplate ownertable="" ownerid="" @contactData="contactData" :name="param.content.name" @inputChange="inputChange" placement="left-start"></contactsNewTemplate>
               </el-form-item>
               <el-form-item label="联系人:" prop="name" v-else>
-<!--                <contactsTemplate ref="contactsRef" @contactSelect="contactSelect" :name="param.content.name"></contactsTemplate>-->
                 <contactsNewTemplate ownertable="" ownerid="" @contactData="contactData" :name="param.content.name" @inputChange="inputChange" placement="left-start"></contactsNewTemplate>
-
               </el-form-item>
             </el-col>
             <el-col :span="24">
@@ -102,8 +98,6 @@
                     :key="item.value"
                     :label="item.value"
                     :value="item.value">
-                  <!--                    <span style="float: left">{{ item.value }}</span>-->
-                  <!--                    <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>-->
                 </el-option>
               </el-select>
             </el-col>
@@ -175,11 +169,9 @@
             </el-col>
             <el-col :span="24">
               <el-form-item label="设计师:" prop="contactsid" v-if="param.content.isuppictured === 1" :rules="{required:true,message:'请选择设计师',trigger:'change'}">
-<!--                <el-input v-model="param.content.contactsid"  placeholder="请选择设计师" :disabled="param.content.sys_enterpriseid === ''"></el-input>-->
                 <designer  ref="designer" :sys_enterpriseid="param.content.sys_enterpriseid" @designer="selectDesigner" :disabled="isuppictured === 1"></designer>
               </el-form-item>
               <el-form-item label="设计师:" prop="contactsid" v-else >
-                <!--                <el-input v-model="param.content.contactsid"  placeholder="请选择设计师" :disabled="param.content.sys_enterpriseid === ''"></el-input>-->
                 <designer ref="designer" :sys_enterpriseid="param.content.sys_enterpriseid" @designer="selectDesigner" :disabled="isuppictured === 1"></designer>
               </el-form-item>
             </el-col>
@@ -226,18 +218,30 @@ import designer from '@/template/clueModel/designer'
 import project from '@/template/clueModel/project'
 import contactsTemplate from '@/template/contactsTemplate/index'
 import contactsNewTemplate from '@/template/contactsNewTemplate/index'
+import businessInquiry from '@/template/businessInquiry/index'
+
 export default {
-  components: {selectActivity,businessMessage,tableList,designingInstitute,designer,project,contactsTemplate,contactsNewTemplate},
-  data () {
-    var telephone = (rule,value,callback) =>{
-      if (this.param.content.areaCode === '' && this.param.content.telephone === ''){
+  components: {
+    selectActivity,
+    businessMessage,
+    tableList,
+    designingInstitute,
+    designer,
+    project,
+    contactsTemplate,
+    contactsNewTemplate,
+    businessInquiry
+  },
+  data() {
+    var telephone = (rule, value, callback) => {
+      if (this.param.content.areaCode === '' && this.param.content.telephone === '') {
         callback(new Error('座机电话不能为空'))
       } else {
-        var reg=/^0\d{2,3}-\d{7,8}$/
+        var reg = /^0\d{2,3}-\d{7,8}$/;
         let telephone = this.param.content.areaCode + '-' + this.param.content.telephone
-        if (!reg.test(telephone)){
+        if (!reg.test(telephone)) {
           callback(new Error('请输入正确座机电话'))
-        }else {
+        } else {
           callback();
         }
       }
@@ -467,39 +471,54 @@ export default {
       this.param.content.phonenumber = ''
       this.param.content.isTelephone = '0'
     },
-    centerChange (data) {
+    centerChange(data) {
       this.param.content.campaign_name = data[0].name
       this.param.content.sat_campaignid = data[0].sat_campaignid
       this.param.content.cluesource = data[0].name
       this.activityVisible = false
     },
     /*工商信息*/
-    businessData(val){
-      console.log(val)
-      this.param.content.enterprisename = val.companyName
-      this.param.content.address = val.address === '-' ? '' : val.address
-      this.areaSelectResult = [val.regProvince,val.regCity,val.regArea]
-      this.param.content.province = [val.regProvince,val.regCity,val.regArea]
+    businessSelect(val, regProvince) {
+      this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.param.content.enterprisename = val.companyName;
+        this.param.content.address = val.address === "-" ? '' : val.address;
+        this.areaSelectResult = [regProvince, val.regCity, val.regArea];
+        this.param.content.province = [regProvince, val.regCity, val.regArea];
+        this.param.content.city = val.regCity;
+        this.param.content.county = val.regArea;
+        this.param.content.contact = val.legalPerson
+      }).catch(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.$message({
+          type: 'info',
+          message: '已取消更新'
+        });
+      })
     },
     /*获取领域*/
-    queryTradefield(){
-      this.$store.dispatch('optiontypeselect','tradefield').then(res=>{
+    queryTradefield() {
+      this.$store.dispatch('optiontypeselect', 'tradefield').then(res => {
         this.tradefieldSelect = res.data
       })
     },
     /*获取单位*/
-    queryUnitname(){
-      this.$store.dispatch('optiontypeselect','scaleunitname').then(res=>{
+    queryUnitname() {
+      this.$store.dispatch('optiontypeselect', 'scaleunitname').then(res => {
         this.param.content.unitname = res.data[0].value
         this.unitnameList = res.data
       })
     },
     /*判断是否上图员*/
-    async queryIsuppictured(hrid){
+    async queryIsuppictured(hrid) {
       const res = await this.$api.requested({
-        "classname":"webmanage.hr.hr",
-        "method":"query_hrMain",
-        "content":{
+        "classname": "webmanage.hr.hr",
+        "method": "query_hrMain",
+        "content": {
           "hrid":hrid
         }
       })

+ 46 - 26
src/HManagement/clueManage/clue_private/modules/edit.vue

@@ -19,15 +19,14 @@
               </el-form-item>
             </el-col>
             <el-col :span="4">
-              <businessMessage ref="businessMessage" :keyWord="form.enterprisename" @businessData="businessData"></businessMessage>
+              <businessInquiry ref="businessRef" :keyword="form.enterprisename"
+                               @businessData="businessSelect"></businessInquiry>
             </el-col>
             <el-col :span="24">
               <el-form-item label="联系人:" prop="name" v-if="form.isuppictured === 1" :rules="{required:true,message:'请填写联系人',trigger:'blur'}">
-<!--                <contactsTemplate ref="contactsRef" @contactSelect="contactSelect" :name="form.name"></contactsTemplate>-->
                 <contactsNewTemplate ownertable="" ownerid="" @contactData="contactData" :name="form.name" @inputChange="inputChange" placement="left-start"></contactsNewTemplate>
               </el-form-item>
               <el-form-item label="联系人:" prop="name" v-else>
-<!--                <contactsTemplate ref="contactsRef" @contactSelect="contactSelect" :name="form.name"></contactsTemplate>-->
                 <contactsNewTemplate ownertable="" ownerid="" @contactData="contactData" :name="form.name" @inputChange="inputChange" placement="left-start"></contactsNewTemplate>
               </el-form-item>
             </el-col>
@@ -102,8 +101,6 @@
                     :key="item.value"
                     :label="item.value"
                     :value="item.value">
-                  <!--                    <span style="float: left">{{ item.value }}</span>-->
-                  <!--                    <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>-->
                 </el-option>
               </el-select>
             </el-col>
@@ -175,11 +172,9 @@
             </el-col>
             <el-col :span="24">
               <el-form-item label="设计师:" prop="name" v-if="form.isuppictured === 1" :rules="{required:true,message:'请选择设计师',trigger:'change'}">
-                <!--                <el-input v-model="param.content.contactsid"  placeholder="请选择设计师" :disabled="param.content.sys_enterpriseid === ''"></el-input>-->
                 <designer ref="designer" :sys_enterpriseid="form.sys_enterpriseid" :data="form.designer" @designer="selectDesigner" :disabled="isuppictured === 1"></designer>
               </el-form-item>
               <el-form-item label="设计师:" prop="name" v-else >
-                <!--                <el-input v-model="param.content.contactsid"  placeholder="请选择设计师" :disabled="param.content.sys_enterpriseid === ''"></el-input>-->
                 <designer ref="designer" :sys_enterpriseid="form.sys_enterpriseid" :data="form.designer" @designer="selectDesigner" :disabled="isuppictured === 1"></designer>
               </el-form-item>
             </el-col>
@@ -226,19 +221,31 @@ import designer from '@/template/clueModel/designer'
 import project from '@/template/clueModel/project'
 import contactsTemplate from '@/template/contactsTemplate/index'
 import contactsNewTemplate from '@/template/contactsNewTemplate/index'
+import businessInquiry from '@/template/businessInquiry/index'
+
 export default {
-  props:['data'],
-  components: {selectActivity,businessMessage,tableList,designingInstitute,designer,project,contactsTemplate,contactsNewTemplate},
-  data () {
-    var telephone = (rule,value,callback) =>{
-      if (this.form.areaCode === '' && this.form.telephone === ''){
+  props: ['data'],
+  components: {
+    selectActivity,
+    businessMessage,
+    tableList,
+    designingInstitute,
+    designer,
+    project,
+    contactsTemplate,
+    contactsNewTemplate,
+    businessInquiry
+  },
+  data() {
+    var telephone = (rule, value, callback) => {
+      if (this.form.areaCode === '' && this.form.telephone === '') {
         callback(new Error('座机电话不能为空'))
       } else {
-        var reg=/^0\d{2,3}-\d{7,8}$/
+        var reg = /^0\d{2,3}-\d{7,8}$/;
         let telephone = this.form.areaCode + '-' + this.form.telephone
-        if (!reg.test(telephone)){
+        if (!reg.test(telephone)) {
           callback(new Error('请输入正确座机电话'))
-        }else {
+        } else {
           callback();
         }
       }
@@ -428,31 +435,44 @@ export default {
       })
 
     },
-    cascaderChange (val) {
+    cascaderChange(val) {
       this.form.province = val
 
     },
-    centerChange (data) {
+    centerChange(data) {
       this.form.campaign_name = data[0].name
       this.form.sat_campaignid = data[0].sat_campaignid
       this.activityVisible = false
     },
     /*工商信息*/
-    businessData(val){
-      console.log(val)
-      this.form.enterprisename = val.companyName
-      this.form.address = val.address === '-' ? '' : val.address
-      this.areaSelectResult = [val.regProvince,val.regCity,val.regArea]
-      this.form.province = [val.regProvince,val.regCity,val.regArea]
+    businessSelect(val, regProvince) {
+      this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.form.enterprisename = val.companyName;
+        this.form.address = val.address === "-" ? '' : val.address;
+        this.form.province = [regProvince, val.regCity, val.regArea];
+        this.form.city = val.regCity;
+        this.form.county = val.regArea
+      }).catch(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.$message({
+          type: 'info',
+          message: '已取消更新'
+        });
+      })
     },
-    onClose(){
+    onClose() {
       this.dialogFormVisible = false
       this.activityVisible = false
       this.$refs.businessMessage.businessShow = false
     },
     /*获取领域*/
-    queryTradefield(){
-      this.$store.dispatch('optiontypeselect','tradefield').then(res=>{
+    queryTradefield() {
+      this.$store.dispatch('optiontypeselect', 'tradefield').then(res => {
         this.tradefieldSelect = res.data
       })
     },

+ 39 - 18
src/HManagement/clueManage/clue_public/modules/add.vue

@@ -12,13 +12,11 @@
               </el-form-item>
             </el-col>
             <el-col :span="4">
-              <el-form-item label-width="0" >
-                <businessMessage ref="businessMessage" :keyWord="param.content.enterprisename" @businessData="businessData"></businessMessage>
-              </el-form-item>
+              <businessInquiry ref="businessRef" :keyword="param.content.enterprisename"
+                               @businessData="businessSelect"></businessInquiry>
             </el-col>
             <el-col :span="24">
               <el-form-item label="联系人:" prop="name">
-<!--                <contactsTemplate ref="contactsRef" @contactSelect="contactSelect" :name="param.content.name"></contactsTemplate>-->
                 <contactsNewTemplate ownertable="" ownerid="" @contactData="contactData" :name="param.content.name" @inputChange="inputChange"></contactsNewTemplate>
               </el-form-item>
             </el-col>
@@ -165,18 +163,20 @@ import selectActivity from '@/SManagement/orderclue/components/selectActivity/se
 import businessMessage from "@/components/businessMessage";
 import contactsTemplate from '@/template/contactsTemplate/index'
 import contactsNewTemplate from '@/template/contactsNewTemplate/index'
+import businessInquiry from '@/template/businessInquiry/index'
+
 export default {
-  components: {selectActivity,businessMessage,contactsTemplate,contactsNewTemplate},
-  data () {
-    var telephone = (rule,value,callback) =>{
-      if (this.param.content.areaCode === '' && this.param.content.telephone === ''){
+  components: {selectActivity, businessMessage, contactsTemplate, contactsNewTemplate, businessInquiry},
+  data() {
+    var telephone = (rule, value, callback) => {
+      if (this.param.content.areaCode === '' && this.param.content.telephone === '') {
         callback(new Error('座机电话不能为空'))
       } else {
-        var reg=/^0\d{2,3}-\d{7,8}$/
+        var reg = /^0\d{2,3}-\d{7,8}$/;
         let telephone = this.param.content.areaCode + '-' + this.param.content.telephone
-        if (!reg.test(telephone)){
+        if (!reg.test(telephone)) {
           callback(new Error('请输入正确座机电话'))
-        }else {
+        } else {
           callback();
         }
       }
@@ -372,22 +372,43 @@ export default {
       this.activityVisible = false
     },
     /*工商信息*/
-    businessData(val){
+    businessData(val) {
       console.log(val)
       this.param.content.enterprisename = val.companyName
       this.param.content.address = val.address === '-' ? '' : val.address
-      this.areaSelectResult = [val.regProvince,val.regCity,val.regArea]
-      this.param.content.province = [val.regProvince,val.regCity,val.regArea]
+      this.areaSelectResult = [val.regProvince, val.regCity, val.regArea];
+      this.param.content.province = [val.regProvince, val.regCity, val.regArea]
+    },
+    businessSelect(val, regProvince) {
+      this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.param.content.enterprisename = val.companyName;
+        this.param.content.address = val.address === "-" ? '' : val.address;
+        this.areaSelectResult = [regProvince, val.regCity, val.regArea];
+        this.param.content.province = [regProvince, val.regCity, val.regArea];
+        this.param.content.city = val.regCity;
+        this.param.content.county = val.regArea
+      }).catch(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.$message({
+          type: 'info',
+          message: '已取消更新'
+        });
+      })
     },
     /*获取领域*/
-    queryTradefield(){
-      this.$store.dispatch('optiontypeselect','tradefield').then(res=>{
+    queryTradefield() {
+      this.$store.dispatch('optiontypeselect', 'tradefield').then(res => {
         this.tradefieldSelect = res.data
       })
     },
     /*获取单位*/
-    queryUnitname(){
-      this.$store.dispatch('optiontypeselect','scaleunitname').then(res=>{
+    queryUnitname() {
+      this.$store.dispatch('optiontypeselect', 'scaleunitname').then(res => {
         this.param.content.unitname = res.data[0].value
         this.unitnameList = res.data
       })

+ 35 - 21
src/HManagement/clueManage/clue_public/modules/edit.vue

@@ -11,13 +11,11 @@
               </el-form-item>
             </el-col>
             <el-col :span="4">
-              <el-form-item label-width="0" >
-                <businessMessage ref="businessMessage" :keyWord="form.enterprisename" @businessData="businessData"></businessMessage>
-              </el-form-item>
+              <businessInquiry ref="businessRef" :keyword="form.enterprisename"
+                               @businessData="businessSelect"></businessInquiry>
             </el-col>
             <el-col :span="24">
               <el-form-item label="联系人:" prop="name">
-<!--                <contactsTemplate ref="contactsRef" @contactSelect="contactSelect" :name="form.name"></contactsTemplate>-->
                 <contactsNewTemplate ownertable="" ownerid="" @contactData="contactData" :name="form.name" @inputChange="inputChange"></contactsNewTemplate>
               </el-form-item>
             </el-col>
@@ -169,17 +167,19 @@ import selectActivity from '@/SManagement/orderclue/components/selectActivity/se
 import businessMessage from "@/components/businessMessage";
 import contactsTemplate from '@/template/contactsTemplate/index'
 import contactsNewTemplate from '@/template/contactsNewTemplate/index'
+import businessInquiry from '@/template/businessInquiry/index'
+
 export default {
-  components: {selectActivity,businessMessage,contactsTemplate,contactsNewTemplate},
-  props:['data','type'],
-  data () {
-    var telephone = (rule,value,callback) =>{
-      if (this.form.areaCode === '' && this.form.telephone === ''){
+  components: {selectActivity, businessMessage, contactsTemplate, contactsNewTemplate, businessInquiry},
+  props: ['data', 'type'],
+  data() {
+    var telephone = (rule, value, callback) => {
+      if (this.form.areaCode === '' && this.form.telephone === '') {
         callback(new Error('座机电话不能为空'))
       } else {
-        var reg=/^0\d{2,3}-\d{7,8}$/
+        var reg = /^0\d{2,3}-\d{7,8}$/;
         let telephone = this.form.areaCode + '-' + this.form.telephone
-        if (!reg.test(telephone)){
+        if (!reg.test(telephone)) {
           callback(new Error('请输入正确座机电话'))
         }else {
           callback();
@@ -332,29 +332,43 @@ export default {
         })
       });
     },
-    cascaderChange (val) {
+    cascaderChange(val) {
       this.form.province = val
     },
-    centerChange (data) {
+    centerChange(data) {
       this.form.campaign_name = data[0].name
       this.form.sat_campaignid = data[0].sat_campaignid
       this.activityVisible = false
     },
     /*工商信息*/
-    businessData(val){
-      console.log(val)
-      this.form.enterprisename = val.companyName
-      this.form.address = val.address === '-' ? '' : val.address
-      this.form.province = [val.regProvince,val.regCity,val.regArea]
+    businessSelect(val, regProvince) {
+      this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.form.enterprisename = val.companyName;
+        this.form.address = val.address === "-" ? '' : val.address;
+        this.form.province = [regProvince, val.regCity, val.regArea];
+        this.form.city = val.regCity;
+        this.form.county = val.regArea
+      }).catch(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.$message({
+          type: 'info',
+          message: '已取消更新'
+        });
+      })
     },
-    onClose(){
+    onClose() {
       this.dialogFormVisible = false
       this.$refs.businessMessage.businessShow = false
       this.activityVisible = false
     },
     /*获取领域*/
-    queryTradefield(){
-      this.$store.dispatch('optiontypeselect','tradefield').then(res=>{
+    queryTradefield() {
+      this.$store.dispatch('optiontypeselect', 'tradefield').then(res => {
         this.tradefieldSelect = res.data
       })
     },

+ 40 - 25
src/HManagement/clueManage/m_activity/modules/addClue.vue

@@ -18,11 +18,11 @@
               </el-form-item>
             </el-col>
             <el-col :span="4">
-              <businessMessage :keyWord="form.enterprisename" @businessData="businessData"></businessMessage>
+              <businessInquiry ref="businessRef" :keyword="form.enterprisename"
+                               @businessData="businessSelect"></businessInquiry>
             </el-col>
             <el-col :span="24">
               <el-form-item label="联系人:" prop="name">
-<!--                <contactsTemplate ref="contactsRef" @contactSelect="contactSelect" :name="form.name"></contactsTemplate>-->
                 <contactsNewTemplate ownertable="" ownerid="" @contactData="contactData" :name="form.name" @inputChange="inputChange"></contactsNewTemplate>
               </el-form-item>
             </el-col>
@@ -171,20 +171,21 @@ import selectActivity from '@/SManagement/orderclue/components/selectActivity/se
 import businessMessage from '@/components/businessMessage/index'
 import contactsTemplate from '@/template/contactsTemplate/index'
 import contactsNewTemplate from '@/template/contactsNewTemplate/index'
-import { log } from '@antv/g2plot/lib/utils'
+import businessInquiry from '@/template/businessInquiry/index'
+
 export default {
-  props:['disabled','data'],
-  components: {selectActivity,businessMessage,contactsTemplate,contactsNewTemplate},
-  data () {
-    var telephone = (rule,value,callback) =>{
-      if (this.form.areaCode === '' && this.form.telephone === ''){
+  props: ['disabled', 'data'],
+  components: {selectActivity, businessMessage, contactsTemplate, contactsNewTemplate, businessInquiry},
+  data() {
+    var telephone = (rule, value, callback) => {
+      if (this.form.areaCode === '' && this.form.telephone === '') {
         callback(new Error('座机电话不能为空'))
       } else {
-        var reg=/^0\d{2,3}-\d{7,8}$/
+        var reg = /^0\d{2,3}-\d{7,8}$/;
         let telephone = this.form.areaCode + '-' + this.form.telephone
-        if (!reg.test(telephone)){
+        if (!reg.test(telephone)) {
           callback(new Error('请输入正确座机电话'))
-        }else {
+        } else {
           callback();
         }
       }
@@ -360,39 +361,53 @@ export default {
         })
       });
     },
-    cascaderChange (val) {
+    cascaderChange(val) {
       this.form.province = val
     },
-    centerChange (data) {
+    centerChange(data) {
       this.form.campaign_name = data[0].name
       this.form.sat_campaignid = data[0].sat_campaignid
       this.activityVisible = false
     },
     /*工商信息*/
-    businessData(val){
-      console.log(val)
-      this.form.enterprisename = val.companyName
-      this.form.address = val.address
-      this.form.province = [val.regProvince,val.regCity,val.regArea]
+    businessSelect(val, regProvince) {
+      this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.form.enterprisename = val.companyName;
+        this.form.address = val.address === "-" ? '' : val.address;
+        this.form.province = [regProvince, val.regCity, val.regArea];
+        this.form.city = val.regCity;
+        this.form.county = val.regArea;
+      }).catch(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.$message({
+          type: 'info',
+          message: '已取消更新'
+        });
+      })
     },
     /*获取领域*/
-    queryTradefield(){
-      this.$store.dispatch('optiontypeselect','tradefield').then(res=>{
+    queryTradefield() {
+      this.$store.dispatch('optiontypeselect', 'tradefield').then(res => {
         this.tradefieldSelect = res.data
       })
     },
     /*获取单位*/
-    queryUnitname(){
-      this.$store.dispatch('optiontypeselect','scaleunitname').then(res=>{
+    queryUnitname() {
+      this.$store.dispatch('optiontypeselect', 'scaleunitname').then(res => {
         this.form.unitname = res.data[0].value
         this.unitnameList = res.data
       })
     },
-    phoneChange(val){
-      if (val === '手机'){
+    phoneChange(val) {
+      if (val === '手机') {
         this.form.telephone = ''
         this.form.areaCode = ''
-      }else {
+      } else {
         this.form.phonenumber = ''
       }
     },

+ 38 - 22
src/HManagement/clueManage/m_activity/modules/editClue.vue

@@ -18,11 +18,11 @@
               </el-form-item>
             </el-col>
             <el-col :span="4">
-              <businessMessage ref="businessMessage" :keyWord="form.enterprisename" @businessData="businessData"></businessMessage>
+              <businessInquiry ref="businessRef" :keyword="form.enterprisename"
+                               @businessData="businessSelect"></businessInquiry>
             </el-col>
             <el-col :span="24">
               <el-form-item label="联系人" prop="name">
-<!--                <contactsTemplate ref="contactsRef" @contactSelect="contactSelect" :name="form.name"></contactsTemplate>-->
                 <contactsNewTemplate ownertable="" ownerid="" @contactData="contactData" :name="form.name" @inputChange="inputChange"></contactsNewTemplate>
               </el-form-item>
             </el-col>
@@ -173,18 +173,20 @@ import selectActivity from '@/SManagement/orderclue/components/selectActivity/se
 import businessMessage from '@/components/businessMessage/index'
 import contactsTemplate from '@/template/contactsTemplate/index'
 import contactsNewTemplate from '@/template/contactsNewTemplate/index'
+import businessInquiry from '@/template/businessInquiry/index'
+
 export default {
-  components: {selectActivity,businessMessage,contactsTemplate,contactsNewTemplate},
-  data () {
-    var telephone = (rule,value,callback) =>{
-      if (this.form.areaCode === '' && this.form.telephone === ''){
+  components: {selectActivity, businessMessage, contactsTemplate, contactsNewTemplate, businessInquiry},
+  data() {
+    var telephone = (rule, value, callback) => {
+      if (this.form.areaCode === '' && this.form.telephone === '') {
         callback(new Error('座机电话不能为空'))
       } else {
-        var reg=/^0\d{2,3}-\d{7,8}$/
+        var reg = /^0\d{2,3}-\d{7,8}$/;
         let telephone = this.form.areaCode + '-' + this.form.telephone
-        if (!reg.test(telephone)){
+        if (!reg.test(telephone)) {
           callback(new Error('请输入正确座机电话'))
-        }else {
+        } else {
           callback();
         }
       }
@@ -359,35 +361,49 @@ export default {
         })
       });
     },
-    cascaderChange (val) {
+    cascaderChange(val) {
       this.form.province = val
     },
-    centerChange (data) {
+    centerChange(data) {
       this.form.campaign_name = data[0].name
       this.form.sat_campaignid = data[0].sat_campaignid
       this.activityVisible = false
     },
     /*工商信息*/
-    businessData(val){
-      console.log(val)
-      this.form.enterprisename = val.companyName
-      this.form.address = val.address
-      this.form.province = [val.regProvince,val.regCity,val.regArea]
+    businessSelect(val, regProvince) {
+      this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.form.enterprisename = val.companyName;
+        this.form.address = val.address === "-" ? '' : val.address;
+        this.form.province = [regProvince, val.regCity, val.regArea];
+        this.form.city = val.regCity;
+        this.form.county = val.regArea;
+      }).catch(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.$message({
+          type: 'info',
+          message: '已取消更新'
+        });
+      })
     },
-    onClose(){
+    onClose() {
       this.drawer = false
       this.$refs.businessMessage.businessShow = false
     },
     /*获取领域*/
-    queryTradefield(){
-      this.$store.dispatch('optiontypeselect','tradefield').then(res=>{
+    queryTradefield() {
+      this.$store.dispatch('optiontypeselect', 'tradefield').then(res => {
         this.tradefieldSelect = res.data
       })
     },
     /*获取单位*/
-    queryUnitname(){
-      this.$store.dispatch('optiontypeselect','scaleunitname').then(res=>{
-        if (this.form.scale === ''){
+    queryUnitname() {
+      this.$store.dispatch('optiontypeselect', 'scaleunitname').then(res => {
+        if (this.form.scale === '') {
           this.form.unitname = res.data[0].value
         }
         this.unitnameList = res.data

+ 36 - 31
src/SManagement/orderclue/components/add.vue

@@ -12,22 +12,14 @@
               </el-form-item>
             </el-col>
             <el-col :span="4">
-              <el-form-item label-width="0" >
-                <businessMessage ref="businessMessage" :keyWord="param.content.enterprisename" @businessData="businessData"></businessMessage>
-              </el-form-item>
+              <businessInquiry ref="businessRef" :keyword="param.content.enterprisename"
+                               @businessData="businessSelect"></businessInquiry>
             </el-col>
             <el-col :span="24">
               <el-form-item label="联系人:" prop="name">
-<!--                <el-input v-model="param.content.name"  placeholder="请填写联系人"></el-input>-->
-<!--                <contactsTemplate ref="contactsRef" @contactSelect="contactSelect" :name="param.content.name"></contactsTemplate>-->
                 <contactsNewTemplate ownertable="" ownerid="" @contactData="contactData" :name="param.content.name" @inputChange="inputChange"></contactsNewTemplate>
               </el-form-item>
             </el-col>
-<!--            <el-col :span="24">
-              <el-form-item label="联系方式:" prop="phonenumber">
-                <el-input v-model="param.content.phonenumber"  placeholder="请填写手机号"></el-input>
-              </el-form-item>
-            </el-col>-->
             <el-col :span="24">
               <el-form-item>
                 <el-radio v-model="param.content.isTelephone" label="0" @change="phoneChange('手机')">手机号</el-radio>
@@ -84,8 +76,6 @@
                     :key="item.value"
                     :label="item.value"
                     :value="item.value">
-                  <!--                    <span style="float: left">{{ item.value }}</span>-->
-                  <!--                    <span style="float: right; color: #8492a6; font-size: 12px">{{ item.remarks?item.remarks:'暂无描述' }}</span>-->
                 </el-option>
               </el-select>
             </el-col>
@@ -173,18 +163,20 @@ import selectActivity from '@/SManagement/orderclue/components/selectActivity/se
 import businessMessage from "@/components/businessMessage";
 import contactsTemplate from '@/template/contactsTemplate/index'
 import contactsNewTemplate from '@/template/contactsNewTemplate/index'
+import businessInquiry from '@/template/businessInquiry/index'
+
 export default {
-  components: {selectActivity,businessMessage,contactsTemplate,contactsNewTemplate},
-  data () {
-    var telephone = (rule,value,callback) =>{
-      if (this.param.content.areaCode === '' && this.param.content.telephone === ''){
+  components: {selectActivity, businessMessage, contactsTemplate, contactsNewTemplate, businessInquiry},
+  data() {
+    var telephone = (rule, value, callback) => {
+      if (this.param.content.areaCode === '' && this.param.content.telephone === '') {
         callback(new Error('座机电话不能为空'))
       } else {
-        var reg=/^0\d{2,3}-\d{7,8}$/
+        var reg = /^0\d{2,3}-\d{7,8}$/;
         let telephone = this.param.content.areaCode + '-' + this.param.content.telephone
-        if (!reg.test(telephone)){
+        if (!reg.test(telephone)) {
           callback(new Error('请输入正确座机电话'))
-        }else {
+        } else {
           callback();
         }
       }
@@ -455,29 +447,42 @@ export default {
       this.param.content.isTelephone = '0'
       this.$refs.businessMessage.businessShow = false
     },
-    centerChange (data) {
+    centerChange(data) {
       this.param.content.campaign_name = data[0].name
       this.param.content.sat_campaignid = data[0].sat_campaignid
       this.activityVisible = false
     },
     /*工商信息*/
-    businessData(val){
-      console.log(val)
-      this.param.content.enterprisename = val.companyName
-      this.param.content.address = val.address === '-' ? '' : val.address
-      this.areaSelectResult = [val.regProvince,val.regCity,val.regArea]
-      this.param.content.province = [val.regProvince,val.regCity,val.regArea]
-      console.log(this.param)
+    businessSelect(val, regProvince) {
+      this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.param.content.enterprisename = val.companyName;
+        this.param.content.address = val.address === "-" ? '' : val.address;
+        this.areaSelectResult = [regProvince, val.regCity, val.regArea];
+        this.param.content.province = [regProvince, val.regCity, val.regArea];
+        this.param.content.city = val.regCity;
+        this.param.content.county = val.regArea
+      }).catch(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.$message({
+          type: 'info',
+          message: '已取消更新'
+        });
+      })
     },
     /*获取领域*/
-    queryTradefield(){
-      this.$store.dispatch('optiontypeselect','tradefield').then(res=>{
+    queryTradefield() {
+      this.$store.dispatch('optiontypeselect', 'tradefield').then(res => {
         this.tradefieldSelect = res.data
       })
     },
     /*获取单位*/
-    queryUnitname(){
-      this.$store.dispatch('optiontypeselect','scaleunitname').then(res=>{
+    queryUnitname() {
+      this.$store.dispatch('optiontypeselect', 'scaleunitname').then(res => {
         this.param.content.unitname = res.data[0].value
         this.unitnameList = res.data
       })

+ 36 - 22
src/SManagement/orderclue/components/edit.vue

@@ -12,9 +12,8 @@
               </el-form-item>
             </el-col>
             <el-col :span="4">
-              <el-form-item label-width="0" >
-                <businessMessage :keyWord="param.enterprisename" ref="businessMessage" @businessData="businessData"></businessMessage>
-              </el-form-item>
+              <businessInquiry ref="businessRef" :keyword="param.enterprisename"
+                               @businessData="businessSelect"></businessInquiry>
             </el-col>
             <el-col :span="24">
               <el-form-item label="联系人:" prop="name">
@@ -162,21 +161,22 @@
 <script>
 import selectActivity from '@/SManagement/orderclue/components/selectActivity/selectActivity'
 import contactsTemplate from '@/template/contactsTemplate/index'
-import { log } from '@antv/g2plot/lib/utils'
 import businessMessage from "@/components/businessMessage";
 import contactsNewTemplate from '@/template/contactsNewTemplate/index'
+import businessInquiry from '@/template/businessInquiry/index'
+
 export default {
-  components: {selectActivity,businessMessage,contactsTemplate,contactsNewTemplate},
-  data () {
-    var telephone = (rule,value,callback) =>{
-      if (this.param.areaCode === '' && this.param.telephone === ''){
+  components: {selectActivity, businessMessage, contactsTemplate, contactsNewTemplate, businessInquiry},
+  data() {
+    var telephone = (rule, value, callback) => {
+      if (this.param.areaCode === '' && this.param.telephone === '') {
         callback(new Error('座机电话不能为空'))
       } else {
-        var reg=/^0\d{2,3}-\d{7,8}$/
+        var reg = /^0\d{2,3}-\d{7,8}$/;
         let telephone = this.param.areaCode + '-' + this.param.telephone
-        if (!reg.test(telephone)){
+        if (!reg.test(telephone)) {
           callback(new Error('请输入正确座机电话'))
-        }else {
+        } else {
           callback();
         }
       }
@@ -427,30 +427,44 @@ export default {
       })
 
     },
-    cascaderChange (result) {
+    cascaderChange(result) {
       this.areaSelectResult = result
 
     },
-    centerChange (data) {
+    centerChange(data) {
       this.param.campaign_name = data[0].name
       this.param.sat_campaignid = data[0].sat_campaignid
       this.activityVisible = false
     },
     /*工商信息*/
-    businessData(val){
-      console.log(val)
-      this.param.enterprisename = val.companyName
-      this.param.address = val.address === '-' ? '' : val.address
-      this.areaSelectResult = [val.regProvince,val.regCity,val.regArea]
-      this.param.province = [val.regProvince,val.regCity,val.regArea]
+    businessSelect(val, regProvince) {
+      this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.param.enterprisename = val.companyName;
+        this.param.address = val.address === "-" ? '' : val.address;
+        this.areaSelectResult = [regProvince, val.regCity, val.regArea];
+        this.param.province = [regProvince, val.regCity, val.regArea];
+        this.param.city = val.regCity;
+        this.param.county = val.regArea
+      }).catch(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.$message({
+          type: 'info',
+          message: '已取消更新'
+        });
+      })
     },
-    onClose(){
+    onClose() {
       this.$refs.businessMessage.businessShow = false
       this.drawer = false
     },
     /*获取领域*/
-    queryTradefield(){
-      this.$store.dispatch('optiontypeselect','tradefield').then(res=>{
+    queryTradefield() {
+      this.$store.dispatch('optiontypeselect', 'tradefield').then(res => {
         this.tradefieldSelect = res.data
       })
     },

+ 41 - 24
src/SManagement/orderclue_detail/components/changeCustomer.vue

@@ -18,7 +18,8 @@
               </el-form-item>
             </el-col>
             <el-col :span="4">
-              <businessMessage :keyWord="form.enterprisename_customer" @businessData="onBusinessData"></businessMessage>
+              <businessInquiry ref="businessRef" :keyword="form.enterprisename_customer"
+                               @businessData="businessSelect"></businessInquiry>
             </el-col>
             <el-col :span="24">
               <el-form-item label="企业简称:" prop="abbreviation">
@@ -232,20 +233,22 @@
 import businessMessage from '@/components/businessMessage/index'
 import duplicateCheck from "@/components/duplicatesCheck/customerChangeCheck";
 import contactsNewTemplate from '@/template/contactsNewTemplate/index'
+import businessInquiry from '@/template/businessInquiry/index'
+
 export default {
-  props:["disabled","data"],
+  props: ["disabled", "data"],
   name: "changeCustomer",
-  components:{businessMessage,duplicateCheck,contactsNewTemplate},
-  data(){
+  components: {businessMessage, duplicateCheck, contactsNewTemplate, businessInquiry},
+  data() {
     return {
-      activeName:'first',
-      drawer:false,
-      customerShow:false,
-      checkResults:'',
-      rules:{
+      activeName: 'first',
+      drawer: false,
+      customerShow: false,
+      checkResults: '',
+      rules: {
         phonenumber: [
-          { required: true, message: '请输入手机号码', trigger: 'blur' },
-          { pattern:/^1[3-9]\d{9}$/, message: '请输入正确手机号码',trigger: 'blur' }
+          {required: true, message: '请输入手机号码', trigger: 'blur'},
+          {pattern: /^1[3-9]\d{9}$/, message: '请输入正确手机号码', trigger: 'blur'}
         ],
         enterprisename_customer: [
           { required: true, message: '请输入客户名称', trigger: 'blur' },
@@ -508,24 +511,38 @@ export default {
 
     },
     /*获取工商信息*/
-    onBusinessData(val){
-      this.form.enterprisename_customer = val.companyName
-      this.form.enterprisename = val.companyName
-      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
-      this.form.city = val.regCity
-      this.form.county = val.regArea
-      this.form.contact = val.legalPerson
+    businessSelect(val, regProvince) {
+      this.$confirm('是否以查询的工商信息更新客户信息?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.form.enterprisename_customer = val.companyName;
+        this.form.enterprisename = val.companyName;
+        this.form.address = val.address === "-" ? '' : val.address;
+        this.form.taxno = val.taxNum;
+        this.value = [regProvince, val.regCity, val.regArea];
+        this.form.province = regProvince;
+        this.form.city = val.regCity;
+        this.form.county = val.regArea;
+        this.form.contact = val.legalPerson;
+        this.form.telephone = val.phone
+      }).catch(() => {
+        this.$refs.businessRef.businessShow = false;
+        this.$message({
+          type: 'info',
+          message: '已取消更新'
+        });
+      })
     },
     /*省市县*/
-    cascaderChange (val) {
+    cascaderChange(val) {
       this.form.province = val[0]
       if (val.length === 1)
-        return this.form = Object.assign({},this.form,{province:val[0],city:'',county:''})
+        return this.form = Object.assign({}, this.form, {province: val[0], city: '', county: ''});
 
-      this.form = Object.assign({},this.form,{province:val[0],city:val[1],county:val[2]})
+      this.form = Object.assign({}, this.form, {province: val[0], city: val[1], county: val[2]});
 
       this.$refs.form.validateField('province')
     },

+ 6 - 1
src/template/contactsNewTemplate/index.vue

@@ -5,7 +5,8 @@
         width="900"
         v-model="show"
         trigger="click">
-      <el-input  autosize v-model="param.content.where.condition" placeholder="搜索" @change="listData" style="width: 200px;margin-bottom: 10px"></el-input>
+      <el-input  style="width:200px;margin-bottom: 10px" placeholder="搜索" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="clearSearchValue" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+      </el-input>
       <el-table
           border
           height="500px"
@@ -133,6 +134,10 @@ export default {
     },
     inputChange(){
       this.$emit('inputChange',this.name)
+    },
+    clearSearchValue () {
+      this.$store.dispatch('clearSearchValue')
+      this.listData(this.param.content.pageNumber = 1)
     }
   },
   watch:{