liyg il y a 1 an
Parent
commit
e160decdf2

+ 60 - 16
src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckDetailsOrderNew.vue

@@ -1379,7 +1379,20 @@ export default {
       //筛选条件1(客户)
       filters1: [],
       spanArr: [],
+      spanArr1:[],
+      spanArr2:[],
+      spanArr3:[],
       pos: 0,
+      pos1:0,
+      pos2:0,
+      pos3:0,
+      mergeListBatch : [
+        '净重',
+        '皮重时间',
+        '皮重',
+        '毛重时间',
+        '毛重',
+      ],
       //需要合并列的名称
       mergeList: [
         // '选择',
@@ -1412,11 +1425,6 @@ export default {
         '签收时间',
         '最终运价',
         '摘要',
-        '净重',
-        '皮重时间',
-        '皮重',
-        '毛重时间',
-        '毛重',
       ],
       //需要合并列的名称(已结算)
       mergeList1: [
@@ -1449,12 +1457,6 @@ export default {
         '抵达时间',
         '签收时间',
         '最终运价',
-        '摘要',
-        '净重',
-        '皮重时间',
-        '皮重',
-        '毛重时间',
-        '毛重',
       ],
 
       tableTitle: '销售钢材统计报表',
@@ -3337,19 +3339,33 @@ export default {
     getSpanArr(data) {
       //每次调用方法初始化
       this.spanArr = []
+      this.spanArr2 = []
       for (var i = 0; i < data.length; i++) {
         if (i === 0) {
           this.spanArr.push(1)
+          this.spanArr2.push(1)
           this.pos = 0
+          this.pos2 = 0
         } else {
           // 判断当前元素与上一个元素是否相同
-          if (data[i].saleOrderMaterialId === data[i - 1].saleOrderMaterialId || ( data[i].weightBatchId && data[i].weightBatchId ===data[i - 1].weightBatchId)) {
+          if (data[i].saleOrderMaterialId === data[i - 1].saleOrderMaterialId) {
             this.spanArr[this.pos] += 1
-
             this.spanArr.push(0)
+
+            if(data[i].weightBatchId && data[i].weightBatchId ===data[i - 1].weightBatchId){
+              //批次合并
+              this.spanArr2[this.pos2] += 1
+              this.spanArr2.push(0)
+            }else{
+              this.spanArr2.push(1)
+              this.pos2 = i
+            }
           } else {
             this.spanArr.push(1)
             this.pos = i
+
+            this.spanArr2.push(1)
+            this.pos2 = i
           }
         }
       }
@@ -3357,20 +3373,34 @@ export default {
     getSpanArr1(data) {
       //每次调用方法初始化
       this.spanArr1 = []
+      this.spanArr3 = []
       for (var i = 0; i < data.length; i++) {
         if (i === 0) {
           this.spanArr1.push(1)
-
           this.pos = 0
+
+          this.spanArr3.push(1)
+          this.pos3 = 0
         } else {
           // 判断当前元素与上一个元素是否相同
-          if (data[i].saleOrderMaterialId === data[i - 1].saleOrderMaterialId || ( data[i].weightBatchId && data[i].weightBatchId ===data[i - 1].weightBatchId)) {
+          if (data[i].saleOrderMaterialId === data[i - 1].saleOrderMaterialId) {
             this.spanArr1[this.pos] += 1
-
             this.spanArr1.push(0)
+
+            if(data[i].weightBatchId && data[i].weightBatchId ===data[i - 1].weightBatchId){
+              //批次合并
+              this.spanArr3[this.pos3] += 1
+              this.spanArr3.push(0)
+            }else{
+              this.spanArr3.push(1)
+              this.pos3 = i
+            }
           } else {
             this.spanArr1.push(1)
             this.pos = i
+
+            this.spanArr3.push(1)
+              this.pos3 = i
           }
         }
       }
@@ -3383,6 +3413,13 @@ export default {
           rowspan: _row,
           colspan: _col
         }
+      }else if(this.mergeListBatch.indexOf(column.label) != -1){
+        const _row = this.spanArr2[rowIndex]
+        const _col = _row > 0 ? 1 : 0
+        return {
+          rowspan: _row,
+          colspan: _col
+        }
       }
     },
     objectSpanMethod1({ row, column, rowIndex, columnIndex }) {
@@ -3393,6 +3430,13 @@ export default {
           rowspan: _row,
           colspan: _col
         }
+      }else if(this.mergeListBatch.indexOf(column.label) != -1){
+        const _row = this.spanArr2[rowIndex]
+        const _col = _row > 0 ? 1 : 0
+        return {
+          rowspan: _row,
+          colspan: _col
+        }
       }
     },
     //计算总件数和总车数

+ 56 - 7
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -2036,6 +2036,17 @@ export default {
       spanArr: [],
       pos: 0,
       spanArr1: [],
+      spanArr2:[],
+      spanArr3:[],
+      mergeListBatch : [
+        '净重',
+        '皮重时间',
+        '皮重',
+        '毛重时间',
+        '毛重',
+      ],
+      pos2: 0,
+      pos3: 0,
       pos1: 0,
       //需要合并列的名称
       mergeList: [
@@ -2080,11 +2091,6 @@ export default {
         '是否继续装',
         '订单上传时间',
         '收款公司',
-        '净重',
-        '皮重时间',
-        '皮重',
-        '毛重时间',
-        '毛重',
       ],
       //钢材多拼车辆线路ID
       //索引从1-10为1-10拼路线ID
@@ -4872,21 +4878,35 @@ export default {
     getSpanArr(data) {
       //每次调用方法初始化
       this.spanArr = []
+      this.spanArr2 = []
       for (var i = 0; i < data.length; i++) {
         if (i === 0) {
           this.spanArr.push(1)
+          this.spanArr2.push(1)
           // data[i].group = i
           this.pos = 0
+          this.pos2 = 0
         } else {
           // 判断当前元素与上一个元素是否相同
-          if (data[i].saleOrderMaterialId === data[i - 1].saleOrderMaterialId || ( data[i].weightBatchId && data[i].weightBatchId ===data[i - 1].weightBatchId)) {
+          if (data[i].saleOrderMaterialId === data[i - 1].saleOrderMaterialId) {
             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.spanArr2[this.pos2] += 1
+              this.spanArr2.push(0)
+            }else{
+              this.spanArr2.push(1)
+              this.pos2 = i
+            }
           } else {
             this.spanArr.push(1)
             this.pos = i
             // data[i].group = data[i - 1].group + 1
+            this.spanArr2.push(1)
+            this.pos2 = i
           }
         }
       }
@@ -4894,20 +4914,35 @@ export default {
     getSpanArr1(data) {
       //每次调用方法初始化
       this.spanArr1 = []
+      this.spanArr3 = []
       for (var i = 0; i < data.length; i++) {
         if (i === 0) {
           this.spanArr1.push(1)
+          this.spanArr3.push(1)
           // data[i].group = i
           this.pos1 = 0
+          this.pos3 = 0
         } else {
           // 判断当前元素与上一个元素是否相同
-          if (data[i].saleOrderMaterialId === data[i - 1].saleOrderMaterialId || ( data[i].weightBatchId && data[i].weightBatchId ===data[i - 1].weightBatchId)) {
+          if (data[i].saleOrderMaterialId === data[i - 1].saleOrderMaterialId) {
             this.spanArr1[this.pos] += 1
             // data[i].group = data[i - 1].group
             this.spanArr1.push(0)
+
+            if(data[i].weightBatchId && data[i].weightBatchId ===data[i - 1].weightBatchId){
+              //批次合并
+              this.spanArr3[this.pos3] += 1
+              this.spanArr3.push(0)
+            }else{
+              this.spanArr3.push(1)
+              this.pos3 = i
+            }
           } else {
             this.spanArr1.push(1)
             this.pos1 = i
+
+            this.spanArr3.push(1)
+            this.pos3 = i
             // data[i].group = data[i - 1].group + 1
           }
         }
@@ -4921,6 +4956,13 @@ export default {
           rowspan: _row,
           colspan: _col
         }
+      }else if(this.mergeListBatch.indexOf(column.label) != -1){
+        const _row = this.spanArr2[rowIndex]
+        const _col = _row > 0 ? 1 : 0
+        return {
+          rowspan: _row,
+          colspan: _col
+        }
       }
     },
     objectSpanMethod1({ row, column, rowIndex, columnIndex }) {
@@ -4931,6 +4973,13 @@ export default {
           rowspan: _row,
           colspan: _col
         }
+      }else if(this.mergeListBatch.indexOf(column.label) != -1){
+        const _row = this.spanArr3[rowIndex]
+        const _col = _row > 0 ? 1 : 0
+        return {
+          rowspan: _row,
+          colspan: _col
+        }
       }
     },
     //计算总件数和总车数