diff --git a/src/views/inspection/businessStatistics/index.vue b/src/views/inspection/businessStatistics/index.vue index c060dca..5268919 100644 --- a/src/views/inspection/businessStatistics/index.vue +++ b/src/views/inspection/businessStatistics/index.vue @@ -341,6 +341,11 @@ {{ item.theAmount || '' }} {{ item.order_count || '' }} + + 合计 + {{ calculateTotalAmount(data5) }} + {{ calculateTotalCount(data5) }} + @@ -362,6 +367,11 @@
金额:{{ item.theAmount || '' }}
台次:{{ item.order_count || '' }}
+
+
合计
+
金额:{{ calculateTotalAmount(data5) }}
+
台次:{{ calculateTotalCount(data5) }}
+
@@ -662,12 +672,24 @@ this.getStaticsTable5(), this.getFileStatistics() ]) + }, + + // 计算待收款总金额 + calculateTotalAmount(data) { + if (!data || data.length === 0) return 0; + return data.reduce((total, item) => total + (parseFloat(item.theAmount) || 0), 0).toFixed(2); + }, + + // 计算待收款总台次 + calculateTotalCount(data) { + if (!data || data.length === 0) return 0; + return data.reduce((total, item) => total + (parseInt(item.order_count) || 0), 0); } } } -