Selaa lähdekoodia

Merge branch 'feature_20250415_公装主管任务' into release

zhujindu 7 kuukautta sitten
vanhempi
commit
f834cd61da
1 muutettua tiedostoa jossa 19 lisäystä ja 8 poistoa
  1. 19 8
      src/views/week/VisitSummaryAdd.vue

+ 19 - 8
src/views/week/VisitSummaryAdd.vue

@@ -577,7 +577,7 @@ export default {
             //   }
             // }
             if (answerValue) {
-              let findCompany = this.regionList.find((item) => item.deptCode == answerValue);
+              let findCompany = this.companyList.find((item) => item.deptCode == answerValue);
               this.onSalesRegionConfirm(findCompany);
             } else {
               this.onSalesRegionConfirm(this.regionList[0]);
@@ -587,7 +587,7 @@ export default {
           if (res.data.dept != null) {
             this.deptList = res.data.dept;
             if (answerValue) {
-              let findCompany = this.deptList.find((item) => item.deptCode == answerValue);
+              let findCompany = this.regionList.find((item) => item.deptCode == answerValue);
               this.onSalesDepartmentConfirm(findCompany);
             } else {
               this.onSalesDepartmentConfirm(this.deptList[0]);
@@ -669,6 +669,11 @@ export default {
       if (this.index != '') {
         this.collectionItemList[this.index].answerName = val.deptName;
         this.collectionItemList[this.index].answerValue = val.deptCode;
+        for (var k1 = 0; k1 < this.collectionItemList.length; k1++) {
+          if (this.collectionItemList[k1].answerType == 'xsb' && val.deptId != '') {
+            this.getDeptInfo('dept', 'xsb', this.collectionItemList[k1].answerValue);
+          }
+        }
       } else {
         for (var k1 = 0; k1 < this.collectionItemList.length; k1++) {
           if (this.collectionItemList[k1].answerType == 'xsb') {
@@ -691,15 +696,21 @@ export default {
     onregionConfirm(val) {
       this.RegionShow = false;
       this.companyCode = val.deptId;
-      if (this.index != '') {
+      if (this.index !== '') {
         this.collectionItemList[this.index].answerName = val.deptName;
         this.collectionItemList[this.index].answerValue = val.deptCode;
+        for (var k1 = 0; k1 < this.collectionItemList.length; k1++) {
+          if (this.collectionItemList[k1].answerType == 'dq') {
+            this.getDeptInfo('dept', 'dq');
+          }
+        }
       } else {
         for (var k1 = 0; k1 < this.collectionItemList.length; k1++) {
-          if (
-            this.collectionItemList[k1].answerType == 'xsb' ||
-            this.collectionItemList[k1].answerType == 'dq'
-          ) {
+          if (this.collectionItemList[k1].answerType == 'xsb') {
+            this.collectionItemList[k1].answerName = '';
+            this.collectionItemList[k1].answerValue = '';
+          }
+          if (this.collectionItemList[k1].answerType == 'xsb') {
             this.collectionItemList[k1].answerName = '';
             this.collectionItemList[k1].answerValue = '';
           }
@@ -708,7 +719,7 @@ export default {
             this.collectionItemList[k1].answerValue = val.deptCode;
           }
           if (this.collectionItemList[k1].answerType == 'dq') {
-            this.getDeptInfo('dept', 'dq', this.collectionItemList[k1].answerValue);
+            this.getDeptInfo('dept', 'dq');
           }
         }
       }