From e4cfdc9bb84b5c659bb8b7390b01c61afbc8b6d8 Mon Sep 17 00:00:00 2001 From: liangzai <2440983361@qq.com> Date: Sun, 1 Feb 2026 16:12:13 +0800 Subject: [PATCH] f --- apps/web-antd/src/api/agent/agent.ts | 2 ++ .../src/views/agent/agent-withdrawal/data.ts | 7 +++++ .../agent-withdrawal/modules/review-modal.vue | 29 +++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/apps/web-antd/src/api/agent/agent.ts b/apps/web-antd/src/api/agent/agent.ts index 6404f7e..3649e36 100644 --- a/apps/web-antd/src/api/agent/agent.ts +++ b/apps/web-antd/src/api/agent/agent.ts @@ -588,6 +588,8 @@ export interface ReviewBankCardWithdrawalParams { withdrawal_id: number; action: 1 | 2; // 1-确认, 2-拒绝 remark?: string; + /** 扣税比例,如 0.06 表示 6%,不传则默认 6% */ + tax_rate?: number; } async function reviewBankCardWithdrawal( 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 5681f65..ae578cc 100644 --- a/apps/web-antd/src/views/agent/agent-withdrawal/data.ts +++ b/apps/web-antd/src/views/agent/agent-withdrawal/data.ts @@ -14,6 +14,13 @@ export function useWithdrawalColumns(): VxeTableGridOptions['columns'] { width: 120, formatter: ({ cellValue }) => `¥${cellValue?.toFixed(2) || '0.00'}`, }, + { + title: '扣税比例', + field: 'tax_rate', + width: 90, + formatter: ({ cellValue }) => + cellValue != null ? `${(Number(cellValue) * 100).toFixed(1)}%` : '-', + }, { title: '扣税金额', field: 'tax_amount', 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 index a5ab2d8..4632f0f 100644 --- 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 @@ -119,6 +119,26 @@ const getFormSchema = (): VbenFormSchema[] => [ }, rules: 'required', }, + // 确认时可编辑扣税比例,默认 6% + { + component: 'InputNumber', + fieldName: 'tax_rate_percent', + label: '扣税比例(%)', + defaultValue: 6, + componentProps: { + min: 0, + max: 100, + step: 0.5, + precision: 1, + style: { width: '100%' }, + addonAfter: '%', + placeholder: '默认 6', + }, + dependencies: { + show: (values) => values.action === 1, + triggerFields: ['action'], + }, + }, { component: 'Textarea', fieldName: 'remark', @@ -153,6 +173,7 @@ const [Drawer, drawerApi] = useVbenDrawer({ const values = await formApi.getValues<{ action: 1 | 2; remark: string; + tax_rate_percent?: number; }>(); // 验证拒绝时必须填写原因 @@ -161,11 +182,18 @@ const [Drawer, drawerApi] = useVbenDrawer({ return; } + // 确认时:扣税比例(%)转成小数,如 6 -> 0.06,不传则默认 6% + const taxRate = + values.action === 1 && values.tax_rate_percent != null + ? Number(values.tax_rate_percent) / 100 + : undefined; + try { await reviewBankCardWithdrawal({ action: values.action, remark: values.remark || '', withdrawal_id: formData.value.id, + ...(taxRate != null && { tax_rate: taxRate }), }); message.success(values.action === 1 ? '确认提现成功' : '拒绝提现成功'); drawerApi.close(); @@ -191,6 +219,7 @@ const [Drawer, drawerApi] = useVbenDrawer({ withdraw_type: typeMap[data.withdraw_type] || '未知', amount: data.amount || 0, action: 1, // 默认选择确认 + tax_rate_percent: 6, // 扣税比例默认 6% remark: '', };