余额变动记录

This commit is contained in:
墨大叔 2024-08-06 13:32:29 +08:00
parent cfab3f7ea9
commit c44a3930b7
2 changed files with 92 additions and 59 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户名称" prop="userName">
<el-form-item label="用户名称" prop="userName" v-if="notHasView(views.user)">
<el-input
v-model="queryParams.userId"
placeholder="请输入用户名称"
@ -17,6 +17,11 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="业务类型" prop="bstType">
<el-select v-model="queryParams.bstType" placeholder="请输入变动原因" clearable @change="handleQuery">
<el-option v-for="dict in dict.type.record_balance_bst_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -24,38 +29,38 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['ss:recordBalance:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['ss:recordBalance:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['ss:recordBalance:remove']"
>删除</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['ss:recordBalance:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['ss:recordBalance:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['ss:recordBalance:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
@ -71,30 +76,42 @@
<el-table v-loading="loading" :data="recordBalanceList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="id" sortable="custom" :sort-orders="orderSorts" v-if="isShow('id')"/>
<el-table-column label="记录ID" align="center" prop="id" sortable="custom" :sort-orders="orderSorts" v-if="isShow('id')" width="100"/>
<el-table-column label="用户名称" align="center" prop="userName" sortable="custom" :sort-orders="orderSorts" v-if="isShow('userName')"/>
<el-table-column label="变动前余额" align="center" prop="beforeBalance" sortable="custom" :sort-orders="orderSorts" v-if="isShow('beforeBalance')"/>
<el-table-column label="变动后余额" align="center" prop="afterBalance" sortable="custom" :sort-orders="orderSorts" v-if="isShow('afterBalance')"/>
<el-table-column label="变动原因" align="center" prop="reason" sortable="custom" :sort-orders="orderSorts" v-if="isShow('reason')"/>
<el-table-column label="变动时间" align="center" prop="createTime" sortable="custom" :sort-orders="orderSorts" v-if="isShow('createTime')"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['ss:recordBalance:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['ss:recordBalance:remove']"
>删除</el-button>
<el-table-column label="业务类型" align="center" prop="bstType" sortable="custom" :sort-orders="orderSorts" v-if="isShow('bstType')">
<template slot-scope="d">
<dict-tag :value="d.row.bstType" :options="dict.type.record_balance_bst_type"/>
</template>
</el-table-column>
<el-table-column label="变动时间" align="center" prop="createTime" sortable="custom" :sort-orders="orderSorts" v-if="isShow('createTime')"/>
<el-table-column label="变动金额" align="center" prop="beforeBalance" sortable="custom" :sort-orders="orderSorts" v-if="isShow('amount')">
<template slot-scope="d">{{d.row.amount | money}} </template>
</el-table-column>
<el-table-column label="变动前余额" align="center" prop="beforeBalance" sortable="custom" :sort-orders="orderSorts" v-if="isShow('beforeBalance')">
<template slot-scope="d">{{d.row.beforeBalance | money}} </template>
</el-table-column>
<el-table-column label="变动后余额" align="center" prop="afterBalance" sortable="custom" :sort-orders="orderSorts" v-if="isShow('afterBalance')">
<template slot-scope="d">{{d.row.afterBalance | money}} </template>
</el-table-column>
<el-table-column label="变动原因" align="center" prop="reason" sortable="custom" :sort-orders="orderSorts" v-if="isShow('reason')" min-width="200"/>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['ss:recordBalance:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['ss:recordBalance:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
@ -131,7 +148,7 @@
<script>
import { listRecordBalance, getRecordBalance, delRecordBalance, addRecordBalance, updateRecordBalance } from "@/api/ss/recordBalance";
import { $showColumns } from '@/utils/mixins';
import { $showColumns, $view } from '@/utils/mixins'
//
const defaultSort = {
@ -141,17 +158,28 @@ const defaultSort = {
export default {
name: "RecordBalance",
mixins: [$showColumns],
mixins: [$showColumns, $view],
dicts: ['record_balance_bst_type'],
props: {
query: {
type: Object,
default: () => {
return {}
}
}
},
data() {
return {
//
columns: [
{key: 'id', visible: true, label: 'ID'},
{key: 'userName', visible: true, label: '用户名称'},
{key: 'beforeBalance', visible: true, label: '变动前余额(元)'},
{key: 'afterBalance', visible: true, label: '变动后余额(元)'},
{key: 'reason', visible: true, label: '变动原因'},
{key: 'bstType', visible: true, label: '业务类型'},
{key: 'createTime', visible: true, label: '变动时间'},
{key: 'amount', visible: true, label: '变动金额'},
{key: 'beforeBalance', visible: true, label: '变动前余额'},
{key: 'afterBalance', visible: true, label: '变动后余额'},
{key: 'reason', visible: true, label: '变动原因'},
],
//
orderSorts: ['ascending', 'descending', null],
@ -206,6 +234,10 @@ export default {
};
},
created() {
this.queryParams = {
...this.queryParams,
...this.query
}
this.getList();
},
methods: {

View File

@ -35,6 +35,7 @@
</el-descriptions-item>
<el-descriptions-item label="账户余额">{{userData.balance | money | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="总收入">{{userData.totalIncome | money | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="总充值">{{userData.rechargeAmount | money | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="总提现">{{userData.withDrawlAmount | money | defaultValue}} </el-descriptions-item>
</el-descriptions>
</div>