Browse Source

feature_20260108_陈列奖励案任务合并

zhujindu 1 week ago
parent
commit
00c4b1f2c3
1 changed files with 65 additions and 32 deletions
  1. 65 32
      src/views/deviceWithin/storeVisit.vue

+ 65 - 32
src/views/deviceWithin/storeVisit.vue

@@ -480,7 +480,7 @@ export default {
                   localStorage.setItem('visitId', res.data.visitId);
                   that.visitId = res.data.visitId;
                 }
-                that.list = res.data.sfaTaskList;
+                that.list = that.filterSfaTaskList(res.data.sfaTaskList);
                 that.storeGroupId = res.data.storeGroupId;
                 that.showOrderButton = res.data.showOrderButton;
                 that.startTime = res.data.startTime;
@@ -538,7 +538,7 @@ export default {
                   localStorage.setItem('visitId', res.data.visitId);
                   that.visitId = res.data.visitId;
                 }
-                that.list = res.data.sfaTaskList;
+                that.list = that.filterSfaTaskList(res.data.sfaTaskList);
                 that.storeGroupId = res.data.storeGroupId;
                 that.showOrderButton = res.data.showOrderButton;
                 that.startTime = res.data.startTime;
@@ -598,7 +598,7 @@ export default {
                   localStorage.setItem('visitId', res.data.visitId);
                   that.visitId = res.data.visitId;
                 }
-                that.list = res.data.sfaTaskList;
+                that.list = that.filterSfaTaskList(res.data.sfaTaskList);
                 that.storeGroupId = res.data.storeGroupId;
                 that.showOrderButton = res.data.showOrderButton;
                 that.startTime = res.data.startTime;
@@ -655,7 +655,7 @@ export default {
                   localStorage.setItem('visitId', res.data.visitId);
                   that.visitId = res.data.visitId;
                 }
-                that.list = res.data.sfaTaskList;
+                that.list = that.filterSfaTaskList(res.data.sfaTaskList);
                 that.storeGroupId = res.data.storeGroupId;
                 that.showOrderButton = res.data.showOrderButton;
                 that.startTime = res.data.startTime;
@@ -762,6 +762,25 @@ export default {
           }
         });
     },
+    filterSfaTaskList(list) {
+      let taskTypeArr = list.filter((val) => val.taskType !== '5');
+      let taskType5Index = list.findIndex((val) => val.taskType == '5');
+      if (taskType5Index != -1) {
+        let taskType5Arr = list.filter((val) => val.taskType == '5');
+        let taskIds = [];
+        taskType5Arr.forEach((val) => {
+          taskIds.push(val.taskId);
+        });
+        let taskType5 = {
+          ...list[taskType5Index],
+          taskIds: taskIds,
+        };
+        taskType5.taskName = '生动化陈列任务拍照';
+        taskTypeArr.splice(taskType5Index, 0, taskType5);
+      }
+      console.log(taskTypeArr);
+      return taskTypeArr;
+    },
     addStoreVisit(val, index) {
       if (this.flag) {
         this.flag = false;
@@ -770,34 +789,48 @@ export default {
           this.flag = true;
         }, 2000);
         localStorage.setItem('getRequestFlage', 'false');
-        this.$router.push({
-          path: '/addStoreVisit',
-          query: {
-            visitSource: '1',
-            storeId: this.storeId,
-            storeCode: this.urlParameter.storeCode,
-            visitId: this.visitId,
-            ids: index,
-            taskId: val.taskId,
-            type: this.urlParameter.type,
-            storeGroupId: this.storeGroupId,
-            taskType: val.taskType,
-            photoType: val.photoType,
-            lat: this.lat,
-            lon: this.lon,
-            visitModel: this.visitModel,
-            locationCity: this.city,
-            locationRemark: this.address,
-            types: this.$route.query.type,
-            locationAccuracy: this.locationAccuracy,
-            insert: this.insert,
-            photoIdentifyType: val.photoIdentifyType,
-            deviceCode: val.deviceCode,
-            putInCode: val.putInCode,
-            equipmentCode: val.equipmentCode,
-            inspectionType: val.inspectionType,
-          },
-        });
+        if (val.taskType == '5') {
+          this.$router.push({
+            path: '/taskPhotoTaking',
+            query: {
+              storeCode: this.urlParameter.storeCode,
+              visitsId: this.visitId,
+              taskIds: val.taskIds.join(','),
+              storeGroupId: this.storeGroupId,
+              photoType: val.photoType,
+              insert: 1,
+            },
+          });
+        } else {
+          this.$router.push({
+            path: '/addStoreVisit',
+            query: {
+              visitSource: '1',
+              storeId: this.storeId,
+              storeCode: this.urlParameter.storeCode,
+              visitId: this.visitId,
+              ids: index,
+              taskId: val.taskId,
+              type: this.urlParameter.type,
+              storeGroupId: this.storeGroupId,
+              taskType: val.taskType,
+              photoType: val.photoType,
+              lat: this.lat,
+              lon: this.lon,
+              visitModel: this.visitModel,
+              locationCity: this.city,
+              locationRemark: this.address,
+              types: this.$route.query.type,
+              locationAccuracy: this.locationAccuracy,
+              insert: this.insert,
+              photoIdentifyType: val.photoIdentifyType,
+              deviceCode: val.deviceCode,
+              putInCode: val.putInCode,
+              equipmentCode: val.equipmentCode,
+              inspectionType: val.inspectionType,
+            },
+          });
+        }
       }
       // this.$router.push({path: "/addStoreVisit", query:
       // 		{storeId:this.storeId,storeCode:that.urlParameter.storeCode,visitId:this.visitId,ids:index,taskId:val.taskId,storeGroupId:this.storeGroupId,taskType:val.taskType,photoType:val.photoType}})