zhujindu před 1 rokem
rodič
revize
a7b266b93c
1 změnil soubory, kde provedl 69 přidání a 49 odebrání
  1. 69 49
      src/views/deviceWithin/addStoreVisit.vue

+ 69 - 49
src/views/deviceWithin/addStoreVisit.vue

@@ -3822,39 +3822,54 @@ export default {
     },
     newimgarr1(val) {
       this.show = false;
-      //是否开启图匠识别,(1:店招内容识别,2:门店代码识别,3:调色机识别,4:更换店招)
-      //  拍摄店招时只允许上传一张
-      let photoIdentifyType = val.photoIdentifyType;
       if (this.pType == 'D') {
-        let fileInfoList =
+        if (
           this.collectionItemList[this.indeximg].collectionOptionList[this.childIndex1]
             .collectionItems[this.childIndex].collectionOptionList[this.childIndex2]
             .collectionItems[this.childIndex3].collectionOptionList[this.childIndex4]
-            .collectionItems[this.childIndex5].fileInfoList;
-        if (fileInfoList == null) {
-          fileInfoList = [];
-        }
-        if (photoIdentifyType == 1) {
-          fileInfoList = val;
-        } else {
-          fileInfoList.push(val);
+            .collectionItems[this.childIndex5].fileInfoList == null
+        ) {
+          this.collectionItemList[this.indeximg].collectionOptionList[
+            this.childIndex1
+          ].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[
+            this.childIndex3
+          ].collectionOptionList[this.childIndex4].collectionItems[this.childIndex5].fileInfoList =
+            [];
         }
+        this.collectionItemList[this.indeximg].collectionOptionList[
+          this.childIndex1
+        ].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[
+          this.childIndex3
+        ].collectionOptionList[this.childIndex4].collectionItems[
+          this.childIndex5
+        ].fileInfoList.push(val);
       }
       if (this.pType == 'E') {
-        let fileInfoList =
+        if (
           this.collectionItemList[this.indeximg].collectionOptionList[this.childIndex1]
             .collectionItems[this.childIndex].collectionOptionList[this.childIndex2]
             .collectionItems[this.childIndex3].collectionOptionList[this.childIndex4]
             .collectionItems[this.childIndex5].collectionOptionList[this.childIndex6]
-            .collectionItems[this.childIndex7].fileInfoList;
-        if (fileInfoList == null) {
-          fileInfoList = [];
-        }
-        if (photoIdentifyType == 1) {
-          fileInfoList = val;
-        } else {
-          fileInfoList.push(val);
+            .collectionItems[this.childIndex7].fileInfoList == null
+        ) {
+          this.collectionItemList[this.indeximg].collectionOptionList[
+            this.childIndex1
+          ].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[
+            this.childIndex3
+          ].collectionOptionList[this.childIndex4].collectionItems[
+            this.childIndex5
+          ].collectionOptionList[this.childIndex6].collectionItems[this.childIndex7].fileInfoList =
+            [];
         }
+        this.collectionItemList[this.indeximg].collectionOptionList[
+          this.childIndex1
+        ].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[
+          this.childIndex3
+        ].collectionOptionList[this.childIndex4].collectionItems[
+          this.childIndex5
+        ].collectionOptionList[this.childIndex6].collectionItems[
+          this.childIndex7
+        ].fileInfoList.push(val);
       }
       if (this.pType == 'A' || this.pType == 'B') {
         var child = false;
@@ -3873,49 +3888,54 @@ export default {
           }
         }
         if (child) {
-          let fileInfoList =
-            this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
-              this.childIndex
-            ].fileInfoList;
           for (
             let childi = 0;
             childi < this.collectionItemList[this.indeximg].collectionOptionList.length;
             childi++
           ) {
-            if (fileInfoList == null || fileInfoList == undefined) {
-              fileInfoList = [];
-            }
-            if (photoIdentifyType == 1) {
-              fileInfoList = val;
-            } else {
-              fileInfoList.push(val);
+            if (
+              this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
+                this.childIndex
+              ].fileInfoList == null ||
+              this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
+                this.childIndex
+              ].fileInfoList == undefined
+            ) {
+              this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
+                this.childIndex
+              ].fileInfoList = [];
             }
+            this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
+              this.childIndex
+            ].fileInfoList.push(val);
           }
         } else {
-          let fileInfoList = this.collectionItemList[this.indeximg].fileInfoList;
-          if (fileInfoList == null || fileInfoList == undefined) {
-            fileInfoList = [];
-          }
-          if (photoIdentifyType == 1) {
-            fileInfoList = val;
-          } else {
-            fileInfoList.push(val);
+          if (
+            this.collectionItemList[this.indeximg].fileInfoList == null ||
+            this.collectionItemList[this.indeximg].fileInfoList == undefined
+          ) {
+            this.collectionItemList[this.indeximg].fileInfoList = [];
           }
+          this.collectionItemList[this.indeximg].fileInfoList.push(val);
         }
       }
       if (this.pType == 'C') {
-        let fileInfoList =
+        if (
           this.collectionItemList[this.indeximg].collectionOptionList[this.childIndex1]
             .collectionItems[this.childIndex].collectionOptionList[this.childIndex2]
-            .collectionItems[this.childIndex3].fileInfoList;
-        if (fileInfoList == null) {
-          fileInfoList = [];
-        }
-        if (photoIdentifyType == 1) {
-          fileInfoList = val;
-        } else {
-          fileInfoList.push(val);
+            .collectionItems[this.childIndex3].fileInfoList == null
+        ) {
+          this.collectionItemList[this.indeximg].collectionOptionList[
+            this.childIndex1
+          ].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[
+            this.childIndex3
+          ].fileInfoList = [];
         }
+        this.collectionItemList[this.indeximg].collectionOptionList[
+          this.childIndex1
+        ].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[
+          this.childIndex3
+        ].fileInfoList.push(val);
       }
     },
     zSelectVal(value) {