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
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:
@@ -14,6 +14,18 @@ export function useWithdrawalColumns(): VxeTableGridOptions['columns'] {
|
||||
width: 120,
|
||||
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: '提现类型',
|
||||
field: 'withdraw_type',
|
||||
|
||||
@@ -92,7 +92,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
<template #operation="{ row }">
|
||||
<Space>
|
||||
<Button
|
||||
v-if="row.withdraw_type === 2 && row.status === 1"
|
||||
v-if="row.status === 1"
|
||||
type="link"
|
||||
@click="onActionClick({ code: 'review', row })"
|
||||
>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { message } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { reviewBankCardWithdrawal } from '#/api/agent';
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'success'): void;
|
||||
@@ -14,106 +15,140 @@ const emit = defineEmits<{
|
||||
|
||||
const formData = ref<any>(null);
|
||||
|
||||
// 表单配置(包含所有字段)
|
||||
const getFormSchema = (): VbenFormSchema[] => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'withdraw_no',
|
||||
label: '提现单号',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'withdraw_type',
|
||||
label: '提现类型',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'InputNumber',
|
||||
fieldName: 'amount',
|
||||
label: '提现金额',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
min: 0,
|
||||
precision: 2,
|
||||
style: { width: '100%' },
|
||||
addonBefore: '¥',
|
||||
},
|
||||
},
|
||||
// 银行卡提现特有字段:扣税金额
|
||||
{
|
||||
component: 'InputNumber',
|
||||
fieldName: 'tax_amount',
|
||||
label: '扣税金额',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
min: 0,
|
||||
precision: 2,
|
||||
style: { width: '100%' },
|
||||
addonBefore: '¥',
|
||||
},
|
||||
dependencies: {
|
||||
show: (values) => values.withdraw_type === '银行卡',
|
||||
triggerFields: ['withdraw_type'],
|
||||
},
|
||||
},
|
||||
// 银行卡提现特有字段:实际转账金额
|
||||
{
|
||||
component: 'InputNumber',
|
||||
fieldName: 'actual_amount',
|
||||
label: '实际转账金额',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
min: 0,
|
||||
precision: 2,
|
||||
style: { width: '100%' },
|
||||
addonBefore: '¥',
|
||||
},
|
||||
dependencies: {
|
||||
show: (values) => values.withdraw_type === '银行卡',
|
||||
triggerFields: ['withdraw_type'],
|
||||
},
|
||||
},
|
||||
// 银行卡和支付宝都有:收款账号
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'payee_account',
|
||||
label: '收款账号',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
// 银行卡提现特有字段:开户支行
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'bank_name',
|
||||
label: '开户支行',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
dependencies: {
|
||||
show: (values) => values.withdraw_type === '银行卡',
|
||||
triggerFields: ['withdraw_type'],
|
||||
},
|
||||
},
|
||||
// 银行卡提现特有字段:收款人姓名
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'payee_name',
|
||||
label: '收款人姓名',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
dependencies: {
|
||||
show: (values) => values.withdraw_type === '银行卡',
|
||||
triggerFields: ['withdraw_type'],
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'RadioGroup',
|
||||
fieldName: 'action',
|
||||
label: '审核操作',
|
||||
defaultValue: 1,
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '确认提现', value: 1 },
|
||||
{ label: '拒绝提现', value: 2 },
|
||||
],
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'Textarea',
|
||||
fieldName: 'remark',
|
||||
label: '备注',
|
||||
componentProps: {
|
||||
rows: 4,
|
||||
placeholder: '拒绝提现时,请填写拒绝原因',
|
||||
maxLength: 200,
|
||||
showCount: true,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
schema: [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'withdraw_no',
|
||||
label: '提现单号',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'InputNumber',
|
||||
fieldName: 'amount',
|
||||
label: '提现金额',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
min: 0,
|
||||
precision: 2,
|
||||
style: { width: '100%' },
|
||||
addonBefore: '¥',
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'InputNumber',
|
||||
fieldName: 'tax_amount',
|
||||
label: '扣税金额',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
min: 0,
|
||||
precision: 2,
|
||||
style: { width: '100%' },
|
||||
addonBefore: '¥',
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'InputNumber',
|
||||
fieldName: 'actual_amount',
|
||||
label: '实际转账金额',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
min: 0,
|
||||
precision: 2,
|
||||
style: { width: '100%' },
|
||||
addonBefore: '¥',
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'bank_card_no',
|
||||
label: '银行卡号',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'bank_name',
|
||||
label: '开户支行',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'payee_name',
|
||||
label: '收款人姓名',
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'RadioGroup',
|
||||
fieldName: 'action',
|
||||
label: '审核操作',
|
||||
defaultValue: 1,
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '确认提现', value: 1 },
|
||||
{ label: '拒绝提现', value: 2 },
|
||||
],
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'Textarea',
|
||||
fieldName: 'remark',
|
||||
label: '备注',
|
||||
componentProps: {
|
||||
rows: 4,
|
||||
placeholder: '拒绝提现时,请填写拒绝原因',
|
||||
maxLength: 200,
|
||||
showCount: true,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
],
|
||||
schema: getFormSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'agent-withdrawal-form-wrapper',
|
||||
});
|
||||
|
||||
const [Drawer, drawerApi] = useVbenDrawer({
|
||||
class: 'agent-withdrawal-review-drawer',
|
||||
async onConfirm() {
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) return;
|
||||
@@ -153,30 +188,70 @@ const [Drawer, drawerApi] = useVbenDrawer({
|
||||
formApi.resetForm();
|
||||
if (data) {
|
||||
formData.value = data;
|
||||
// 设置表单初始值
|
||||
formApi.setValues({
|
||||
|
||||
// 根据提现类型设置不同的表单初始值
|
||||
const typeMap: Record<number, string> = {
|
||||
1: '支付宝',
|
||||
2: '银行卡',
|
||||
};
|
||||
const initialValues: any = {
|
||||
withdraw_no: data.withdraw_no || '',
|
||||
withdraw_type: typeMap[data.withdraw_type] || '未知',
|
||||
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, // 默认选择确认
|
||||
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(() => {
|
||||
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>
|
||||
|
||||
<template>
|
||||
<Drawer :title="getDrawerTitle" width="600">
|
||||
<Form />
|
||||
<Drawer :title="getDrawerTitle" :width="800">
|
||||
<div class="agent-withdrawal-review-content">
|
||||
<Form />
|
||||
</div>
|
||||
</Drawer>
|
||||
</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>
|
||||
|
||||
Reference in New Issue
Block a user