diff --git a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts index 947edf4e6..995d146a5 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts @@ -1169,6 +1169,15 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive { + if (!value) { + callback(new Error('包装数量必须大于0')); + } else { + callback(); + } +} + //表单校验 export const ProductionreturnRequestDetailRules = reactive({ workStationCode: [ @@ -1183,9 +1192,12 @@ export const ProductionreturnRequestDetailRules = reactive({ // packingNumber: [ // { required: true, message: '请选择包装号', trigger: 'change' } // ], - // batch: [ - // { required: true, message: '请输入批次', trigger: 'blur' } - // ], + qty:[ + { validator:validateQty, message: '数量必须大于0', trigger: 'change'} + ], + batch: [ + { required: true, message: '请输入批次', trigger: 'blur' } + ], inventoryStatus: [ { required: true, message: '请选择库存状态', trigger: 'change' } ], diff --git a/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/productionreturnRequestMainNo.data.ts b/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/productionreturnRequestMainNo.data.ts index 4ba1b9e1f..8438301be 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/productionreturnRequestMainNo.data.ts +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/productionreturnRequestMainNo.data.ts @@ -680,6 +680,14 @@ export const ProductionreturnRequestDetail = useCrudSchemas( ]) ) +const validateQty = (rule: any, value: any, callback: any,a,b) => { + if (!value) { + callback(new Error('包装数量必须大于0')); + } else { + callback(); + } +} + //表单校验 export const ProductionreturnRequestDetailRules = reactive({ workStationCode: [ @@ -694,6 +702,9 @@ export const ProductionreturnRequestDetailRules = reactive({ // packingNumber: [ // { required: true, message: '请选择包装号', trigger: 'change' } // ], + qty:[ + { validator:validateQty, message: '数量必须大于0', trigger: 'change'} + ], batch: [ { required: true, message: '请输入批次', trigger: 'blur' } ], @@ -717,6 +728,8 @@ export const ProductionreturnRequestDetailRules = reactive({ ], }) + + /** * @returns {Array} 隔离退料申请子表创建标签 */