diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100644 index 270ebb8..0000000 --- a/.husky/commit-msg +++ /dev/null @@ -1,6 +0,0 @@ -echo Start running commit-msg hook... - -# Check whether the git commit information is standardized -pnpm exec commitlint --edit "$1" - -echo Run commit-msg hook done. diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100644 index 5dccee2..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,7 +0,0 @@ -# update `.vscode/vben-admin.code-workspace` file -pnpm vsh code-workspace --auto-commit - -# Format and submit code according to lintstagedrc.js configuration -pnpm exec lint-staged - -echo Run pre-commit hook done. diff --git a/apps/web-antd/src/api/agent/agent.ts b/apps/web-antd/src/api/agent/agent.ts index 95aed33..37ec306 100644 --- a/apps/web-antd/src/api/agent/agent.ts +++ b/apps/web-antd/src/api/agent/agent.ts @@ -111,10 +111,16 @@ export namespace AgentApi { agent_id: number; withdraw_no: string; amount: number; + actual_amount: number; // 实际到账金额(扣税后) + tax_amount: number; // 扣税金额 status: number; payee_account: string; remark: string; create_time: string; + withdraw_type: number; // 提现类型:1-支付宝,2-银行卡 + bank_card_no?: string; // 银行卡号 + bank_name?: string; // 开户支行 + payee_name?: string; // 收款人姓名 } export interface AgentWithdrawalList { @@ -128,6 +134,8 @@ export namespace AgentApi { agent_id?: number; status?: number; withdraw_no?: string; + status?: number; + withdraw_no?: string; } // 代理上级抽佣相关接口 @@ -446,6 +454,24 @@ async function updateAgentMembershipConfig( ); } +/** + * 银行卡提现审核 + */ +export interface ReviewBankCardWithdrawalParams { + withdrawal_id: number; + action: 1 | 2; // 1-确认, 2-拒绝 + remark?: string; +} + +async function reviewBankCardWithdrawal( + params: ReviewBankCardWithdrawalParams, +) { + return requestClient.post<{ success: boolean }>( + '/agent/agent-withdrawal/bank-card/review', + params, + ); +} + export { getAgentCommissionDeductionList, getAgentCommissionList, @@ -457,6 +483,7 @@ export { getAgentRewardList, getAgentWithdrawalList, getMembershipRechargeOrderList, + reviewBankCardWithdrawal, updateAgentMembershipConfig, updateAgentProductionConfig, }; diff --git a/apps/web-antd/src/preferences.ts b/apps/web-antd/src/preferences.ts index c27c961..726b105 100644 --- a/apps/web-antd/src/preferences.ts +++ b/apps/web-antd/src/preferences.ts @@ -15,7 +15,7 @@ export const overridesPreferences = defineOverridesPreferences({ source: 'https://ctrlph.tianyuandb.com/logo.png', }, copyright: { - companyName: '海南天远大数据科技有限公司', + companyName: '海南海宇大数据有限公司', companySiteLink: 'https://www.tianyuandb.com', date: '2025', icp: '琼ICP备2024048057号-1', diff --git a/apps/web-antd/src/views/agent/agent-withdrawal/data.ts b/apps/web-antd/src/views/agent/agent-withdrawal/data.ts index d2bbfb9..9d18837 100644 --- a/apps/web-antd/src/views/agent/agent-withdrawal/data.ts +++ b/apps/web-antd/src/views/agent/agent-withdrawal/data.ts @@ -1,9 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -type WithdrawalMethod = 'alipay' | 'bank' | 'wechat'; -type WithdrawalStatus = 'approved' | 'failed' | 'paid' | 'pending' | 'rejected'; - export function useWithdrawalColumns(): VxeTableGridOptions['columns'] { return [ { @@ -15,39 +12,88 @@ export function useWithdrawalColumns(): VxeTableGridOptions['columns'] { title: '提现金额', field: 'amount', width: 120, - formatter: ({ cellValue }) => `¥${cellValue.toFixed(2)}`, + formatter: ({ cellValue }) => `¥${cellValue?.toFixed(2) || '0.00'}`, }, { - title: '提现方式', - field: 'method', - width: 120, - formatter: ({ cellValue }: { cellValue: WithdrawalMethod }) => { - const methodMap: Record = { - alipay: '支付宝', - wechat: '微信', - bank: '银行卡', + title: '提现类型', + field: 'withdraw_type', + width: 100, + formatter: ({ cellValue }) => { + const typeMap: Record = { + 1: '支付宝', + 2: '银行卡', }; - return methodMap[cellValue] || cellValue; + return typeMap[cellValue] || '未知'; }, }, { - title: '收款账号', - field: 'account', - width: 180, + title: '收款信息', + field: 'payee_info', + width: 200, + formatter: ({ row }) => { + if (row.withdraw_type === 1) { + // 支付宝提现 + return row.payee_account || '-'; + } else if (row.withdraw_type === 2) { + // 银行卡提现 + if (row.bank_card_no) { + const cardNo = row.bank_card_no.replaceAll(/\s/g, ''); + const masked = + cardNo.length > 8 + ? `${cardNo.slice(0, 4)} **** **** ${cardNo.slice( + Math.max(0, cardNo.length - 4), + )}` + : cardNo; + return `${masked}${row.bank_name ? ` (${row.bank_name})` : ''}`; + } + return '-'; + } + return '-'; + }, + }, + { + title: '收款人', + field: 'payee_name', + width: 120, + formatter: ({ cellValue, row }) => { + if (row.withdraw_type === 2 && cellValue) { + return cellValue; + } + return '-'; + }, }, { title: '状态', field: 'status', width: 100, - formatter: ({ cellValue }: { cellValue: WithdrawalStatus }) => { - const statusMap: Record = { - pending: '待审核', - approved: '已通过', - rejected: '已拒绝', - paid: '已打款', - failed: '打款失败', + formatter: ({ cellValue }) => { + const statusMap: Record = { + 1: '申请中', + 2: '成功', + 3: '失败', }; - return statusMap[cellValue] || cellValue; + return statusMap[cellValue] || '未知'; + }, + cellRender: { + name: 'VxeTag', + props: ({ row }) => { + const statusConfig: Record< + number, + { content: string; type: string } + > = { + 1: { type: 'warning', content: '申请中' }, + 2: { type: 'success', content: '成功' }, + 3: { type: 'error', content: '失败' }, + }; + const config = statusConfig[row.status] || { + type: 'info', + content: '未知', + }; + return { + type: config.type, + content: config.content, + }; + }, }, }, { @@ -55,20 +101,19 @@ export function useWithdrawalColumns(): VxeTableGridOptions['columns'] { field: 'create_time', width: 180, }, - { - title: '审核时间', - field: 'audit_time', - width: 180, - }, - { - title: '打款时间', - field: 'pay_time', - width: 180, - }, { title: '备注', field: 'remark', width: 200, + formatter: ({ cellValue }) => cellValue || '-', + }, + { + align: 'center', + slots: { default: 'operation' }, + field: 'operation', + fixed: 'right', + title: '操作', + width: 120, }, ]; } @@ -76,14 +121,13 @@ export function useWithdrawalColumns(): VxeTableGridOptions['columns'] { export function useWithdrawalFormSchema(): VbenFormSchema[] { return [ { - fieldName: 'method', - label: '提现方式', + fieldName: 'withdraw_type', + label: '提现类型', component: 'Select', componentProps: { options: [ - { label: '支付宝', value: 'alipay' }, - { label: '微信', value: 'wechat' }, - { label: '银行卡', value: 'bank' }, + { label: '支付宝', value: 1 }, + { label: '银行卡', value: 2 }, ], allowClear: true, }, @@ -94,11 +138,9 @@ export function useWithdrawalFormSchema(): VbenFormSchema[] { component: 'Select', componentProps: { options: [ - { label: '待审核', value: 'pending' }, - { label: '已通过', value: 'approved' }, - { label: '已拒绝', value: 'rejected' }, - { label: '已打款', value: 'paid' }, - { label: '打款失败', value: 'failed' }, + { label: '申请中', value: 1 }, + { label: '成功', value: 2 }, + { label: '失败', value: 3 }, ], allowClear: true, }, diff --git a/apps/web-antd/src/views/agent/agent-withdrawal/list.vue b/apps/web-antd/src/views/agent/agent-withdrawal/list.vue index 0b58301..408dd51 100644 --- a/apps/web-antd/src/views/agent/agent-withdrawal/list.vue +++ b/apps/web-antd/src/views/agent/agent-withdrawal/list.vue @@ -1,11 +1,13 @@ diff --git a/apps/web-antd/src/views/agent/agent-withdrawal/modules/review-modal.vue b/apps/web-antd/src/views/agent/agent-withdrawal/modules/review-modal.vue new file mode 100644 index 0000000..404870d --- /dev/null +++ b/apps/web-antd/src/views/agent/agent-withdrawal/modules/review-modal.vue @@ -0,0 +1,182 @@ + + + diff --git a/apps/web-antd/vite.config.mts b/apps/web-antd/vite.config.mts index 25e0f1b..d085397 100644 --- a/apps/web-antd/vite.config.mts +++ b/apps/web-antd/vite.config.mts @@ -10,10 +10,10 @@ export default defineConfig(async () => { changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ''), // mock代理目标地址 - // target: 'http://localhost:8888/api', + target: 'http://localhost:8888/api', // target: 'https://www.tianyuandb.com/api', // target: 'https://www.zhinengcha.cn/api', - target: 'https://www.quannengcha./api', + // target: 'https://www.quannengcha./api', ws: true, }, },