From 5d9eee0f3c7ac5f03fd18d66b1b5109f007e3f02 Mon Sep 17 00:00:00 2001 From: yufei_wang <2267742828@qq.com> Date: Thu, 19 Sep 2024 11:54:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=85=88=E6=A0=A1=E9=AA=8C=E8=A1=A5?= =?UTF-8?q?=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../strategy/upShelfStrategy/AddForm.vue | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue b/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue index 0b06729cc..a648a54d9 100644 --- a/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue +++ b/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue @@ -1210,6 +1210,37 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const submitForm = async () => { + let TransactionType = formData.value.condition[5]['Value'] + if(Array.isArray(TransactionType)){ + TransactionType = TransactionType.join(',') + } + 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(',') + } + let locationCodes = formData.value.configuration.LocationCode + if(Array.isArray(locationCodes)){ + locationCodes = locationCodes.join(',') + } + 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){ @@ -1231,38 +1262,7 @@ const submitForm = async () => { return } - let TransactionType = formData.value.condition[5]['Value'] - if(Array.isArray(TransactionType)){ - TransactionType = TransactionType.join(',') - } - if(TransactionType=='Repleinment'){ - //补料--物料和库位必填 - let msg = '' - - // 判断物料必填 - 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){ - msg = '请您选择库位' - } - } - if(msg){ - message.error(msg) - return - } - } + // 校验表单 if (!formRef) return const valid = await formRef.value.validate()