Browse Source

发货策略

intex
zhang_li 2 days ago
parent
commit
aaab2a3e5c
  1. 146
      src/views/wms/basicDataManage/strategySetting/strategy/deliverStrategy/AddForm.vue

146
src/views/wms/basicDataManage/strategySetting/strategy/deliverStrategy/AddForm.vue

@ -167,7 +167,7 @@
v-else-if="item.ParamCode == 'Project'" v-else-if="item.ParamCode == 'Project'"
:disabled="formData.priority==0&&formType=='update'" :disabled="formData.priority==0&&formType=='update'"
/> />
<el-input key="物料" style="flex:1" placeholder="请输入物料,多个物料以逗号分隔" disabled v-else-if="item.ParamCode == 'ItemCode'"v-model="item.Value"> <el-input key="物料" style="flex:1" placeholder="请输入物料,多个物料以逗号分隔" @blur="blurWarehouse({module:'condition',type:'ItemCode'})" v-else-if="item.ParamCode == 'ItemCode'" v-model="item.Value">
<template #suffix> <template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchItemCode"> <el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchItemCode">
<Icon icon="ep:search" class="mr-5px" /> <Icon icon="ep:search" class="mr-5px" />
@ -204,7 +204,7 @@
:key="'供应商和客户Operator'+cur.value" :key="'供应商和客户Operator'+cur.value"
/> />
</el-select> </el-select>
<el-input key="供应商和客户Value" style="flex:1" placeholder="请选择客户" disabled v-model="item.Value" @blur="blurCustomerList"> <el-input key="供应商和客户Value" style="flex:1" placeholder="请选择客户" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'CustomerCode'})">
<template #suffix> <template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchCustomerList"> <el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchCustomerList">
<Icon icon="ep:search" class="mr-5px" /> <Icon icon="ep:search" class="mr-5px" />
@ -228,7 +228,7 @@
:key="'生产线Operator'+cur.value" :key="'生产线Operator'+cur.value"
/> />
</el-select> </el-select>
<el-input key="生产线Value" style="flex:1" placeholder="请选择生产线" disabled v-model="item.Value" @blur="blurTransactionType"> <el-input key="生产线Value" style="flex:1" placeholder="请选择生产线" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'Productionline'})">
<template #suffix> <template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchTransactionType"> <el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchTransactionType">
<Icon icon="ep:search" class="mr-5px" /> <Icon icon="ep:search" class="mr-5px" />
@ -261,7 +261,7 @@
<!-- 仓库 --> <!-- 仓库 -->
<el-input style="flex:1" v-show="warehouseType == 'WarehouseCode'" placeholder="请选择从仓库" v-model="formData.configuration.WarehouseCode" @blur="blurWarehouse"> <el-input style="flex:1" v-show="warehouseType == 'WarehouseCode'" placeholder="请选择从仓库" v-model="formData.configuration.WarehouseCode" @blur="blurWarehouse({module:'config',type:'WarehouseCode'})">
<template #suffix> <template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse"> <el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" /> <Icon icon="ep:search" class="mr-5px" />
@ -270,7 +270,7 @@
</el-input> </el-input>
<!-- 库区 --> <!-- 库区 -->
<el-input style="flex:1" v-show="warehouseType == 'AreaCode'" placeholder="请选择从库区" v-model="formData.configuration.AreaCode" @blur="blurWarehouse"> <el-input style="flex:1" v-show="warehouseType == 'AreaCode'" placeholder="请选择从库区" v-model="formData.configuration.AreaCode" @blur="({module:'config',type:'AreaCode'})">
<template #suffix> <template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse"> <el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" /> <Icon icon="ep:search" class="mr-5px" />
@ -280,7 +280,7 @@
<!-- 库位组 --> <!-- 库位组 -->
<el-input style="flex:1" v-show="warehouseType == 'LocationGroupCode'" placeholder="请选择从库位组" v-model="formData.configuration.LocationGroupCode" @blur="blurWarehouse"> <el-input style="flex:1" v-show="warehouseType == 'LocationGroupCode'" placeholder="请选择从库位组" v-model="formData.configuration.LocationGroupCode" @blur="({module:'config',type:'LocationGroupCode'})">
<template #suffix> <template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse"> <el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" /> <Icon icon="ep:search" class="mr-5px" />
@ -289,7 +289,7 @@
</el-input> </el-input>
<!-- 库位 --> <!-- 库位 -->
<el-input style="flex:1" v-show="warehouseType == 'LocationCode'" placeholder="请选择从库位" v-model="formData.configuration.LocationCode" @blur="blurWarehouse"> <el-input style="flex:1" v-show="warehouseType == 'LocationCode'" placeholder="请选择从库位" v-model="formData.configuration.LocationCode" @blur="({module:'config',type:'LocationCode'})">
<template #suffix> <template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse"> <el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" /> <Icon icon="ep:search" class="mr-5px" />
@ -754,74 +754,105 @@ const filterMethodWarehouseList = (query: string) => {
const searchTableRef = ref() const searchTableRef = ref()
const blurWarehouse = async ()=>{ const blurWarehouse = async ({module='config',type})=>{
// //
let warehouseValue = formData.value.configuration[warehouseType.value] let warehouseValue = formData.value.configuration[warehouseType.value]
let conditionObj = null
if(module=='condition'){
//
conditionObj = formData.value.condition.find(item=>item['ParamCode']==type)
if(conditionObj){
warehouseValue = conditionObj['Value']
}
}
if(!warehouseValue){ if(!warehouseValue){
return return
} }
if(warehouseType.value == 'WarehouseCode'){ let verifyRes = []
console.log(222,warehouseValue)
if(module=='condition'&&type=='ItemCode' || module=='config'&&warehouseType.value == 'ItemCode'){
//
verifyRes = await ItembasicApi.getItemListByCodes({
codes:warehouseValue
})
console.log('物料verifyRes',verifyRes)
}else if(module=='condition'&&type=='CustomerCode' || module=='config'&&warehouseType.value == 'CustomerCode'){
//
verifyRes = await CustomerApi.getCustomerByCodes({
codes:warehouseValue
})
console.log('客户verifyRes',verifyRes)
}else if(module=='condition'&&type=='Productionline' || module=='config'&&warehouseType.value == 'Productionline'){
// 线
verifyRes = await ProductionlineApi.getProductionlineByCodes({
codes:warehouseValue
})
console.log('生产线verifyRes',verifyRes)
}else if(module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){
// //
let verifyRes = await WarehouseApi.verifyWarehouse({ verifyRes = await WarehouseApi.verifyWarehouse({
code:warehouseValue code:warehouseValue
}) })
console.log('仓库verifyRes',verifyRes) console.log('仓库verifyRes',verifyRes)
if(verifyRes&&verifyRes.length>0){ }else if(module=='condition'&&type=='AreaCode' || module=='config'&&warehouseType.value == 'AreaCode'){
let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
}else{
formData.value.configuration[warehouseType.value] = ''
}
}else if(warehouseType.value == 'AreaCode'){
// //
let verifyRes = await AreaApi.verifyAreaList({ verifyRes = await AreaApi.verifyAreaList({
code:warehouseValue code:warehouseValue
}) })
console.log('库区verifyRes',verifyRes) console.log('库区verifyRes',verifyRes)
if(verifyRes&&verifyRes.length>0){ }else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){
let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
}else{
formData.value.configuration[warehouseType.value] = ''
}
}else if(warehouseType.value == 'LocationGroupCode'){
// //
let verifyRes = await LocationgroupApi.verifyLocationgroup({ verifyRes = await LocationgroupApi.verifyLocationgroup({
code:warehouseValue code:warehouseValue
}) })
console.log('库位组verifyRes',verifyRes) console.log('库位组verifyRes',verifyRes)
if(verifyRes&&verifyRes.length>0){ }else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){
let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
}else{
formData.value.configuration[warehouseType.value] = ''
}
}else if(warehouseType.value == 'LocationCode'){
// //
let verifyRes = await LocationApi.verifyLocation({ verifyRes = await LocationApi.verifyLocation({
code:warehouseValue code:warehouseValue
}) })
console.log('库位组verifyRes',verifyRes) console.log('库位verifyRes',verifyRes)
if(verifyRes&&verifyRes.length>0){ }
let verifyList = verifyRes.map(item=>(item['code'])) 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 + '没有找到对应数据')
}
}else{
//
let codeList = formData.value.configuration[warehouseType.value].split(',') let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') formData.value.configuration[warehouseType.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{
if(module=='condition'){
message.alert('代码' + conditionObj['Value'] + '没有找到对应数据')
//
conditionObj['Value'] = ''
}else{ }else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = '' formData.value.configuration[warehouseType.value] = ''
} }
} }
if(module!='condition'){
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode'] let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{ fields.forEach(item=>{
if(item!=warehouseType.value){ if(item!=warehouseType.value){
formData.value.configuration[item] = '' formData.value.configuration[item] = ''
} }
}) })
}
} }
// //
const searchCustomerList = ()=>{ const searchCustomerList = ()=>{
@ -838,22 +869,7 @@ const searchCustomerList = ()=>{
) )
} }
const blurCustomerList = async ()=>{
let customerCode = formData.value.condition.find(item=>item['ParamCode']=='CustomerCode')
if(customerCode&&customerCode.Value){
let verifyRes = await CustomerApi.getCustomerPage({
code:customerCode.Value
})
console.log('客户',verifyRes)
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
let codeList = customerCode.Value.split(',')
customerCode.Value = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
}else{
customerCode.Value = ''
}
}
}
// //
const searchItemCode = ()=>{ const searchItemCode = ()=>{

Loading…
Cancel
Save