|
|
@ -265,12 +265,32 @@ export const ProcessproductionRequestMain = useCrudSchemas(reactive<CrudSchema[] |
|
|
|
} |
|
|
|
} |
|
|
|
])) |
|
|
|
|
|
|
|
// 完工数量校验
|
|
|
|
const validateCompletedQuantity= (rule: any, value: any, callback: any) => { |
|
|
|
if (Number(value)>0) { |
|
|
|
callback(); |
|
|
|
} else { |
|
|
|
callback(new Error('完工数量不能为0')); |
|
|
|
} |
|
|
|
} |
|
|
|
// 报废数量校验
|
|
|
|
const validateScrapQuantity= (rule: any, value: any, callback: any) => { |
|
|
|
if (Number(value)>0) { |
|
|
|
callback(); |
|
|
|
} else { |
|
|
|
callback(new Error('完工数量不能为0')); |
|
|
|
} |
|
|
|
} |
|
|
|
// 表单校验
|
|
|
|
export const ProcessproductionRequestMainRules = reactive({ |
|
|
|
itemCode: [{ required: true, message: '物料代码不能为空', trigger: 'change' }], |
|
|
|
completedQuantity: [{ required: true, message: '完工数量不能为空', trigger: 'change' }], |
|
|
|
scrapQuantity: [{ required: true, message: '报废数量不能为空', trigger: 'change' }], |
|
|
|
completedQuantity: [ |
|
|
|
{ required: true, message: '完工数量不能为空', trigger: 'change' }, |
|
|
|
{ validator: validateCompletedQuantity, trigger: 'change' } |
|
|
|
], |
|
|
|
scrapQuantity: [{ required: true, message: '报废数量不能为空', trigger: 'change' }, |
|
|
|
{ validator: validateScrapQuantity, trigger: 'change' } |
|
|
|
], |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|