瀏覽代碼

Merge branch 'master-20260422' into release

zhujindu 1 周之前
父節點
當前提交
ceffd5fa3a

+ 29 - 124
src/components/deleteUploadImgTaskPhoto.vue

@@ -7,6 +7,7 @@
         v-if="formData.processStatus != 1 || formData.displayRewardTaskEditable">
         <div class="addImg">
           <uploadVNormalTaskPhoto
+            :imgArr="imgs"
             :formData="formData"
             :shouws="true"
             :storeGroupId="storeGroupId"
@@ -23,18 +24,14 @@
             ref="uploadVNormal" />
         </div>
       </van-col>
-      <van-col span="6" v-for="(urls, index) in imgArr" :key="index">
+      <van-col span="6" v-for="(urls, index) in imgs" :key="index">
         <div class="imgview">
           <van-icon
             v-if="formData.processStatus != 1 || formData.displayRewardTaskEditable"
             name="close"
             size="20"
-            v-on:click="deleteImg(index, urls)" />
-          <img
-            :src="urls.fileUrl || urls.mediaFileUrl"
-            width="100px"
-            height="100px"
-            @click="previewsImg(index)" />
+            v-on:click="deleteImg(index, urls.fileIdSplicing)" />
+          <img :src="urls.fileUrl" width="100px" height="100px" @click="previewsImg(index)" />
           <!-- <img
             v-else
             :src="urls.fileUrl"
@@ -117,24 +114,16 @@ export default {
         return [];
       },
     },
