zhujindu hace 2 semanas
padre
commit
dea4dd0cf8
Se han modificado 1 ficheros con 10 adiciones y 1 borrados
  1. 10 1
      src/views/deviceWithin/taskPhotoTaking.vue

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

@@ -244,8 +244,17 @@ export default {
         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,
+        mediaInfos: [],
       };
+      // 如果已经上传过照片了,则提交时以已上传的照片为准;如果没有上传过照片,则以当前页面的照片为准
+      if (
+        this.formData.collectionItemList[0].fileInfoList &&
+        this.formData.collectionItemList[0].fileInfoList.length > 0
+      ) {
+        formData.mediaInfos = this.formData.collectionItemList[0].fileInfoList;
+      } else {
+        formData.mediaInfos = this.$refs.taskPhoto[0].imgArr;
+      }
       this.addCollection(formData);
     },
     addCollection(formData) {