|
@@ -1,40 +1,43 @@
|
|
|
<template>
|
|
|
<el-container class="withdraw-detail">
|
|
|
- <el-main>
|
|
|
- <!-- 操作按钮 -->
|
|
|
- <div class="operation-buttons sa-m-b-26" v-if="withdrawDetail.status === 'processing'">
|
|
|
- <el-button type="success" @click="handleApprove">审核通过</el-button>
|
|
|
- <el-button type="danger" @click="handleReject">审核拒绝</el-button>
|
|
|
- </div>
|
|
|
-
|
|
|
+ <el-main v-loading="loading" element-loading-text="加载中...">
|
|
|
<!-- 基本信息 -->
|
|
|
<div class="basic-info sa-m-b-26">
|
|
|
- <h3 class="sa-m-b-20">基本信息</h3>
|
|
|
+ <div class="sa-flex sa-row-between sa-m-b-20">
|
|
|
+ <h3>基本信息</h3>
|
|
|
+ <!-- 操作按钮 -->
|
|
|
+ <div class="operation-buttons mb-40px" v-if="withdrawDetail.status === 1">
|
|
|
+ <el-button type="success" plain @click="handleApprove" class="mr-10px"
|
|
|
+ >审核通过</el-button
|
|
|
+ >
|
|
|
+ <el-button type="danger" plain @click="handleReject">审核拒绝</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">提款单号:</span>
|
|
|
- <span class="value">{{ withdrawDetail.order_no || '--' }}</span>
|
|
|
+ <span class="value">{{ withdrawDetail.orderNo || '--' }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">提款状态:</span>
|
|
|
<el-tag :type="getStatusType(withdrawDetail.status)">
|
|
|
- {{ withdrawDetail.status_text || '--' }}
|
|
|
+ {{ getStatusText(withdrawDetail.status) }}
|
|
|
</el-tag>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">收款银行:</span>
|
|
|
- <span class="value">{{ withdrawDetail.bank_name || '--' }}</span>
|
|
|
+ <span class="value">{{ withdrawDetail.bank || '--' }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">用户名:</span>
|
|
|
- <span class="value">{{ withdrawDetail.username || '--' }}</span>
|
|
|
+ <span class="value">{{ withdrawDetail.userName || '--' }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -42,28 +45,28 @@
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">提款类型:</span>
|
|
|
- <el-tag :type="withdrawDetail.withdraw_type === 'bank' ? 'info' : 'success'">
|
|
|
- {{ withdrawDetail.withdraw_type_text || '--' }}
|
|
|
+ <el-tag :type="withdrawDetail.accountType === 1 ? 'primary' : 'success'">
|
|
|
+ {{ getAccountTypeText(withdrawDetail.accountType) }}
|
|
|
</el-tag>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">账户名称:</span>
|
|
|
- <span class="value">{{ withdrawDetail.account_name || '--' }}</span>
|
|
|
+ <span class="value">{{ withdrawDetail.bankAccountName || '--' }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">手机号:</span>
|
|
|
- <span class="value">{{ withdrawDetail.phone || '--' }}</span>
|
|
|
+ <span class="value">{{ withdrawDetail.userPhone || '--' }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">提款渠道:</span>
|
|
|
- <el-tag type="info">
|
|
|
- {{ withdrawDetail.withdraw_channel_text || '--' }}
|
|
|
+ <el-tag :type="getChannelType(withdrawDetail.channel)">
|
|
|
+ {{ getChannelText(withdrawDetail.channel) }}
|
|
|
</el-tag>
|
|
|
</div>
|
|
|
</el-col>
|
|
@@ -72,25 +75,25 @@
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">收款账户:</span>
|
|
|
- <span class="value">{{ withdrawDetail.account_number || '--' }}</span>
|
|
|
+ <span class="value">{{ withdrawDetail.bankAccount || '--' }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">账户余额:</span>
|
|
|
- <span class="value">৳{{ withdrawDetail.account_balance || '0' }}</span>
|
|
|
+ <span class="value">৳{{ withdrawDetail.walletBalance || 0 }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">币种:</span>
|
|
|
- <span class="value">{{ withdrawDetail.currency || 'BDT' }}</span>
|
|
|
+ <span class="value">{{ getCurrencyText(withdrawDetail.currency) }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">收益余额:</span>
|
|
|
- <span class="value">৳{{ withdrawDetail.profit_balance || '0' }}</span>
|
|
|
+ <span class="value">৳{{ withdrawDetail.earningsBalance || 0 }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -98,25 +101,13 @@
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">提款金额:</span>
|
|
|
- <span class="value">৳{{ withdrawDetail.amount || '0' }}</span>
|
|
|
+ <span class="value">৳{{ withdrawDetail.amount || 0 }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<div class="info-item">
|
|
|
<span class="label">提款手续费:</span>
|
|
|
- <span class="value">৳{{ withdrawDetail.fee || '0' }}</span>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <div class="info-item">
|
|
|
- <span class="label">申请时间:</span>
|
|
|
- <span class="value">{{ withdrawDetail.create_time || '--' }}</span>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <div class="info-item">
|
|
|
- <span class="label">成功时间:</span>
|
|
|
- <span class="value">{{ withdrawDetail.success_time || '--' }}</span>
|
|
|
+ <span class="value">৳{{ withdrawDetail.fee || 0 }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -136,19 +127,19 @@
|
|
|
<template #empty>
|
|
|
<sa-empty />
|
|
|
</template>
|
|
|
- <el-table-column prop="time" label="时间" min-width="160" align="center">
|
|
|
+ <el-table-column prop="createTime" label="时间" min-width="160" align="center">
|
|
|
<template #default="scope">
|
|
|
- {{ scope.row.time || '--' }}
|
|
|
+ {{ scope.row.createTime || '--' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="operator" label="操作人" min-width="120" align="center">
|
|
|
+ <el-table-column prop="createUser" label="操作人" min-width="120" align="center">
|
|
|
<template #default="scope">
|
|
|
- {{ scope.row.operator || '--' }}
|
|
|
+ {{ scope.row.createUser || '--' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="action" label="事项" min-width="200">
|
|
|
+ <el-table-column prop="type" label="事项" min-width="200">
|
|
|
<template #default="scope">
|
|
|
- {{ scope.row.action || '--' }}
|
|
|
+ {{ getLogTypeText(scope.row.type) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="remark" label="备注" min-width="300">
|
|
@@ -158,15 +149,6 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
-
|
|
|
- <!-- 分页 -->
|
|
|
- <div class="sa-m-t-16" v-if="operationLogs.total > 0">
|
|
|
- <sa-pagination
|
|
|
- :pageData="operationLogs.pageData"
|
|
|
- @updateFn="getOperationLogs"
|
|
|
- layout="total, prev, pager, next"
|
|
|
- />
|
|
|
- </div>
|
|
|
</div>
|
|
|
</el-main>
|
|
|
</el-container>
|
|
@@ -174,13 +156,16 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
|
- import { ElMessage } from 'element-plus';
|
|
|
- import { withdrawMockData } from '@/sheep/mock/withdraw';
|
|
|
import { useModal, usePagination } from '@/sheep/hooks';
|
|
|
+ import { api, financeUtils } from '../finance.service';
|
|
|
import WithdrawAudit from './audit.vue';
|
|
|
|
|
|
- const props = defineProps(['modal']);
|
|
|
- const emit = defineEmits(['modalCallBack']);
|
|
|
+ const props = defineProps({
|
|
|
+ modal: {
|
|
|
+ type: Object,
|
|
|
+ default: () => ({}),
|
|
|
+ },
|
|
|
+ });
|
|
|
|
|
|
const withdrawDetail = ref({});
|
|
|
const loading = ref(false);
|
|
@@ -194,15 +179,14 @@
|
|
|
pageData: logPageData,
|
|
|
});
|
|
|
|
|
|
- // 获取状态类型
|
|
|
- function getStatusType(status) {
|
|
|
- const statusMap = {
|
|
|
- processing: 'warning',
|
|
|
- success: 'success',
|
|
|
- failed: 'danger',
|
|
|
- };
|
|
|
- return statusMap[status] || 'info';
|
|
|
- }
|
|
|
+ // 使用公共配置的函数
|
|
|
+ const getStatusType = (status) => financeUtils.getStatusType(status, 'withdraw');
|
|
|
+ const getStatusText = financeUtils.getWithdrawStatusText;
|
|
|
+ const getAccountTypeText = financeUtils.getAccountTypeText;
|
|
|
+ const getChannelType = financeUtils.getChannelType;
|
|
|
+ const getChannelText = financeUtils.getChannelText;
|
|
|
+ const getCurrencyText = financeUtils.getCurrencyText;
|
|
|
+ const getLogTypeText = financeUtils.getLogTypeText;
|
|
|
|
|
|
// 获取提款详情
|
|
|
async function getWithdrawDetail() {
|
|
@@ -210,9 +194,11 @@
|
|
|
|
|
|
loading.value = true;
|
|
|
try {
|
|
|
- const result = withdrawMockData.getDetail(props.modal.params.id);
|
|
|
- if (result.code == '200') {
|
|
|
- withdrawDetail.value = result.data;
|
|
|
+ const { code, data } = await api.withdraw.withdrawDetail(props.modal.params.id);
|
|
|
+ if (code == '200') {
|
|
|
+ withdrawDetail.value = data;
|
|
|
+ // 获取详情后更新操作日志
|
|
|
+ getOperationLogs();
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('获取提款详情失败:', error);
|
|
@@ -221,42 +207,13 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 获取操作日志
|
|
|
- function getOperationLogs(page) {
|
|
|
- if (page) operationLogs.pageData.page = page;
|
|
|
+ // 获取操作日志 - 从详情数据中获取
|
|
|
+ function getOperationLogs() {
|
|
|
operationLogs.loading = true;
|
|
|
-
|
|
|
try {
|
|
|
- // 模拟操作日志数据
|
|
|
- const mockLogs = [
|
|
|
- {
|
|
|
- time: '2025/01/15 10:30:00',
|
|
|
- operator: 'John Doe',
|
|
|
- action: '提交提款申请',
|
|
|
- remark: '--',
|
|
|
- },
|
|
|
- {
|
|
|
- time: '2025/01/15 10:35:00',
|
|
|
- operator: 'John Doe',
|
|
|
- action: '上传银行凭证',
|
|
|
- remark: '--',
|
|
|
- },
|
|
|
- {
|
|
|
- time: '2025/01/15 11:00:00',
|
|
|
- operator: 'system',
|
|
|
- action: '提款申请审核中',
|
|
|
- remark: '--',
|
|
|
- },
|
|
|
- {
|
|
|
- time: '2025/01/15 11:30:00',
|
|
|
- operator: 'admin',
|
|
|
- action: '提款申请审核通过',
|
|
|
- remark: '审核通过,开始处理',
|
|
|
- },
|
|
|
- ];
|
|
|
-
|
|
|
- operationLogs.data = mockLogs;
|
|
|
- operationLogs.total = mockLogs.length;
|
|
|
+ // 使用详情数据中的 bizLogs
|
|
|
+ operationLogs.data = withdrawDetail.value.bizLogs || [];
|
|
|
+ operationLogs.total = operationLogs.data.length;
|
|
|
} catch (error) {
|
|
|
console.error('获取操作日志失败:', error);
|
|
|
} finally {
|
|
@@ -271,13 +228,12 @@
|
|
|
{
|
|
|
width: '500px',
|
|
|
title: '提款审核通过',
|
|
|
+ id: withdrawDetail.value.id,
|
|
|
type: 'approve',
|
|
|
},
|
|
|
{
|
|
|
- confirm: (result) => {
|
|
|
- if (result.action === 'confirm') {
|
|
|
- handleAuditResult(result.data);
|
|
|
- }
|
|
|
+ confirm: () => {
|
|
|
+ getWithdrawDetail();
|
|
|
},
|
|
|
},
|
|
|
);
|
|
@@ -290,69 +246,27 @@
|
|
|
{
|
|
|
width: '500px',
|
|
|
title: '提款审核拒绝',
|
|
|
+ id: withdrawDetail.value.id,
|
|
|
type: 'reject',
|
|
|
},
|
|
|
{
|
|
|
- confirm: (result) => {
|
|
|
- if (result.action === 'confirm') {
|
|
|
- handleAuditResult(result.data);
|
|
|
- }
|
|
|
+ confirm: () => {
|
|
|
+ getWithdrawDetail();
|
|
|
},
|
|
|
},
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- // 处理审核结果
|
|
|
- function handleAuditResult(data) {
|
|
|
- if (data.type === 'approve') {
|
|
|
- // 更新状态为成功
|
|
|
- withdrawDetail.value.status = 'success';
|
|
|
- withdrawDetail.value.status_text = '提款成功';
|
|
|
- withdrawDetail.value.success_time = new Date().toLocaleString();
|
|
|
-
|
|
|
- // 添加操作日志
|
|
|
- operationLogs.data.unshift({
|
|
|
- time: new Date().toLocaleString(),
|
|
|
- operator: 'admin',
|
|
|
- action: '审核通过',
|
|
|
- remark: `通过渠道:${data.channel}${data.remark ? ',备注:' + data.remark : ''}`,
|
|
|
- });
|
|
|
- } else if (data.type === 'reject') {
|
|
|
- // 更新状态为失败
|
|
|
- withdrawDetail.value.status = 'failed';
|
|
|
- withdrawDetail.value.status_text = '提款失败';
|
|
|
-
|
|
|
- // 添加操作日志
|
|
|
- operationLogs.data.unshift({
|
|
|
- time: new Date().toLocaleString(),
|
|
|
- operator: 'admin',
|
|
|
- action: '审核拒绝',
|
|
|
- remark: data.remark,
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- // 通知父组件刷新
|
|
|
- emit('modalCallBack');
|
|
|
- }
|
|
|
-
|
|
|
onMounted(() => {
|
|
|
getWithdrawDetail();
|
|
|
- getOperationLogs();
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.withdraw-detail {
|
|
|
.operation-buttons {
|
|
|
- text-align: center;
|
|
|
- padding: 20px 0;
|
|
|
- border-bottom: 1px solid #ebeef5;
|
|
|
-
|
|
|
.el-button {
|
|
|
- margin: 0 10px;
|
|
|
- padding: 12px 30px;
|
|
|
- font-size: 14px;
|
|
|
- font-weight: 500;
|
|
|
+ margin-left: 8px;
|
|
|
}
|
|
|
}
|
|
|
|