Commit 2b17f357 by wusiyi

feat: 客户余额管理页面新增扣费明细分页和消费金额汇总

parent e7ed5796
...@@ -32,3 +32,7 @@ export function getLogListApi(params) { ...@@ -32,3 +32,7 @@ export function getLogListApi(params) {
export function getChargerRecordsApi(params) { export function getChargerRecordsApi(params) {
return axios.post('/charge/customerChargeRecords/list_page', params) return axios.post('/charge/customerChargeRecords/list_page', params)
} }
// 客户余额管理 扣费明细金额汇总
export function getChargerRecordsTotalApi(params) {
return axios.post('/charge/customerChargeRecords/total', params)
}
...@@ -296,20 +296,22 @@ ...@@ -296,20 +296,22 @@
class="recordsDialog"> class="recordsDialog">
<div class="search"> <div class="search">
<el-form :model="searchRecordsForm" size="small" :inline="true"> <el-form :model="searchRecordsForm" size="small" :inline="true">
<el-form-item label="创建时间"> <el-form-item label="起始时间">
<el-date-picker <el-date-picker
style="width: 360px" style="width: 360px"
v-model="searchRecordsForm.createTime" v-model="searchRecordsForm.daterange"
type="datetimerange" type="datetimerange"
value-format="yyyy-MM-dd HH:ss:mm" value-format="yyyy-MM-dd HH:ss:mm"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"></el-date-picker> end-placeholder="结束日期"
clearable></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="支付款项"> <el-form-item label="支付款项">
<el-select <el-select
style="width: 150px" style="width: 150px"
v-model="searchRecordsForm.chargeType" v-model="searchRecordsForm.chargeType"
clearable
placeholder="请选择支付款项"> placeholder="请选择支付款项">
<el-option <el-option
v-for="(item, index) in chargeTypeMap" v-for="(item, index) in chargeTypeMap"
...@@ -321,6 +323,7 @@ ...@@ -321,6 +323,7 @@
<el-form-item label="支付方式"> <el-form-item label="支付方式">
<el-select <el-select
style="width: 150px" style="width: 150px"
clearable
v-model="searchRecordsForm.payMode" v-model="searchRecordsForm.payMode"
placeholder="请选择支付方式"> placeholder="请选择支付方式">
<el-option <el-option
...@@ -332,13 +335,13 @@ ...@@ -332,13 +335,13 @@
</el-form-item> </el-form-item>
<el-form-item label="订单号"> <el-form-item label="订单号">
<el-input <el-input
v-model="searchForm.bizNo" v-model="searchRecordsForm.bizNo"
placeholder="请输入订单号" placeholder="请输入订单号"
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="交易流水号"> <el-form-item label="交易流水号">
<el-input <el-input
v-model="searchForm.tradeNo" v-model="searchRecordsForm.tradeNo"
placeholder="请输入交易流水号" placeholder="请输入交易流水号"
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
...@@ -433,6 +436,9 @@ ...@@ -433,6 +436,9 @@
:show-overflow-tooltip="true"></el-table-column> :show-overflow-tooltip="true"></el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<div class="total-amount">
{{ '总消费金额:' + totalAmount + ' 元' }}
</div>
<el-pagination <el-pagination
layout="sizes, total, prev, pager, next, jumper" layout="sizes, total, prev, pager, next, jumper"
background background
...@@ -453,7 +459,8 @@ import { ...@@ -453,7 +459,8 @@ import {
customerBalanceRechargeApi, customerBalanceRechargeApi,
customerBalanceDelete, customerBalanceDelete,
getLogListApi, getLogListApi,
getChargerRecordsApi getChargerRecordsApi,
getChargerRecordsTotalApi
} from '@/common/api/user/user' } from '@/common/api/user/user'
export default { export default {
...@@ -479,6 +486,7 @@ export default { ...@@ -479,6 +486,7 @@ export default {
3: '一件定制' 3: '一件定制'
}, },
loading: false, loading: false,
totalAmount: 0,
total: 0, total: 0,
currentPage: 1, currentPage: 1,
pageSize: 50, pageSize: 50,
...@@ -652,7 +660,6 @@ export default { ...@@ -652,7 +660,6 @@ export default {
getChargeTypeText(type) { getChargeTypeText(type) {
return this.chargeTypeMap[type] return this.chargeTypeMap[type]
}, },
searchRecords() {},
// 分页查看扣费明细 // 分页查看扣费明细
async getChargerLog() { async getChargerLog() {
try { try {
...@@ -662,8 +669,14 @@ export default { ...@@ -662,8 +669,14 @@ export default {
namespace: this.namespace, namespace: this.namespace,
...this.searchRecordsForm ...this.searchRecordsForm
} }
if (this.searchRecordsForm.daterange?.length) {
data.createTimeStart = this.searchRecordsForm.daterange[0]
data.createTimeEnd = this.searchRecordsForm.daterange[1]
}
const res = await getChargerRecordsApi(data) const res = await getChargerRecordsApi(data)
this.chargerRecordsList = res.data.records this.chargerRecordsList = res.data.records
const totalRes = await getChargerRecordsTotalApi(data)
this.totalAmount = totalRes.data.feesSum
if (this.chargerRecordsList.length) { if (this.chargerRecordsList.length) {
this.totalRecords = res.data.total this.totalRecords = res.data.total
...@@ -729,11 +742,33 @@ export default { ...@@ -729,11 +742,33 @@ export default {
.el-input-group__append { .el-input-group__append {
padding-left: 0; padding-left: 0;
} }
.el-icon-time:before {
content: '';
}
} }
} }
.recordsDialog { .recordsDialog {
margin: 10px; margin: 10px;
.pagination {
display: flex;
align-items: center;
justify-content: center; /* 让el-pagination居中 */
position: relative;
min-height: 50px; /* 根据实际高度调整 */
}
.total-amount {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
/* 可加padding或字体样式 */
color: #333;
font-size: 14px;
}
&::v-deep { &::v-deep {
.el-dialog { .el-dialog {
height: 85vh !important; height: 85vh !important;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment