| | |
| | | /** 表单类型 */ |
| | | export type FormType = 'create' | 'detail' | 'update'; |
| | | |
| | | /** 新增/修改产品技术确认函 */ |
| | | /** |
| | | * 新增/修改/查看产品技术确认函 |
| | | * |
| | | * 状态及编制人、审核人、客户确认人等流程派生字段一律只读: |
| | | * 状态由后端按业务流程推进(提交审核 → 审核通过/不通过 → 客户确认), |
| | | * 人员与时间由后端自动记录,均不允许手工填写。 |
| | | * |
| | | * @param formType 表单类型,create 时不展示状态字段(新建单据固定为草稿) |
| | | * @param formApi 表单 API |
| | | */ |
| | | export function useFormSchema( |
| | | formType: FormType, |
| | | formApi?: VbenFormApi, |
| | | ): VbenFormSchema[] { |
| | | return [ |
| | |
| | | label: '状态', |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | // 状态由业务流程驱动,仅作展示,不可手工选择 |
| | | disabled: true, |
| | | options: getDictOptions(DICT_TYPE.PRODUCT_TECH_CONFIRM_STATUS, 'number'), |
| | | placeholder: '请选择状态', |
| | | }, |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | // 新建单据固定为草稿,不展示状态 |
| | | show: () => formType !== 'create', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'flowDivider', |
| | | label: '流程信息(系统自动记录)', |
| | | component: 'Divider', |
| | | formItemClass: 'col-span-3', |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | show: () => formType !== 'create', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | label: '编制人', |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请输入编制人姓名', |
| | | disabled: true, |
| | | placeholder: '由系统自动记录', |
| | | }, |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | show: () => formType !== 'create', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | disabled: true, |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | showTime: true, |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | }, |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | show: () => formType !== 'create', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | label: '审核人', |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请输入审核人姓名', |
| | | disabled: true, |
| | | placeholder: '提交审核时选择', |
| | | }, |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | show: () => formType !== 'create', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | disabled: true, |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | showTime: true, |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | }, |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | show: () => formType !== 'create', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'reviewRemark', |
| | | label: '审核意见', |
| | | component: 'Textarea', |
| | | formItemClass: 'col-span-3', |
| | | componentProps: { |
| | | disabled: true, |
| | | placeholder: '审核时填写', |
| | | rows: 2, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | show: () => formType !== 'create', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | label: '客户确认人', |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请输入客户确认人', |
| | | disabled: true, |
| | | placeholder: '由系统自动记录', |
| | | }, |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | show: () => formType !== 'create', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | disabled: true, |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | showTime: true, |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | }, |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | show: () => formType !== 'create', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | }, |
| | | }, |
| | | { field: 'drafterName', title: '编制人', width: 90 }, |
| | | { field: 'reviewerName', title: '审核人', width: 90 }, |
| | | { |
| | | field: 'status', |
| | | title: '状态', |