+    imgs: {
+      type: Array,
+      default() {
+        return [];
+      },
+    },
   },
   watch: {
-    formData: {
-      handler(val) {
-        // <!-- 0=企业微信,1=H5相机 -->
-        if (this.userInfo.photoMethod == '1') {
-          this.imgArr = this.fileInfoList || [];
-        } else {
-          this.imgArr = val.mediaInfos || [];
-          // if (this.formData.mediaInfos) {
-          //   getTicketFun(['downloadImage']).then(() => {
-          //     this.toastLoading(0, '加载中,请稍候...', true);
-          //     let mediaInfosCopy = JSON.parse(JSON.stringify(this.formData.mediaInfos));
-          //     this.downloadImage(mediaInfosCopy);
-          //   });
-          // }
-        }
-      },
+    imgs: {
+      handler(val) {},
       deep: true,
       immediate: true,
     },
@@ -142,119 +131,35 @@ export default {
   data() {
     return {
       url: process.env.VUE_APP_Target1 + process.env.VUE_APP_BASE_API,
-      imgArr: [],
-      mediaIds: [],
-      locationRemark: '',
-      isUploadImg: true,
     };
   },
   methods: {
-    downloadImage(mediaInfos) {
-      if (!mediaInfos.length) {
-        this.toastLoading().clear();
-        return;
-      } else {
-        let mediaitem = mediaInfos.pop();
-        if (mediaitem.fileUrl) {
-          this.imgArr.push(mediaitem);
-          this.downloadImage(mediaInfos);
+    deleteImg(index, fileIdList) {
+      this.toastLoading(0, '请稍候...', true);
+      removePhotoBatch({ fileIdList: fileIdList.split(',') }).then((res) => {
+        if (res.code == 200) {
+          this.$emit('upDataDetail');
         } else {
-          wx.downloadImage({
-            serverId: mediaitem.mediaId,
-            isShowProgressTips: 0, // 默认为1,显示进度提示
-            success: (res) => {
-              wx.getLocalImgData({
-                localId: res.localId,
-                success: (res2) => {
-                  this.imgArr.push({
-                    mediaId: mediaitem.mediaId,
-                    mediaFileUrl: res2.localData,
-                  });
-                  this.downloadImage(mediaInfos);
-                },
-                fail: (err) => {
-                  console.error('获取本地图片数据失败:', err);
-                  this.$toast('获取图片数据失败');
-                  this.toastLoading().clear();
-                  this.downloadImage(mediaInfos);
-                },
-              });
-            },
-            fail: (err) => {
-              console.error('下载图片失败:', err);
-              this.$toast('下载图片失败,请重试');
-              // 可以选择继续下载其他图片或停止
-              this.downloadImage(mediaInfos);
-            },
-          });
+          this.$toast('删除失败!');
         }
-      }
-    },
-    deleteImg(index, urls) {
-      // <!-- 0=企业微信,1=H5相机 -->
-      if (this.userInfo.photoMethod == '1') {
-        removePhotoBatch({ fileIdList: urls.fileIdSplicing.split(',') }).then((res) => {
-          if (res.code == 200) {
-            this.$toast('删除成功!');
-            this.$emit('upDataDetail');
-          } else {
-            this.$toast('删除失败!');
-          }
-        });
-      } else {
-        this.imgArr.splice(index, 1);
-      }
+      });
     },
     previewsImg(index) {
-      let urls = this.imgArr.map((item) => item.fileUrl || item.mediaFileUrl);
+      var arrimg = [];
+      for (var imgi = 0; imgi < this.imgs.length; imgi++) {
+        arrimg.push(this.imgs[imgi].fileUrl);
+      }
       ImagePreview({
-        images: urls,
+        images: arrimg,
         startPosition: index,
+        onClose() {
+          // do something
+        },
       });
     },
-    newimgarr(data) {
-      const { localIds, locationRemark, source } = data;
-      this.locationRemark = locationRemark;
-      console.log(source);
-      // 0=企业微信,1=H5相机
-      if (this.userInfo.photoMethod == '0') {
-        this.isUploadImg = false;
-        const startIndex = this.imgArr.length;
-        this.imgArr = this.imgArr.concat(
-          localIds.map((item) => {
-            return {
-              mediaId: '',
-              mediaFileUrl: item,
-            };
-          }),
-        );
-        // this.$nextTick(() => {
-        //   this.syncUpload(localIds, startIndex);
-        // });
-      } else {
-        this.$emit('upDataDetail');
-      }
+    newimgarr() {
+      this.$emit('upDataDetail');
     },
-    // syncUpload(localIds, baseIndex = 0, callback) {
-    //   if (!localIds.length) {
-    //     this.isUploadImg = true;
-    //     callback && callback();
-    //     return;
-    //   } else {
-    //     var localId = localIds.pop();
-    //     wx.uploadImage({
-    //       localId: localId,
-    //       isShowProgressTips: 0, // 默认为1,显示进度提示
-    //       success: (res) => {
-    //         const index = baseIndex + localIds.length;
-    //         if (this.imgArr[index]) {
-    //           this.imgArr[index].mediaId = res.serverId;
-    //         }
-    //         this.syncUpload(localIds, baseIndex, callback);
-    //       },
-    //     });
-    //   }
-    // },
   },
 };
 </script>

+ 9 - 9
src/components/uploadVNormalTaskPhoto.vue

@@ -217,7 +217,7 @@ export default {
               }
               wx.chooseImage({
                 count: count,
-                sizeType: ['original'], // 可以指定是原图还是压缩图,默认二者都有
+                sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
                 sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有
                 defaultCameraMode: count == 1 ? 'normal' : 'batch', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
                 // defaultCameraMode: 'normal', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
@@ -225,13 +225,13 @@ export default {
                 success: function (res) {
                   let localIds = res.localIds;
                   that.localIdsArr = [];
-                  that.$emit('newimgarr', {
-                    localIds: localIds,
-                    locationRemark: that.addressesRemark,
-                    collectionItemId: that.collectionItemId,
-                    source: 'weixin',
-                  });
-                  // that.syncUpload(localIds);
+                  // that.$emit('newimgarr', {
+                  //   localIds: localIds,
+                  //   locationRemark: that.addressesRemark,
+                  //   collectionItemId: that.collectionItemId,
+                  //   source: 'weixin',
+                  // });
+                  that.syncUpload(localIds);
                 },
               });
             });
@@ -248,7 +248,7 @@ export default {
           isShowProgressTips: 1, // 默认为1,显示进度提示
           success: (res) => {
             this.localIdsArr.push(res.serverId);
-            // this.syncUpload(localIds);
+            this.syncUpload(localIds);
           },
         });
       }

+ 1 - 1
src/views/deviceOutside/index.vue

@@ -367,7 +367,7 @@
               <template v-if="item.stateString == '已拜访'">
                 <template v-if="item.visitSource == 1">
                   <!-- 金牌店+同城分销店+可控店 -->
-                  <template v-if="item.jinpaiStore || item.fenxiaoStore || item.kekongStore">
+                  <template v-if="item.wanmeiStore">
                     <div class="statstext" style="background-color: #e3f0fe">
                       <span style="color: #387bca">已拜访</span>
                       <div

+ 17 - 17
src/views/deviceOutside/suishenbangOutstoreVisit.vue

@@ -630,24 +630,24 @@ export default {
       localStorage.setItem('getRequestFlage', 'false');
       console.log(this.visitId);
       if (val.taskType == '5') {
-        getCljlaToDBLabel({ visitsId: this.visitId }).then((res) => {
-          if (res.code == 200) {
-            this.$router.push({
-              path: '/taskPhotoTaking',
-              query: {
-                storeCode: this.urlParameter.storeCode,
-                visitsId: this.visitId,
-                taskIds: val.taskIds.join(','),
-                storeGroupId: this.storeGroupId,
-                photoType: val.photoType,
-                insert: true,
-                storeId: this.storeId,
-              },
-            });
-          } else {
-            this.$toast(res.msg);
-          }
+        // getCljlaToDBLabel({ visitsId: this.visitId }).then((res) => {
+        //   if (res.code == 200) {
+        this.$router.push({
+          path: '/taskPhotoTaking',
+          query: {
+            storeCode: this.urlParameter.storeCode,
+            visitsId: this.visitId,
+            taskIds: val.taskIds.join(','),
+            storeGroupId: this.storeGroupId,
+            photoType: val.photoType,
+            insert: true,
+            storeId: this.storeId,
+          },
         });
+        //   } else {
+        //     this.$toast(res.msg);
+        //   }
+        // });
       } else {
         this.$router.push({
           path: '/addStoreVisit',

+ 1 - 1
src/views/deviceWithin/index.vue

@@ -394,7 +394,7 @@
               <!-- 正常拜访 -->
               <template v-if="item.visitSource == 1">
                 <!-- 金牌店+同城分销店+可控店 -->
-                <template v-if="item.jinpaiStore || item.fenxiaoStore || item.kekongStore">
+                <template v-if="item.wanmeiStore">
                   <div class="statstext" style="background-color: #e3f0fe">
                     <span style="color: #387bca">已拜访</span>
                     <div

+ 17 - 17
src/views/deviceWithin/storeVisit.vue

@@ -791,24 +791,24 @@ export default {
         }, 2000);
         localStorage.setItem('getRequestFlage', 'false');
         if (val.taskType == '5') {
-          getCljlaToDBLabel({ visitsId: this.visitId }).then((res) => {
-            if (res.code == 200) {
-              this.$router.push({
-                path: '/taskPhotoTaking',
-                query: {
-                  storeCode: this.urlParameter.storeCode,
-                  visitsId: this.visitId,
-                  taskIds: val.taskIds.join(','),
-                  storeGroupId: this.storeGroupId,
-                  photoType: val.photoType,
-                  insert: this.insert,
-                  storeId: this.storeId,
-                },
-              });
-            } else {
-              this.$toast(res.msg);
-            }
+          // getCljlaToDBLabel({ visitsId: this.visitId }).then((res) => {
+          //   if (res.code == 200) {
+          this.$router.push({
+            path: '/taskPhotoTaking',
+            query: {
+              storeCode: this.urlParameter.storeCode,
+              visitsId: this.visitId,
+              taskIds: val.taskIds.join(','),
+              storeGroupId: this.storeGroupId,
+              photoType: val.photoType,
+              insert: this.insert,
+              storeId: this.storeId,
+            },
           });
+          //   } else {
+          //     this.$toast(res.msg);
+          //   }
+          // });
         } else {
           this.$router.push({
             path: '/addStoreVisit',

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

@@ -42,6 +42,7 @@
                 </template>
               </van-cell>
               <deleteUploadImgTaskPhoto
+                :imgs="item.fileInfoList"
                 ref="taskPhoto"
                 :formData="formData"
                 :storeGroupId="storeGroupId"
@@ -163,6 +164,9 @@ export default {
     };
   },
   activated() {
+    if (this.formData && this.formData.collectionItemList && this.formData.collectionItemList[0]) {
+      this.formData.collectionItemList[0].fileInfoList = [];
+    }
     this.taskIds = this.$route.query.taskIds || [];
     this.visitsId = this.$route.query.visitsId || '';
     this.storeGroupId = this.$route.query.storeGroupId || '';
@@ -170,6 +174,7 @@ export default {
     this.insert = this.$route.query.insert;
     // 授权
     // getTicketFun(['uploadImage']).then(() => {});
+    this.toastLoading(0, '加载中...', true);
     if (this.$route.query.source == 'historicalDetails') {
       this.getVisitsDetailFun();
     } else {
@@ -249,7 +254,6 @@ export default {
       }
     },
     getVisitsDetailFun() {
-      this.toastLoading(0, '加载中...', true);
       getVisitsDetail({ visitsId: this.visitsId }).then((res) => {
         this.toastLoading().clear();
         if (res.data.sfaTaskList) {
@@ -269,6 +273,7 @@ export default {
         id: this.visitsId,
         taskIds: this.taskIds.split(','),
       }).then((res) => {
+        this.toastLoading().clear();
         if (res.data && res.data.length) {
           this.dataList = res.data;
           this.formData = res.data[0];
@@ -279,7 +284,7 @@ export default {
       });
     },
     isEditFun() {
-      this.getTicketFunfun();
+      // this.getTicketFunfun();
     },
     openDialog(item) {
       this.vanPopup = true;
@@ -292,7 +297,6 @@ export default {
     },
     onSubmit() {
       this.toastLoading(0, '提交中,请稍候...', true);
-      const taskPhoto = this.$refs.taskPhoto && this.$refs.taskPhoto[0];
       let formData = {
         storeId: this.$route.query.storeId,
         storeCode: this.$route.query.storeCode,
@@ -305,24 +309,8 @@ export default {
         deviceCode: '',
         putInCode: '',
         equipmentCode: '',
-        collectionItemId: taskPhoto ? taskPhoto.collectionItemId : '',
-        objectType: this.$route.query.photoType,
-        locationRemark: taskPhoto ? taskPhoto.locationRemark : '',
-        mediaInfos: [],
-        isH5: this.userInfo.photoMethod == '1',
       };
-      if (this.userInfo.photoMethod == '1') {
-        formData.mediaInfos = [];
-        this.addCollection(formData);
-      } else {
-        this.mediaInfos = [];
-        let imgArr = JSON.parse(JSON.stringify(taskPhoto.imgArr));
-        this.syncUpload(imgArr, () => {
-          this.toastLoading().clear();
-          formData.mediaInfos = this.mediaInfos;
-          this.addCollection(formData);
-        });
-      }
+      this.addCollection(formData);
     },
     syncUpload(imgArr, callback) {
       if (!imgArr.length) {
@@ -349,7 +337,8 @@ export default {
       }
     },
     addCollection(formData) {
-      return addCollectionAnswerBatch(formData).then((res) => {
+      addCollectionAnswerBatch(formData).then((res) => {
+        this.toastLoading().clear();
         if (res.code == 200) {
           localStorage.setItem('getRequestFlage', 'true');
           this.$router.go(-1);

+ 13 - 3
src/views/historicalVisit/perfectStore.vue

@@ -74,7 +74,7 @@
         </div>
       </div>
       <!-- 调色机 -->
-      <div class="TSJBox specialTask" v-if="tiaoSJDetail && tiaoSJDetail.qualifiedState">
+      <div class="TSJBox specialTask" v-if="tiaoSJDetail">
         <div class="specialTaskLeft" @click="openPerfectStoreTSJ(tiaoSJDetail)">
           <div class="SignText">AI 调色机识别</div>
           <div class="signContent">
@@ -351,7 +351,15 @@ export default {
           if (shopSignArr.length) this.shopSignDetail = shopSignArr[0];
           let tiaoSJArr = this.list.sfaTaskList.filter((val) => val.photoIdentifyType == '3');
           if (tiaoSJArr.length) {
-            this.tiaoSJDetail = tiaoSJArr[0];
+            let TSJqualifiedState0 = tiaoSJArr.filter((val) => val.qualifiedState == '0');
+            let TSJqualifiedState1 = tiaoSJArr.filter((val) => val.qualifiedState == '1');
+            if (TSJqualifiedState0 && TSJqualifiedState0.length) {
+              this.tiaoSJDetail = TSJqualifiedState0[0];
+            } else if (TSJqualifiedState1 && TSJqualifiedState1.length) {
+              this.tiaoSJDetail = TSJqualifiedState1[0];
+            } else {
+              this.tiaoSJDetail = tiaoSJArr[0];
+            }
             console.log(this.tiaoSJDetail);
           }
           if (res.data.visitSource != 2) {
@@ -443,9 +451,11 @@ export default {
       });
     },
     openPerfectStoreTSJ(val) {
+      let tiaoSJArr = this.list.sfaTaskList.filter((val) => val.photoIdentifyType == '3');
+      let taskIds = tiaoSJArr.map((item) => item.taskId).join(',');
       this.$router.push({
         path: '/perfectStoreTSJ',
-        query: { visitId: this.visitsId, taskId: val.taskId },
+        query: { visitId: this.visitsId, taskId: taskIds },
       });
     },
   },

+ 3 - 3
src/views/historicalVisit/perfectStoreSign.vue

@@ -74,12 +74,12 @@ export default {
       this.shopSignDetail = null;
       getVisitsDetailPerfectStoreByTaskId({
         visitsId: this.visitsId,
-        taskId: this.$route.query.taskId,
+        taskIdList: this.$route.query.taskId,
       })
         .then((res) => {
           this.toastLoading().clear();
-          if (res.code == 200) {
-            this.detail = res.data;
+          if (res.code == 200 && res.data && res.data.length > 0) {
+            this.detail = res.data[0];
             let shopSignArr = this.detail;
             this.shopSignDetail = shopSignArr;
           } else {

+ 18 - 22
src/views/historicalVisit/perfectStoreTSJ.vue

@@ -2,37 +2,32 @@
   <div class="perfectStoreTSJ">
     <van-nav-bar class="navBar" title="AI 调色机识别" left-arrow @click-left="onClickLeft" />
     <div class="content">
-      <!-- <div class="contentBox" v-for="val in tiaoSJArr"> -->
-      <div class="contentBox" v-if="tiaoSJArr">
+      <div class="contentBox" v-for="val in tiaoSJArr">
         <div class="deviceCode">
           <div class="vertical"></div>
           <div class="codeData">
-            <p style="margin: 13px 0">设备编号:{{ tiaoSJArr.deviceCode || '' }}</p>
-            <p style="margin: 13px 0">投放编号:{{ tiaoSJArr.putInCode || '' }}</p>
+            <p style="margin: 13px 0">设备编号:{{ val.deviceCode || '' }}</p>
+            <p style="margin: 13px 0">投放编号:{{ val.putInCode || '' }}</p>
           </div>
         </div>
-        <div class="shopSign specialTask" v-if="tiaoSJArr && tiaoSJArr.qualifiedState">
+        <div class="shopSign specialTask">
           <div class="specialTaskLeft">
             <div class="SignText">识别结果:</div>
             <div class="signContent">
-              <div class="icon">
-                <van-icon name="checked" color="#07c160" v-if="tiaoSJArr.qualifiedState == '1'" />
+              <div class="icon" v-if="val.qualifiedState">
+                <van-icon name="checked" color="#07c160" v-if="val.qualifiedState == '1'" />
                 <van-icon name="warning" color="#ee0a24" v-else />
               </div>
-              <div :style="{ color: tiaoSJArr.qualifiedState == '1' ? '#07c160' : '#ee0a24' }">
-                {{
-                  tiaoSJArr.qualifiedState == '1'
-                    ? '调色机完整,投放号正确'
-                    : tiaoSJArr.unqualifiedReason
-                }}
+              <div
+                :style="{ color: val.qualifiedState == '1' ? '#07c160' : '#ee0a24' }"
+                v-if="val.qualifiedState">
+                {{ val.qualifiedState == '1' ? '调色机完整,投放号正确' : val.unqualifiedReason }}
               </div>
             </div>
             <div class="shopSignButton">
               <div class="" style="display: flex">
-                <van-button round type="primary" v-if="tiaoSJArr.qualifiedState == '1'"
-                  >通过</van-button
-                >
-                <van-button round type="danger" v-else>不通过</van-button>
+                <van-button round type="primary" v-if="val.qualifiedState == '1'">通过</van-button>
+                <van-button round type="danger" v-if="val.qualifiedState == '0'">不通过</van-button>
               </div>
             </div>
           </div>
@@ -40,10 +35,10 @@
 
         <div
           class="container containert"
-          style="width: 100%; margin: 0 auto; padding-bottom: 10px"
-          v-if="tiaoSJArr.collectionItemList.length">
+          style="font-size: 16px; width: 100%; margin: 0 auto; padding-bottom: 10px"
+          v-if="val.collectionItemList.length">
           <van-form ref="tabstoreVal">
-            <div v-for="(item, index) in tiaoSJArr.collectionItemList" :key="index">
+            <div v-for="(item, index) in val.collectionItemList" :key="index">
               <div v-if="item.answerType == 'tel_send_code'" class="formLabel z-cell z-cells">
                 <van-cell>
                   <template #title> {{ index + 1 }}.{{ item.collectionName }} </template>
@@ -289,11 +284,11 @@ export default {
       //   this.collectionItemList = [];
       getVisitsDetailPerfectStoreByTaskId({
         visitsId: this.visitsId,
-        taskId: this.$route.query.taskId,
+        taskIdList: this.$route.query.taskId,
       })
         .then((res) => {
           this.toastLoading().clear();
-          if (res.code == 200) {
+          if (res.code == 200 && res.data && res.data.length > 0) {
             this.detail = res.data;
             this.tiaoSJArr = this.detail;
             console.log(this.tiaoSJArr);
@@ -480,6 +475,7 @@ export default {
 
   .formLabel .van-cell {
     padding: 5px 0;
+    font-size: 16px;
   }
 
   .formLabel .van-cell::after {

+ 3 - 3
src/views/historicalVisit/perfectStoreTask.vue

@@ -242,11 +242,11 @@ export default {
       this.toastLoading(0, '加载中...', true);
       getVisitsDetailPerfectStoreByTaskId({
         visitsId: this.visitsId,
-        taskId: this.$route.query.taskId,
+        taskIdList: this.$route.query.taskId,
       }).then((res) => {
         this.toastLoading().clear();
-        if (res.code == 200 && res.data) {
-          this.formData = res.data;
+        if (res.code == 200 && res.data && res.data.length > 0) {
+          this.formData = res.data[0];
           console.log(this.formData.taskPhotoRecognitionResult);
           this.getSpanArr(this.formData.taskPhotoRecognitionResult);
           console.log(this.formData);