Browse Source

feature_20250704_陈列SKU图片识别

zhujindu 4 months ago
parent
commit
30d1376bc0
1 changed files with 27 additions and 28 deletions
  1. 27 28
      src/views/week/dailyDetails.vue

+ 27 - 28
src/views/week/dailyDetails.vue

@@ -382,9 +382,9 @@
               </van-col>
             </van-row>
           </van-collapse-item>
-          <van-collapse-item title="今日拜访照片" name="10" v-if="reportTarget.photos">
-            <div v-for="(item, index) in reportTarget.photos" :key="index">
-              <p style="margin-bottom: 10px">{{ item.taskName }}</p>
+          <van-collapse-item title="今日拜访照片" name="10" v-if="reportTarget.photoSummary">
+            <div v-for="(item, index) in reportTarget.photoSummary" :key="index">
+              <!-- <p style="margin-bottom: 10px">{{ item.taskName }}</p> -->
               <van-row
                 gutter="10"
                 class="visitIMG1"
@@ -396,13 +396,12 @@
                   span="6"
                   style="padding-bottom: 10px"
                   @click="pviewFn(index, indexImg)"
-                  v-for="(itemImg, indexImg) in item.photos"
-                  :key="indexImg">
-                  <img :src="itemImg.fileUrl" alt="" />
+                  :key="index">
+                  <img :src="item.fileUrl" alt="" />
                 </van-col>
               </van-row>
               <div
-                v-if="item.photos.length > 4"
+                v-if="reportTarget.photoSummary.length > 4"
                 class="arrowIcon"
                 style="
                   display: flex;
@@ -560,17 +559,17 @@
       :close-on-click-modal="false"
       @close="wuliaoTableClose"
       custom-class="shareImgFlag">
-      <div v-if="reportTarget.photos">
+      <div v-if="reportTarget.photoSummary">
         <p style="margin-bottom: 10px; margin-top: 0; display: flex">
           今日总结&明日规划的文本内容<van-checkbox
             v-model="checkedPlan"
             style="margin-left: 10px"></van-checkbox>
         </p>
-        <div v-for="(item, index) in reportTarget.photos" :key="index">
-          <p style="margin-bottom: 10px">{{ item.taskName }}</p>
+        <div v-for="(item, index) in reportTarget.photoSummary" :key="index">
+          <!-- <p style="margin-bottom: 10px">{{ item.taskName }}</p> -->
           <div class="shareVisitImg">
-            <div v-for="(itemImg, indexImg) in item.photos" :key="indexImg">
-              <img :src="itemImg.fileUrl" alt="" @click="selectImg(itemImg)" />
+            <div :key="index">
+              <img :src="item.fileUrl" alt="" @click="selectImg(item)" />
               <van-icon
                 @click.stop
                 name="success"
@@ -586,7 +585,7 @@
                   background: #2b73cf;
                   border: 2px solid #fff;
                 "
-                v-if="itemImg.checked" />
+                v-if="item.checked" />
             </div>
           </div>
         </div>
@@ -740,12 +739,12 @@ export default {
       });
       this.urlList = [];
       this.reportRemarksIndex = index;
-      if (this.reportTarget.photos && this.reportTarget.photos.length) {
+      if (this.reportTarget.photoSummary && this.reportTarget.photoSummary.length) {
         // 重置分享图片状态
-        this.reportTarget.photos.forEach((item) => {
-          item.photos.forEach((val) => {
-            this.$set(val, 'checked', false);
-          });
+        this.reportTarget.photoSummary.forEach((item) => {
+          // item.photos.forEach((val) => {
+          this.$set(item, 'checked', false);
+          // });
         });
         // 选择分享的图片
         this.shareImgFlag = true;
@@ -755,10 +754,10 @@ export default {
     },
     // 确认分享
     confirmShare() {
-      this.reportTarget.photos.forEach((item) => {
-        item.photos.forEach((val) => {
-          if (val.checked) this.urlList.push(val.fileUrl);
-        });
+      this.reportTarget.photoSummary.forEach((item) => {
+        // item.photos.forEach((val) => {
+        if (item.checked) this.urlList.push(item.fileUrl);
+        // });
       });
       if (this.urlList.length == 0 && !this.checkedPlan) {
         this.$notify({ type: 'warning', message: '请选择分享内容!', className: 'notifyIndex' });
@@ -776,7 +775,7 @@ export default {
     },
     pviewFn(val, imgVal) {
       var imgList = [];
-      var photos = this.reportTarget.photos[val].photos;
+      var photos = this.reportTarget.photoSummary[val];
       for (let i = 0; i < photos.length; i++) {
         imgList.push(photos[i].fileUrl);
       }
@@ -833,13 +832,13 @@ export default {
         }
         this.reportContents = res.data.reportContents;
         var imgList = [];
-        if (res.data.photos != null) {
-          for (var k = 0; k < res.data.photos.length; k++) {
-            res.data.photos[k].visitIMG1Flag = false;
-            imgList.push(res.data.photos[k].fileUrl + '');
+        if (res.data.photoSummary != null) {
+          for (var k = 0; k < res.data.photoSummary.length; k++) {
+            res.data.photoSummary[k].visitIMG1Flag = false;
+            imgList.push(res.data.photoSummary[k].fileUrl + '');
           }
         }
-        console.log(res.data.photos);
+        console.log(res.data.photoSummary);
         this.imgList = imgList;
         if (this.sourceType == 'daily') {
           this.$nextTick(() => {