Browse Source

采购策略失去焦点

intex
zhang_li 1 week ago
parent
commit
fc9c092579
  1. 93
      src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue

93
src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue

@ -82,7 +82,7 @@
:key="'仓库和库区Operator'+cur.value" :key="'仓库和库区Operator'+cur.value"
/> />
</el-select> </el-select>
<el-input key="仓库和库区Value" style="flex:1" placeholder="请选择仓库或者库区" v-model="item.Value" @blur="blurWarehouseByCodes" :disabled="formData.priority==0&&formType=='update'"/> <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'"> <el-button type="info" plain @click="searchWarehouse" :disabled="formData.priority==0&&formType=='update'">
<Icon icon="ep:search" /> <Icon icon="ep:search" />
</el-button> </el-button>
@ -563,45 +563,84 @@ const searchTableSuccess = (formField, searchField, val, type, row) => {
} }
} }
// //
const blurWarehouseByCodes = async ()=>{ const blurWarehouseByCodes = async (formField) => {
let WarehouseCode = formData.value.condition.find(item=>item['ParamCode']=='WarehouseCode') if (formField == 'WarehouseCode') {
if(WarehouseCode&&WarehouseCode.Value){ let WarehouseCode = formData.value.condition.find(item=>item['ParamCode']=='WarehouseCode')
let verifyRes = await WarehouseApi.getWarehouseByCodes({ if(WarehouseCode&&WarehouseCode.Value){
codes:WarehouseCode.Value let verifyRes = await WarehouseApi.getWarehouseByCodes({
}) codes:WarehouseCode.Value
console.log('事务类型verifyRes',verifyRes) })
if (verifyRes && verifyRes.length > 0) { console.log('事务类型verifyRes',verifyRes)
const arr1 = WarehouseCode.Value.split(',') if (verifyRes && verifyRes.length > 0) {
if (arr1.length != verifyRes.length) { const arr1 = WarehouseCode.Value.split(',')
const arr2 = verifyRes.map((item) => item.code) if (arr1.length != verifyRes.length) {
const str = [ const arr2 = verifyRes.map((item) => item.code)
...arr1.filter((item) => !arr2.includes(item)), const str = [
...arr2.filter((item) => !arr1.includes(item)) ...arr1.filter((item) => !arr2.includes(item)),
].join(',') ...arr2.filter((item) => !arr1.includes(item))
message.alert('代码' + str + '没有找到对应数据') ].join(',')
message.alert('代码' + str + '没有找到对应数据')
WarehouseCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
return
}
} else {
WarehouseCode.Value = '' WarehouseCode.Value = ''
// formData.value.configuration.DockCode='' // formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver='' // formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber='' // formData.value.configuration.PhoneNumber=''
return message.alert('暂无数据')
} }
} else { }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 = '' WarehouseCode.Value = ''
// formData.value.configuration.DockCode='' // formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver='' // formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber='' // formData.value.configuration.PhoneNumber=''
message.alert('暂无数据')
} }
}else{
WarehouseCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
} }
} }
// //
const blurSupplierCode = async ()=>{ const blurSupplierCode = async () => {
let SupplierCode = formData.value.condition.find(item=>item['ParamCode']=='SupplierCode') let SupplierCode = formData.value.condition.find(item => item['ParamCode'] == 'SupplierCode')
console.log(77,SupplierCode)
if(SupplierCode&&SupplierCode.Value){ if(SupplierCode&&SupplierCode.Value){
let verifyRes = await SupplierApi.getSupplierListByCodes({ let verifyRes = await SupplierApi.getSupplierListByCodes({
codes:SupplierCode.Value codes:SupplierCode.Value

Loading…
Cancel
Save