diff --git a/src/views/statistics/stock_statistics.vue b/src/views/statistics/stock_statistics.vue index 823fdfc6..5899cf1f 100644 --- a/src/views/statistics/stock_statistics.vue +++ b/src/views/statistics/stock_statistics.vue @@ -182,6 +182,8 @@ stripe hideDo hidePagination + :summary-method="getSummaries" + show-summary > { + if (index === 0) { + sums[index] = "合计"; + return; + } + if (index == 4) { + const values = data.map((item) => + Number(item[column.property]) + ); + if (!values.every((value) => Number.isNaN(value))) { + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + let sum = Number(Number(prev) + Number(curr)).toFixed(2); + if (!isNaN(value)) { + return sum; + } else { + return prev; + } + }, 0); + } + } + }); + return sums; + }, handleExport(val) { this.exportLoading = true; let id = "#exportDiv" + val;