|
|
@@ -1,45 +1,45 @@
|
|
|
<template>
|
|
|
<ele-page flex-table>
|
|
|
- <page-search @search="reload"></page-search>
|
|
|
+ <page-search @search="reload" :status="useStatus"></page-search>
|
|
|
|
|
|
<common-table ref="pageRef" :pageConfig="pageConfig" :columns="columns">
|
|
|
<template #toolbar>
|
|
|
<div class="flex items-center mb-4">
|
|
|
<el-statistic
|
|
|
- :value="693700"
|
|
|
+ :value="statistics.totalWithdrawMoney"
|
|
|
title="提现累计金额"
|
|
|
value-style="font-size:30px"
|
|
|
class="mr-10"
|
|
|
></el-statistic>
|
|
|
<el-statistic
|
|
|
- :value="693700"
|
|
|
+ :value="statistics.unWithdrawMoney"
|
|
|
title="待提现金额"
|
|
|
value-style="font-size:30px"
|
|
|
class="mr-10"
|
|
|
></el-statistic>
|
|
|
<el-statistic
|
|
|
- :value="693700"
|
|
|
+ :value="statistics.auditWithdrawMoney"
|
|
|
title="提现中金额"
|
|
|
value-style="font-size:30px"
|
|
|
class="mr-10"
|
|
|
></el-statistic>
|
|
|
<el-statistic
|
|
|
- :value="693700"
|
|
|
+ :value="statistics.withdrawSuccessMoney"
|
|
|
title="已提现金额"
|
|
|
value-style="font-size:30px"
|
|
|
class="mr-10"
|
|
|
></el-statistic>
|
|
|
<el-statistic
|
|
|
- :value="693700"
|
|
|
+ :value="statistics.averageWithdrawDuration"
|
|
|
title="平均提现时长"
|
|
|
value-style="font-size:30px"
|
|
|
class="mr-10"
|
|
|
></el-statistic>
|
|
|
<el-statistic
|
|
|
- :value="693700"
|
|
|
+ :value="statistics.noWithdrawMoney"
|
|
|
title="长期不提现金额"
|
|
|
value-style="font-size:30px"
|
|
|
- class="mr-10"Audit
|
|
|
+ class="mr-10"
|
|
|
></el-statistic>
|
|
|
</div>
|
|
|
|
|
|
@@ -55,14 +55,18 @@
|
|
|
</div>
|
|
|
|
|
|
<el-radio-group @change="handleStatusChange" v-model="useStatus">
|
|
|
- <el-radio-button label="全部" value="1" />
|
|
|
+ <el-radio-button label="全部" value="" />
|
|
|
<el-radio-button label="提现中" value="2" />
|
|
|
- <el-radio-button label="提现完成" value="3" />
|
|
|
- <el-radio-button label="提现失败" value="4" />
|
|
|
- <el-radio-button label="长期不提现用户" value="5" />
|
|
|
+ <el-radio-button label="提现完成" value="4" />
|
|
|
+ <el-radio-button label="提现失败" value="5" />
|
|
|
+ <el-radio-button label="长期不提现用户" value="6" />
|
|
|
</el-radio-group>
|
|
|
</template>
|
|
|
|
|
|
+ <template #status="{ row }">
|
|
|
+ {{ statusDicts.find((d) => d.value == row.status)?.label }}
|
|
|
+ </template>
|
|
|
+
|
|
|
<template #action="{ row }">
|
|
|
<div>
|
|
|
<el-button
|
|
|
@@ -76,6 +80,7 @@
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
link
|
|
|
+ v-if="row.status == 1"
|
|
|
v-permission="'finance:withdrawal:audit'"
|
|
|
@click="handleChangeStatus(row)"
|
|
|
>
|
|
|
@@ -85,24 +90,65 @@
|
|
|
</template>
|
|
|
</common-table>
|
|
|
|
|
|
+ <!-- 审核弹窗 -->
|
|
|
+ <audit-dialog ref="auditDialogRef" @success="reload" />
|
|
|
</ele-page>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
- import { ref, reactive } from 'vue';
|
|
|
+ import { ref, reactive, onMounted } from 'vue';
|
|
|
import CommonTable from '@/components/CommonPage/CommonTable.vue';
|
|
|
import pageSearch from './components/page-search.vue';
|
|
|
import { useDictData } from '@/utils/use-dict-data';
|
|
|
import request from '@/utils/request';
|
|
|
+ import auditDialog from './components/audit-dialog.vue';
|
|
|
|
|
|
defineOptions({ name: 'withdrawal' });
|
|
|
- const [useStatusDicts] = useDictData(['use_status']);
|
|
|
|
|
|
- const useStatus = ref('1');
|
|
|
+ // 添加统计数据的响应式对象
|
|
|
+ const statistics = reactive({
|
|
|
+ totalWithdrawMoney: 0,
|
|
|
+ unWithdrawMoney: 0,
|
|
|
+ auditWithdrawMoney: 0,
|
|
|
+ withdrawSuccessMoney: 0,
|
|
|
+ averageWithdrawDuration: 0,
|
|
|
+ noWithdrawMoney: 0
|
|
|
+ });
|
|
|
+
|
|
|
+ // 获取统计数据
|
|
|
+ async function fetchStatistics() {
|
|
|
+ try {
|
|
|
+ const res = await request.get('/sys/finance/withdrawSum');
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ Object.assign(statistics, res.data.data);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取统计数据失败:', error);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ fetchStatistics();
|
|
|
+ });
|
|
|
+
|
|
|
+ const [statusDicts] = useDictData(['withdrawal_status']);
|
|
|
+
|
|
|
+ const useStatus = ref('');
|
|
|
function handleStatusChange(value) {
|
|
|
- pageRef.value.reload({ useStatus: value });
|
|
|
+ if (value === '6') {
|
|
|
+ pageConfig.pageUrl = '/sys/finance/noWithdrawList';
|
|
|
+ pageRef.value?.reload();
|
|
|
+ } else {
|
|
|
+ pageConfig.pageUrl = '/sys/finance/withdrawList';
|
|
|
+ pageRef.value.reload({ status: value });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ //提现类型 string
|
|
|
+ const withdrawTypeDicts = ref([
|
|
|
+ { label: '微信', value: 1 },
|
|
|
+ { label: '支付宝', value: 2 }
|
|
|
+ ]);
|
|
|
/** 表格列配置 */
|
|
|
const columns = ref([
|
|
|
{
|
|
|
@@ -113,30 +159,34 @@
|
|
|
fixed: 'left'
|
|
|
},
|
|
|
{ label: '提现时间', prop: 'createTime', align: 'center', width: 180 },
|
|
|
- { label: '用户UID', prop: 'uid', align: 'center', minWidth: 140 },
|
|
|
+ { label: '用户名', prop: 'nickName', align: 'center', minWidth: 140 },
|
|
|
{
|
|
|
label: '支付单号/流水号',
|
|
|
- prop: 'paymentCode',
|
|
|
+ prop: 'transferNo',
|
|
|
align: 'center',
|
|
|
minWidth: 160
|
|
|
},
|
|
|
- { label: '对方账户', prop: 'addressDetail', align: 'center' },
|
|
|
- { label: '金额', prop: 'money', align: 'center' },
|
|
|
+ {
|
|
|
+ label: '对方账户',
|
|
|
+ prop: 'withdrawType',
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) =>
|
|
|
+ withdrawTypeDicts.value.find((d) => d.value == row.withdrawType)
|
|
|
+ ?.label
|
|
|
+ },
|
|
|
+ { label: '金额', prop: 'withdrawMoney', align: 'center' },
|
|
|
{
|
|
|
label: '交易状态',
|
|
|
- prop: 'useStatus',
|
|
|
+ prop: 'status',
|
|
|
align: 'center',
|
|
|
formatter: (row) =>
|
|
|
- useStatusDicts.value.find((d) => d.dictValue == row.useStatus)
|
|
|
- ?.dictLabel
|
|
|
+ statusDicts.value.find((d) => d.dictValue == row.status)?.dictLabel
|
|
|
},
|
|
|
{
|
|
|
label: '交易类型',
|
|
|
- prop: 'paymentType',
|
|
|
+ prop: 'withdrawType',
|
|
|
align: 'center',
|
|
|
- formatter: (row) =>
|
|
|
- useStatusDicts.value.find((d) => d.dictValue == row.useStatus)
|
|
|
- ?.dictLabel
|
|
|
+ formatter: (row) => '提现'
|
|
|
},
|
|
|
{
|
|
|
columnKey: 'action',
|
|
|
@@ -150,10 +200,10 @@
|
|
|
|
|
|
/** 页面组件实例 */
|
|
|
const pageRef = ref(null);
|
|
|
+ const auditDialogRef = ref(null);
|
|
|
|
|
|
const pageConfig = reactive({
|
|
|
- pageUrl: '/baseinfo/godown/pagelist',
|
|
|
- exportUrl: '/baseinfo/godown/export',
|
|
|
+ pageUrl: '/sys/finance/withdrawList',
|
|
|
fileName: '提现管理',
|
|
|
cacheKey: 'withdrawalTable'
|
|
|
});
|
|
|
@@ -164,19 +214,17 @@
|
|
|
}
|
|
|
|
|
|
//审核
|
|
|
- function handleAudit(row) {
|
|
|
- pageRef.value?.messageBoxConfirm({
|
|
|
- message: '确认审核?',
|
|
|
- fetch: () => {}
|
|
|
- });
|
|
|
+ function handleChangeStatus(row) {
|
|
|
+ auditDialogRef.value?.handleOpen(row.id);
|
|
|
}
|
|
|
|
|
|
- //编辑页面
|
|
|
- const editRef = ref(null);
|
|
|
- function handleStepAudit(row) {
|
|
|
- pageRef.value?.messageBoxConfirm({
|
|
|
- message: '确认一键审核?',
|
|
|
- fetch: () => {}
|
|
|
- });
|
|
|
+ //一键审核
|
|
|
+ function handleStepAudit() {
|
|
|
+ const selections = pageRef.value?.getSelections();
|
|
|
+ if (!selections?.length) {
|
|
|
+ ElMessage.warning('请至少选择一条数据');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ auditDialogRef.value?.handleOpen(selections.map(item => item.id));
|
|
|
}
|
|
|
</script>
|