From 5e8c9175bb14cf8d86487f89f67f0e21fcb7dfb9 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 14 Oct 2025 20:28:21 +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=94=AE=E5=90=8E=E9=80=80=E6=AC=BE=EF=BC=88100%=20an?= =?UTF-8?q?td=20form=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/mall/trade/afterSale/data.ts | 25 ++++++ .../mall/trade/afterSale/detail/index.vue | 10 +-- .../trade/afterSale/modules/disagree-form.vue | 78 +++++++++++++++++++ 3 files changed, 108 insertions(+), 5 deletions(-) create mode 100644 apps/web-antd/src/views/mall/trade/afterSale/modules/disagree-form.vue 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(() => {