fix
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled

This commit is contained in:
2026-01-04 18:58:18 +08:00
parent d3c32c23fd
commit 1d17926c70
3 changed files with 194 additions and 107 deletions

View File

@@ -14,6 +14,18 @@ export function useWithdrawalColumns(): VxeTableGridOptions['columns'] {
width: 120, width: 120,
formatter: ({ cellValue }) => `¥${cellValue?.toFixed(2) || '0.00'}`, formatter: ({ cellValue }) => `¥${cellValue?.toFixed(2) || '0.00'}`,
}, },
{
title: '扣税金额',
field: 'tax_amount',
width: 120,
formatter: ({ cellValue }) => `¥${cellValue?.toFixed(2) || '0.00'}`,
},
{
title: '实际转账金额',
field: 'actual_amount',
width: 120,
formatter: ({ cellValue }) => `¥${cellValue?.toFixed(2) || '0.00'}`,
},
{ {
title: '提现类型', title: '提现类型',
field: 'withdraw_type', field: 'withdraw_type',

View File

@@ -92,7 +92,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
<template #operation="{ row }"> <template #operation="{ row }">
<Space> <Space>
<Button <Button
v-if="row.withdraw_type === 2 && row.status === 1" v-if="row.status === 1"
type="link" type="link"
@click="onActionClick({ code: 'review', row })" @click="onActionClick({ code: 'review', row })"
> >

View File

@@ -7,6 +7,7 @@ import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form'; import { useVbenForm } from '#/adapter/form';
import { reviewBankCardWithdrawal } from '#/api/agent'; import { reviewBankCardWithdrawal } from '#/api/agent';
import type { VbenFormSchema } from '#/adapter/form';
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'success'): void; (e: 'success'): void;
@@ -14,8 +15,8 @@ const emit = defineEmits<{
const formData = ref<any>(null); const formData = ref<any>(null);
const [Form, formApi] = useVbenForm({ // 表单配置(包含所有字段)
schema: [ const getFormSchema = (): VbenFormSchema[] => [
{ {
component: 'Input', component: 'Input',
fieldName: 'withdraw_no', fieldName: 'withdraw_no',
@@ -24,6 +25,14 @@ const [Form, formApi] = useVbenForm({
disabled: true, disabled: true,
}, },
}, },
{
component: 'Input',
fieldName: 'withdraw_type',
label: '提现类型',
componentProps: {
disabled: true,
},
},
{ {
component: 'InputNumber', component: 'InputNumber',
fieldName: 'amount', fieldName: 'amount',
@@ -36,6 +45,7 @@ const [Form, formApi] = useVbenForm({
addonBefore: '¥', addonBefore: '¥',
}, },
}, },
// 银行卡提现特有字段:扣税金额
{ {
component: 'InputNumber', component: 'InputNumber',
fieldName: 'tax_amount', fieldName: 'tax_amount',
@@ -47,7 +57,12 @@ const [Form, formApi] = useVbenForm({
style: { width: '100%' }, style: { width: '100%' },
addonBefore: '¥', addonBefore: '¥',
}, },
dependencies: {
show: (values) => values.withdraw_type === '银行卡',
triggerFields: ['withdraw_type'],
}, },
},
// 银行卡提现特有字段:实际转账金额
{ {
component: 'InputNumber', component: 'InputNumber',
fieldName: 'actual_amount', fieldName: 'actual_amount',
@@ -59,15 +74,21 @@ const [Form, formApi] = useVbenForm({
style: { width: '100%' }, style: { width: '100%' },
addonBefore: '¥', addonBefore: '¥',
}, },
dependencies: {
show: (values) => values.withdraw_type === '银行卡',
triggerFields: ['withdraw_type'],
}, },
},
// 银行卡和支付宝都有:收款账号
{ {
component: 'Input', component: 'Input',
fieldName: 'bank_card_no', fieldName: 'payee_account',
label: '银行卡号', label: '收款账号',
componentProps: { componentProps: {
disabled: true, disabled: true,
}, },
}, },
// 银行卡提现特有字段:开户支行
{ {
component: 'Input', component: 'Input',
fieldName: 'bank_name', fieldName: 'bank_name',
@@ -75,7 +96,12 @@ const [Form, formApi] = useVbenForm({
componentProps: { componentProps: {
disabled: true, disabled: true,
}, },
dependencies: {
show: (values) => values.withdraw_type === '银行卡',
triggerFields: ['withdraw_type'],
}, },
},
// 银行卡提现特有字段:收款人姓名
{ {
component: 'Input', component: 'Input',
fieldName: 'payee_name', fieldName: 'payee_name',
@@ -83,6 +109,10 @@ const [Form, formApi] = useVbenForm({
componentProps: { componentProps: {
disabled: true, disabled: true,
}, },
dependencies: {
show: (values) => values.withdraw_type === '银行卡',
triggerFields: ['withdraw_type'],
},
}, },
{ {
component: 'RadioGroup', component: 'RadioGroup',
@@ -109,11 +139,16 @@ const [Form, formApi] = useVbenForm({
style: { width: '100%' }, style: { width: '100%' },
}, },
}, },
], ];
const [Form, formApi] = useVbenForm({
schema: getFormSchema(),
showDefaultActions: false, showDefaultActions: false,
wrapperClass: 'agent-withdrawal-form-wrapper',
}); });
const [Drawer, drawerApi] = useVbenDrawer({ const [Drawer, drawerApi] = useVbenDrawer({
class: 'agent-withdrawal-review-drawer',
async onConfirm() { async onConfirm() {
const { valid } = await formApi.validate(); const { valid } = await formApi.validate();
if (!valid) return; if (!valid) return;
@@ -153,30 +188,70 @@ const [Drawer, drawerApi] = useVbenDrawer({
formApi.resetForm(); formApi.resetForm();
if (data) { if (data) {
formData.value = data; formData.value = data;
// 设置表单初始值
formApi.setValues({ // 根据提现类型设置不同的表单初始值
const typeMap: Record<number, string> = {
1: '支付宝',
2: '银行卡',
};
const initialValues: any = {
withdraw_no: data.withdraw_no || '', withdraw_no: data.withdraw_no || '',
withdraw_type: typeMap[data.withdraw_type] || '未知',
amount: data.amount || 0, amount: data.amount || 0,
tax_amount: data.tax_amount || 0,
actual_amount: data.actual_amount || 0,
bank_card_no: data.bank_card_no || '',
bank_name: data.bank_name || '',
payee_name: data.payee_name || '',
action: 1, // 默认选择确认 action: 1, // 默认选择确认
remark: '', remark: '',
}); };
// 银行卡提现特有字段
if (data.withdraw_type === 2) {
initialValues.tax_amount = data.tax_amount || 0;
initialValues.actual_amount = data.actual_amount || 0;
initialValues.payee_account = data.bank_card_no || '';
initialValues.bank_name = data.bank_name || '';
initialValues.payee_name = data.payee_name || '';
} else {
// 支付宝提现
initialValues.tax_amount = data.tax_amount || 0;
initialValues.actual_amount = data.actual_amount || 0;
initialValues.payee_account = data.payee_account || '';
}
formApi.setValues(initialValues);
} }
} }
}, },
}); });
const getDrawerTitle = computed(() => { const getDrawerTitle = computed(() => {
return `银行卡提现审核 ${formData.value?.withdraw_no || ''}`; const typeMap: Record<number, string> = {
1: '支付宝',
2: '银行卡',
};
const typeName = typeMap[formData.value?.withdraw_type] || '未知';
return `${typeName}提现审核 ${formData.value?.withdraw_no || ''}`;
}); });
</script> </script>
<template> <template>
<Drawer :title="getDrawerTitle" width="600"> <Drawer :title="getDrawerTitle" :width="800">
<div class="agent-withdrawal-review-content">
<Form /> <Form />
</div>
</Drawer> </Drawer>
</template> </template>
<style scoped>
.agent-withdrawal-review-content {
padding: 0 4px;
max-height: calc(100vh - 120px);
overflow-y: auto;
}
.agent-withdrawal-review-content :deep(.ant-form-item) {
margin-bottom: 16px;
}
.agent-withdrawal-review-content :deep(.ant-form-item-label) {
padding-bottom: 4px;
}
</style>