import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const BackflushDetailbQadRules = reactive({ qty: [required], productreceiptNumber: [required], parentItemCode: [required], itemCode: [required], status: [required], }) export const BackflushDetailbQad = useCrudSchemas(reactive([ { label: '制品收货记录单据号', field: 'productreceiptNumber', sort: 'custom', isSearch: true, }, { label: '父物品代码', field: 'parentItemCode', sort: 'custom', isSearch: true, }, { label: '物品代码', field: 'itemCode', sort: 'custom', isSearch: true, }, { label: '创建时间', field: 'createTime', sort: 'custom', formatter: dateFormatter, 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')] } }, isForm: false, }, // { // label: '创建者Id', // field: 'creator', // sort: 'custom', // isForm: false, // }, { label: '执行状态', field: 'status', sort: 'custom', isSearch: true, search: { component: 'Select', componentProps: { options: [{ value: '', label: '全部' },{ value: 0, label: '未执行' }, { value: 1, label: '成功' }, { value: 2, label: '失败' }] }, }, form: { component: 'Select', componentProps: { options: [{ value: 0, label: '未执行' }, { value: 1, label: '成功' }, { value: 2, label: '失败' }] }, }, }, { label: '备注', field: 'remark', sort: 'custom', isSearch: true, }, { label: '数量', field: 'qty', sort: 'custom', }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))