Переглянути джерело

Merge branch 'feature_20250527_门店拜访任务列表访问速度优化' into uat(dev)

zhujindu 6 місяців тому
батько
коміт
c6f799cc16
1 змінених файлів з 55 додано та 76 видалено
  1. 55 76
      src/views/deviceWithin/addStoreVisit.vue

+ 55 - 76
src/views/deviceWithin/addStoreVisit.vue

@@ -3378,7 +3378,6 @@ export default {
           this.processKey = false;
         }
         this.infoShow = res.data.isMust;
-        debugger;
         if (this.$route.query.taskType == 1) {
           for (var q = 0; q < collectionItemLists.length; q++) {
             if (
@@ -4680,94 +4679,73 @@ export default {
           }
         }
       } else if (this.$route.query.taskType == 2) {
-        for (let dy = 0; dy < this.competitortableData.length; dy++) {
-          for (let p = 0; p < this.productTitles.length; p++) {
-            if (this.competitortableData[dy][this.productTitles[p].titleValue] == '') {
+        for (let dy = 0; dy < this.tableData1.length; dy++) {
+          if (this.tableData1[dy].xdjhchjj != '') {
+            if (
+              this.tableData1[dy].xdjhyj == '' ||
+              this.tableData1[dy].ygnhj == '' ||
+              this.tableData1[dy].xdjhchjj.split('.')[1] == ''
+            ) {
+              this.$dialog.alert({
+                title: '系统提示',
+                message: '请完善' + this.tableData1[dy].collectionName + '信息或促后竞价格式不正确',
+              });
+              return false;
+            }
+          }
+          if (this.tableData1[dy].xdjhyj != '') {
+            if (this.tableData1[dy].xdjhchjj == '' || this.tableData1[dy].ygnhj == '') {
+              this.$dialog.alert({
+                title: '系统提示',
+                message: '请完善' + this.tableData1[dy].collectionName + '信息',
+              });
+              return false;
+            }
+          }
+          if (this.tableData1[dy].ygnhj != '') {
+            if (this.tableData1[dy].xdjhchjj == '' || this.tableData1[dy].xdjhyj == '') {
               this.$dialog.alert({
                 title: '系统提示',
-                message: '请完善' + this.competitortableData[dy].collectionName + '信息',
+                message: '请完善' + this.tableData1[dy].collectionName + '信息',
               });
               return false;
             }
           }
-          // if (this.tableData1[dy].xdjhchjj != '') {
-          //   if (
-          //     this.tableData1[dy].xdjhyj == '' ||
-          //     this.tableData1[dy].ygnhj == '' ||
-          //     this.tableData1[dy].xdjhchjj.split('.')[1] == ''
-          //   ) {
-          //     this.$dialog.alert({
-          //       title: '系统提示',
-          //       message: '请完善' + this.tableData1[dy].collectionName + '信息或促后竞价格式不正确',
-          //     });
-          //     return false;
-          //   }
-          // }
-          // if (this.tableData1[dy].xdjhyj != '') {
-          //   if (this.tableData1[dy].xdjhchjj == '' || this.tableData1[dy].ygnhj == '') {
-          //     this.$dialog.alert({
-          //       title: '系统提示',
-          //       message: '请完善' + this.tableData1[dy].collectionName + '信息',
-          //     });
-          //     return false;
-          //   }
-          // }
-          // if (this.tableData1[dy].ygnhj != '') {
-          //   if (this.tableData1[dy].xdjhchjj == '' || this.tableData1[dy].xdjhyj == '') {
-          //     this.$dialog.alert({
-          //       title: '系统提示',
-          //       message: '请完善' + this.tableData1[dy].collectionName + '信息',
-          //     });
-          //     return false;
-          //   }
-          // }
         }
-        for (var d = 0; d < this.competitortableData.length; d++) {
-          if (this.productTitles) {
-            for (let p = 0; p < this.productTitles.length; p++) {
+        for (var d = 0; d < this.tableData1.length; d++) {
+          for (var dd = 0; dd < this.tableData1[d].collectionOptionList.length; dd++) {
+            if (dd == 0) {
+              formData.collectionAnswers.push({
+                collectionId: this.tableData1[d].collectionId,
+                itemName: this.tableData1[d].collectionName,
+                collectionType: 'chanpin',
+                collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
+                answerType: 'sz',
+                answerValue: this.tableData1[d].xdjhyj,
+              });
+            }
+            if (dd == 1) {
               formData.collectionAnswers.push({
-                collectionId: this.competitortableData[d].collectionId,
-                itemName: this.competitortableData[d].collectionName,
+                collectionId: this.tableData1[d].collectionId,
+                itemName: this.tableData1[d].collectionName,
                 collectionType: 'chanpin',
-                collectionOptionId:
-                  this.competitortableData[d].collectionOptionList[p].collectionOptionId,
+                collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
                 answerType: 'sz',
-                answerValue: this.competitortableData[d][this.productTitles[p].titleValue],
+                answerValue: this.tableData1[d].xdjhchjj,
+              });
+            }
+            debugger
+            if (dd == 2) {
+              formData.collectionAnswers.push({
+                collectionId: this.tableData1[d].collectionId,
+                itemName: this.tableData1[d].collectionName,
+                collectionType: 'chanpin',
+                collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
+                answerType: 'sz',
+                answerValue: this.tableData1[d].ygnhj,
               });
             }
           }
-          // for (var dd = 0; dd < this.tableData1[d].collectionOptionList.length; dd++) {
-          // if (dd == 0) {
-          //   formData.collectionAnswers.push({
-          //     collectionId: this.tableData1[d].collectionId,
-          //     itemName: this.tableData1[d].collectionName,
-          //     collectionType: 'chanpin',
-          //     collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
-          //     answerType: 'sz',
-          //     answerValue: this.tableData1[d].xdjhyj,
-          //   });
-          // }
-          // if (dd == 1) {
-          //   formData.collectionAnswers.push({
-          //     collectionId: this.tableData1[d].collectionId,
-          //     itemName: this.tableData1[d].collectionName,
-          //     collectionType: 'chanpin',
-          //     collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
-          //     answerType: 'sz',
-          //     answerValue: this.tableData1[d].xdjhchjj,
-          //   });
-          // }
-          // if (dd == 2) {
-          //   formData.collectionAnswers.push({
-          //     collectionId: this.tableData1[d].collectionId,
-          //     itemName: this.tableData1[d].collectionName,
-          //     collectionType: 'chanpin',
-          //     collectionOptionId: this.tableData1[d].collectionOptionList[dd].collectionOptionId,
-          //     answerType: 'sz',
-          //     answerValue: this.tableData1[d].ygnhj,
-          //   });
-          // }
-          // }
         }
       } else {
         for (var d = 0; d < this.tableData1.length; d++) {
@@ -4809,6 +4787,7 @@ export default {
             telName = item.itemName + '格式错误';
           }
         });
+        debugger;
         if (!telVerify) {
           this.$toast(telName);
         } else {