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 1/3] 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: '', }; From b85589e40e7d5fba8ae414c7239942c8fc186661 Mon Sep 17 00:00:00 2001 From: liangzai <2440983361@qq.com> Date: Sun, 1 Feb 2026 17:59:25 +0800 Subject: [PATCH 2/3] f --- .../src/views/agent/agent-withdrawal/list.vue | 11 + .../agent-withdrawal/modules/review-modal.vue | 282 ++++++++++-------- 2 files changed, 171 insertions(+), 122 deletions(-) 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 5b7467c..f5b0208 100644 --- a/apps/web-antd/src/views/agent/agent-withdrawal/list.vue +++ b/apps/web-antd/src/views/agent/agent-withdrawal/list.vue @@ -40,6 +40,10 @@ function onActionClick(e: any) { // 打开审核弹窗 reviewDrawerApi.setData(row).open(); break; + case 'detail': + // 已审核记录:仅查看详情(只读) + reviewDrawerApi.setData({ ...row, _isDetailView: true }).open(); + break; } } @@ -98,6 +102,13 @@ const [Grid, gridApi] = useVbenVxeGrid({ > 审核 + 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 4632f0f..dbc46bf 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 @@ -14,98 +14,30 @@ const emit = defineEmits<{ }>(); const formData = ref(null); +// 用于纯文字展示与实时计算:当前选择的审核操作、扣税比例 +const currentAction = ref<1 | 2>(1); +const currentTaxRatePercent = ref(6); -// 表单配置(包含所有字段) +const typeMap: Record = { + 1: '支付宝', + 2: '银行卡', +}; + +// 根据当前扣税比例与提现金额实时计算 +const previewTaxAmount = computed(() => { + const amount = formData.value?.amount; + if (amount == null || typeof amount !== 'number') return 0; + const rate = currentTaxRatePercent.value / 100; + return Math.round(amount * rate * 100) / 100; +}); +const previewActualAmount = computed(() => { + const amount = formData.value?.amount; + if (amount == null || typeof amount !== 'number') return 0; + return Math.round((amount - previewTaxAmount.value) * 100) / 100; +}); + +// 表单只保留:审核操作、扣税比例、备注 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: '¥', - }, - }, - // 银行卡和支付宝通用字段:实际转账金额 - { - component: 'InputNumber', - fieldName: 'actual_amount', - label: '实际转账金额', - componentProps: { - disabled: true, - min: 0, - precision: 2, - style: { width: '100%' }, - addonBefore: '¥', - }, - }, - // 银行卡和支付宝都有:收款账号 - { - 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', @@ -116,10 +48,12 @@ const getFormSchema = (): VbenFormSchema[] => [ { label: '确认提现', value: 1 }, { label: '拒绝提现', value: 2 }, ], + onChange: (v: number) => { + currentAction.value = v as 1 | 2; + }, }, rules: 'required', }, - // 确认时可编辑扣税比例,默认 6% { component: 'InputNumber', fieldName: 'tax_rate_percent', @@ -133,6 +67,9 @@ const getFormSchema = (): VbenFormSchema[] => [ style: { width: '100%' }, addonAfter: '%', placeholder: '默认 6', + onChange: (v: number | null) => { + currentTaxRatePercent.value = v ?? 6; + }, }, dependencies: { show: (values) => values.action === 1, @@ -162,6 +99,10 @@ const [Form, formApi] = useVbenForm({ const [Drawer, drawerApi] = useVbenDrawer({ class: 'agent-withdrawal-review-drawer', async onConfirm() { + if (formData.value?._isDetailView) { + drawerApi.close(); + return; + } const { valid } = await formApi.validate(); if (!valid) return; @@ -208,36 +149,16 @@ const [Drawer, drawerApi] = useVbenDrawer({ formApi.resetForm(); if (data) { formData.value = data; - - // 根据提现类型设置不同的表单初始值 - const typeMap: Record = { - 1: '支付宝', - 2: '银行卡', - }; - const initialValues: any = { - withdraw_no: data.withdraw_no || '', - withdraw_type: typeMap[data.withdraw_type] || '未知', - amount: data.amount || 0, - action: 1, // 默认选择确认 - tax_rate_percent: 6, // 扣税比例默认 6% - 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 || ''; + currentAction.value = 1; + currentTaxRatePercent.value = 6; + if (!data._isDetailView) { + const initialValues: any = { + action: 1, + tax_rate_percent: 6, + remark: '', + }; + formApi.setValues(initialValues); } - - formApi.setValues(initialValues); } } }, @@ -249,14 +170,91 @@ const getDrawerTitle = computed(() => { 2: '银行卡', }; const typeName = typeMap[formData.value?.withdraw_type] || '未知'; - return `${typeName}提现审核 ${formData.value?.withdraw_no || ''}`; + const suffix = formData.value?._isDetailView ? '详情' : '审核'; + return `${typeName}提现${suffix} ${formData.value?.withdraw_no || ''}`; }); + +const isDetailView = computed(() => !!formData.value?._isDetailView); + +const statusMap: Record = { + 1: '申请中', + 2: '成功', + 3: '失败', +}; @@ -268,6 +266,46 @@ const getDrawerTitle = computed(() => { overflow-y: auto; } +.review-info-block { + margin-bottom: 20px; + padding: 16px; + background: var(--ant-color-fill-quaternary); + border-radius: 8px; +} + +.info-row { + display: flex; + align-items: baseline; + margin-bottom: 10px; + font-size: 14px; +} + +.info-row:last-child { + margin-bottom: 0; +} + +.info-row.highlight .info-value { + font-weight: 600; + color: var(--ant-color-primary); +} + +.info-label { + flex-shrink: 0; + width: 120px; + color: var(--ant-color-text-secondary); +} + +.info-value { + flex: 1; + color: var(--ant-color-text); +} + +.info-hint { + margin-left: 8px; + font-size: 12px; + color: var(--ant-color-text-tertiary); +} + .agent-withdrawal-review-content :deep(.ant-form-item) { margin-bottom: 16px; } From fd7e9aa91fb40045b5a023e0c0d9e541b93b6cd1 Mon Sep 17 00:00:00 2001 From: liangzai <2440983361@qq.com> Date: Sun, 1 Feb 2026 19:03:27 +0800 Subject: [PATCH 3/3] f --- apps/web-antd/src/api/order/query.ts | 10 +++++ .../src/views/order/query/query-details.vue | 45 +++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/apps/web-antd/src/api/order/query.ts b/apps/web-antd/src/api/order/query.ts index 215697a..26d5717 100644 --- a/apps/web-antd/src/api/order/query.ts +++ b/apps/web-antd/src/api/order/query.ts @@ -13,6 +13,11 @@ export namespace OrderQueryApi { order_id: number; user_id: number; product_name: string; + order_no?: string; + platform_order_id?: string; + payment_status?: string; + pay_time?: string; + refund_time?: string; query_params: Recordable; query_data: QueryItem[]; create_time: string; @@ -29,6 +34,11 @@ export namespace OrderQueryApi { order_id: number; user_id: number; product_name: string; + order_no?: string; + platform_order_id?: string; + payment_status?: string; + pay_time?: string; + refund_time?: string; query_params: Recordable; query_data: QueryItem[]; create_time: string; diff --git a/apps/web-antd/src/views/order/query/query-details.vue b/apps/web-antd/src/views/order/query/query-details.vue index ee7580c..4cd9296 100644 --- a/apps/web-antd/src/views/order/query/query-details.vue +++ b/apps/web-antd/src/views/order/query/query-details.vue @@ -44,6 +44,34 @@ function getQueryStateConfig(state: string) { ); } +// 支付状态文案 +const paymentStatusMap: Record = { + pending: '待支付', + paid: '已支付', + refunded: '已退款', + refunding: '退款中', + closed: '已关闭', + failed: '支付失败', +}; +function getPaymentStatusLabel(status: string | undefined) { + if (!status) return '-'; + return paymentStatusMap[status] ?? status; +} + +// 支付状态颜色 +const paymentStatusColorMap: Record = { + pending: 'warning', + paid: 'success', + refunded: 'default', + refunding: 'processing', + closed: 'default', + failed: 'error', +}; +function getPaymentStatusColor(status: string | undefined) { + if (!status) return 'default'; + return paymentStatusColorMap[status] ?? 'default'; +} + // 字段名称映射 const fieldNameMap: Record = { // 基础字段 @@ -143,6 +171,23 @@ onMounted(() => { {{ queryDetail.product_name }} + + {{ queryDetail.order_no ?? '-' }} + + + {{ queryDetail.platform_order_id ?? '-' }} + + + + {{ getPaymentStatusLabel(queryDetail.payment_status) }} + + + + {{ queryDetail.pay_time ?? '-' }} + + + {{ queryDetail.refund_time ?? '-' }} + {{ queryDetail.create_time }}