Преглед изворни кода

fix:客户组织修改编码入参更改

snow пре 1 година
родитељ
комит
022f092f54
1 измењених фајлова са 15 додато и 5 уклоњено
  1. 15 5
      src/views/serviceParam/business/addEdit.vue

+ 15 - 5
src/views/serviceParam/business/addEdit.vue

@@ -213,6 +213,8 @@ export default {
       organName: '',
       tableData: [],
       old_tableData: [],
+      branch: '',
+      middle: '',
       rules: {
         region: [
           {
@@ -259,7 +261,11 @@ export default {
       }
     },
     area(val) {
-      if (val) this.ruleForm.code = ''
+      if (val) {
+        this.ruleForm.code = ''
+        this.branch = ''
+        this.middle = ''
+      }
     },
     'ruleForm.code': {
       handler(val) {
@@ -351,9 +357,10 @@ export default {
       if (code === 0) {
         const { pid, name, pname, companyName, parent, member, id, middle, branch, area } = data
         this.organName = pname
+        this.branch = branch
+        this.middle = middle
 
         const isFreedom = String(middle) === '0' && String(branch) === '0' && String(area) === '不限区域'
-        // console.log(middle, branch, area, isFreedom)
         if (isFreedom) this.area = '0'
 
         this.ruleForm = {
@@ -416,7 +423,10 @@ export default {
       this.ruleForm.area = e && id ? label : ''
       this.ruleForm.branch = e && id ? province_code : ''
       this.ruleForm.middle = e && id ? city_code : ''
-      console.log(label, '--------')
+
+      this.branch = province_code
+      this.middle = city_code
+
       this.$refs.ruleForm.validateField('code')
     },
     async submitForm() {
@@ -450,8 +460,8 @@ export default {
               id: id,
               companyName: this.organName + companyName,
               parent: pid,
-              branch: this.area === '0' ? '0' : area_code[0],
-              middle: this.area === '0' ? '0' : area_code[0],
+              branch: this.area === '0' ? '0' : this.branch,
+              middle: this.area === '0' ? '0' : this.middle,
               area: this.area === '0' ? '不限区域' : area,
               customer_member: this.getCustomer()
             }