Browse Source

WMS 计划外出库申请、计划外入库申请 新增时,明细中数量为空,没有校验。

hella_online_20240829
wangyufei 3 months ago
parent
commit
5dc7deb559
  1. 11
      src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts
  2. 11
      src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts
  3. 2
      src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts

11
src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts

@ -1086,7 +1086,13 @@ export const UnplannedissueRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
hiddenInMain:true, hiddenInMain:true,
} }
])) ]))
function validateQty(rule, value, callback) {
if (value>0) {
callback()
}else{
callback(new Error('数量必须大于0'))
}
}
//表单校验 //表单校验
export const UnplannedissueRequestDetailRules = reactive({ export const UnplannedissueRequestDetailRules = reactive({
// packingNumber: [ // packingNumber: [
@ -1111,6 +1117,9 @@ export const UnplannedissueRequestDetailRules = reactive({
{ required: true, message: '请选择物料代码', trigger: 'change' }, { required: true, message: '请选择物料代码', trigger: 'change' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }
], ],
qty:[
{ validator:validateQty, message: '数量必须大于0', trigger: 'change'}
],
remark: [ remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }
], ],

11
src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts

@ -1317,7 +1317,13 @@ export const UnplannedreceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[
isTableForm:false, isTableForm:false,
} }
])) ]))
function validateQty(rule, value, callback) {
if (value>0) {
callback()
}else{
callback(new Error('数量必须大于0'))
}
}
//表单校验 //表单校验
export const UnplannedreceiptRequestDetailRules = reactive({ export const UnplannedreceiptRequestDetailRules = reactive({
arriveDate: [ arriveDate: [
@ -1335,6 +1341,9 @@ export const UnplannedreceiptRequestDetailRules = reactive({
inventoryStatus: [ inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' } { required: true, message: '请选择库存状态', trigger: 'change' }
], ],
qty:[
{ validator:validateQty, message: '数量必须大于0', trigger: 'change'}
],
itemCode: [ itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' } { required: true, message: '请选择物料代码', trigger: 'change' }
], ],

2
src/views/wms/productionManage/productscrap/productscrapRequestMain/productscrapRequestMain.data.ts

@ -1262,7 +1262,7 @@ export const ProductscrapRequestDetailRules = reactive({
{ required: true, message: '请选择工位代码', trigger: 'change' } { required: true, message: '请选择工位代码', trigger: 'change' }
], ],
qty:[ qty:[
{ validator:validateQty, message: '数量必须大于0', trigger: 'blur'} { validator:validateQty, message: '数量必须大于0', trigger: 'change'}
], ],
// processCode: [ // processCode: [
// { required: true, message: '请选择工序代码', trigger: 'change' } // { required: true, message: '请选择工序代码', trigger: 'change' }

Loading…
Cancel
Save