Explorar o código

feature_20250704_陈列SKU图片识别

zhujindu hai 4 meses
pai
achega
0e5b166e6f

+ 9 - 0
src/api/index.js

@@ -1039,3 +1039,12 @@ export function imgToBase64(data) {
     data,
   });
 }
+
+// sku识别信息接口
+export function getSkuDetailById(query) {
+  return request({
+    url: '/mobile/reportMobile/getSkuDetailById',
+    method: 'get',
+    params: query,
+  });
+}

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

@@ -29,7 +29,7 @@
           :data="detail.skuList"
           style="width: 100%; border-radius: 10px"
           border
-          class="table-headermd">
+          class="table-headermd1">
           <el-table-column label="序号" type="index" align="center" width="40"> </el-table-column>
           <el-table-column
             label="品类"
@@ -264,7 +264,7 @@ export default {
 </style>
 <style lang="scss">
 .skuDeatil {
-  .table-headermd {
+  .table-headermd1 {
     font-size: 14px;
     text-align: center;
     position: initial;
@@ -286,7 +286,7 @@ export default {
       }
     }
   }
-  .table-headermd th.el-table__cell {
+  .table-headermd1 th.el-table__cell {
     background-color: #f5f5f5;
   }
 }

+ 31 - 0
src/views/week/daily.vue

@@ -380,6 +380,23 @@
             </van-col>
           </van-row>
         </van-collapse-item>
+        <!-- 生动化陈列 sku -->
+        <template v-if="photoSkuImgSummaryeList">
+          <p style="padding: 10px 0; font-size: 14px; color: #1e5398; font-weight: 500">
+            SKU陈列照识别结果
+          </p>
+          <el-table
+            :data="photoSkuImgSummaryeList"
+            border
+            class="table-headermd table-headermdhome"
+            style="width: 100%">
+            <el-table-column label="序号" type="index" width="50px" />
+            <el-table-column label="门店名称(编号)" prop="name" align="center">
+              <template slot-scope="scope"> {{ scope.row.name }}({{ scope.row.code }}) </template>
+            </el-table-column>
+            <el-table-column label="SKU数量" prop="count" width="80px" align="center" />
+          </el-table>
+        </template>
       </van-collapse>
       <div class="contentContainer">
         <div v-if="GZQuota">
@@ -454,6 +471,7 @@ import {
   getDetailById,
   tsContents,
   buryingPoint,
+  getSkuDetailById,
 } from '@/api/index';
 import visitedRealTime from '@/views/componentsTarget/visitedRealTime';
 import createStoreBJ from '@/views/componentsTarget/createStoreBJ';
@@ -549,6 +567,7 @@ export default {
       YFQuota: false, //应用服务
       titlejz: '',
       notVisitReason: '', //今日拜访0家店的原因;
+      photoSkuImgSummaryeList: null,
     };
   },
   created() {
@@ -651,6 +670,7 @@ export default {
             this.reportTarget = res.data;
             this.notVisitReason = this.reportTarget.notVisitReason;
           }
+          this.getskuDetailByIdFun();
         } else {
           this.$toast(res.msg);
         }
@@ -835,6 +855,17 @@ export default {
             this.tucReportingSuccessNum = res.data.reportContents[3].tucReportingSuccessNum;
           }
         }
+        this.getskuDetailByIdFun();
+      });
+    },
+    getskuDetailByIdFun() {
+      if (this.reportTarget.reportPostType != 'fx') return;
+      getSkuDetailById({ reportId: this.reportTarget.id }).then((res) => {
+        if (res.code == 200) {
+          this.photoSkuImgSummaryeList = res.data;
+        } else {
+          this.photoSkuImgSummaryeList = null;
+        }
       });
     },
     userTodayPlanNum() {

+ 39 - 89
src/views/week/dailyApproval.vue

@@ -365,88 +365,39 @@
             </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; margin-top: 0">{{ 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, item)"
-                v-for="(itemImg, indexImg) in item.photos"
-                :key="indexImg">
-                <img :src="itemImg.fileUrl" alt="" />
+        <van-collapse-item title="今日拜访照片" name="10" v-if="reportTarget.photoSummary">
+          <div
+            class="visitIMG1"
+            :style="{
+              overflow: 'hidden',
+              height: visitIMG1Flag ? 'auto' : '85px',
+            }">
+            <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="item.photos.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>
-        </van-collapse-item>
-        <van-collapse-item title="SKU陈列照识别结果" name="10" v-if="reportTarget.photoSummary">
-          <div v-for="(item, index) in reportTarget.photoSummary" :key="index">
-            <p style="margin-bottom: 10px; margin-top: 0">{{ 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, item)"
-                v-for="(itemImg, indexImg) in item.photos"
-                :key="indexImg">
-                <img :src="itemImg.fileUrl" alt="" />
-              </van-col>
-            </van-row>
-            <div
-              v-if="item.photos.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>
+          <div
+            v-if="reportTarget.photoSummary.length > 8"
+            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
@@ -456,11 +407,10 @@
             <p style="padding: 10px 0; font-size: 14px; color: #1e5398; font-weight: 500">
               SKU陈列照识别结果
             </p>
-            <!-- <div class="skuNum">SKU识别:{{ reportTarget.num }}个</div> -->
             <el-table
               :data="reportTarget.photoSkuImgSummaryeList"
               border
-              class="table-headermd"
+              class="table-headermd table-headermdhome"
               style="width: 100%">
               <el-table-column label="序号" type="index" width="50px" />
               <el-table-column label="门店名称(编号)" prop="name" align="center">
@@ -627,6 +577,7 @@ export default {
       GZQuota: false,
       YFQuota: false,
       titlejz: '',
+      visitIMG1Flag: false,
       //
     };
   },
