Procházet zdrojové kódy

Merge branch 'feature_20260121_陈列奖励案任务复制暂' into uat(dev)

# Conflicts:
#	src/views/historicalVisit/hisvistdeils.vue
zhujindu před 1 týdnem
rodič
revize
2d24c24284

+ 42 - 6
src/views/deviceWithin/taskPhotoTaking.vue

@@ -90,22 +90,22 @@
         <div class="resultContent">
           <el-table
             :data="taskPhotoRecognitionResult"
+            :span-method="taskObjectSpanMethod"
             border
             class="table-headermd1"
             style="width: 100%">
             <el-table-column label="" type="index" width="50px" align="center" />
             <el-table-column label="产品" prop="skuProductName" align="center" />
-            <el-table-column label="要求" prop="conditionIdentifyNum" align="center" width="60px">
-            </el-table-column>
             <el-table-column
               label="识别排面数"
               prop="identifyTheNumberOfCards"
               width="70px"
-              align="center"
-              >meetTheStandard
+              align="center">
+            </el-table-column>
+            <el-table-column label="要求" prop="conditionIdentifyNum" align="center" width="60px">
               <template slot-scope="scope">
                 <span :style="{ color: scope.row.meetTheStandard == 1 ? '#07c160' : 'red' }">
-                  {{ scope.row.identifyTheNumberOfCards }}
+                  {{ scope.row.conditionIdentifyNum }}
                 </span>
               </template>
             </el-table-column>
