zhujindu 1 неделя назад
Родитель
Сommit
3e5838bd0a
3 измененных файлов с 131 добавлено и 69 удалено
  1. 2 0
      src/main.js
  2. 10 1
      src/utils/index.js
  3. 119 68
      src/views/historicalVisit/PerfectStore.vue

+ 2 - 0
src/main.js

@@ -19,6 +19,7 @@ import {
   validatePhone,
   formatChineseDate,
   shareVedioLinks,
+  convertToChinese,
 } from '@/utils/index';
 import { toastLoading } from '@/utils/commonVant';
 import '@vant/touch-emulator';
@@ -66,6 +67,7 @@ Vue.prototype.verifyStoreType = verifyStoreType;
 Vue.prototype.validatePhone = validatePhone;
 Vue.prototype.formatChineseDate = formatChineseDate;
 Vue.prototype.shareVedioLinks = shareVedioLinks;
+Vue.prototype.convertToChinese = convertToChinese;
 Vue.prototype.Toast = Toast;
 Vue.prototype.notify = Notify;
 var clipboard = new ClipboardJS('.btn');

+ 10 - 1
src/utils/index.js

@@ -128,7 +128,7 @@ export function parseTimeParagraph(dayTime) {
         ' ' +
         ['周日', '周一', '周二', '周三', '周四', '周五', '周六'][
           new Date(dataTime.toString().replace(/-/g, '/')).getDay()
-        ]
+        ],
     );
   }
   tabTime.push(dates[0]);
@@ -325,3 +325,12 @@ export function shareVedioLinks() {
   window.location.href =
     'https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww5444eb205d75e730&redirect_uri=https%3A%2F%2Fknowledgewiki.nipponpaint.com.cn%2Fapi%2Fauth%2Fwx%2FshareOuth%3Fguid%3Dd4ac9b85658570389cfebe70e4505071%26shareId%3DSHARE21482&response_type=code&scope=snsapi_base&state=ZyKPSJuKA6-ZikabG6WSBqgGRsjsYK8j6P5I2bVdqOs&agentid=1000291#wechat_redirect';
 }
+
+export function convertToChinese(num) {
+  const digitMap = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
+  return num
+    .toString()
+    .split('')
+    .map((digit) => digitMap[parseInt(digit)])
+    .join('');
+}

+ 119 - 68
src/views/historicalVisit/PerfectStore.vue

@@ -52,12 +52,12 @@
         </template>
         <div class="subtitle" v-if="updateTimeShow">更新时间:{{ list.updateTime }}</div>
       </div>
-      <p
+      <!-- <p
         style="padding: 0 10px; font-size: 14px; color: #222; font-weight: bold"
         v-if="list.visitSource != 2 && ListHistoryList.length > 0">
         审批历史
-      </p>
-      <div
+      </p> -->
+      <!-- <div
         v-for="(item1, index1) in ListHistoryList"
         :key="index1"
         style="background-color: white; padding-top: 14px">
@@ -71,8 +71,8 @@
           </van-step>
         </van-steps>
         <div style="border-bottom: 2px solid #f5f5f5; margin: 0 16px 16px"></div>
-      </div>
-      <van-collapse
+      </div> -->
+      <!-- <van-collapse
         v-model="active"
         class="fontWeit"
         v-if="managerRemarkContents != null && managerRemarkContents.length > 0">
@@ -91,8 +91,8 @@
           </p>
           <p style="text-align: right">点评时间:{{ managerRemarkContents[0].createTime }}</p>
         </van-collapse-item>
-      </van-collapse>
-      <template v-if="list.isSku == '是'">
+      </van-collapse> -->
+      <!-- <template v-if="list.isSku == '是'">
         <div style="padding: 10px 16px; font-size: 16px; font-weight: bold">SKU图像识别结果</div>
         <div class="card">
           <div
@@ -115,12 +115,12 @@
             </p>
           </div>
         </div>
-      </template>
+      </template> -->
       <!-- 特殊任务展示 -->
       <!-- 店招 -->
       <div class="shopSign specialTask" v-if="shopSignDetail">
         <div class="specialTaskLeft">
-          <div class="SignText">{{ shopSignDetail.taskName }}:</div>
+          <div class="SignText">店招:</div>
           <div class="signContent">
             <div class="icon">
               <van-icon name="checked" color="#07c160" v-if="shopSignDetail.status == '1'" />
