|
|
@@ -55,6 +55,14 @@
|
|
|
>
|
|
|
[账户明细]
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ link
|
|
|
+ v-permission="'customer:list:reduceUserAccount'"
|
|
|
+ @click="handleReduceAccount(row)"
|
|
|
+ >
|
|
|
+ [扣减余额]
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
type="success"
|
|
|
link
|
|
|
@@ -195,6 +203,36 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ //扣减余额
|
|
|
+ function handleReduceAccount(row) {
|
|
|
+ ElMessageBox.prompt(
|
|
|
+ `请输入用户"${row.nickName}"(ID: ${row.id})的扣减金额`,
|
|
|
+ '扣减余额',
|
|
|
+ {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ inputPlaceholder: '请输入扣减金额',
|
|
|
+ inputPattern: /^([1-9]\d*)(\.\d{1,2})?$/,
|
|
|
+ inputErrorMessage: '请输入大于0的金额,最多两位小数',
|
|
|
+ draggable: true
|
|
|
+ }
|
|
|
+ ).then(({ value }) => {
|
|
|
+ request
|
|
|
+ .post('/user/userAccountInfo/reduceUserAccount', {
|
|
|
+ userId: row.id,
|
|
|
+ reduceMoney: Number(value)
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ EleMessage.success('操作成功');
|
|
|
+ reload();
|
|
|
+ } else {
|
|
|
+ EleMessage.error(res.data.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
//编辑页面
|
|
|
const editRef = ref(null);
|
|
|
function handleUpdate(row) {
|