Răsfoiți Sursa

feat: 统计收发表新增类别小计列并优化计算逻辑

yusheng 9 luni în urmă
părinte
comite
ac0048f83e

+ 15 - 1
src/views/warehouseManagement/statisticalReports/transceiverSummary/index.vue

@@ -137,6 +137,13 @@
             showOverflowTooltip: true,
             fixed: 'left'
           },
+          {
+            prop: 'categoryNum',
+            label: '类别小计',
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
           {
             prop: 'dateList',
             label: '日期/数量',
@@ -153,7 +160,8 @@
     data() {
       return {
         date: '',
-        cacheKeyUrl: 'wms-warehouseManagement-statisticalReports-transceiverSummary'
+        cacheKeyUrl:
+          'wms-warehouseManagement-statisticalReports-transceiverSummary'
       };
     },
     methods: {
@@ -168,6 +176,7 @@
       },
 
       spanMethod({ row, column, rowIndex, columnIndex }) {
+        
         if (
           column.property === 'startNum' ||
           // column.property === 'endNum' ||
@@ -188,6 +197,11 @@
             };
           }
         }
+        if(row.dateList?.length){
+          row.categoryNum = row.dateList.reduce((total, item) => {
+            return total + item.dateTotalNum;
+          }, 0);
+        }
         // 其他列不进行合并
         return {
           rowspan: 1,