个人钱包

This commit is contained in:
zzyuan 2025-04-14 15:42:16 +08:00
parent 448e998e62
commit e0c4750259
2 changed files with 485 additions and 0 deletions

View File

@ -76,6 +76,30 @@ export function updateAccStateApi(data) {
})
}
// 账户管理-个人钱包-线下充值
export function rechargeAccWalletApi(data) {
return request({
url: '/smart-canteen/acc_info/recharge',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 账户管理-个人钱包-离职时,清空金额
export function clearAccWalletApi(data) {
return request({
url: '/smart-canteen/acc_info/acc/leave/clear',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 当前账户状态
export function accountDataTotalApi(data) {

View File

@ -0,0 +1,461 @@
<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="deptIdList">
<el-cascader v-model="queryParams.deptIdList"
:options="deptOptions" :filterable="true" style="width: 240px" :show-all-levels="false"
:props="{
multiple: true,
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable collapse-tags >
</el-cascader>
</el-form-item>
<el-form-item label="关键字" prop="searchValue">
<el-input v-model="queryParams.searchValue" placeholder="请输入用户姓名,编号,手机号" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
<!-- <el-form-item label="账户状态" prop="accStatusList">
<el-select v-model="queryParams.accStatusList" multiple style="width: 240px" clearable>
<el-option label="正常" value="0"></el-option>
<el-option label="停用" value="1"></el-option>
</el-select>
</el-form-item> -->
<!-- <el-form-item label="钱包类型" prop="walletType">
<el-select v-model="queryParams.walletType" style="width: 240px" clearable>
<el-option label="账户总余额" value="0"></el-option>
<el-option label="个人钱包" value="1"></el-option>
<el-option label="补贴钱包" value="2"></el-option>
<el-option label="红包" value="3"></el-option>
</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>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800" :span-method="objectSpanMethod">
<el-table-column label="序号" align="center" width="80" type="index" fixed="left">
<template scope="scope">
<span v-if="!scope.row.userId">合计</span>
<span v-else>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="用户编号" align="center" prop="userId" :show-overflow-tooltip="true" width="120" fixed="left"/>
<el-table-column label="用户姓名" align="center" prop="nickName" :show-overflow-tooltip="true" width="120" fixed="left"/>
<el-table-column label="用户手机号" align="center" prop="phoneNumber" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="所属组织" align="center" prop="deptName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="用户类别" align="center" prop="userTypeName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="账户总余额" align="center" prop="accBalTotal" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span>{{ (scope.row.accBalTotal/100).toFixed(2) }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="可用总余额" align="center" prop="accAvailableBal" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span>{{ (scope.row.accAvailableBal/100).toFixed(2) }}</span>
</template>
</el-table-column> -->
<el-table-column label="个人钱包余额" align="center" prop="walletBal" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span>{{ (scope.row.walletBal/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="补贴钱包余额" align="center" prop="subsidyBal" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span>{{ (scope.row.subsidyBal/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="冻结金额" align="center" prop="accFreezeBalTotal" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span>{{ (scope.row.accFreezeBalTotal/100).toFixed(2) }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="个人钱包允许最低金额" align="center" prop="minWalletBalLimit" :show-overflow-tooltip="true" width="160">
<template slot-scope="scope">
<span>{{ (scope.row.minWalletBalLimit/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="补贴钱包允许最低金额" align="center" prop="minSubBalLimit" :show-overflow-tooltip="true" width="160">
<template slot-scope="scope">
<span>{{ (scope.row.minSubBalLimit/100).toFixed(2) }}</span>
</template>
</el-table-column> -->
<el-table-column label="账户状态" align="center" prop="accStatusName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="账户有效期" align="center" prop="endDate" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope" v-if="scope.$index!=10">
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>充值</el-button>
<el-button
size="mini"
type="text" style="color: red;"
@click="handleClear(scope.row)"
>钱包清空</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 充值对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<div style="width: 100%;height: 400px;overflow-y: auto;">
<el-descriptions class="margin-top" title="账户信息" :column="2" size="small" border>
<el-descriptions-item>
<template slot="label">用户编号</template>
{{form.userId}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">用户姓名</template>
{{ form.nickName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">所属组织</template>
{{ form.deptName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">用户手机号</template>
{{ form.phoneNumber }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">账户状态</template>
{{ form.accStatusName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">用户类别</template>
{{ form.userTypeName }}
</el-descriptions-item>
</el-descriptions>
<el-descriptions class="margin-top" title="账户钱包" :column="2" size="small" border>
<el-descriptions-item>
<template slot="label">账户总余额</template>
{{ (form.accBalTotal/100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">可用总余额</template>
{{ (form.accAvailableBal/100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">个人钱包余额</template>
{{ (form.walletBal/100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">补贴钱包余额</template>
{{ (form.subsidyBal/100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">冻结金额</template>
{{ (form.accFreezeBalTotal/100).toFixed(2) }}
</el-descriptions-item>
</el-descriptions>
<div style="margin: 20px 0;font-weight: bold;font-size: 16px;color: #000;"></div>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="充值金额" prop="amount">
<el-input v-model="form.amount" placeholder="请输入充值金额" maxlength="9" clearable style="width: 300px;"
@input="(v)=>(form.amount=v.replace(/[^\d.]/g,''))">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 补贴清空对话框 -->
<el-dialog :title="title" :visible.sync="openClear" width="800px" append-to-body>
<div style="width: 100%;height: 300px;overflow-y: auto;">
<el-descriptions class="margin-top" title="账户信息" :column="2" size="small" border>
<el-descriptions-item>
<template slot="label">用户编号</template>
{{form.userId}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">用户姓名</template>
{{ form.nickName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">所属组织</template>
{{ form.deptName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">用户手机号</template>
{{ form.phoneNumber }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">账户状态</template>
{{ form.accStatusName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">用户类别</template>
{{ form.userTypeName }}
</el-descriptions-item>
</el-descriptions>
<el-descriptions class="margin-top" title="账户钱包" :column="2" size="small" border>
<el-descriptions-item>
<template slot="label">账户总余额</template>
{{ (form.accBalTotal/100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">可用总余额</template>
{{ (form.accAvailableBal/100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">个人钱包余额</template>
{{ (form.walletBal/100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">补贴钱包余额</template>
{{ (form.subsidyBal/100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">冻结金额</template>
{{ (form.accFreezeBalTotal/100).toFixed(2) }}
</el-descriptions-item>
</el-descriptions>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitClearForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { deptTreeSelect } from '@/api/system/user'
import { accInfoPageApi, accInfoSumPageApi,rechargeAccWalletApi,clearAccWalletApi } from "@/api/accountCenter/manager";
export default {
name: "",
dicts: ['user_psn_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [],
//
title: "",
//
open: false,
//
deptOptions:[],
//
queryParams: {
pageNum: 1,
pageSize: 10,
accStatusList:[],
deptIdList:[],
hasSum:true,
searchValue:null,
walletType:null,
walletMinAmount:null,
walletMaxAmount:null,
},
cancelCount:0,
expiredCount:0,
//
form: {},
pickerOptions:{
//
disabledDate(time) {
//Date.now()javascript19701100:00:00 UTC
return time.getTime() < Date.now() - 8.64e7;
}
},
//
rules: {
amount: [
{ required: true, message: "金额不能为空", trigger: "blur" }
]
},
openClear:false,
};
},
created() {
this.getDeptTree()
// this.getAccOperateCount()
this.getList();
},
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then((response) => {
this.deptOptions = this.filterTree(response.data)
})
},
filterTree(nodes) {
return nodes
.map((node) => {
if (node.children) {
node.children = this.filterTree(node.children)
}
return node
})
.filter((node) => node.status !== '1')
},
// //
// getAccOperateCount(){
// accInfoOperateCountApi().then(response => {
// this.cancelCount = response.data.cancelCount
// this.expiredCount = response.data.expiredCount
// });
// },
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
console.log(this.queryParams)
this.loading = true;
let param = {
"pageNum": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize,
"accStatusList": this.queryParams.accStatusList,
"deptIdList": this.queryParams.deptIdList,
// "hasSum": this.queryParams.hasSum,
"searchValue": this.queryParams.searchValue,
"walletType": this.queryParams.walletType,
// "walletMinAmount": Number(this.queryParams.walletMinAmount)*100,
// "walletMaxAmount": Number(this.queryParams.walletMaxAmount)*100
}
accInfoPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
accInfoSumPageApi(param).then(response => {
this.tableListData.push(response.data)
});
this.loading = false;
});
},
// rowIndex= columnIndex=
// table +
// 0
objectSpanMethod ({ row, column, rowIndex, columnIndex }) {
// if (rowIndex === 0 && columnIndex == 0) {
// let rowspan = 0
// let colspan = 0
// return { rowspan, colspan }
// }
//
// else if
// 使
// else if (rowIndex === 0 && columnIndex < 5) {
// return {
// rowspan: 11,
// colspan: 0
// }
// }
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form = Object.assign({}, row)
this.$set(this.form,"amount",null)
// this.$set(this.form,"subLimitBalance",(row.minSubBalLimit/100).toFixed(2))
// this.$set(this.form,"walletLimitBalance",(row.minWalletBalLimit/100).toFixed(2))
this.open = true;
this.title = "充值个人钱包";
},
/** 补贴清空按钮操作 */
handleClear(row) {
this.reset();
this.form = Object.assign({}, row)
// this.$set(this.form,"clearType",1)
// this.$set(this.form,"amount",null)
this.openClear = true;
this.title = "个人钱包清空";
},
//
cancel() {
this.open = false;
this.openClear = false;
this.reset();
},
//
reset() {
this.form = {};
this.resetForm("form");
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
let param = {
userId:this.form.userId,
amount:Number(this.form.amount*100)
}
rechargeAccWalletApi(param).then(response => {
this.$modal.msgSuccess("操作成功");
this.open = false;
this.getList();
});
}
});
},
/** 清空提交按钮 */
submitClearForm: function() {
let param = {
userId:this.form.userId
}
clearAccWalletApi(param).then(response => {
this.$modal.msgSuccess("操作成功");
this.openClear = false;
this.getList();
});
},
}
};
</script>