|
@@ -1,10 +1,13 @@
|
|
|
<template>
|
|
|
<el-dialog :close-on-click-modal="false" title="消费记录" :visible.sync="consumptionDialogVisible" width="60%" append-to-body>
|
|
|
<div class="join-shop-list-container">
|
|
|
+ <div style="display: flex; justify-content: flex-end; margin-bottom: 20px">
|
|
|
+ <el-button @click="handleExport" :loading="isExportLoading" size="mini" type="primary">导出excel</el-button>
|
|
|
+ </div>
|
|
|
<!-- 查询结果 -->
|
|
|
<el-table v-loading="listLoading" element-loading-text="正在查询中..." :data="list" v-bind="{ stripe: true, size: 'small', border: true, highlightCurrentRow: true }">
|
|
|
<el-table-column prop="allianceCardId" label="联盟卡ID" align="center" />
|
|
|
- <el-table-column prop="buyerUserId" label="购买者会员ID" align="center" />
|
|
|
+ <el-table-column prop="buyerUserId" label="购买者会员ID" align="center" width="120" />
|
|
|
<el-table-column prop="shopId" label="商家ID" align="center" />
|
|
|
<el-table-column prop="shopName" label="商家名称" align="center" />
|
|
|
<el-table-column prop="amount" label="消费金额" align="center">
|
|
@@ -12,7 +15,19 @@
|
|
|
<el-tag size="mini" type="danger">¥{{ scope.row.amount }}</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="createTime" label="消费时间" align="center" />
|
|
|
+ <el-table-column prop="amount" label="到账比例" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag size="mini" type="success">{{ ((scope.row.settlementRatio || 0) * 100).toFixed(2) + '%' }}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column width="160" prop="amount" label="商家实际到账金额" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag size="mini" type="success">¥{{ scope.row.actualAmountReceived || 0 }}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column width="160" prop="createTime" label="消费时间" align="center" />
|
|
|
</el-table>
|
|
|
|
|
|
<div style="margin-top: 10px">
|
|
@@ -31,7 +46,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getConsumptionRecordByUserIdAndAllianceCardIdApi } from '@/api/business'
|
|
|
+import { getConsumptionRecordByUserIdAndAllianceCardIdApi, exportConsumptionRecordByUserIdAndAllianceCardIdApi } from '@/api/business'
|
|
|
+import {exportExcel} from '../utils'
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -45,19 +61,22 @@ export default {
|
|
|
page: 1,
|
|
|
pageSize: 20
|
|
|
},
|
|
|
- consumptionDialogVisible: false
|
|
|
+ consumptionDialogVisible: false,
|
|
|
+ isExportLoading: false,
|
|
|
+ memberName: ""
|
|
|
}
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
// 打开
|
|
|
- handleOpen(allianceCardId, buyerUserId) {
|
|
|
+ handleOpen(allianceCardId, buyerUserId, memberName) {
|
|
|
if (!allianceCardId || !buyerUserId) {
|
|
|
return this.$message.error('数据错误')
|
|
|
}
|
|
|
this.listQuery.allianceCardId = allianceCardId
|
|
|
this.listQuery.buyerUserId = buyerUserId
|
|
|
this.consumptionDialogVisible = true
|
|
|
+ this.memberName = memberName
|
|
|
this.getList()
|
|
|
},
|
|
|
|
|
@@ -72,6 +91,18 @@ export default {
|
|
|
} catch (error) {
|
|
|
this.listLoading = false
|
|
|
}
|
|
|
+ },
|
|
|
+
|
|
|
+ handleExport() {
|
|
|
+ exportExcel(
|
|
|
+ this,
|
|
|
+ exportConsumptionRecordByUserIdAndAllianceCardIdApi,
|
|
|
+ {
|
|
|
+ allianceCardId: this.listQuery.allianceCardId,
|
|
|
+ buyerUserId: this.listQuery.buyerUserId
|
|
|
+ },
|
|
|
+ `${this.memberName} - 联盟卡用户消费记录`
|
|
|
+ )
|
|
|
}
|
|
|
}
|
|
|
}
|