提现优化
This commit is contained in:
parent
6885e6cf78
commit
e481bf27f4
|
@ -8,3 +8,12 @@ export function mchListWithdraw(params) {
|
|||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 查询本人提现详情
|
||||
export function mchGetWithdraw(params) {
|
||||
return request({
|
||||
url: '/mch/withdraw/withdrawList',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
|
|
@ -17,6 +17,18 @@ export function getAccount(accountId) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询用户对应类型的账户
|
||||
export function getUserAccountByType(userId, type) {
|
||||
return request({
|
||||
url: '/ss/account/getUserAccountByType',
|
||||
method: 'get',
|
||||
params: {
|
||||
userId,
|
||||
type
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 新增用户账户
|
||||
export function addAccount(data) {
|
||||
return request({
|
||||
|
|
|
@ -16,3 +16,11 @@ export const UserType = {
|
|||
ADMIN: "1", // 管理员
|
||||
APP: "2" // 普通用户
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现打款方式
|
||||
*/
|
||||
export const WithdrawType = {
|
||||
ONLINE: "1", // 线上
|
||||
OFFLINE: "2" // 线下
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
<script>
|
||||
import { mchGetBill } from '@/api/mch/bill'
|
||||
import { mchGetWithdraw } from '@/api/mch/withdraw'
|
||||
|
||||
export default {
|
||||
name: 'MchWithdrawDetail',
|
||||
|
@ -65,7 +66,7 @@ export default {
|
|||
methods: {
|
||||
getDetail(id) {
|
||||
this.loading = true;
|
||||
mchGetBill(id).then(res => {
|
||||
mchGetWithdraw(id).then(res => {
|
||||
this.detail = res.data;
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
|
|
|
@ -103,6 +103,7 @@
|
|||
<dict-tag :value="d.row.withdrawType" :options="dict.type.withdraw_type"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核意见" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -196,7 +197,6 @@ export default {
|
|||
handleView(row) {
|
||||
this.row = row;
|
||||
this.showDetail = true;
|
||||
// this.$router.push(`/money/withdraw/${row.billId}`)
|
||||
},
|
||||
/** 查询充值记录列表 */
|
||||
getList() {
|
||||
|
|
173
src/views/system/withdraw/detail.vue
Normal file
173
src/views/system/withdraw/detail.vue
Normal file
|
@ -0,0 +1,173 @@
|
|||
<template>
|
||||
<div style="padding: 0 20px;" v-loading="loading">
|
||||
<el-descriptions title="申请信息" :column="2">
|
||||
<el-descriptions-item label="提现单号">{{detail.billNo | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
<dict-tag :value="detail.status" :options="dict.type.withdraw_status" size="small"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请时间">{{detail.createTime | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="提现方式">
|
||||
<dict-tag :value="detail.channelId" :options="dict.type.channel_type" size="small"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="提现金额">{{detail.money | money | defaultValue}} 元</el-descriptions-item>
|
||||
<el-descriptions-item label="到账金额">{{detail.arrivalAmount | money | defaultValue}} 元</el-descriptions-item>
|
||||
<el-descriptions-item label="余额">{{detail.afterBalance | money | defaultValue}} 元</el-descriptions-item>
|
||||
<el-descriptions-item label="服务费">{{detail.serviceCharge | money | defaultValue}} 元</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions title="审核信息" :column="2" style="margin-top: 1em;" v-if="detail.status !== '11'" >
|
||||
<el-descriptions-item label="打款方式">
|
||||
<dict-tag :value="detail.withdrawType" :options="dict.type.withdraw_type" size="small"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="到账时间">{{detail.payTime | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="用户线下收款码">
|
||||
<image-preview :src="detail.offlineImage" :width="100" :height="100"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="线下支付凭证">
|
||||
<image-preview :src="detail.payPicture" :width="100" :height="100"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核意见" :span="4">{{detail.remark | defaultValue}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<template v-else v-hasPermi="['system:bill:approval']">
|
||||
<h3>审核</h3>
|
||||
<el-form ref="form" :model="detail" :rules="approvalRules" label-width="6em">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="打款方式" prop="withdrawType">
|
||||
<el-select v-model="detail.withdrawType" style="width: 100%" @change="onChangeWithdrawType">
|
||||
<el-option v-for="dict in dict.type.withdraw_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<template v-if="detail.withdrawType === '2'">
|
||||
<form-col :span="12" label="用户收款码" label-width="7em" prop="offlineImage">
|
||||
<image-upload v-model="detail.offlineImage"/>
|
||||
</form-col>
|
||||
<form-col :span="12" label="支付凭证" prop="payPicture">
|
||||
<image-upload v-model="detail.payPicture"/>
|
||||
</form-col>
|
||||
</template>
|
||||
</el-row>
|
||||
<el-form-item label-width="0">
|
||||
<el-input v-model="detail.remark" type="textarea" placeholder="请输入审核意见" maxlength="500" :rows="5" show-word-limit/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" style="justify-content: flex-end">
|
||||
<el-button type="success" @click="pass" v-hasPermi="['system:bill:approval']" icon="el-icon-check">通过并打款</el-button>
|
||||
<el-button type="danger" @click="reject" v-hasPermi="['system:bill:approval']" icon="el-icon-close">驳回</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getBill } from '@/api/system/recharge'
|
||||
import { passWithDrawBill, rejectWithDrawBill } from '@/api/system/withdraw'
|
||||
import { AccountType, WithdrawType } from '@/utils/constants'
|
||||
import { getUserAccountByType } from '@/api/ss/account'
|
||||
|
||||
export default {
|
||||
name: 'WithdrawDetail',
|
||||
dicts: ['channel_type','withdraw_status', 'withdraw_type'],
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
detail: {},
|
||||
suitUsingType: ['info', 'warning', 'success', 'danger'],
|
||||
suitUsingText: ['未知', '未生效', '使用中', '已失效'],
|
||||
|
||||
approvalRules: {
|
||||
withdrawType: [
|
||||
{ required: true, message: "请选择打款方式", trigger: "blur"}
|
||||
],
|
||||
payPicture: [
|
||||
{ required: true, message: "请上传支付凭证", trigger: "blur"}
|
||||
],
|
||||
offlineImage: [
|
||||
{ required: true, message: "请上传收款二维码", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
id(nv, ov) {
|
||||
console.log("id", nv)
|
||||
if (nv == null) {
|
||||
this.detail = {}
|
||||
} else {
|
||||
this.getDetail(nv);
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getDetail(this.id);
|
||||
},
|
||||
methods: {
|
||||
onChangeWithdrawType(val) {
|
||||
if (val === WithdrawType.OFFLINE && this.detail.offlineImage == null) {
|
||||
getUserAccountByType(this.detail.userId, AccountType.OFFLINE_IMAGE).then(res => {
|
||||
if (res.code === 200 && res.data != null) {
|
||||
this.detail.offlineImage = res.data.map(item => item.accountNo).join(",");
|
||||
} else {
|
||||
this.detail.offlineImage = null;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getDetail(id) {
|
||||
this.loading = true;
|
||||
getBill(id).then(res => {
|
||||
this.detail = res.data;
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
pass() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
this.$confirm("确定通过审核吗?", "通过", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
passWithDrawBill(this.detail).then(res => {
|
||||
if (res.code !== 200) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.$message.success("通过成功");
|
||||
this.getDetail(this.id);
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
reject() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
this.$confirm("确定驳回吗?", "驳回", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
rejectWithDrawBill(this.detail).then(res => {
|
||||
if (res.code !== 200) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.$message.success("驳回成功");
|
||||
this.getDetail(this.id);
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -1,7 +1,20 @@
|
|||
<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="userId">
|
||||
<el-form-item label="提现单号" prop="billNo">
|
||||
<el-input
|
||||
v-model="queryParams.billNo"
|
||||
placeholder="请输入提现单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" clearable placeholder="请选择状态" @change="handleQuery">
|
||||
<el-option v-for="dict in dict.type.withdraw_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名称" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入用户名称"
|
||||
|
@ -9,22 +22,38 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceId">
|
||||
<el-input
|
||||
v-model="queryParams.deviceName"
|
||||
placeholder="请输入设备名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
<el-form-item label="申请时间" prop="createDateRange">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createDateRange"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户名称" label-width="120" prop="landlordId">
|
||||
<el-input
|
||||
v-model="queryParams.mchName"
|
||||
placeholder="请输入商户名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
<el-form-item label="到账时间" prop="payDateRange">
|
||||
<el-date-picker
|
||||
v-model="queryParams.payDateRange"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="提现方式" prop="channelId">
|
||||
<el-select v-model="queryParams.channelId" clearable placeholder="请选择提现方式" @change="handleQuery">
|
||||
<el-option v-for="dict in dict.type.withdraw_channel" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="打款方式" prop="withdrawType">
|
||||
<el-select v-model="queryParams.withdrawType" clearable placeholder="请选择打款方式" @change="handleQuery">
|
||||
<el-option v-for="dict in dict.type.withdraw_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>
|
||||
|
@ -48,7 +77,9 @@
|
|||
<el-table v-loading="loading" :data="billList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="ID" align="center" prop="billId" width="50"/>
|
||||
<el-table-column label="提现单号" align="center" prop="billNo" />
|
||||
<el-table-column label="提现单号" align="center" prop="billNo" >
|
||||
<el-link slot-scope="d" @click="handleView(d.row)" type="primary">{{d.row.billNo}}</el-link>
|
||||
</el-table-column>
|
||||
<el-table-column label="到账用户" align="center" prop="mchName" >
|
||||
<user-link slot-scope="d" :id="d.row.mchId" :name="d.row.mchName"/>
|
||||
</el-table-column>
|
||||
|
@ -57,7 +88,7 @@
|
|||
{{d.row.money | money}} 元
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实际到账金额" align="center">
|
||||
<el-table-column label="到账金额" align="center">
|
||||
<template slot-scope="d">
|
||||
{{d.row.arrivalAmount | money}} 元
|
||||
</template>
|
||||
|
@ -74,7 +105,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="时间" align="center" prop="createTime" width="180"/>
|
||||
<el-table-column label="到账时间" align="center" prop="payTime" width="180"/>
|
||||
<el-table-column label="打款渠道" align="center">
|
||||
<el-table-column label="提现方式" align="center">
|
||||
<template slot-scope="d">
|
||||
<dict-tag :value="d.row.channelId" :options="dict.type.channel_type"/>
|
||||
</template>
|
||||
|
@ -89,16 +120,17 @@
|
|||
<dict-tag :value="d.row.status" :options="dict.type.withdraw_status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核意见" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
style="padding-left: 1em; padding-right: 1em;"
|
||||
type="text"
|
||||
icon="el-icon-s-check"
|
||||
v-show="scope.row.status === '11'"
|
||||
@click="handleApproval(scope.row)"
|
||||
v-hasPermi="['system:bill:approval']"
|
||||
>审核</el-button>
|
||||
icon="el-icon-view"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['system:bill:query']"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
style="padding-left: 1em; padding-right: 1em;"
|
||||
|
@ -120,53 +152,15 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 审核对话框 -->
|
||||
<el-dialog title="提现审核" :visible.sync="openApproval" width="500px" append-to-body center top="30vh">
|
||||
<el-form ref="form" :model="approvalForm" :rules="approvalRules" label-width="6em">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="到账用户">
|
||||
{{approvalForm.mchName | defaultVaule}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="提现金额">{{approvalForm.money | money}} 元</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="到账金额">{{approvalForm.arrivalAmount | money}} 元</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="服务费">{{approvalForm.serviceCharge | money}} 元</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="打款方式" prop="withdrawType">
|
||||
<el-select v-model="approvalForm.withdrawType" style="width: 100%">
|
||||
<el-option v-for="dict in dict.type.withdraw_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付凭证" v-if="approvalForm.withdrawType === '2'">
|
||||
<image-upload v-model="approvalForm.payPicture"/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="0">
|
||||
<el-input v-model="approvalForm.remark" type="textarea" placeholder="请输入审核意见" maxlength="500" :rows="5" show-word-limit/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="success" @click="pass" v-hasPermi="['system:bill:approval']" icon="el-icon-check">通过并打款</el-button>
|
||||
<el-button type="danger" @click="reject" v-hasPermi="['system:bill:approval']" icon="el-icon-close">驳回</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 添加或修改充值记录对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-drawer
|
||||
title="提现详情"
|
||||
:visible.sync="showDetail"
|
||||
direction="rtl"
|
||||
size="800px"
|
||||
destroy-on-close
|
||||
>
|
||||
<withdraw-detail :id="row.billId"/>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -181,13 +175,18 @@ import {
|
|||
rejectWithDrawBill, payWithDrawBill
|
||||
} from "@/api/system/withdraw";
|
||||
import UserLink from '@/components/Business/SmUser/UserLink.vue'
|
||||
import WithdrawDetail from '@/views/system/withdraw/detail.vue'
|
||||
import { AccountType, WithdrawType } from '@/utils/constants'
|
||||
import { getUserAccountByType } from '@/api/ss/account'
|
||||
|
||||
export default {
|
||||
name: "Bill",
|
||||
components: { UserLink },
|
||||
components: { WithdrawDetail, UserLink },
|
||||
dicts: ['withdraw_status', 'withdraw_type', 'channel_type'],
|
||||
data() {
|
||||
return {
|
||||
showDetail: false,
|
||||
row: {},
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
|
@ -224,18 +223,19 @@ export default {
|
|||
approvalForm: {
|
||||
billId: null,
|
||||
remark: null,
|
||||
offlineImage: null
|
||||
},
|
||||
approvalRules: {
|
||||
withdrawType: [
|
||||
{ required: true, message: "请选择打款方式", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 查看详情
|
||||
handleView(row) {
|
||||
this.row = row;
|
||||
this.showDetail = true;
|
||||
},
|
||||
// 处理打款
|
||||
handlePay(row) {
|
||||
if (row == null || row.billId == null) {
|
||||
|
@ -255,38 +255,6 @@ export default {
|
|||
})
|
||||
})
|
||||
},
|
||||
pass() {
|
||||
this.$confirm("确定通过审核吗?", "通过", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
passWithDrawBill(this.approvalForm).then(res => {
|
||||
if (res.code !== 200) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.$message.success("通过成功");
|
||||
this.openApproval = false;
|
||||
this.getList();
|
||||
})
|
||||
})
|
||||
},
|
||||
reject() {
|
||||
this.$confirm("确定驳回吗?", "驳回", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
rejectWithDrawBill(this.approvalForm).then(res => {
|
||||
if (res.code !== 200) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.$message.success("驳回成功");
|
||||
this.openApproval = false;
|
||||
this.getList();
|
||||
})
|
||||
})
|
||||
},
|
||||
// 处理审核
|
||||
handleApproval(row) {
|
||||
getBill(row.billId).then(response => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user