import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import * as ItembasicApi from '@/api/wms/itembasic' import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' // 表单校验 export const ProcessrouteRules = reactive({ processrouteCode: [{ required: true, message: '请输入工艺路线编码!', trigger: 'blur' },], processName: [{ required: true, message: '请输入工艺路线名称!', trigger: 'blur' },], productCode: [{ required: true, message: '请输入产品编码!', trigger: 'blur' },], }) export const Processroute = useCrudSchemas(reactive([ { label: '删除时间', field: 'deleteTime', sort: 'custom', isTable: false, isForm: false, form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } }, }, { label: '主键', field: 'id', sort: 'custom', isForm: false, isTable: false, }, { label: '并发乐观锁', field: 'concurrencyStamp', sort: 'custom', isTable: false, isForm: false, form: { component: 'InputNumber', value: 0 }, }, { label: '删除用户名', field: 'deleter', sort: 'custom', isTable: false, isForm: false, }, { label: '工艺路线编码', field: 'processrouteCode', sort: 'custom', isSearch: true, }, { label: '工艺路线名称', field: 'processName', sort: 'custom', isSearch: true, }, { label: '产品编码', field: 'productCode', sort: 'custom', isSearch: true, width: 150, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '产成品代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '产品信息', // 查询弹窗标题 searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类 searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', isMainValue: false }, { key: 'type', action: 'in', // 查询拼接条件 isSearch: true, // 使用自定义拼接条件 value: 'CCP,BCP',//,SEMI] isMainValue: false }, ] } } }, // { // label: '版本号', // field: 'routeVersion', // sort: 'custom', // isSearch: true, // }, { label: '创建时间', field: 'createTime', sort: 'custom', formatter: dateFormatter, isForm: false, isTable: false, }, { label: '状态', field: 'status', sort: 'custom', isSearch: false, dictType: DICT_TYPE.ITEM_STATUS, dictClass: 'string', form: { component: 'Switch', value: 'ENABLE', componentProps: { inactiveValue: 'DISABLE', activeValue: 'ENABLE' } }, }, { label: '备注', field: 'remark', sort: 'custom', }, { label: '图形数据', field: 'graphJson', sort: 'custom', isForm: false, isTable: false, isSearch:false }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))