@@ -140,7 +140,7 @@
       <!-- 调色机 -->
       <div class="TSJBox specialTask" v-if="tiaoSJDetail">
         <div class="specialTaskLeft">
-          <div class="SignText">{{ tiaoSJDetail.taskName }}:</div>
+          <div class="SignText">调色机:</div>
           <div class="signContent">
             <div class="icon">
               <van-icon name="checked" color="#07c160" v-if="tiaoSJDetail.status == '1'" />
@@ -157,6 +157,33 @@
           <img :src="tiaoSJDetail.fileUrl" @click="previewsImg(tiaoSJDetail.fileUrl)" />
         </div>
       </div>
+      <div class="SKUBox">
+        <div class="SKUTotal" @click="toSkuRecognize" v-if="list.isSku == '是'">
+          <p style="flex: 1; margin: 0; line-height: 24px; padding: 10px 0; display: inline-block">
+            陈列SKU个数:<span v-if="list.skuTotal" style="color: #000">{{ list.skuTotal }}个</span>
+          </p>
+          <p class="arrowdetils1">
+            查看详情
+            <van-icon name="arrow" />
+          </p>
+        </div>
+        <div class="SKUList">
+          <div class="SKUListTitle">目前陈列任务:</div>
+          <div
+            class="itemList"
+            v-for="(value, index) in taskTypeArr"
+            @click="historiStoreVisit(value)">
+            <div class="itemTitle">{{ convertToChinese(index + 1) }}、{{ value.taskName }}</div>
+            <div class="jiantou">
+              <van-icon name="arrow" />
+            </div>
+            <div class="">
+              <van-icon name="success" color="#07c160" v-if="value.taskPhotoConditionPassed == 1" />
+              <van-icon name="cross" color="#ee0a24" v-else />
+            </div>
+          </div>
+        </div>
+      </div>
 
       <div style="padding: 10px 16px; font-size: 16px; font-weight: bold">任务</div>
       <div class="card" v-if="list.visitSource != 2">
@@ -171,37 +198,38 @@
           "
           v-for="(item, index) in list.sfaTaskList"
           :key="index"
+          v-if="
+            item.photoIdentifyType != '1' && item.photoIdentifyType != '3' && item.taskType != '5'
+          "
           @click="historiStoreVisit(item, index)">
-          <template v-if="item.photoIdentifyType != '1' && item.photoIdentifyType != '3'">
-            <p style="flex: 1; margin: 0">
-              {{ item.taskName }}
-            </p>
+          <p style="flex: 1; margin: 0">
+            {{ item.taskName }}
+          </p>
 
-            <div class="taskPhotoConditionPassed" @click.stop>
-              <el-popover
-                :popper-class="item.taskPhotoConditionPassed == 1 ? 'zpoverSuccess' : 'zpover'"
-                placement="bottom"
-                width="120"
-                trigger="click"
-                :content="
-                  item.taskPhotoConditionPassed == 1
-                    ? '陈列奖励案拍照AI识别通过'
-                    : '陈列奖励案拍照AI识别不通过'
-                ">
-                <div class="taskPhotoConditionPassed" slot="reference">
-                  <img
-                    v-if="item.taskPhotoConditionPassed == 1"
-                    :src="require('@/assets/taskPhotoSu.png')" />
-                  <img
-                    v-if="item.taskPhotoConditionPassed == 0"
-                    :src="require('@/assets/taskPhotoErr.png')" />
-                </div>
-              </el-popover>
-            </div>
-            <p class="arrowdetils1">
-              <van-icon name="arrow" />
-            </p>
-          </template>
+          <div class="taskPhotoConditionPassed" @click.stop>
+            <el-popover
+              :popper-class="item.taskPhotoConditionPassed == 1 ? 'zpoverSuccess' : 'zpover'"
+              placement="bottom"
+              width="120"
+              trigger="click"
+              :content="
+                item.taskPhotoConditionPassed == 1
+                  ? '陈列奖励案拍照AI识别通过'
+                  : '陈列奖励案拍照AI识别不通过'
+              ">
+              <div class="taskPhotoConditionPassed" slot="reference">
+                <img
+                  v-if="item.taskPhotoConditionPassed == 1"
+                  :src="require('@/assets/taskPhotoSu.png')" />
+                <img
+                  v-if="item.taskPhotoConditionPassed == 0"
+                  :src="require('@/assets/taskPhotoErr.png')" />
+              </div>
+            </el-popover>
+          </div>
+          <p class="arrowdetils1">
+            <van-icon name="arrow" />
+          </p>
         </div>
       </div>
       <!-- <div v-if="list.visitSource == 2" style="background-color: #fff">
