f
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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: '',
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user