|
|
@@ -75,56 +75,64 @@ const loadData = (refresh: boolean = false) => {
|
|
|
})
|
|
|
.catch(() => {
|
|
|
state.tableData.data = [];
|
|
|
+ ElMessage.error("加载提现记录失败");
|
|
|
})
|
|
|
.finally(() => {
|
|
|
state.tableData.loading = false;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+const auditLoading = ref(false);
|
|
|
+const confirmLoading = ref(false);
|
|
|
+
|
|
|
const handleWithdrawAudit = (row: any) => {
|
|
|
- ElMessageBox.confirm("确认执行本操作吗?", "提现审核", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- const loading = ElMessage({
|
|
|
- message: "操作中...",
|
|
|
- type: "info",
|
|
|
- duration: 0
|
|
|
- });
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ `确认对站点「${row.stationName}」的提现申请执行审核通过吗?`,
|
|
|
+ "提现审核",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }
|
|
|
+ ).then(() => {
|
|
|
+ auditLoading.value = true;
|
|
|
http
|
|
|
.request("post", "finance/reviewWithdrawn", { data: { id: row.id, status: 1 } })
|
|
|
.then(() => {
|
|
|
- loading.close();
|
|
|
ElMessage.success("提现审核通过");
|
|
|
loadData(true);
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- loading.close();
|
|
|
+ ElMessage.error("审核操作失败,请稍后重试");
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ auditLoading.value = false;
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const handleWithdrawConfirm = (row: any) => {
|
|
|
- ElMessageBox.confirm("确认执行本操作吗?", "打款确认", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- const loading = ElMessage({
|
|
|
- message: "操作中...",
|
|
|
- type: "info",
|
|
|
- duration: 0
|
|
|
- });
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ `确认对站点「${row.stationName}」的提现执行打款确认吗?`,
|
|
|
+ "打款确认",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }
|
|
|
+ ).then(() => {
|
|
|
+ confirmLoading.value = true;
|
|
|
http
|
|
|
.request("post", "finance/confirmWithdrawnPayment", { data: { id: row.id, paymentStatus: 1 } })
|
|
|
.then(() => {
|
|
|
- loading.close();
|
|
|
ElMessage.success("提现打款已确认");
|
|
|
loadData(true);
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- loading.close();
|
|
|
+ ElMessage.error("打款确认失败,请稍后重试");
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ confirmLoading.value = false;
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
@@ -153,8 +161,8 @@ const handleReset = () => {
|
|
|
};
|
|
|
|
|
|
const formatMoney = (value: number) => {
|
|
|
- if (value === null || value === undefined) return "0.00";
|
|
|
- return (value / 100).toFixed(2);
|
|
|
+ if (value === null || value === undefined) return "¥0.00";
|
|
|
+ return `¥${(value / 100).toFixed(2)}`;
|
|
|
};
|
|
|
|
|
|
const getStatusLabel = (status: number) => {
|
|
|
@@ -165,8 +173,8 @@ const getStatusLabel = (status: number) => {
|
|
|
return map[status] || String(status);
|
|
|
};
|
|
|
|
|
|
-const getStatusType = (status: number) => {
|
|
|
- const map: Record<number, string> = {
|
|
|
+const getStatusType = (status: number): "info" | "success" | "danger" | "warning" => {
|
|
|
+ const map: Record<number, "warning" | "success"> = {
|
|
|
0: "warning",
|
|
|
1: "success"
|
|
|
};
|
|
|
@@ -181,8 +189,8 @@ const getPaymentStatusLabel = (status: number) => {
|
|
|
return map[status] || String(status);
|
|
|
};
|
|
|
|
|
|
-const getPaymentStatusType = (status: number) => {
|
|
|
- const map: Record<number, string> = {
|
|
|
+const getPaymentStatusType = (status: number): "info" | "success" | "danger" | "warning" => {
|
|
|
+ const map: Record<number, "warning" | "success"> = {
|
|
|
0: "warning",
|
|
|
1: "success"
|
|
|
};
|
|
|
@@ -193,6 +201,9 @@ const getPaymentStatusType = (status: number) => {
|
|
|
<template>
|
|
|
<div class="page-container">
|
|
|
<el-card shadow="hover">
|
|
|
+ <template #header>
|
|
|
+ <span class="card-header">提现记录</span>
|
|
|
+ </template>
|
|
|
<el-form
|
|
|
ref="queryRef"
|
|
|
:model="state.formQuery"
|
|
|
@@ -255,7 +266,7 @@ const getPaymentStatusType = (status: number) => {
|
|
|
stripe
|
|
|
>
|
|
|
<template #empty>
|
|
|
- <el-empty description="暂无数据" />
|
|
|
+ <el-empty description="暂无提现记录" />
|
|
|
</template>
|
|
|
<el-table-column
|
|
|
v-for="col in state.tableData.columns"
|
|
|
@@ -325,16 +336,21 @@ const getPaymentStatusType = (status: number) => {
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
.page-container {
|
|
|
- padding: 15px;
|
|
|
+ padding: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.card-header {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 600;
|
|
|
}
|
|
|
|
|
|
.search-form {
|
|
|
- margin-bottom: 15px;
|
|
|
+ margin-bottom: 16px;
|
|
|
}
|
|
|
|
|
|
.pagination-container {
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
- margin-top: 15px;
|
|
|
+ margin-top: 20px;
|
|
|
}
|
|
|
</style>
|