| | |
| | | |
| | | import { z } from '#/adapter/form'; |
| | | import { generateAutoCode } from '#/api/mes/md/autocode/record'; |
| | | import { getTemplatePage } from '#/api/mes/pro/processdesign/template'; |
| | | |
| | | /** 表单类型 */ |
| | | export type FormType = 'create' | 'detail' | 'update'; |
| | |
| | | options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), |
| | | }, |
| | | rules: z.number().default(CommonStatusEnum.ENABLE), |
| | | }, |
| | | { |
| | | fieldName: 'paramCollectMode', |
| | | label: '参数采集方式', |
| | | component: 'Select', |
| | | defaultValue: 0, |
| | | componentProps: { |
| | | options: [ |
| | | { label: '不采集', value: 0 }, |
| | | { label: '每次报工填写', value: 1 }, |
| | | { label: '每个任务填写一次', value: 2 }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'paramTemplateId', |
| | | label: '参数模板', |
| | | component: 'ApiSelect', |
| | | componentProps: { |
| | | api: getTemplatePage, |
| | | params: { pageNo: 1, pageSize: 100 }, |
| | | resultField: 'list', |
| | | labelField: 'templateName', |
| | | valueField: 'id', |
| | | showSearch: true, |
| | | optionFilterProp: 'label', |
| | | allowClear: true, |
| | | placeholder: '启用参数采集时请选择模板', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'attention', |
| | |
| | | props: { type: DICT_TYPE.COMMON_STATUS }, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'paramCollectMode', |
| | | title: '参数采集方式', |
| | | minWidth: 150, |
| | | formatter: ({ cellValue }) => |
| | | (['不采集', '每次报工填写', '每个任务填写一次'])[Number(cellValue ?? 0)] ?? '未知', |
| | | }, |
| | | { field: 'remark', title: '备注', minWidth: 180 }, |
| | | { |
| | | field: 'createTime', |