import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' export const ProcessproductionRequestMain = useCrudSchemas(reactive([ { label: 'id', field: 'id', sort: 'custom', isForm: false, isTable:false, isTableForm:false, }, { label: '单据号', field: 'number', sort: 'custom', table: { width: 150 }, isSearch: true, }, { label: '物料代码', field: 'itemCode', sort: 'custom', table: { width: 150 }, isSearch: true, }, { label: '完工数量', field: 'completedQuantity', sort: 'custom', table: { width: 150 }, }, { label: '报废数量', field: 'scrapQuantity', sort: 'custom', table: { width: 150 }, }, { label: '是否可用', field: 'available', sort: 'custom', table: { width: 150 }, }, { label: '备注', field: 'remark', sort: 'custom', isTable:false, }, { label: '创建时间', field: 'createTime', sort: 'custom', formatter: dateFormatter, isForm: false, isTable:false, }, { label: '删除时间', field: 'deletionTime', sort: 'custom', formatter: dateFormatter, isSearch: false, isTable:false, isForm:false, search: { component: 'DatePicker', componentProps: { valueFormat: 'YYYY-MM-DD HH:mm:ss', type: 'daterange', defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } }, }, { label: '删除者ID', field: 'deleterId', sort: 'custom', isSearch: false, isTable:false, }, { label: '扩展属性', field: 'extraProperties', sort: 'custom', isSearch: false, isTable:false, }, { label: '并发乐观锁', field: 'concurrencyStamp', sort: 'custom', isSearch: false, isTable:false, form: { component: 'InputNumber', value: 0 }, }, { label: '地点ID', field: 'siteId', sort: 'custom', isSearch: false, isTable:false, }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ])) // 表单校验 export const ProcessproductionRequestMainRules = reactive({ available: [required], concurrencyStamp: [required], }) export const ProcessproductionRequestDetail = useCrudSchemas(reactive([ { label: 'id', field: 'id', sort: 'custom', isForm: false, isTable:false, }, { label: '主表ID', field: 'masterId', sort: 'custom', isTable:false, form: { component: 'InputNumber', value: 0 }, }, { label: '单据号', field: 'number', sort: 'custom', isSearch: true, table: { width: 150 }, hiddenInMain:true, }, { label: '工序', field: 'processCode', sort: 'custom', table: { width: 150 }, }, { label: '生产线', field: 'productionLine', sort: 'custom', table: { width: 150 }, }, { label: '库位代码', field: 'locationCode', sort: 'custom', table: { width: 150 }, }, { label: '子物料代码', field: 'componentItemCode', sort: 'custom', isSearch: false, table: { width: 150 }, }, { label: '批次', field: 'batch', sort: 'custom', table: { width: 150 }, }, { label: '子物料数量', field: 'componentItemcodeQty', sort: 'custom', table: { width: 150 }, }, { label: '生效日期', field: 'effectiveDate', sort: 'custom', formatter: dateFormatter, form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } }, table: { width: 150 }, }, { label: '是否可用', field: 'available', sort: 'custom', isTable:false, table: { width: 150 }, }, { label: '备注', field: 'remark', sort: 'custom', }, { label: '创建时间', field: 'createTime', sort: 'custom', formatter: dateFormatter, isForm: false, table: { width: 150 }, }, { label: '删除时间', field: 'deletionTime', sort: 'custom', formatter: dateFormatter, isSearch: false, isTable:false, table: { width: 150 }, search: { component: 'DatePicker', componentProps: { valueFormat: 'YYYY-MM-DD HH:mm:ss', type: 'daterange', defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } }, }, { label: '删除者ID', field: 'deleterId', sort: 'custom', isSearch: false, isTable:false, table: { width: 150 }, }, { label: '扩展属性', field: 'extraProperties', sort: 'custom', isSearch: false, isTable:false, }, { label: '并发乐观锁', field: 'concurrencyStamp', sort: 'custom', isSearch: false, isTable:false, form: { component: 'InputNumber', value: 0 }, }, { label: '地点ID', field: 'siteId', sort: 'custom', isSearch: false, isTable:false, }, { label: '操作', field: 'action', isForm: false, hiddenInMain:true, table: { width: 150, fixed: 'right' } } ])) // 表单校验 export const ProcessproductionRequestDetailRules = reactive({ })