Browse Source

feature_20260108_陈列奖励案任务合并

zhujindu 1 week ago
parent
commit
3acab3f6d4

+ 9 - 0
src/api/index.js

@@ -1142,3 +1142,12 @@ export function removePhotoBatch(data) {
     data: data,
   });
 }
+
+//
+export function addCollectionAnswerBatch(data) {
+  return request({
+    url: 'mobile/storeGroup/addCollectionAnswerBatch',
+    method: 'post',
+    data,
+  });
+}

+ 1 - 0
src/views/deviceOutside/suishenbangOutstoreVisit.vue

@@ -635,6 +635,7 @@ export default {
             storeGroupId: this.storeGroupId,
             photoType: val.photoType,
             insert: 1,
+            storeId: this.storeId,
           },
         });
       } else {

+ 37 - 3
src/views/deviceWithin/taskPhotoTaking.vue

@@ -113,7 +113,7 @@
   </div>
 </template>
 <script>
-import { getCollectionInfosBatch } from '@/api/index';
+import { getCollectionInfosBatch, addCollectionAnswerBatch, getVisitsDetail } from '@/api/index';
 import taskTips from './taskTips';
 import deleteUploadImg from '@/components/deleteUploadImgTaskPhoto';
 export default {
@@ -139,9 +139,25 @@ export default {
     this.storeGroupId = this.$route.query.storeGroupId || '';
     this.objectType = this.$route.query.photoType || '';
     this.insert = this.$route.query.insert;
-    this.getDetaile();
+    if (this.$route.query.source == 'historicalDetails') {
+      this.getVisitsDetailFun();
+    } else {
+      this.getDetaile();
+    }
   },
   methods: {
+    getVisitsDetailFun() {
+      this.toastLoading(0, '加载中...', true);
+      getVisitsDetail({ visitsId: this.visitsId }).then((res) => {
+        this.toastLoading().clear();
+        if (res.data.sfaTaskList) {
+          this.dataList = res.data.sfaTaskList.filter((val) => val.taskType == '5');
+          this.formData = this.dataList[0];
+        } else {
+          this.formData = null;
+        }
+      });
+    },
     getDetaile() {
       console.log(this.$route.query);
       getCollectionInfosBatch({
@@ -163,7 +179,25 @@ export default {
       this.taskPhotoRecognitionResult = item.taskPhotoRecognitionResult;
     },
     onSubmit() {
-      this.$router.go(-1);
+      let formData = {
+        storeId: this.$route.query.storeId,
+        storeCode: this.$route.query.storeCode,
+        storeGroupId: this.$route.query.storeGroupId,
+        visitsId: this.visitsId,
+        taskList: this.taskIds.split(',').map((val) => Number(val)),
+        insert: true,
+        collectionAnswers: [],
+        checkUnManage: 'N',
+        deviceCode: '',
+        putInCode: '',
+        equipmentCode: '',
+      };
+      addCollectionAnswerBatch(formData).then((res) => {
+        if (res.code == 200) {
+          localStorage.setItem('getRequestFlage', 'true');
+          this.$router.go(-1);
+        }
+      });
     },
     onClickLeft() {
       this.$router.go(-1);

+ 1 - 0
src/views/historicalVisit/historicalDetails.vue

@@ -469,6 +469,7 @@ export default {
             taskIds: val.taskIds.join(','),
             storeGroupId: this.list.storeGroupId,
             insert: 0,
+            source: 'historicalDetails',
           },
         });
       } else {