liyg 1 năm trước cách đây
mục cha
commit
9ab427c5bd

+ 25 - 2
src/views/inward/components/offsetSteel/saleSteelTruckOrder/platformStockInfo.vue

@@ -495,7 +495,8 @@ export default {
       operateName: '编辑',
       unloadPointList: [],
       spanArr: [],
-      mergeList: ['wagonNo', 'wagonBillWeight', 'OutStation','materialWeight'],
+      spanArr1: [],
+      mergeList: ['wagonNo', 'wagonBillWeight', 'OutStation'],
       filterMap: {},
       filterConsigneeList: [],
       filterEnStationList: [],
@@ -863,26 +864,41 @@ export default {
     getSpanArr(data) {
       //每次调用方法初始化
       this.spanArr = []
+      this.spanArr1 = []
       for (var i = 0; i < data.length; i++) {
         if (i === 0) {
           this.spanArr.push(1)
           data[i].group = i
           this.pos = 0
+          this.spanArr1.push(1)
+          this.pos1 = 0
         } else {
           // 判断当前元素与上一个元素是否相同
           if (
             data[i].orderId === data[i - 1].orderId &&
             data[i].wagonNo === data[i - 1].wagonNo &&
             data[i].OutStation === data[i - 1].OutStation
-            || ( data[i].weightBatchId && data[i].weightBatchId ===data[i - 1].weightBatchId)
           ) {
             this.spanArr[this.pos] += 1
             data[i].group = data[i - 1].group
             this.spanArr.push(0)
+
+            if(data[i].weightBatchId && data[i].weightBatchId ===data[i - 1].weightBatchId){
+              //批次合并
+              this.spanArr1[this.pos1] += 1
+              this.spanArr1.push(0)
+            }else{
+              this.spanArr1.push(1)
+              this.pos1 = i
+            }
+
           } else {
             this.spanArr.push(1)
             this.pos = i
             data[i].group = data[i - 1].group + 1
+
+            this.spanArr1.push(1)
+            this.pos1 = i
           }
         }
       }
@@ -895,6 +911,13 @@ export default {
           rowspan: _row,
           colspan: _col
         }
+      }else if('materialWeight' == column.property){
+        const _row = this.spanArr1[rowIndex]
+        const _col = _row > 0 ? 1 : 0
+        return {
+          rowspan: _row,
+          colspan: _col
+        }
       }
     },
     //导出Excel