diff --git a/apps/web-antd/src/views/mall/trade/delivery/expressTemplate/data.ts b/apps/web-antd/src/views/mall/trade/delivery/expressTemplate/data.ts index 048b68aab..c8b9334e5 100644 --- a/apps/web-antd/src/views/mall/trade/delivery/expressTemplate/data.ts +++ b/apps/web-antd/src/views/mall/trade/delivery/expressTemplate/data.ts @@ -6,6 +6,80 @@ import { getDictOptions } from '@vben/hooks'; import { z } from '#/adapter/form'; +/** 运费设置表格列 */ +export function useChargesColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'seq', title: '序号', width: 50 }, + { + field: 'areaIds', + title: '区域', + minWidth: 300, + slots: { default: 'areaIds' }, + }, + { + field: 'startCount', + title: '首件数', + width: 120, + slots: { default: 'startCount' }, + }, + { + field: 'startPrice', + title: '运费(元)', + width: 120, + slots: { default: 'startPrice' }, + }, + { + field: 'extraCount', + title: '续件数', + width: 120, + slots: { default: 'extraCount' }, + }, + { + field: 'extraPrice', + title: '续费(元)', + width: 120, + slots: { default: 'extraPrice' }, + }, + { + title: '操作', + width: 80, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 包邮设置表格列 */ +export function useFreesColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'seq', title: '序号', width: 50 }, + { + field: 'areaIds', + title: '区域', + minWidth: 300, + slots: { default: 'areaIds' }, + }, + { + field: 'freeCount', + title: '包邮件数', + width: 120, + slots: { default: 'freeCount' }, + }, + { + field: 'freePrice', + title: '包邮金额(元)', + width: 120, + slots: { default: 'freePrice' }, + }, + { + title: '操作', + width: 80, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { return [ @@ -21,6 +95,9 @@ export function useFormSchema(): VbenFormSchema[] { component: 'Input', fieldName: 'name', label: '模板名称', + componentProps: { + placeholder: '请输入模板名称', + }, rules: 'required', }, { @@ -39,6 +116,7 @@ export function useFormSchema(): VbenFormSchema[] { label: '显示顺序', component: 'InputNumber', componentProps: { + placeholder: '请输入显示顺序', min: 0, }, rules: 'required', @@ -53,12 +131,17 @@ export function useGridFormSchema(): VbenFormSchema[] { fieldName: 'name', label: '模板名称', component: 'Input', + componentProps: { + placeholder: '请输入模板名称', + allowClear: true, + }, }, { fieldName: 'chargeMode', label: '计费方式', component: 'Select', componentProps: { + placeholder: '请选择计费方式', allowClear: true, options: getDictOptions(DICT_TYPE.EXPRESS_CHARGE_MODE, 'number'), }, @@ -72,14 +155,17 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'id', title: '编号', + minWidth: 100, }, { field: 'name', title: '模板名称', + minWidth: 200, }, { field: 'chargeMode', title: '计费方式', + minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.EXPRESS_CHARGE_MODE }, @@ -88,10 +174,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'sort', title: '显示顺序', + minWidth: 100, }, { field: 'createTime', title: '创建时间', + minWidth: 180, formatter: 'formatDateTime', }, { diff --git a/apps/web-antd/src/views/mall/trade/delivery/expressTemplate/index.vue b/apps/web-antd/src/views/mall/trade/delivery/expressTemplate/index.vue index 5355825c2..0c6a96fb6 100644 --- a/apps/web-antd/src/views/mall/trade/delivery/expressTemplate/index.vue +++ b/apps/web-antd/src/views/mall/trade/delivery/expressTemplate/index.vue @@ -22,7 +22,7 @@ const [FormModal, formModalApi] = useVbenModal({ }); /** 刷新表格 */ -function onRefresh() { +function handleRefresh() { gridApi.query(); } @@ -46,10 +46,8 @@ async function handleDelete( }); try { await deleteDeliveryExpressTemplate(row.id as number); - message.success({ - content: $t('ui.actionMessage.deleteSuccess', [row.name]), - }); - onRefresh(); + message.success($t('ui.actionMessage.deleteSuccess', [row.name])); + handleRefresh(); } finally { hideLoading(); } @@ -76,6 +74,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, @@ -87,7 +86,7 @@ const [Grid, gridApi] = useVbenVxeGrid({