|
|
@ -167,7 +167,7 @@ |
|
|
|
v-else-if="item.ParamCode == 'Project'" |
|
|
|
: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> |
|
|
|
<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" /> |
|
|
@ -204,7 +204,7 @@ |
|
|
|
:key="'供应商和客户Operator'+cur.value" |
|
|
|
/> |
|
|
|
</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> |
|
|
|
<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" /> |
|
|
@ -228,7 +228,7 @@ |
|
|
|
:key="'生产线Operator'+cur.value" |
|
|
|
/> |
|
|
|
</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> |
|
|
|
<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" /> |
|
|
@ -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> |
|
|
|
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse"> |
|
|
|
<Icon icon="ep:search" class="mr-5px" /> |
|
|
@ -270,7 +270,7 @@ |
|
|
|
</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> |
|
|
|
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse"> |
|
|
|
<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> |
|
|
|
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse"> |
|
|
|
<Icon icon="ep:search" class="mr-5px" /> |
|
|
@ -289,7 +289,7 @@ |
|
|
|
</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> |
|
|
|
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse"> |
|
|
|
<Icon icon="ep:search" class="mr-5px" /> |
|
|
@ -754,74 +754,105 @@ const filterMethodWarehouseList = (query: string) => { |
|
|
|
|
|
|
|
const searchTableRef = ref() |
|
|
|
|
|
|
|
const blurWarehouse = async ()=>{ |
|
|
|
const blurWarehouse = async ({module='config',type})=>{ |
|
|
|
|
|
|
|
// 校验的值 |
|
|
|
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){ |
|
|
|
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 |
|
|
|
}) |
|
|
|
console.log('仓库verifyRes',verifyRes) |
|
|
|
if(verifyRes&&verifyRes.length>0){ |
|
|
|
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'){ |
|
|
|
}else if(module=='condition'&&type=='AreaCode' || module=='config'&&warehouseType.value == 'AreaCode'){ |
|
|
|
// 库区 |
|
|
|
let verifyRes = await AreaApi.verifyAreaList({ |
|
|
|
verifyRes = await AreaApi.verifyAreaList({ |
|
|
|
code:warehouseValue |
|
|
|
}) |
|
|
|
console.log('库区verifyRes',verifyRes) |
|
|
|
if(verifyRes&&verifyRes.length>0){ |
|
|
|
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'){ |
|
|
|
}else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){ |
|
|
|
// 库位组 |
|
|
|
let verifyRes = await LocationgroupApi.verifyLocationgroup({ |
|
|
|
verifyRes = await LocationgroupApi.verifyLocationgroup({ |
|
|
|
code:warehouseValue |
|
|
|
}) |
|
|
|
console.log('库位组verifyRes',verifyRes) |
|
|
|
if(verifyRes&&verifyRes.length>0){ |
|
|
|
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'){ |
|
|
|
}else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){ |
|
|
|
// 库位 |
|
|
|
let verifyRes = await LocationApi.verifyLocation({ |
|
|
|
verifyRes = await LocationApi.verifyLocation({ |
|
|
|
code:warehouseValue |
|
|
|
}) |
|
|
|
console.log('库位组verifyRes',verifyRes) |
|
|
|
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 + '没有找到对应数据') |
|
|
|
} |
|
|
|
}else{ |
|
|
|
// 配置 |
|
|
|
let codeList = formData.value.configuration[warehouseType.value].split(',') |
|
|
|
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{ |
|
|
|
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 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 = ()=>{ |
|
|
|