Commit 6f6d827c authored by zhengyi's avatar zhengyi

线路选择器的逻辑目的国、目的城市、目的仓选择联动逻辑修改完善

parent 6efa58ae
...@@ -319,30 +319,31 @@ export default { ...@@ -319,30 +319,31 @@ export default {
if (this.destCountryIds && this.destCountryIds.length > 0) { if (this.destCountryIds && this.destCountryIds.length > 0) {
this.destCityList = this.AddressCity.filter(item => this.destCountryIds.includes(item.guojia)) this.destCityList = this.AddressCity.filter(item => this.destCountryIds.includes(item.guojia))
this.destWarehouseList = this.AddressTown.filter(item => this.destCountryIds.includes(item.guojia)) this.destWarehouseList = this.AddressTown.filter(item => this.destCountryIds.includes(item.guojia))
}else {
if (this.destCityIds && this.destCityIds.length > 0) {
let cityCountryIdList = this.destCityList.filter(item => this.destCityIds.includes(item.shi)).map((city) => {
return city.guojia
})
this.destCountryList = this.countryList.filter(item => cityCountryIdList.includes(item.guojia))
this.destWarehouseList = this.AddressTown.filter(item => this.destCityIds.includes(item.shi))
}else {
if (this.destWarehouseIds && this.destWarehouseIds.length > 0) {
let warehouseCountryIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => {
return warehouse.guojia
})
this.destCountryList = this.countryList.filter(item => warehouseCountryIdList.includes(item.guojia))
let warehouseCityIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => {
return warehouse.shi
})
this.destCityList = this.AddressCity.filter(item => warehouseCityIdList.includes(item.shi))
}else {
this.destCountryList = this.countryList;
this.destCityList = this.AddressCity;
this.destWarehouseList = this.AddressTown
}
}
} }
// else {
// if (this.destCityIds && this.destCityIds.length > 0) {
// let cityCountryIdList = this.destCityList.filter(item => this.destCityIds.includes(item.shi)).map((city) => {
// return city.guojia
// })
// this.destCountryList = this.countryList.filter(item => cityCountryIdList.includes(item.guojia))
// this.destWarehouseList = this.AddressTown.filter(item => this.destCityIds.includes(item.shi))
// }else {
// if (this.destWarehouseIds && this.destWarehouseIds.length > 0) {
// let warehouseCountryIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => {
// return warehouse.guojia
// })
// this.destCountryList = this.countryList.filter(item => warehouseCountryIdList.includes(item.guojia))
// let warehouseCityIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => {
// return warehouse.shi
// })
// this.destCityList = this.AddressCity.filter(item => warehouseCityIdList.includes(item.shi))
// }else {
// this.destCountryList = this.countryList;
// this.destCityList = this.AddressCity;
// this.destWarehouseList = this.AddressTown
// }
// }
// }
this.getOpenedRouterList() this.getOpenedRouterList()
}, },
}, },
...@@ -352,66 +353,70 @@ export default { ...@@ -352,66 +353,70 @@ export default {
console.log("目的城市id集合变更", this.destCityIds) console.log("目的城市id集合变更", this.destCityIds)
this.destWarehouseIds = []; this.destWarehouseIds = [];
if (this.destCityIds && this.destCityIds.length > 0) { if (this.destCityIds && this.destCityIds.length > 0) {
let cityCountryIdList = this.destCityList.filter(item => this.destCityIds.includes(item.shi)).map((city) => { // let cityCountryIdList = this.destCityList.filter(item => this.destCityIds.includes(item.shi)).map((city) => {
return city.guojia // return city.guojia
}) // })
this.destCountryList = this.countryList.filter(item => cityCountryIdList.includes(item.guojia)) // this.destCountryList = this.countryList.filter(item => cityCountryIdList.includes(item.guojia))
this.destWarehouseList = this.AddressTown.filter(item => this.destCityIds.includes(item.shi)) this.destWarehouseList = this.AddressTown.filter(item => this.destCityIds.includes(item.shi))
}else {
if (this.destCountryIds && this.destCountryIds.length > 0) {
this.destCityList = this.AddressCity.filter(item => this.destCountryIds.includes(item.guojia))
this.destWarehouseList = this.AddressTown.filter(item => this.destCountryIds.includes(item.guojia))
}else {
if (this.destWarehouseIds && this.destWarehouseIds.length > 0) {
let warehouseCountryIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => {
return warehouse.guojia
})
this.destCountryList = this.countryList.filter(item => warehouseCountryIdList.includes(item.guojia))
let warehouseCityIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => {
return warehouse.shi
})
this.destCityList = this.AddressCity.filter(item => warehouseCityIdList.includes(item.shi))
}else {
this.destCountryList = this.countryList;
this.destCityList = this.AddressCity;
this.destWarehouseList = this.AddressTown
}
}
} }
// else {
// if (this.destCountryIds && this.destCountryIds.length > 0) {
// this.destCityList = this.AddressCity.filter(item => this.destCountryIds.includes(item.guojia))
// this.destWarehouseList = this.AddressTown.filter(item => this.destCountryIds.includes(item.guojia))
// }else {
// if (this.destWarehouseIds && this.destWarehouseIds.length > 0) {
// let warehouseCountryIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => {
// return warehouse.guojia
// })
// this.destCountryList = this.countryList.filter(item => warehouseCountryIdList.includes(item.guojia))
// let warehouseCityIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => {
// return warehouse.shi
// })
// this.destCityList = this.AddressCity.filter(item => warehouseCityIdList.includes(item.shi))
// }else {
// this.destCountryList = this.countryList;
// this.destCityList = this.AddressCity;
// this.destWarehouseList = this.AddressTown
// }
// }
// }
this.getOpenedRouterList() this.getOpenedRouterList()
}, },
}, },
destWarehouseIds: { destWarehouseIds: {
deep: true, //深度监听 deep: true, //深度监听
handler() { handler() {
console.log("目的仓库id集合变更", this.destWarehouseIds) // console.log("目的仓库id集合变更", this.destWarehouseIds)
if (this.destWarehouseIds && this.destWarehouseIds.length > 0) { // if (this.destWarehouseIds && this.destWarehouseIds.length > 0) {
let warehouseCountryIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => { // let warehouseCountryIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => {
return warehouse.guojia // return warehouse.guojia
}) // })
this.destCountryList = this.countryList.filter(item => warehouseCountryIdList.includes(item.guojia)) // this.destCountryList = this.countryList.filter(item => warehouseCountryIdList.includes(item.guojia))
let warehouseCityIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => { // let warehouseCityIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => {
return warehouse.shi // return warehouse.shi
}) // })
this.destCityList = this.AddressCity.filter(item => warehouseCityIdList.includes(item.shi)) // this.destCityList = this.AddressCity.filter(item => warehouseCityIdList.includes(item.shi))
}else { // }else {
if (this.destCountryIds && this.destCountryIds.length > 0) { // if (this.destCountryIds && this.destCountryIds.length > 0) {
this.destCityList = this.AddressCity.filter(item => this.destCountryIds.includes(item.guojia)) // this.destCityList = this.AddressCity.filter(item => this.destCountryIds.includes(item.guojia))
this.destWarehouseList = this.AddressTown.filter(item => this.destCountryIds.includes(item.guojia)) // this.destWarehouseList = this.AddressTown.filter(item => this.destCountryIds.includes(item.guojia))
}else { // }else {
if (this.destCityIds && this.destCityIds.length > 0) { // if (this.destWarehouseIds && this.destWarehouseIds.length > 0) {
let cityCountryIdList = this.destCityList.filter(item => this.destCityIds.includes(item.shi)).map((city) => { // let warehouseCountryIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => {
return city.guojia // return warehouse.guojia
}) // })
this.destCountryList = this.countryList.filter(item => cityCountryIdList.includes(item.guojia)) // this.destCountryList = this.countryList.filter(item => warehouseCountryIdList.includes(item.guojia))
this.destWarehouseList = this.AddressTown.filter(item => this.destCityIds.includes(item.shi)) // let warehouseCityIdList = this.destWarehouseList.filter(item => this.destWarehouseIds.includes(item.warehouseId)).map((warehouse) => {
}else { // return warehouse.shi
this.destCountryList = this.countryList; // })
this.destCityList = this.AddressCity; // this.destCityList = this.AddressCity.filter(item => warehouseCityIdList.includes(item.shi))
this.destWarehouseList = this.AddressTown // }else {
} // this.destCountryList = this.countryList;
} // this.destCityList = this.AddressCity;
} // this.destWarehouseList = this.AddressTown
// }
// }
// }
this.getOpenedRouterList() this.getOpenedRouterList()
}, },
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment