Commit 6f6d827c authored by zhengyi's avatar zhengyi

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

parent 6efa58ae
......@@ -319,30 +319,31 @@ export default {
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.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()
},
},
......@@ -352,66 +353,70 @@ export default {
console.log("目的城市id集合变更", this.destCityIds)
this.destWarehouseIds = [];
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))
// 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.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()
},
},
destWarehouseIds: {
deep: true, //深度监听
handler() {
console.log("目的仓库id集合变更", this.destWarehouseIds)
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 {
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.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 {
this.destCountryList = this.countryList;
this.destCityList = this.AddressCity;
this.destWarehouseList = this.AddressTown
}
}
}
// console.log("目的仓库id集合变更", this.destWarehouseIds)
// 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 {
// 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()
},
},
......
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