瀏覽代碼

主管任务照片批量上传

zhujindu 5 月之前
父節點
當前提交
28586e6829
共有 2 個文件被更改,包括 15 次插入14 次删除
  1. 13 14
      src/components/uploadVTask.vue
  2. 2 0
      src/views/week/VisitSummaryAdd.vue

+ 13 - 14
src/components/uploadVTask.vue

@@ -179,14 +179,13 @@ export default {
       }
       }
     },
     },
     uploadImagev(meidaIds) {
     uploadImagev(meidaIds) {
-      var that = this;
       var form = {
       var form = {
         mediaIds: meidaIds,
         mediaIds: meidaIds,
-        customId: that.customId,
-        summaryId: that.summaryId,
-        locationRemark: that.addressesRemark,
+        customId: this.customId,
+        summaryId: this.summaryId,
+        locationRemark: this.addressesRemark,
       };
       };
-      var loind1 = that.$toast.loading({
+      var loind1 = this.$toast.loading({
         duration: 0,
         duration: 0,
         message: '上传中...',
         message: '上传中...',
         forbidClick: true,
         forbidClick: true,
@@ -199,7 +198,7 @@ export default {
         if (res.code == 200) {
         if (res.code == 200) {
           // that.imgArr = res.data.url;
           // that.imgArr = res.data.url;
           loind1.clear();
           loind1.clear();
-          that.$toast('上传成功!');
+          this.$toast('上传成功!');
           let urlArr = [];
           let urlArr = [];
           let idArr = [];
           let idArr = [];
           res.data.forEach((val) => {
           res.data.forEach((val) => {
@@ -208,10 +207,10 @@ export default {
               id: val.fileId,
               id: val.fileId,
               fileType: val.fileType,
               fileType: val.fileType,
               fileName: val.fileName,
               fileName: val.fileName,
-              type: that.type,
-              index: that.indexImg,
+              type: this.type,
+              index: this.indexImg,
             });
             });
-            idArr.push(val.id);
+            idArr.push(val.fileId);
           });
           });
           if (this.item.fileInfoList == null || this.item.fileInfoList == undefined) {
           if (this.item.fileInfoList == null || this.item.fileInfoList == undefined) {
             this.item.fileInfoList = [];
             this.item.fileInfoList = [];
@@ -219,17 +218,17 @@ export default {
           }
           }
           this.item.fileInfoList.concat(urlArr);
           this.item.fileInfoList.concat(urlArr);
           this.item.fileIdList.concat(idArr);
           this.item.fileIdList.concat(idArr);
-          that.$emit('newimgarr');
-          // that.$emit('newimgarr', {
+          this.$emit('newimgarr');
+          // this.$emit('newimgarr', {
           //   fileUrl: res.data.url,
           //   fileUrl: res.data.url,
           //   id: res.data.fileId,
           //   id: res.data.fileId,
           //   fileType: res.fileType,
           //   fileType: res.fileType,
           //   fileName: res.fileName,
           //   fileName: res.fileName,
-          //   type: that.type,
-          //   index: that.indexImg,
+          //   type: this.type,
+          //   index: this.indexImg,
           // });
           // });
         } else {
         } else {
-          that.$toast('上传失败!');
+          this.$toast('上传失败!');
         }
         }
       });
       });
     },
     },

+ 2 - 0
src/views/week/VisitSummaryAdd.vue

@@ -451,7 +451,9 @@ export default {
       this.show = true;
       this.show = true;
     },
     },
     newimgarr1(val) {
     newimgarr1(val) {
+      console.log(this.collectionItemList);
       this.$forceUpdate();
       this.$forceUpdate();
+      console.log(this.collectionItemList);
       // if (
       // if (
       //   this.collectionItemList[val.index].fileInfoList == null ||
       //   this.collectionItemList[val.index].fileInfoList == null ||
       //   this.collectionItemList[val.index].fileInfoList == undefined
       //   this.collectionItemList[val.index].fileInfoList == undefined