zhujindu 2 nedēļas atpakaļ
vecāks
revīzija
eee6cad0ba

+ 12 - 5
src/components/deleteUploadImgTaskPhoto.vue

@@ -19,10 +19,10 @@
             ref="uploadVNormal" />
             ref="uploadVNormal" />
         </div>
         </div>
       </van-col>
       </van-col>
-      <van-col span="6" v-for="(item, index) in imgArr" :key="index">
+      <van-col span="6" v-for="(urls, index) in imgArr" :key="index">
         <div class="imgview">
         <div class="imgview">
           <van-icon v-if="insert == '1'" name="close" size="16" v-on:click="deleteImg(index)" />
           <van-icon v-if="insert == '1'" name="close" size="16" v-on:click="deleteImg(index)" />
-          <img :src="item.serverId" width="100px" height="100px" @click="previewsImg(index)" />
+          <img :src="urls.fileUrl" width="100px" height="100px" @click="previewsImg(index)" />
           <!-- <img
           <!-- <img
             v-else
             v-else
             :src="urls.fileUrl"
             :src="urls.fileUrl"
@@ -107,6 +107,7 @@ export default {
       url: process.env.VUE_APP_Target1 + process.env.VUE_APP_BASE_API,
       url: process.env.VUE_APP_Target1 + process.env.VUE_APP_BASE_API,
       imgArr: [],
       imgArr: [],
       mediaIds: [],
       mediaIds: [],
+      locationRemark: '',
     };
     };
   },
   },
   methods: {
   methods: {
@@ -120,8 +121,14 @@ export default {
         startPosition: index,
         startPosition: index,
       });
       });
     },
     },
-    newimgarr(localIds) {
-      this.syncUpload(localIds);
+    newimgarr(data) {
+      const { localIds, locationRemark, source } = data;
+      this.locationRemark = locationRemark;
+      if (source == 'weixin') {
+        this.syncUpload(localIds);
+      } else {
+        this.$emit('upDataDetail');
+      }
       // if (this.isIOS()) {
       // if (this.isIOS()) {
       //   this.imgArr = this.imgArr.concat([...localIds]);
       //   this.imgArr = this.imgArr.concat([...localIds]);
       //   // 解决ios微信localId无法直接使用的问题,获取base64后再上传
       //   // 解决ios微信localId无法直接使用的问题,获取base64后再上传
@@ -143,7 +150,7 @@ export default {
           success: (res) => {
           success: (res) => {
             this.imgArr.push({
             this.imgArr.push({
               mediaId: res.serverId,
               mediaId: res.serverId,
-              serverId: localId,
+              fileUrl: localId,
             });
             });
             this.syncUpload(localIds, callback);
             this.syncUpload(localIds, callback);
           },
           },

+ 7 - 1
src/components/uploadVNormalTaskPhoto.vue

@@ -219,7 +219,12 @@ export default {
                 success: function (res) {
                 success: function (res) {
                   let localIds = res.localIds;
                   let localIds = res.localIds;
                   that.localIdsArr = [];
                   that.localIdsArr = [];
-                  that.$emit('newimgarr', localIds);
+                  that.$emit('newimgarr', {
+                    localIds: localIds,
+                    locationRemark: that.addressesRemark,
+                    collectionItemId: that.collectionItemId,
+                    source: 'weixin',
+                  });
                   // that.syncUpload(localIds);
                   // that.syncUpload(localIds);
                 },
                 },
               });
               });
@@ -336,6 +341,7 @@ export default {
       this.$emit('newimgarr', {
       this.$emit('newimgarr', {
         fileInfoList: fileInfoList,
         fileInfoList: fileInfoList,
         photoIdentifyType: this.photoIdentifyType,
         photoIdentifyType: this.photoIdentifyType,
+        source: 'H5',
       });
       });
     },
     },
     // 照片是否入库,1.照片识别三次不通过仍要上传,2.照片识别通过
     // 照片是否入库,1.照片识别三次不通过仍要上传,2.照片识别通过

+ 4 - 1
src/views/deviceWithin/taskPhotoTaking.vue

@@ -241,7 +241,10 @@ export default {
         deviceCode: '',
         deviceCode: '',
         putInCode: '',
         putInCode: '',
         equipmentCode: '',
         equipmentCode: '',
-        mediaIds: this.$refs.taskPhoto[0].imgArr,
+        collectionItemId: this.$refs.taskPhoto[0].collectionItemId, //	是	string	采集项id
+        objectType: this.$route.query.photoType, //	是	string	照片类型,取任务上的照片类型,如果没有则取手动选择的照片类型
+        locationRemark: this.$refs.taskPhoto[0].locationRemark, //	是	String	当前地址信息
+        mediaInfos: this.$refs.taskPhoto[0].imgArr,
       };
       };
       this.addCollection(formData);
       this.addCollection(formData);
     },
     },