|
|
@ -1210,27 +1210,6 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
/** 提交表单 */ |
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
|
|
|
const submitForm = async () => { |
|
|
|
await blurWarehouse() |
|
|
|
// await blurTransactionType() |
|
|
|
if(warehouseType.value == 'WarehouseCode' && !formData.value.configuration.WarehouseCode){ |
|
|
|
// 仓库 |
|
|
|
message.error('请选择仓库') |
|
|
|
return |
|
|
|
// formData.configuration.WarehouseCode |
|
|
|
}else if(warehouseType.value == 'AreaCode'&& !formData.value.configuration.AreaCode){ |
|
|
|
// 库区 |
|
|
|
message.error('请选择库区') |
|
|
|
return |
|
|
|
}else if(warehouseType.value == 'LocationGroupCode'&&!formData.value.configuration.LocationGroupCode){ |
|
|
|
// 库位组 |
|
|
|
message.error('请选择库位组') |
|
|
|
return |
|
|
|
}else if(warehouseType.value == 'LocationCode'&&!formData.value.configuration.LocationCode){ |
|
|
|
// 库位 |
|
|
|
message.error('请选择库位') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
let TransactionType = formData.value.condition[5]['Value'] |
|
|
|
if(Array.isArray(TransactionType)){ |
|
|
|
TransactionType = TransactionType.join(',') |
|
|
@ -1238,31 +1217,52 @@ const submitForm = async () => { |
|
|
|
if(TransactionType=='Repleinment'){ |
|
|
|
//补料--物料和库位必填 |
|
|
|
let msg = '' |
|
|
|
|
|
|
|
// 判断物料必填 |
|
|
|
let itemCodeType = formData.value.condition[1]['ParamCode'] |
|
|
|
let itemCodes = formData.value.condition[1]['Value'] |
|
|
|
if(Array.isArray(itemCodes)){ |
|
|
|
itemCodes = itemCodes.join(',') |
|
|
|
} |
|
|
|
if(itemCodes.trim().length<=0){ |
|
|
|
msg = '请您选择物料' |
|
|
|
}else if(warehouseType.value!='LocationCode'){ |
|
|
|
// 判断库位必填 |
|
|
|
msg = '请选择库位类型' |
|
|
|
}else{ |
|
|
|
let locationCodes = formData.value.configuration.LocationCode |
|
|
|
if(Array.isArray(locationCodes)){ |
|
|
|
locationCodes = locationCodes.join(',') |
|
|
|
} |
|
|
|
if(locationCodes.trim().length<=0){ |
|
|
|
if(itemCodeType!='ItemCode'){ |
|
|
|
msg = '请选择物料' |
|
|
|
}else if(itemCodes.trim().length<=0){ |
|
|
|
msg = '请您选择物料' |
|
|
|
}else if(warehouseType.value!='LocationCode'){ |
|
|
|
// 判断库位必填 |
|
|
|
msg = '请选择库位' |
|
|
|
}else if(locationCodes.trim().length<=0){ |
|
|
|
msg = '请您选择库位' |
|
|
|
} |
|
|
|
} |
|
|
|
if(msg){ |
|
|
|
message.error(msg) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
await blurWarehouse() |
|
|
|
// await blurTransactionType() |
|
|
|
if(warehouseType.value == 'WarehouseCode' && !formData.value.configuration.WarehouseCode){ |
|
|
|
// 仓库 |
|
|
|
message.error('请选择仓库') |
|
|
|
return |
|
|
|
// formData.configuration.WarehouseCode |
|
|
|
}else if(warehouseType.value == 'AreaCode'&& !formData.value.configuration.AreaCode){ |
|
|
|
// 库区 |
|
|
|
message.error('请选择库区') |
|
|
|
return |
|
|
|
}else if(warehouseType.value == 'LocationGroupCode'&&!formData.value.configuration.LocationGroupCode){ |
|
|
|
// 库位组 |
|
|
|
message.error('请选择库位组') |
|
|
|
return |
|
|
|
}else if(warehouseType.value == 'LocationCode'&&!formData.value.configuration.LocationCode){ |
|
|
|
// 库位 |
|
|
|
message.error('请选择库位') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 校验表单 |
|
|
|
if (!formRef) return |
|
|
|
const valid = await formRef.value.validate() |
|
|
|