zhujindu 1 рік тому
батько
коміт
5ad2616c02
1 змінених файлів з 38 додано та 20 видалено
  1. 38 20
      src/views/deviceWithin/addStoreVisit.vue

+ 38 - 20
src/views/deviceWithin/addStoreVisit.vue

@@ -3956,27 +3956,45 @@ export default {
             childi++
           ) {
             console.log('this.childIndex=' + this.childIndex);
-            console.log('测试111=' + JSON.stringify(this.collectionItemList));
-            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 = [];
-            }
-            if (photoIdentifyType == 1) {
-              this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
-                this.childIndex
-              ].fileInfoList = [val];
+            // console.log('测试111=' + JSON.stringify(this.collectionItemList));
+            if (this.childIndex != undefined) {
+              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 = [];
+              }
+              if (photoIdentifyType == 1) {
+                this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
+                  this.childIndex
+                ].fileInfoList = [val];
+              } else {
+                this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
+                  this.childIndex
+                ].fileInfoList.push(val);
+              }
             } else {
-              this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
-                this.childIndex
-              ].fileInfoList.push(val);
+              if (
+                this.collectionItemList[this.indeximg].fileInfoList == null ||
+                this.collectionItemList[this.indeximg].fileInfoList == undefined
+              ) {
+                this.collectionItemList[this.indeximg].fileInfoList = [];
+              }
+              if (photoIdentifyType == 1) {
+                this.collectionItemList[this.indeximg].fileInfoList = [val];
+                console.log(
+                  'fileInfoList222=' +
+                    JSON.stringify(this.collectionItemList[this.indeximg].fileInfoList)
+                );
+              } else {
+                this.collectionItemList[this.indeximg].fileInfoList.push(val);
+              }
             }
           }
         } else {