@@ -134,6 +134,8 @@ export default {
       insert: '',
       vanPopup: false,
       taskPhotoRecognitionResult: null,
+      spanArr: [],
+      pos: 0,
     };
   },
   activated() {
@@ -149,6 +151,36 @@ export default {
     }
   },
   methods: {
+    taskObjectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      const cellValue = row[column.property];
+      if (cellValue && ['conditionIdentifyNum'].includes(column.property)) {
+        const _row = this.spanArr[rowIndex]; // 合并行数
+        const _col = this.spanArr[rowIndex] > 0 ? 1 : 0; // 合并的列数
+        return {
+          rowspan: _row,
+          colspan: _col,
+        };
+      }
+    },
+    getSpanArr(data) {
+      this.spanArr = []; // tip: 后台获取完成数据后,一定要重置spanArr=[],避免出现合并混乱!!!!!
+      for (let i = 0; i < data.length; i++) {
+        // 当为第一行时
+        if (i === 0) {
+          this.spanArr.push(1);
+          this.pos = 0;
+        } else {
+          // 判断当前值是否与上一行的【名称】相等,相等则进行合并
+          if (data[i].conditionIdentifyNum === data[i - 1].conditionIdentifyNum) {
+            this.spanArr[this.pos] += 1; // 合并单元格:合并的行数 +1
+            this.spanArr.push(0); // 0代表单元格是不需要显示, 已经被合并的单元格
+          } else {
+            this.spanArr.push(1); // 1代表当前这行的数据需要被显示
+            this.pos = i;
+          }
+        }
+      }
+    },
     getVisitsDetailFun() {
       this.toastLoading(0, '加载中...', true);
       getVisitsDetail({ visitsId: this.visitsId }).then((res) => {
@@ -179,7 +211,11 @@ export default {
     },
     openDialog(item) {
       this.vanPopup = true;
-      this.taskPhotoRecognitionResult = item.taskPhotoRecognitionResult;
+      this.getSpanArr(item.taskPhotoRecognitionResult);
+      this.$nextTick(() => {
+        console.log(this.spanArr);
+        this.taskPhotoRecognitionResult = item.taskPhotoRecognitionResult;
+      });
     },
     onSubmit() {
       let formData = {

+ 7 - 20
src/views/historicalVisit/historicalDetails.vue

@@ -135,26 +135,13 @@
             {{ 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 class="taskPhotoConditionPassed">
+            <img
+              v-if="item.taskPhotoConditionPassed == 1"
+              :src="require('@/assets/taskPhotoSu.png')" />
+            <img
+              v-if="item.taskPhotoConditionPassed == 0"
+              :src="require('@/assets/taskPhotoErr.png')" />
           </div>
           <p class="arrowdetils1">
             <van-icon name="arrow" />

+ 42 - 6
src/views/historicalVisit/hisvistdeils.vue

@@ -275,26 +275,29 @@
     </div>
     <!-- 识别结果 -->
     <div class="identifyResult" v-if="taskPhotoRecognitionResult" style="padding: 0 10px">
-      <div style="font-weight: bold; padding: 10px; font-size: 16px">识别结果:</div>
+      <div style="font-weight: bold; padding: 10px; font-size: 16px">
+        <span>识别结果:</span>
+        <!-- <span>{{ taskPhotoConditionPassed }}</span> -->
+      </div>
       <div class="resultContent">
         <el-table
           :data="taskPhotoRecognitionResult"
+          :span-method="taskObjectSpanMethod"
           border
           class="table-headermd1"
           style="width: 100%">
           <el-table-column label="" type="index" width="50px" align="center" />
           <el-table-column label="产品" prop="skuProductName" align="center" />
-          <el-table-column label="要求" prop="conditionIdentifyNum" align="center" width="60px">
-          </el-table-column>
           <el-table-column
             label="识别排面数"
             prop="identifyTheNumberOfCards"
             width="70px"
-            align="center"
-            >meetTheStandard
+            align="center">
+          </el-table-column>
+          <el-table-column label="要求" prop="conditionIdentifyNum" align="center" width="60px">
             <template slot-scope="scope">
               <span :style="{ color: scope.row.meetTheStandard == 1 ? '#07c160' : 'red' }">
-                {{ scope.row.identifyTheNumberOfCards }}
+                {{ scope.row.conditionIdentifyNum }}
               </span>
             </template>
           </el-table-column>
@@ -361,6 +364,8 @@ export default {
       yfNumFlage: false,
       wuliaoPhotoImg: [], //任务包含的图片信息(只针对于物料任务)
       activatedSfaTask: null,
+      spanArr: [],
+      pos: 0,
     };
   },
   activated() {
@@ -401,6 +406,17 @@ export default {
         }
       }
     },
+    taskObjectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      const cellValue = row[column.property];
+      if (cellValue && ['conditionIdentifyNum'].includes(column.property)) {
+        const _row = this.spanArr[rowIndex]; // 合并行数
+        const _col = this.spanArr[rowIndex] > 0 ? 1 : 0; // 合并的列数
+        return {
+          rowspan: _row,
+          colspan: _col,
+        };
+      }
+    },
     // 历史回显
     getCollectionShowHistory(id) {
       getCollectionShowHistory({
@@ -427,6 +443,25 @@ export default {
       }
       return arrc.join(',');
     },
+    getSpanArr(data) {
+      this.spanArr = []; // tip: 后台获取完成数据后,一定要重置spanArr=[],避免出现合并混乱!!!!!
+      for (let i = 0; i < data.length; i++) {
+        // 当为第一行时
+        if (i === 0) {
+          this.spanArr.push(1);
+          this.pos = 0;
+        } else {
+          // 判断当前值是否与上一行的【名称】相等,相等则进行合并
+          if (data[i].conditionIdentifyNum === data[i - 1].conditionIdentifyNum) {
+            this.spanArr[this.pos] += 1; // 合并单元格:合并的行数 +1
+            this.spanArr.push(0); // 0代表单元格是不需要显示, 已经被合并的单元格
+          } else {
+            this.spanArr.push(1); // 1代表当前这行的数据需要被显示
+            this.pos = i;
+          }
+        }
+      }
+    },
     info() {
       this.toastLoading(0, '加载中...', true);
       getVisitsDetail({ visitsId: this.visitId }).then((res) => {
@@ -436,6 +471,7 @@ export default {
         this.activatedSfaTask = filterSfaTask.length ? filterSfaTask[0] : null;
         if (!this.activatedSfaTask) return false;
         this.taskPhotoRecognitionResult = this.activatedSfaTask.taskPhotoRecognitionResult;
+        this.getSpanArr(this.taskPhotoRecognitionResult);
         var collectionItemLists = this.activatedSfaTask.collectionItemList;
         if (this.activatedSfaTask.checkUnManage == 'Y') {
           this.checkShow = true;