ViewWithdraw.vue
8.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<template>
<a-alert type="info" :show-icon="true" :closable="false" message="请仔细核对收款账户信息,确保与申请人身份一致。">
</a-alert>
<a-descriptions :bordered="false" :column="3" size="small" v-if="withdraw" class=" mt-16">
<template #title>
<title-tip-icon></title-tip-icon>
申请与账户信息
</template>
<a-descriptions-item label="流水号" name="name">
{{ withdraw.withdrawCode }}
</a-descriptions-item>
<a-descriptions-item label="申请状态" name="auditState">
<audit-state-tag :audit-state="withdraw.auditState"></audit-state-tag>
</a-descriptions-item>
<a-descriptions-item label="申请人" name="updateBy">
{{ withdraw.account.accountName }}
</a-descriptions-item>
<a-descriptions-item label="申请时间" name="createTime">
{{ withdraw.createTime }}
</a-descriptions-item>
<a-descriptions-item label="审核时间" name="bankAccount">
{{ withdraw.auditTime }}
</a-descriptions-item>
</a-descriptions>
<a-descriptions :bordered="false" :column="3" size="small" v-if="withdraw" class="withdraw-view mt-16">
<template #title>
申请提现金额
</template>
<template #extra>
申请时间: {{ withdraw.createTime }}
</template>
<a-descriptions-item label="申请提现金额" name="amount">
¥{{ withdraw.amount }}
</a-descriptions-item>
<a-descriptions-item label="账户余额" name="amount">
¥{{ withdraw.account.surplus }}
</a-descriptions-item>
</a-descriptions>
<a-descriptions :bordered="false" :column="3" size="small" v-if="withdraw&&withdraw.auditState==='REJECTED'">
<template #title>
<title-tip-icon></title-tip-icon>
驳回原因
</template>
<a-descriptions-item label="详细驳回原因" name="amount">
{{ withdraw.rejectReason }}
</a-descriptions-item>
</a-descriptions>
<!-- <a-descriptions v-if="withdraw&&withdraw.auditState==='AUDITED'" :bordered="false" :column="3" size="small">-->
<!-- <template #title>-->
<!-- <title-tip-icon></title-tip-icon>-->
<!-- 转账情况-->
<!-- </template>-->
<!-- <a-descriptions-item label="付款单号">-->
<!-- {{ withdraw.transferBillNo }}-->
<!-- </a-descriptions-item>-->
<!-- <a-descriptions-item label="转账状态">-->
<!-- <transfer-state-tag :state="withdraw.state"></transfer-state-tag>-->
<!-- </a-descriptions-item>-->
<!-- <a-descriptions-item label="失败原因" :span="2">-->
<!-- {{ withdraw.failReason ?? '-' }}-->
<!-- </a-descriptions-item>-->
<!-- <a-descriptions-item label="转账时间">-->
<!-- {{ withdraw.transferTime }}-->
<!-- </a-descriptions-item>-->
<!-- <a-descriptions-item label="付款成功时间">-->
<!-- {{ withdraw.paymentTime }}-->
<!-- </a-descriptions-item>-->
<!-- <a-descriptions-item label="付款备注">-->
<!-- {{ withdraw.transferRemark }}-->
<!-- </a-descriptions-item>-->
<!-- </a-descriptions>-->
<template v-if="withdraw&&withdraw.auditState==='AUDITED'">
<div class="mt-16"></div>
<title-divider title="退款情况"></title-divider>
<a-table :columns="columns" :data-source="refunds" :pagination="false" size="small"></a-table>
</template>
<br/>
<title-divider title="审核记录"></title-divider>
<approve-history-timeline v-if="withdraw" approve-type="WITHDRAW" :approve-id="withdraw.withdrawId" :create-time="withdraw.createTime" :starter="withdraw.account.accountName"></approve-history-timeline>
<a-space :gap="8" v-if="withdraw&&withdraw.auditState==='UNAUDITED'">
<a-button type="primary" @click="editWithdraw('AUDITED')">审核通过</a-button>
<a-button type="default" @click="editWithdraw('REJECTED')">审核驳回</a-button>
<a-button type="default" @click="this.$goBack()">取消</a-button>
</a-space>
</template>
<script lang="ts">
import {Component, Vue} from "vue-facing-decorator";
import {Withdraw} from "lib/src/entity/finance/entity/Withdraw";
import AuditStateTag from "@/views/common/AuditStateTag.vue";
import TitleTipIcon from "@/components/icons/TitleTipIcon.vue";
import TransferStateTag from "@/views/finance/withdraw/TransferStateTag.vue";
import {WithdrawController} from "@/api/WithdrawController";
import ApproveHistoryTimeline from "@/views/common/ApproveHistoryTimeline.vue";
import TitleDivider from "@/components/TitleDivider.vue";
import {ModalService} from "@/components/ModalService";
import WithdrawForm from "@/views/finance/withdraw/WithdrawForm.vue";
import {AuditState} from "lib/src/entity/enum_types";
import {Refund} from "lib/src/entity/finance/entity/Refund";
import {Transaction} from "lib/src/entity/finance/entity/Transaction";
import {TransactionController} from "@/api/TransactionController";
import {TableColumnsType} from "ant-design-vue";
@Component({
components: {TitleDivider, ApproveHistoryTimeline, TransferStateTag, TitleTipIcon, AuditStateTag}
})
export default class ViewWithdraw extends Vue {
withdrawId: any;
withdraw: Withdraw = null;
refunds: Refund[] = [];
/**
* 表格列配置
*/
columns: TableColumnsType = [
{title: '支付流水号', dataIndex: ['recharge', 'outTradeNo'], key: 'outTradeNo', width: 150, resizable: true, ellipsis: true, sorter: false},
{title: '微信支付订单号', dataIndex: ['recharge', 'transactionId'], key: 'transactionId', width: 170, resizable: true, ellipsis: true, sorter: false},
{
title: '支付金额', dataIndex: ['recharge', 'amount'], key: 'amount', width: 120, align: 'right', resizable: true, ellipsis: true, sorter: false,
customRender: ({text, record, index, column}) => {
return '¥' + text;
}
},
{title: '支付时间', dataIndex: ['recharge', 'paymentTime'], key: 'paymentTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: false},
{title: '微信退款订单号', dataIndex: 'outRefundNo', key: 'outRefundNo', align: 'left', width: 170, resizable: true, ellipsis: true, sorter: false},
{
title: '退款金额', dataIndex: 'refundAmount', key: 'refundAmount', align: 'right', width: 120, resizable: true, ellipsis: true, sorter: false,
customRender: ({text, record, index, column}) => {
return '¥' + text;
}
},
{title: '退款时间', dataIndex: 'refundTime', key: 'refundTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: false},
{title: '退款成功时间', dataIndex: 'refundSuccessTime', key: 'refundSuccessTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: false},
];
created(): void {
this.withdrawId = Number(this.$route.query.withdrawId);
this.loadData();
}
loadData(): void {
WithdrawController.getWithdrawById(this.axios, this.withdrawId).then(response => {
this.withdraw = response.data;
});
TransactionController.getRefundsByWithdrawId(this.axios, this.withdrawId).then(response => {
this.refunds = response.data;
});
}
/**
* 编辑提现申请
*/
editWithdraw(auditState: AuditState): void {
const modal = ModalService.confirm({
title: '提现审核', component: WithdrawForm, closable: true, appContext: this.$.appContext,
props: {withdraw: this.withdraw, auditState: auditState},
onOk: (component): void => {
component.submitForm();
},
emits: {
handleOk: (e) => {
modal.destroy();
this.loadData();
}
},
});
}
}
</script>
<style scoped lang="less">
.withdraw-view {
border-radius: 8px;
background: linear-gradient(180deg, rgba(227, 240, 255, 1) 0%, rgba(249, 251, 254, 1) 100%), rgba(247, 248, 249, 1);
padding: 16px 20px 16px 20px;
}
</style>