From b61aed78990bc55db47e4b1ec4b6484f4721a4a8 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Thu, 21 Nov 2024 11:25:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=96=E7=95=A5=E5=A4=B1=E5=8E=BB=E7=84=A6?= =?UTF-8?q?=E7=82=B9=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supplieDeliveryStrategy/AddForm.vue | 210 +++++++++--------- .../strategy/upShelfStrategy/AddForm.vue | 11 +- 2 files changed, 111 insertions(+), 110 deletions(-) diff --git a/src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue b/src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue index 81d5154a9..2b76dcc70 100644 --- a/src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue +++ b/src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue @@ -82,10 +82,13 @@ :key="'仓库和库区Operator'+cur.value" /> - - - - + + + - - - - + + + @@ -145,10 +151,13 @@ - - - - + + + @@ -561,110 +570,93 @@ const searchTableSuccess = (formField, searchField, val, type, row) => { formData.value.configuration.PhoneNumber = val[0].contactPhone } } -// 受入地失去焦点校验 -const blurWarehouseByCodes = async (formField) => { - if (formField == 'WarehouseCode') { - let WarehouseCode = formData.value.condition.find(item=>item['ParamCode']=='WarehouseCode') - if(WarehouseCode&&WarehouseCode.Value){ - let verifyRes = await WarehouseApi.getWarehouseByCodes({ - codes:WarehouseCode.Value - }) - console.log('事务类型verifyRes',verifyRes) - if (verifyRes && verifyRes.length > 0) { - const arr1 = WarehouseCode.Value.split(',') - if (arr1.length != verifyRes.length) { - const arr2 = verifyRes.map((item) => item.code) - const str = [ - ...arr1.filter((item) => !arr2.includes(item)), - ...arr2.filter((item) => !arr1.includes(item)) - ].join(',') - message.alert('代码' + str + '没有找到对应数据') - WarehouseCode.Value = '' - // formData.value.configuration.DockCode='' - // formData.value.configuration.Receiver='' - // formData.value.configuration.PhoneNumber='' - return - } - } else { - WarehouseCode.Value = '' - // formData.value.configuration.DockCode='' - // formData.value.configuration.Receiver='' - // formData.value.configuration.PhoneNumber='' - message.alert('暂无数据') - } - }else{ - WarehouseCode.Value = '' - // formData.value.configuration.DockCode='' - // formData.value.configuration.Receiver='' - // formData.value.configuration.PhoneNumber='' - } - } else { - let AreaCode = formData.value.condition.find(item=>item['ParamCode']=='AreaCode') - if(AreaCode&&AreaCode.Value){ - let verifyRes = await AreaApi.getAreabasicByCodes({ - codes:AreaCode.Value - }) - console.log('事务类型verifyRes',verifyRes) - if (verifyRes && verifyRes.length > 0) { - const arr1 = AreaCode.Value.split(',') - if (arr1.length != verifyRes.length) { - const arr2 = verifyRes.map((item) => item.code) - const str = [ - ...arr1.filter((item) => !arr2.includes(item)), - ...arr2.filter((item) => !arr1.includes(item)) - ].join(',') - message.alert('代码' + str + '没有找到对应数据') - AreaCode.Value = '' - // formData.value.configuration.DockCode='' - // formData.value.configuration.Receiver='' - // formData.value.configuration.PhoneNumber='' - return - } - } else { - AreaCode.Value = '' - // formData.value.configuration.DockCode='' - // formData.value.configuration.Receiver='' - // formData.value.configuration.PhoneNumber='' - message.alert('暂无数据') - } - }else{ - WarehouseCode.Value = '' - // formData.value.configuration.DockCode='' - // formData.value.configuration.Receiver='' - // formData.value.configuration.PhoneNumber='' +const blurWarehouse = async ({module='config',type})=>{ + + // 校验的值 + let warehouseValue = formData.value.configuration[WarehouseCodeOrArea.value] + let conditionObj = null + if(module=='condition'){ + // 规则条件 + conditionObj = formData.value.condition.find(item=>item['ParamCode']==type) + if(conditionObj){ + warehouseValue = conditionObj['Value'] } + // { value: 'WarehouseCode', label: '仓库' }, + // { value: 'AreaCode', label: '库区' }, + // { value: 'LocationGroupCode', label: '库位组' }, + // { value: 'LocationCode', label: '库位' } } - -} -// 供应商失去焦点 -const blurSupplierCode = async () => { - let SupplierCode = formData.value.condition.find(item => item['ParamCode'] == 'SupplierCode') - console.log(77,SupplierCode) - if(SupplierCode&&SupplierCode.Value){ - let verifyRes = await SupplierApi.getSupplierListByCodes({ - codes:SupplierCode.Value + if(!warehouseValue){ + return + } + let verifyRes = [] + console.log(222,warehouseValue) + if(module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){ + // 仓库 + verifyRes = await WarehouseApi.verifyWarehouse({ + code:warehouseValue }) - console.log('事务类型verifyRes',verifyRes) - if (verifyRes && verifyRes.length > 0) { - const arr1 = SupplierCode.Value.split(',') - if (arr1.length != verifyRes.length) { - const arr2 = verifyRes.map((item) => item.code) - const str = [ - ...arr1.filter((item) => !arr2.includes(item)), - ...arr2.filter((item) => !arr1.includes(item)) - ].join(',') + console.log('仓库verifyRes',verifyRes) + }else if(module=='condition'&&type=='AreaCode' || module=='config'&&warehouseType.value == 'AreaCode'){ + // 库区 + verifyRes = await AreaApi.verifyAreaList({ + code:warehouseValue + }) + console.log('库区verifyRes',verifyRes) + }else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){ + // 库位组 + verifyRes = await LocationgroupApi.verifyLocationgroup({ + code:warehouseValue + }) + console.log('库位组verifyRes',verifyRes) + }else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){ + // 库位 + verifyRes = await LocationApi.verifyLocation({ + code:warehouseValue + }) + console.log('库位verifyRes',verifyRes) + }else if(module=='condition'&&type=='SupplierCode' || module=='config'&&warehouseType.value == 'SupplierCode'){ + // 库位 + verifyRes = await SupplierApi.getSupplierListByCodes({ + code:warehouseValue + }) + console.log('库位verifyRes',verifyRes) + } + if(verifyRes&&verifyRes.length>0){ + let verifyList = verifyRes.map(item=>(item['code'])) + if(module=='condition'){ + // 条件 + let codeList = warehouseValue.split(',') + conditionObj['Value'] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') + const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',') + if (str) { message.alert('代码' + str + '没有找到对应数据') - SupplierCode.Value = '' - return } - } else { - SupplierCode.Value = '' - message.alert('暂无数据') + }else{ + // 配置 + let codeList = formData.value.configuration[warehouseType.value].split(',') + formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') } }else{ - SupplierCode.Value = '' + if(module=='condition'){ + message.alert('代码' + conditionObj['Value'] + '没有找到对应数据') + // 条件 + conditionObj['Value'] = '' + }else{ + message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据') + formData.value.configuration[warehouseType.value] = '' + } + } + if(module!='condition'){ + let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode'] + fields.forEach(item=>{ + if(item!=warehouseType.value){ + formData.value.configuration[item] = '' + } + }) } } + // 月台失去焦点 const blurDockCode = async () => { if (formData.value.configuration.DockCode) { @@ -689,9 +681,11 @@ const blurDockCode = async () => { }) console.log('事务类型verifyRes',verifyRes) if (verifyRes.list && verifyRes.list.length > 0) { + let codeList = formData.value.configuration.DockCode.split(',') + formData.value.configuration.DockCode= codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') } else { + message.alert('代码' + formData.value.configuration.DockCode + '没有找到对应数据') formData.value.configuration.DockCode = '' - message.alert('暂无数据') } } diff --git a/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue b/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue index 05a68ebac..96c4efee8 100644 --- a/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue +++ b/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue @@ -1077,17 +1077,24 @@ const blurWarehouse = async ({module='config',type})=>{ // 条件 let codeList = warehouseValue.split(',') conditionObj['Value'] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') + const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',') + if (str) { + message.alert('代码' + str + '没有找到对应数据') + } }else{ // 配置 let codeList = formData.value.configuration[warehouseType.value].split(',') formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') } + }else{ if(module=='condition'){ - // 条件 - conditionObj['Value'] = '' + message.alert('代码' + conditionObj['Value'] + '没有找到对应数据') + // 条件 + conditionObj['Value'] = '' }else{ + message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据') formData.value.configuration[warehouseType.value] = '' } }