Browse Source

采购策略失去焦点

intex
zhang_li 2 weeks ago
parent
commit
fc9c092579
  1. 47
      src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue

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

@ -82,7 +82,7 @@
:key="'仓库和库区Operator'+cur.value"
/>
</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'">
<Icon icon="ep:search" />
</el-button>
@ -563,7 +563,8 @@ const searchTableSuccess = (formField, searchField, val, type, row) => {
}
}
//
const blurWarehouseByCodes = async ()=>{
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({
@ -598,10 +599,48 @@ const blurWarehouseByCodes = async ()=>{
// 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 blurSupplierCode = async ()=>{
let SupplierCode = formData.value.condition.find(item=>item['ParamCode']=='SupplierCode')
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

Loading…
Cancel
Save