zhujindu 1 неделя назад
Родитель
Сommit
fee55edc92

src/views/historicalVisit/PerfectStore.vue → src/views/historicalVisit/perfectStore111.vue


+ 15 - 3
src/views/historicalVisit/perfectStoreTask.vue

@@ -119,21 +119,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">
+            </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>
@@ -177,6 +178,17 @@ 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,
+        };
+      }
+    },
     getVisitsDetailFun() {
       this.toastLoading(0, '加载中...', true);
       getVisitsDetail({ visitsId: this.visitsId }).then((res) => {