Kaynağa Gözat

feature_20250704_陈列SKU图片识别

zhujindu 4 ay önce
ebeveyn
işleme
3a50f9cbf3
1 değiştirilmiş dosya ile 55 ekleme ve 62 silme
  1. 55 62
      src/views/week/dailyDetails.vue

+ 55 - 62
src/views/week/dailyDetails.vue

@@ -383,44 +383,39 @@
             </van-row>
           </van-collapse-item>
           <van-collapse-item title="今日拜访照片" name="10" v-if="reportTarget.photoSummary">
-            <div v-for="(item, index) in reportTarget.photoSummary" :key="index">
+            <div
+              class="visitIMG1"
+              :style="{
+                overflow: 'hidden',
+                height: visitIMG1Flag ? 'auto' : '85px',
+              }">
               <!-- <p style="margin-bottom: 10px">{{ item.taskName }}</p> -->
-              <van-row
-                gutter="10"
-                class="visitIMG1"
-                :style="{
-                  overflow: 'hidden',
-                  height: item.visitIMG1Flag ? 'auto' : '85px',
-                }">
-                <van-col
-                  span="6"
-                  style="padding-bottom: 10px"
-                  @click="pviewFn(index, indexImg)"
-                  :key="index">
+              <template v-for="(item, index) in reportTarget.photoSummary">
+                <van-col span="6" style="padding: 5px" @click="pviewFn(index)" :key="index">
                   <img :src="item.fileUrl" alt="" />
                 </van-col>
-              </van-row>
-              <div
-                v-if="reportTarget.photoSummary.length > 4"
-                class="arrowIcon"
-                style="
-                  display: flex;
-                  align-items: center;
-                  justify-content: center;
-                  padding: 5px 0;
-                  font-size: 14px;
-                  color: #969799;
-                "
-                @click="setVisitIMG1Flag(item)">
-                <template v-if="item.visitIMG1Flag">
-                  <span style="margin-right: 5px">折叠</span>
-                  <van-icon size="14" :name="require('@/assets/Icon/arrow-up.png')" />
-                </template>
-                <template v-else>
-                  <span style="margin-right: 5px">展开</span>
-                  <van-icon size="14" :name="require('@/assets/Icon/arrow-down.png')" />
-                </template>
-              </div>
+              </template>
+            </div>
+            <div
+              v-if="reportTarget.photoSummary.length > 4"
+              class="arrowIcon"
+              style="
+                display: flex;
+                align-items: center;
+                justify-content: center;
+                padding: 5px 0;
+                font-size: 14px;
+                color: #969799;
+              "
+              @click="visitIMG1Flag = !visitIMG1Flag">
+              <template v-if="visitIMG1Flag">
+                <span style="margin-right: 5px">折叠</span>
+                <van-icon size="14" :name="require('@/assets/Icon/arrow-up.png')" />
+              </template>
+              <template v-else>
+                <span style="margin-right: 5px">展开</span>
+                <van-icon size="14" :name="require('@/assets/Icon/arrow-down.png')" />
+              </template>
             </div>
             <!-- 生动化陈列 sku -->
             <template
@@ -565,29 +560,26 @@
             v-model="checkedPlan"
             style="margin-left: 10px"></van-checkbox>
         </p>
-        <div v-for="(item, index) in reportTarget.photoSummary" :key="index">
-          <!-- <p style="margin-bottom: 10px">{{ item.taskName }}</p> -->
-          <div class="shareVisitImg">
-            <div :key="index">
-              <img :src="item.fileUrl" alt="" @click="selectImg(item)" />
-              <van-icon
-                @click.stop
-                name="success"
-                class="activaImg"
-                color="#fff"
-                size="15"
-                style="
-                  position: absolute;
-                  right: 0;
-                  bottom: 0;
-                  /* margin: -15px 0 0 -15px; */
-                  pointer-events: none;
-                  background: #2b73cf;
-                  border: 2px solid #fff;
-                "
-                v-if="item.checked" />
-            </div>
-          </div>
+        <div class="shareVisitImg">
+          <template v-for="(item, index) in reportTarget.photoSummary">
+            <img :src="item.fileUrl" alt="" @click="selectImg(item)" />
+            <van-icon
+              @click.stop
+              name="success"
+              class="activaImg"
+              color="#fff"
+              size="15"
+              style="
+                position: absolute;
+                right: 0;
+                bottom: 0;
+                /* margin: -15px 0 0 -15px; */
+                pointer-events: none;
+                background: #2b73cf;
+                border: 2px solid #fff;
+              "
+              v-if="item.checked" />
+          </template>
         </div>
       </div>
       <span slot="footer" class="footer-btn">
@@ -689,6 +681,7 @@ export default {
       setDailyDetailsBoxFlag: true,
       sourceType: '',
       checkedPlan: true, //今日总结&明日规划
+      visitIMG1Flag: false,
       //
     };
   },
@@ -719,7 +712,7 @@ export default {
   },
   methods: {
     setVisitIMG1Flag(item) {
-      this.$set(item, 'visitIMG1Flag', !item.visitIMG1Flag);
+      // this.$set(item, 'visitIMG1Flag', !item.visitIMG1Flag);
       this.$forceUpdate();
     },
     setDailyDetailsBox(flag) {
@@ -773,13 +766,13 @@ export default {
       this.shareImgFlag = false;
       this.setShareFlag = true;
     },
-    pviewFn(val, imgVal) {
+    pviewFn(index) {
       var imgList = [];
-      var photos = this.reportTarget.photoSummary[val];
+      var photos = this.reportTarget.photoSummary;
       for (let i = 0; i < photos.length; i++) {
         imgList.push(photos[i].fileUrl);
       }
-      ImagePreview({ images: imgList, startPosition: imgVal });
+      ImagePreview({ images: imgList, startPosition: index });
     },
     submint() {
       this.$router.push({