@@ -652,13 +603,13 @@ export default {
     buryingPoint(val) {
       buryingPoint(val);
     },
-    pviewFn(val, imgVal, datai) {
+    pviewFn(index) {
       var imgList = [];
-      var photos = this.reportTarget.photos[val].photos;
+      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 });
       this.buryingPoint({
         systemModel: '日报审核',
         buryingPointType: 2,
@@ -794,10 +745,9 @@ export default {
             }
           }
           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++) {
+              imgList.push(res.data.photoSummary[k].fileUrl + '');
             }
           }
           this.imgList = imgList;

+ 22 - 22
src/views/week/dailyDetails.vue

@@ -389,7 +389,6 @@
                 overflow: 'hidden',
                 height: visitIMG1Flag ? 'auto' : '85px',
               }">
-              <!-- <p style="margin-bottom: 10px">{{ item.taskName }}</p> -->
               <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="" />
@@ -397,7 +396,7 @@
               </template>
             </div>
             <div
-              v-if="reportTarget.photoSummary.length > 4"
+              v-if="reportTarget.photoSummary.length > 8"
               class="arrowIcon"
               style="
                 display: flex;
@@ -436,7 +435,7 @@
                     {{ scope.row.name }}({{ scope.row.code }})
                   </template>
                 </el-table-column>
-                <el-table-column label="数量" prop="count" width="80px" align="center" />
+                <el-table-column label="SKU数量" prop="count" width="80px" align="center" />
               </el-table>
             </template>
           </van-collapse-item>
@@ -561,24 +560,26 @@
             style="margin-left: 10px"></van-checkbox>
         </p>
         <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 v-for="(itemImg, indexImg) in reportTarget.photoSummary">
+            <div>
+              <img :src="itemImg.fileUrl" alt="" @click="selectImg(itemImg)" />
+              <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="itemImg.checked" />
+            </div>
           </template>
         </div>
       </div>
@@ -827,7 +828,6 @@ export default {
         var imgList = [];
         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 + '');
           }
         }

+ 59 - 64
src/views/week/dailyHistoricalDetails.vue

@@ -396,46 +396,40 @@
             </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">
-              <!-- <p style="margin-bottom: 10px; margin-top: 0">{{ 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, item)"
-                  :key="index">
+            <div
+              class="visitIMG1"
+              :style="{
+                overflow: 'hidden',
+                height: visitIMG1Flag ? 'auto' : '85px',
+              }">
+              <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="item.photos.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 > 8"
+              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   -->
+            <!-- 生动化陈列 sku -->
             <template
               v-if="
                 reportTarget.photoSkuImgSummaryeList && reportTarget.photoSkuImgSummaryeList.length
@@ -446,7 +440,7 @@
               <el-table
                 :data="reportTarget.photoSkuImgSummaryeList"
                 border
-                class="table-headermd"
+                class="table-headermd table-headermdhome"
                 style="width: 100%">
                 <el-table-column label="序号" type="index" width="50px" />
                 <el-table-column label="门店名称(编号)" prop="name" align="center">
@@ -454,7 +448,7 @@
                     {{ scope.row.name }}({{ scope.row.code }})
                   </template>
                 </el-table-column>
-                <el-table-column label="数量" prop="count" width="80px" align="center" />
+                <el-table-column label="SKU数量" prop="count" width="80px" align="center" />
               </el-table>
             </template>
           </van-collapse-item>
@@ -607,16 +601,15 @@
       :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 class="shareVisitImg">
-            <div v-for="(itemImg, indexImg) in item.photos" :key="indexImg">
+        <div class="shareVisitImg">
+          <template v-for="(itemImg, indexImg) in reportTarget.photoSummary">
+            <div>
               <img :src="itemImg.fileUrl" alt="" @click="selectImg(itemImg)" />
               <van-icon
                 @click.stop
@@ -635,7 +628,7 @@
                 "
                 v-if="itemImg.checked" />
             </div>
-          </div>
+          </template>
         </div>
       </div>
       <span slot="footer" class="footer-btn">
@@ -744,6 +737,7 @@ export default {
       reportId: '',
       checkedPlan: true, //今日总结&明日规划
       setDailyDetailsBoxFlag: true,
+      visitIMG1Flag: false,
       //
     };
   },
@@ -800,12 +794,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;
@@ -815,10 +809,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' });
@@ -834,13 +828,13 @@ export default {
       this.shareImgFlag = false;
       this.setShareFlag = true;
     },
-    pviewFn(val, imgVal) {
+    pviewFn(index) {
       var imgList = [];
-      var photos = this.reportTarget.photos[val].photos;
+      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 });
     },
     openEnterpriseChatv() {
       this.$dialog
@@ -1038,19 +1032,20 @@ export default {
           }
           this.reportContents = res.data.reportContents;
           var imgList = [];
-          if (res.data.photos != null) {
-            for (var k = 0; k < res.data.photos.length; k++) {
-              imgList.push(res.data.photos[k].fileUrl + '');
+          if (res.data.photoSummary != null) {
+            for (var k = 0; k < res.data.photoSummary.length; k++) {
+              imgList.push(res.data.photoSummary[k].fileUrl + '');
             }
           }
           this.imgList = imgList;
         }
         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) {
+          if (res.data.photoSummary != null) {
+            for (var k = 0; k < res.data.photoSummary.length; k++) {
+              imgList.push(res.data.photoSummary[k].fileUrl + '');
+            }
           }
         }
         this.imgList = imgList;