import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter2 } from '@/utils/formatTime' import { validateHanset, validateEmail } from '@/utils/validator' import { dateFormatter } from '@/utils/formatTime' const { t } = useI18n() // 国际化 /** * @returns {Array} 检验任务主表 */ export const InspectionJobMain = useCrudSchemas(reactive([ { label: '编码', field: 'number', sort: 'custom', isSearch: true, form: { componentProps:{ disabled:true } }, }, { label: '申请单号', field: 'requestNumber', sort: 'custom', isSearch: true, form: { componentProps:{ disabled:true } }, }, { label: '供应商编码', field: 'supplierCode', sort: 'custom', isSearch: true, form: { componentProps:{ disabled:true } }, }, { label: '物料编码', field: 'materialCode', sort: 'custom', isSearch: true, form: { componentProps:{ disabled:true } }, }, { label: '物料批次', field: 'materialBatch', sort: 'custom', isSearch: false, form: { componentProps:{ disabled:true } }, }, { label: '订单号', field: 'orderCode', sort: 'custom', isSearch: false, form: { componentProps:{ disabled:true } }, }, { label: '订单行', field: 'orderRow', sort: 'custom', isSearch: false, form: { component: 'InputNumber', value: 0, componentProps:{ disabled:true } }, }, { label: '凭证号', field: 'certificateCode', sort: 'custom', isSearch: false, form: { componentProps:{ disabled:true } }, }, { label: '凭证行', field: 'certificateRow', sort: 'custom', isSearch: false, form: { component: 'InputNumber', value: 0, componentProps:{ disabled:true } }, }, { label: '检验方案编码', field: 'inspectionSchemeCode', sort: 'custom', isSearch: false, form: { componentProps:{ disabled:true } }, }, // { // label: '检验方案Json', // field: 'inspectionSchemeJson', // sort: 'custom', // isSearch: false, // }, { label: '检验批次', field: 'inspectionBatch', sort: 'custom', isSearch: false, form: { componentProps:{ disabled:true } }, }, { label: '检验批数量', field: 'inspectionBatchAmount', sort: 'custom', isSearch: false, form: { componentProps:{ disabled:true } }, }, { label: '采样总数量', field: 'sampleTatalAmount', sort: 'custom', isSearch: false, form: { componentProps:{ disabled:true } }, }, { label: '检验类型', field: 'inspectionType', sort: 'custom', isSearch: false, form: { component: 'Select', componentProps:{ disabled:true } }, }, { label: '检验批来源', field: 'inspectionBatchSource', sort: 'custom', isSearch: false, form:{ componentProps:{ disabled:true } } }, { label: '检验阶段', field: 'inspectionStage', sort: 'custom', isSearch: false, form: { component: 'InputNumber', value: 0, componentProps:{ disabled:true } }, }, { label: '检验严格性', field: 'inspectionStringency', sort: 'custom', isSearch: false, form:{ componentProps:{ disabled:true } } }, { label: '检验任务包装列表', field: 'inspectionTaskPackageCode', sort: 'custom', isSearch: false, form:{ componentProps:{ disabled:true } } }, { label: '检验任务工序列表', field: 'inspectionTaskProcessCode', sort: 'custom', isSearch: false, form:{ componentProps:{ disabled:true } } }, { label: '计划开始时间', field: 'planStartTime', sort: 'custom', formatter: dateFormatter, isSearch: 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', disabled:true } }, }, { label: '计划结束时间', field: 'planEndTime', sort: 'custom', formatter: dateFormatter, isSearch: 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', disabled:true } }, }, { label: '检验水平', field: 'inspectionLevel', sort: 'custom', isSearch: false, form:{ componentProps:{ disabled:true } } }, { label: 'AQL值', field: 'aqlValue', sort: 'custom', isSearch: false, form:{ componentProps:{ disabled:true } } }, { label: '使用决策', field: 'usageDecision', sort: 'custom', isSearch: false, dictType: DICT_TYPE.USAGE_DECISION, form:{ componentProps:{ } } }, { label: '是否可用', field: 'available', sort: 'custom', isSearch: false, form:{ componentProps:{ disabled:true } } }, { label: '操作', field: 'action', isDetail: false, isForm: false, table: { width: 200, fixed: 'right' } } ])) //表单校验 export const InspectionJobMainRules = reactive({ number: [required], inspectionCode: [required], supplierCode: [required], materialCode: [required], materialBatch: [required], orderCode: [required], certificateRow: [required], inspectionSchemeCode: [required], inspectionSchemeJson: [required], inspectionBatch: [required], inspectionBatchAmount: [required], sampleTatalAmount: [required], inspectionType: [required], inspectionBatchSource: [required], inspectionStage: [required], inspectionStringency: [required], inspectionLevel: [required], available: [required], }) /** * @returns {Array} 备件申请子表 */ export const InspectionJobDetail = useCrudSchemas(reactive([ { label: '编码', field: 'number', sort: 'custom', isSearch: true, }, { label: '检验方案模板编码', field: 'inspectionCode', sort: 'custom', isSearch: true, }, { label: '描述', field: 'processDescribe', sort: 'custom', isSearch: true, }, { label: '顺序号', field: 'sequenceCode', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 }, }, { label: '检验特性编号', field: 'inspectionCharCode', sort: 'custom', isSearch: true, }, { label: '检验特性编码', field: 'inspectionJobCharacteristicsRespVO.number', sort: 'custom', }, { label: '检验特性描述', field: 'inspectionJobCharacteristicsRespVO.description', sort: 'custom', },{ label: '检验方法', field: 'inspectionJobCharacteristicsRespVO.inspectionMethodName', sort: 'custom', },{ label: '采样过程编码', field: 'inspectionMethod', sort: 'custom', },{ label: '动态修改规则编码', field: 'dynamicUpdateCode', sort: 'custom', },{ label: '是否允许修改特征值', field: 'inspectionJobCharacteristicsRespVO.isCanUpdate', sort: 'custom', },{ label: '结果录入方式', field: 'resultEntryMethod', sort: 'custom', },{ label: '特征类型', field: 'featureType', sort: 'custom', } ])) //表单校验 export const InspectionJobDetailRules = reactive({ taskCode: [required], processCode: [required], sequenceCode: [required], available: [required], })