diff --git a/apps/web-antd/src/views/mall/trade/afterSale/data.ts b/apps/web-antd/src/views/mall/trade/afterSale/data.ts index eadc29823..319b6f193 100644 --- a/apps/web-antd/src/views/mall/trade/afterSale/data.ts +++ b/apps/web-antd/src/views/mall/trade/afterSale/data.ts @@ -4,6 +4,7 @@ import type { VxeGridPropTypes } from '#/adapter/vxe-table'; import { DICT_TYPE } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; +import { z } from '#/adapter/form'; import { getRangePickerDefaultProps } from '#/utils'; /** 列表的搜索表单 */ @@ -60,6 +61,30 @@ export function useGridFormSchema(): VbenFormSchema[] { ]; } +/** 拒绝售后表单的 schema 配置 */ +export function useDisagreeFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + component: 'Textarea', + fieldName: 'reason', + label: '拒绝原因', + componentProps: { + placeholder: '请输入拒绝原因', + rows: 4, + }, + rules: z.string().min(2, { message: '拒绝原因不能少于 2 个字符' }), + }, + ]; +} + /** 表格列配置 */ export function useGridColumns(): VxeGridPropTypes.Columns { return [ diff --git a/apps/web-antd/src/views/mall/trade/afterSale/detail/index.vue b/apps/web-antd/src/views/mall/trade/afterSale/detail/index.vue index 398636c94..7a5a204ee 100644 --- a/apps/web-antd/src/views/mall/trade/afterSale/detail/index.vue +++ b/apps/web-antd/src/views/mall/trade/afterSale/detail/index.vue @@ -25,6 +25,7 @@ import { useDescription } from '#/components/description'; import { DictTag } from '#/components/dict-tag'; import { TableAction } from '#/components/table-action'; +import DisagreeForm from '../modules/disagree-form.vue'; import { useAfterSaleInfoSchema, useOperateLogSchema, @@ -109,7 +110,7 @@ const [OperateLogGrid, operateLogGridApi] = useVbenVxeGrid({ }); const [DisagreeModal, disagreeModalApi] = useVbenModal({ - connectedComponent: () => import('./modules/disagree-form.vue'), + connectedComponent: DisagreeForm, destroyOnClose: true, }); @@ -217,10 +218,6 @@ onMounted(() => {