|
@@ -171,6 +171,7 @@
|
|
|
:header-cell-class-name="tableProps.headerCellClassName"
|
|
|
:tooltip-effect="tableProps.tooltipEffect"
|
|
|
:show-summary="tableProps.showSummary"
|
|
|
+ :summary-method="totalOutPrice"
|
|
|
>
|
|
|
<el-table-column
|
|
|
prop="indexs"
|
|
@@ -306,6 +307,35 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ totalOutPrice(param) {
|
|
|
+ const { columns, data } = param;
|
|
|
+ const sums = [];
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = "合计";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const values = data.map((item) => Number(item[column.property]));
|
|
|
+ if (
|
|
|
+ column.property != "stand" &&
|
|
|
+ column.property != "flightdate" &&
|
|
|
+ column.property != "indexs" &&
|
|
|
+ column.property != "flightNo" &&
|
|
|
+ column.property != "line"
|
|
|
+ ) {
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0);
|
|
|
+ sums[index];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
//滚动分页加载
|
|
|
// load () {
|
|
|
// this.$emit("load", true);
|