diff --git a/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts b/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts index 5ddd1c9de..27e78019e 100644 --- a/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts +++ b/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts @@ -1086,7 +1086,13 @@ export const UnplannedissueRequestDetail = useCrudSchemas(reactive hiddenInMain:true, } ])) - +function validateQty(rule, value, callback) { + if (value>0) { + callback() + }else{ + callback(new Error('数量必须大于0')) + } +} //表单校验 export const UnplannedissueRequestDetailRules = reactive({ // packingNumber: [ @@ -1111,6 +1117,9 @@ export const UnplannedissueRequestDetailRules = reactive({ { required: true, message: '请选择物料代码', trigger: 'change' }, { max: 50, message: '不得超过50个字符', trigger: 'blur' } ], + qty:[ + { validator:validateQty, message: '数量必须大于0', trigger: 'change'} + ], remark: [ { max: 50, message: '不得超过50个字符', trigger: 'blur' } ], diff --git a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts index 7ba954a82..f17b2d593 100644 --- a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts +++ b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts @@ -1317,7 +1317,13 @@ export const UnplannedreceiptRequestDetail = useCrudSchemas(reactive0) { + callback() + }else{ + callback(new Error('数量必须大于0')) + } +} //表单校验 export const UnplannedreceiptRequestDetailRules = reactive({ arriveDate: [ @@ -1335,6 +1341,9 @@ export const UnplannedreceiptRequestDetailRules = reactive({ inventoryStatus: [ { required: true, message: '请选择库存状态', trigger: 'change' } ], + qty:[ + { validator:validateQty, message: '数量必须大于0', trigger: 'change'} + ], itemCode: [ { required: true, message: '请选择物料代码', trigger: 'change' } ], diff --git a/src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts b/src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts index 5cbf8d788..6067ca3e1 100644 --- a/src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts +++ b/src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts @@ -1262,7 +1262,7 @@ export const ProductscrapRequestDetailRules = reactive({ { required: true, message: '请选择工位代码', trigger: 'change' } ], qty:[ - { validator:validateQty, message: '数量必须大于0', trigger: 'blur'} + { validator:validateQty, message: '数量必须大于0', trigger: 'change'} ], // processCode: [ // { required: true, message: '请选择工序代码', trigger: 'change' }