From 5f88a54d60e0344609b63da04ea97495bbdae884 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 11 Oct 2025 13:47:28 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90mall=20=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E3=80=91=E5=88=86=E9=94=80=E6=8F=90=E7=8E=B0=E7=9A=84=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=EF=BC=88ele=20100%=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/trade/brokerage/withdraw/data.ts | 1 - .../mall/trade/brokerage/withdraw/index.vue | 8 +- .../mall/trade/brokerage/withdraw/data.ts | 26 ++--- .../mall/trade/brokerage/withdraw/index.vue | 104 +++++++++++++----- 4 files changed, 92 insertions(+), 47 deletions(-) diff --git a/apps/web-antd/src/views/mall/trade/brokerage/withdraw/data.ts b/apps/web-antd/src/views/mall/trade/brokerage/withdraw/data.ts index 6eb932f12..86452dd8e 100644 --- a/apps/web-antd/src/views/mall/trade/brokerage/withdraw/data.ts +++ b/apps/web-antd/src/views/mall/trade/brokerage/withdraw/data.ts @@ -73,7 +73,6 @@ export function useGridFormSchema(): VbenFormSchema[] { componentProps: { ...getRangePickerDefaultProps(), allowClear: true, - placeholder: ['开始时间', '结束时间'], }, }, ]; diff --git a/apps/web-antd/src/views/mall/trade/brokerage/withdraw/index.vue b/apps/web-antd/src/views/mall/trade/brokerage/withdraw/index.vue index 36279628c..1c635a489 100644 --- a/apps/web-antd/src/views/mall/trade/brokerage/withdraw/index.vue +++ b/apps/web-antd/src/views/mall/trade/brokerage/withdraw/index.vue @@ -65,7 +65,7 @@ function handleReject(row: MallBrokerageWithdrawApi.BrokerageWithdraw) { }).then(async (val) => { if (val) { await rejectBrokerageWithdraw({ - id: row.id as number, + id: row.id!, auditReason: val, }); handleRefresh(); @@ -189,7 +189,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ :actions="[ { label: '通过', - type: 'link' as const, + type: 'link', icon: ACTION_ICON.EDIT, auth: ['trade:brokerage-withdraw:audit'], ifShow: @@ -199,7 +199,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, { label: '驳回', - type: 'link' as const, + type: 'link', danger: true, icon: ACTION_ICON.DELETE, auth: ['trade:brokerage-withdraw:audit'], @@ -210,7 +210,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, { label: '重新转账', - type: 'link' as const, + type: 'link', icon: ACTION_ICON.REFRESH, auth: ['trade:brokerage-withdraw:audit'], ifShow: diff --git a/apps/web-ele/src/views/mall/trade/brokerage/withdraw/data.ts b/apps/web-ele/src/views/mall/trade/brokerage/withdraw/data.ts index dbf6d094d..86452dd8e 100644 --- a/apps/web-ele/src/views/mall/trade/brokerage/withdraw/data.ts +++ b/apps/web-ele/src/views/mall/trade/brokerage/withdraw/data.ts @@ -15,7 +15,7 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'Input', componentProps: { placeholder: '请输入用户编号', - clearable: true, + allowClear: true, }, }, { @@ -24,7 +24,7 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'Select', componentProps: { placeholder: '请选择提现类型', - clearable: true, + allowClear: true, options: getDictOptions(DICT_TYPE.BROKERAGE_WITHDRAW_TYPE, 'number'), }, }, @@ -34,16 +34,16 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'Input', componentProps: { placeholder: '请输入账号', - clearable: true, + allowClear: true, }, }, { fieldName: 'userName', - label: '真实名字', + label: '真实姓名', component: 'Input', componentProps: { - placeholder: '请输入真实名字', - clearable: true, + placeholder: '请输入真实姓名', + allowClear: true, }, }, { @@ -52,7 +52,7 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'Select', componentProps: { placeholder: '请选择提现银行', - clearable: true, + allowClear: true, options: getDictOptions(DICT_TYPE.BROKERAGE_BANK_NAME, 'string'), }, }, @@ -62,7 +62,7 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'Select', componentProps: { placeholder: '请选择状态', - clearable: true, + allowClear: true, options: getDictOptions(DICT_TYPE.BROKERAGE_WITHDRAW_STATUS, 'number'), }, }, @@ -72,7 +72,7 @@ export function useGridFormSchema(): VbenFormSchema[] { component: 'RangePicker', componentProps: { ...getRangePickerDefaultProps(), - clearable: true, + allowClear: true, }, }, ]; @@ -88,25 +88,25 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { }, { field: 'userId', - title: '用户编号:', + title: '用户编号', minWidth: 80, }, { field: 'userNickname', - title: '用户昵称:', + title: '用户昵称', minWidth: 80, }, { field: 'price', title: '提现金额', minWidth: 80, - formatter: 'formatFenToYuanAmount', + formatter: 'formatAmount2', }, { field: 'feePrice', title: '提现手续费', minWidth: 80, - formatter: 'formatFenToYuanAmount', + formatter: 'formatAmount2', }, { field: 'type', diff --git a/apps/web-ele/src/views/mall/trade/brokerage/withdraw/index.vue b/apps/web-ele/src/views/mall/trade/brokerage/withdraw/index.vue index 0924a9da9..633f9af56 100644 --- a/apps/web-ele/src/views/mall/trade/brokerage/withdraw/index.vue +++ b/apps/web-ele/src/views/mall/trade/brokerage/withdraw/index.vue @@ -12,7 +12,7 @@ import { } from '@vben/constants'; import { formatDateTime } from '@vben/utils'; -import { ElInput, ElMessage } from 'element-plus'; +import { ElInput, ElLoading, ElMessage } from 'element-plus'; import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { @@ -29,16 +29,23 @@ import { useGridColumns, useGridFormSchema } from './data'; defineOptions({ name: 'BrokerageWithdraw' }); /** 刷新表格 */ -function onRefresh() { +function handleRefresh() { gridApi.query(); } /** 审核通过 */ async function handleApprove(row: MallBrokerageWithdrawApi.BrokerageWithdraw) { await confirm('确定要审核通过吗?'); - await approveBrokerageWithdraw(row.id); - ElMessage.success($t('ui.actionMessage.operationSuccess')); - onRefresh(); + const loadingInstance = ElLoading.service({ + text: '审核通过中...', + }); + try { + await approveBrokerageWithdraw(row.id); + ElMessage.success($t('ui.actionMessage.operationSuccess')); + handleRefresh(); + } finally { + loadingInstance.close(); + } } /** 审核驳回 */ @@ -56,11 +63,19 @@ function handleReject(row: MallBrokerageWithdrawApi.BrokerageWithdraw) { modelPropName: 'value', }).then(async (val) => { if (val) { - await rejectBrokerageWithdraw({ - id: row.id as number, - auditReason: val, + const loadingInstance = ElLoading.service({ + text: '审核驳回中...', }); - onRefresh(); + try { + await rejectBrokerageWithdraw({ + id: row.id!, + auditReason: val, + }); + ElMessage.success($t('ui.actionMessage.operationSuccess')); + handleRefresh(); + } finally { + loadingInstance.close(); + } } }); } @@ -70,9 +85,16 @@ async function handleRetryTransfer( row: MallBrokerageWithdrawApi.BrokerageWithdraw, ) { await confirm('确定要重新转账吗?'); - await approveBrokerageWithdraw(row.id); - ElMessage.success($t('ui.actionMessage.operationSuccess')); - onRefresh(); + const loadingInstance = ElLoading.service({ + text: '重新转账中...', + }); + try { + await approveBrokerageWithdraw(row.id); + ElMessage.success($t('ui.actionMessage.operationSuccess')); + handleRefresh(); + } finally { + loadingInstance.close(); + } } const [Grid, gridApi] = useVbenVxeGrid({ @@ -84,7 +106,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ height: 'auto', keepSource: true, cellConfig: { - height: 80, + height: 90, }, proxyConfig: { ajax: { @@ -99,6 +121,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, @@ -112,45 +135,67 @@ const [Grid, gridApi] = useVbenVxeGrid({ - -