|
@@ -30,7 +30,15 @@
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
- <el-table ref="tables" v-loading="loading" :data="dataList" max-height="500px" border>
|
|
|
|
|
|
+ <el-table
|
|
|
|
+ ref="tables"
|
|
|
|
+ v-loading="loading"
|
|
|
|
+ :data="dataList"
|
|
|
|
+ max-height="500px"
|
|
|
|
+ border
|
|
|
|
+ :summary-method="getSummaries"
|
|
|
|
+ show-summary
|
|
|
|
+ >
|
|
<el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
|
|
<el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
|
|
<!-- <el-table-column label="剧目名称" align="center" prop="performName" />
|
|
<!-- <el-table-column label="剧目名称" align="center" prop="performName" />
|
|
<el-table-column label="票务名称" align="center" prop="goodsName" /> -->
|
|
<el-table-column label="票务名称" align="center" prop="goodsName" /> -->
|
|
@@ -44,12 +52,12 @@
|
|
<span>{{ scope.row.performTimeStart }} -- {{ scope.row.performTimeEnd }}</span>
|
|
<span>{{ scope.row.performTimeStart }} -- {{ scope.row.performTimeEnd }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="销售量" align="center">
|
|
|
|
|
|
+ <el-table-column label="销售量" align="center" prop="saleTotal">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.saleTotal?scope.row.saleTotal+'张' : '-' }}</span>
|
|
<span>{{ scope.row.saleTotal?scope.row.saleTotal+'张' : '-' }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="核销量" align="center">
|
|
|
|
|
|
+ <el-table-column label="核销量" align="center" prop="usedTotal">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.usedTotal?scope.row.usedTotal+'张' : '-' }}</span>
|
|
<span>{{ scope.row.usedTotal?scope.row.usedTotal+'张' : '-' }}</span>
|
|
</template>
|
|
</template>
|
|
@@ -129,6 +137,31 @@ export default {
|
|
this.ticketListApi();
|
|
this.ticketListApi();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ getSummaries(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 (!values.every(value => isNaN(value))) {
|
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
|
+ const value = Number(curr);
|
|
|
|
+ if (!isNaN(value)) {
|
|
|
|
+ return prev + curr;
|
|
|
|
+ } else {
|
|
|
|
+ return prev;
|
|
|
|
+ }
|
|
|
|
+ }, 0);
|
|
|
|
+ sums[index] += ' 张';
|
|
|
|
+ } else {
|
|
|
|
+ sums[index] = '';
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return sums;
|
|
|
|
+ },
|
|
/** 查询列表 */
|
|
/** 查询列表 */
|
|
getList() {
|
|
getList() {
|
|
this.loading = true;
|
|
this.loading = true;
|