@@ -318,6 +346,7 @@ export default {
       AIResultOption: [],
       shopSignDetail: null,
       tiaoSJDetail: null,
+      taskTypeArr: null,
     };
   },
   activated() {
@@ -430,19 +459,26 @@ export default {
       });
     },
     getVisitsDetailFn() {
+      this.shopSignDetail = null;
+      this.tiaoSJDetail = null;
+      this.taskTypeArr = null;
       getVisitsDetail({ visitsId: this.$route.query.visitId }).then((res) => {
         this.toastLoading().clear();
         if (res.code == 200) {
           this.list = res.data;
-          this.list.sfaTaskList = this.filterSfaTaskList(this.list.sfaTaskList);
-          this.list.sfaTaskList.forEach((val) => {
-            if (val.photoIdentifyType == '1') {
-              this.shopSignDetail = val;
-            }
-            if (val.photoIdentifyType == '3') {
-              this.tiaoSJDetail = val;
-            }
-          });
+          this.filterSfaTaskList(this.list.sfaTaskList);
+          let shopSignArr = this.list.sfaTaskList.filter((val) => val.photoIdentifyType == '1');
+          if (shopSignArr.length) this.shopSignDetail = shopSignArr[0];
+          let tiaoSJArr = this.list.sfaTaskList.filter((val) => val.photoIdentifyType == '1');
+          if (tiaoSJArr.length) {
+            // 有成功的显示成功的,没有显示第一个
+            tiaoSJArr.forEach((val) => {
+              if (val.status == '1') {
+                this.tiaoSJDetail = val;
+              }
+            });
+            this.tiaoSJDetail = this.tiaoSJDetail || tiaoSJArr[0];
+          }
           if (res.data.visitSource != 2) {
             this.getListHistoryList(res.data.instanceId);
           }
@@ -484,24 +520,7 @@ 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,
-          taskPhotoConditionPassed: null,
-        };
-        taskType5.taskName = '生动化陈列';
-        taskTypeArr.splice(taskType5Index, 0, taskType5);
-      }
-      console.log(taskTypeArr);
-      return taskTypeArr;
+      this.taskTypeArr = list.filter((val) => val.taskType == '5');
     },
     historiStoreVisit(val, index) {
       if (val.taskType == '5') {
@@ -510,7 +529,7 @@ export default {
           query: {
             storeCode: this.$route.query.storeCode || this.list.storeCode,
             visitsId: this.visitsId,
-            taskIds: val.taskIds.join(','),
+            taskIds: [val.taskId],
             storeGroupId: this.list.storeGroupId,
             insert: 0,
             source: 'historicalDetails',
@@ -552,7 +571,7 @@ export default {
     flex-direction: row;
     margin: 5px 10px;
     border-radius: 10px;
-    height: 90px;
+    min-height: 90px;
     padding: 10px 20px;
     font-size: 16px;
     justify-content: space-between;
@@ -584,6 +603,38 @@ export default {
     background: #fff4e4;
     margin-top: 20px;
   }
+  .SKUBox {
+    margin: 5px 10px;
+    border-radius: 10px;
+    min-height: 90px;
+    padding: 10px 20px;
+    font-size: 16px;
+    background: #ffecf4;
+    .SKUTotal {
+      display: flex;
+      justify-content: space-between;
+      width: 100%;
+      color: rgb(25, 137, 250);
+    }
+    .SKUList {
+      .itemList {
+        display: flex;
+        flex-direction: row;
+        justify-content: space-between;
+        align-items: center;
+        padding: 8px 0;
+        .itemTitle {
+          flex: 1;
+          text-decoration: underline;
+          color: rgb(25, 137, 250);
+        }
+        .jiantou {
+          margin: 0 20px 0 10px;
+          color: rgb(25, 137, 250);
+        }
+      }
+    }
+  }
 }
 .container {
   padding-bottom: 50px;