|
|
@ -82,10 +82,13 @@ |
|
|
|
:key="'仓库和库区Operator'+cur.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<el-input key="仓库和库区Value" style="flex:1" placeholder="请选择仓库或者库区" v-model="item.Value" @blur="blurWarehouseByCodes(item.ParamCode)" :disabled="formData.priority==0&&formType=='update'"/> |
|
|
|
<el-button type="info" plain @click="searchWarehouse" :disabled="formData.priority==0&&formType=='update'"> |
|
|
|
<Icon icon="ep:search" /> |
|
|
|
<el-input key="仓库和库区Value" style="flex:1" placeholder="请选择仓库或者库区" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:WarehouseCodeOrArea})" :disabled="formData.priority==0&&formType=='update'"> |
|
|
|
<template #suffix> |
|
|
|
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse"> |
|
|
|
<Icon icon="ep:search" class="mr-5px" /> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<!-- 供应商代码 --> |
|
|
|
<el-form-item key="供应商代码formItem" |
|
|
@ -107,10 +110,13 @@ |
|
|
|
:key="'供应商代码Operator'+cur.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<el-input key="供应商代码Value" style="flex:1" placeholder="请选择供应商代码" v-model="item.Value" @blur="blurSupplierCode" :disabled="formData.priority==0&&formType=='update'"/> |
|
|
|
<el-button type="info" plain @click="searchSupplier" :disabled="formData.priority==0&&formType=='update'"> |
|
|
|
<Icon icon="ep:search" /> |
|
|
|
<el-input key="供应商代码Value" style="flex:1" placeholder="请选择供应商代码" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'SupplierCode'})" :disabled="formData.priority==0&&formType=='update'"> |
|
|
|
<template #suffix> |
|
|
|
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchSupplier"> |
|
|
|
<Icon icon="ep:search" class="mr-5px" /> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -145,10 +151,13 @@ |
|
|
|
</el-form-item> |
|
|
|
<!-- 月台 --> |
|
|
|
<el-form-item key="月台formItem" :label="t('ts.月台').replace('ts.','')" prop="configuration.DockCode"> |
|
|
|
<el-input key="月台Value" style="flex:1" placeholder="请选择月台" v-model="formData.configuration.DockCode" @blur="blurDockCode"/> |
|
|
|
<el-button type="info" plain @click="searchDockCode"> |
|
|
|
<Icon icon="ep:search" /> |
|
|
|
<el-input key="月台Value" style="flex:1" placeholder="请选择月台" v-model="formData.configuration.DockCode" @blur="blurDockCode"> |
|
|
|
<template #suffix> |
|
|
|
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchDockCode"> |
|
|
|
<Icon icon="ep:search" class="mr-5px" /> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<!-- 收货人 --> |
|
|
|
<el-form-item key="收货人formItem" :label="t('ts.收货人').replace('ts.','')" prop="Receiver"> |
|
|
@ -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='' |
|
|
|
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: '库位' } |
|
|
|
} |
|
|
|
if(!warehouseValue){ |
|
|
|
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 |
|
|
|
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 = 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(',') |
|
|
|
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 + '没有找到对应数据') |
|
|
|
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='' |
|
|
|
// 配置 |
|
|
|
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'){ |
|
|
|
message.alert('代码' + conditionObj['Value'] + '没有找到对应数据') |
|
|
|
// 条件 |
|
|
|
conditionObj['Value'] = '' |
|
|
|
}else{ |
|
|
|
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据') |
|
|
|
formData.value.configuration[warehouseType.value] = '' |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// 供应商失去焦点 |
|
|
|
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 |
|
|
|
}) |
|
|
|
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(',') |
|
|
|
message.alert('代码' + str + '没有找到对应数据') |
|
|
|
SupplierCode.Value = '' |
|
|
|
return |
|
|
|
} |
|
|
|
} else { |
|
|
|
SupplierCode.Value = '' |
|
|
|
message.alert('暂无数据') |
|
|
|
if(module!='condition'){ |
|
|
|
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode'] |
|
|
|
fields.forEach(item=>{ |
|
|
|
if(item!=warehouseType.value){ |
|
|
|
formData.value.configuration[item] = '' |
|
|
|
} |
|
|
|
}else{ |
|
|
|
SupplierCode.Value = '' |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 月台失去焦点 |
|
|
|
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('暂无数据') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|