更新提现相关功能,新增已批准提现列表页面及路由,优化提现和待审核提现页面的数据获取逻辑,添加过滤功能
This commit is contained in:
133
src/views/withdraw/approved/index.vue
Normal file
133
src/views/withdraw/approved/index.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<script lang="ts" setup>
|
||||
import { h, ref, useTemplateRef } from 'vue';
|
||||
import { NDatePicker, NInputNumber, useDialog, useMessage } from 'naive-ui';
|
||||
import dayjs from 'dayjs';
|
||||
import { client, safeClient } from '@/service/api';
|
||||
import type { TableBaseColumns, TableFetchData, TableInst } from '@/components/table';
|
||||
|
||||
const dialog = useDialog();
|
||||
const message = useMessage();
|
||||
const tableInst = useTemplateRef<TableInst>('tableInst');
|
||||
|
||||
const fetchData: TableFetchData = ({ pagination, filter }) => {
|
||||
return safeClient(() =>
|
||||
client.api.admin.withdraw.approved.get({
|
||||
query: {
|
||||
...pagination,
|
||||
...filter
|
||||
}
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
const columns: TableBaseColumns = [
|
||||
{
|
||||
title: 'ID',
|
||||
key: 'id'
|
||||
},
|
||||
{
|
||||
title: '提现金额',
|
||||
key: 'amount'
|
||||
},
|
||||
{
|
||||
title: '实际到账金额',
|
||||
key: 'actualAmount'
|
||||
},
|
||||
{
|
||||
title: '资产代码',
|
||||
key: 'assetCode'
|
||||
},
|
||||
{
|
||||
title: '银行卡ID',
|
||||
key: 'bankAccountId'
|
||||
},
|
||||
{
|
||||
title: '银行转账凭证',
|
||||
key: 'bankTransferProof'
|
||||
},
|
||||
{
|
||||
title: '现金代理ID',
|
||||
key: 'cashAgentId'
|
||||
},
|
||||
{
|
||||
title: '现金提取时间',
|
||||
key: 'cashPickedUpAt',
|
||||
render(row: any) {
|
||||
return h('span', {}, row.cashPickedUpAt ? dayjs(row.cashPickedUpAt).format('YYYY-MM-DD HH:mm:ss') : '-');
|
||||
}
|
||||
},
|
||||
{ title: '现金提取码', key: 'cashPickupCode' },
|
||||
{
|
||||
title: 'createdAt',
|
||||
key: 'createdAt',
|
||||
render(row: any) {
|
||||
return h('span', {}, row.createdAt ? dayjs(row.createdAt).format('YYYY-MM-DD HH:mm:ss') : '-');
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'updatedAt',
|
||||
key: 'updatedAt',
|
||||
render(row: any) {
|
||||
return h('span', {}, row.updatedAt ? dayjs(row.updatedAt).format('YYYY-MM-DD HH:mm:ss') : '-');
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'deletedAt',
|
||||
key: 'deletedAt',
|
||||
render(row: any) {
|
||||
return h('span', {}, row.deletedAt ? dayjs(row.deletedAt).format('YYYY-MM-DD HH:mm:ss') : '-');
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
key: 'operation',
|
||||
width: 160,
|
||||
operations: (row: any) => [
|
||||
{
|
||||
contentText: '编辑',
|
||||
type: 'primary',
|
||||
onClick: () => {
|
||||
tableInst.value?.reload();
|
||||
}
|
||||
},
|
||||
{
|
||||
contentText: '删除',
|
||||
type: 'error',
|
||||
ghost: true,
|
||||
size: 'small',
|
||||
onClick: async () => {
|
||||
dialog.create({
|
||||
title: '提示',
|
||||
positiveText: '是',
|
||||
negativeText: '否',
|
||||
content: '确认删除该银行信息?',
|
||||
onPositiveClick: async () => {
|
||||
safeClient(() =>
|
||||
client.api.admin.deposit.reject({ orderId: row.id as string }).post({
|
||||
reviewNote: '管理员拒绝充值'
|
||||
})
|
||||
);
|
||||
// tableInst.value?.reload();
|
||||
message.success('删除成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
const filterColumns: TableFilterColumns = [
|
||||
{
|
||||
title: '提现金额',
|
||||
key: 'amount'
|
||||
}
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<TableBase ref="tableInst" :columns="columns" :filter-columns="filterColumns" :fetch-data="fetchData" />
|
||||
</template>
|
||||
|
||||
<style lang="css" scoped></style>
|
||||
Reference in New Issue
Block a user