Commit 4daaff38 authored by yujinyao's avatar yujinyao

客户详情 订单tag搜索目的国+目的地+目的仓下拉多选

parent cba937ec
......@@ -91,7 +91,7 @@
<el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select
v-model="destCountryId"
:label="destCountryId"
multiple
:placeholder="$t('请选择目的国')"
clearable
@change="handleQuery"
......@@ -107,6 +107,7 @@
<el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select
v-model="objectiveId"
multiple
:placeholder="$t('请根据目的国选择目的城市')"
style="width: 200px"
clearable
......@@ -123,6 +124,7 @@
<el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select
v-model="destWarehouseId"
multiple
:placeholder="$t('请根据目的城市选择目的仓')"
style="width: 200px"
clearable
......@@ -234,7 +236,7 @@
<el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select
v-model="destCountryId"
:label="destCountryId"
multiple
:placeholder="$t('请选择目的国')"
clearable
@change="handleQuery"
......@@ -250,6 +252,7 @@
<el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select
v-model="objectiveId"
multiple
:placeholder="$t('请根据目的国选择目的城市')"
style="width: 200px"
clearable
......@@ -266,6 +269,7 @@
<el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select
v-model="destWarehouseId"
multiple
:placeholder="$t('请根据目的城市选择目的仓')"
style="width: 200px"
clearable
......@@ -830,16 +834,16 @@ export default {
activeName(val){
switch (val) {
case 'order':
this.destCountryId = null
this.destWarehouseId = null
this.objectiveId = null
this.destCountryId = ''
this.destWarehouseId = ''
this.objectiveId = ''
this.queryParams.page = 1
this.getorderList()//订单
break
case 'quote':
this.destCountryId = null
this.destWarehouseId = null
this.objectiveId = null
this.destCountryId = ''
this.destWarehouseId = ''
this.objectiveId = ''
this.infoListOfferFrom.pageNo = 1
this.getInfoListOfferPage()//报价
break
......@@ -872,59 +876,18 @@ export default {
this.AddressTown = [];
this.objectiveId = "";
this.destWarehouseId = "";
this.findByprovinceCode();
if (this.destCountryId == "") {
getRegionList(4, 4)
.then(({ data }) => {
this.AddressCity = data;
})
.catch((error) => {
console.log(error);
});
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
this.getAddressCity()
this.getAddressTown()
} else if (
this.destCountryId != "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
/*getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data;
})
.catch((error) => {
console.log(error);
});*/
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
this.findByprovinceCode()
this.getAddressTown()
}
//重新加载目的城市
//目的城市
// getRegionList(4, 4).then(({data}) => {
// this.AddressCity = data;
// })
// .catch(error => {
// console.log(error);
// });
// getRegionList(5, 5).then(({data}) => {
// this.AddressTown = data;
// })
// .catch(error => {
// console.log(error);
// });
},
},
objectiveId: {
......@@ -932,62 +895,28 @@ export default {
handler() {
this.AddressTown = [];
this.destWarehouseId = "";
this.findBycityCode();
if (
this.objectiveId != "" &&
this.destCountryId != "" &&
this.destWarehouseId == ""
) {
//获取当前城市值id,获取该城市下区域
/*getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});*/
this.findBycityCode()
} else if (
this.destCountryId == "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
this.getAddressCity()
this.getAddressTown()
} else if (
this.destCountryId != "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
/*getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data;
})
.catch((error) => {
console.log(error);
});*/
this.findByprovinceCode()
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
this.getAddressTown()
}
// else if(this.objectiveId!="" && this.objectiveId=="" ){
// getRegionList(5, 5).then(({data}) => {
// this.AddressTown = data;
// }).catch(error => {
// console.log(error);
// });
// }
},
},
destWarehouseId: {
......@@ -999,34 +928,14 @@ export default {
this.destWarehouseId == ""
) {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
this.findBycityCode()
} else if (
this.destCountryId != "" &&
this.objectiveId == "" &&
this.destWarehouseId == ""
) {
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
this.getAddressTown()
}
// else if(this.objectiveId=="" && this.destWarehouseId==""){
// getRegionList(5, 5).then(({data}) => {
// this.AddressTown = data;
// })
// .catch(error => {
// console.log(error);
// });
// }
},
},
},
......@@ -1138,9 +1047,9 @@ export default {
AddressCity: [],
AddressProvince: [],
AddressTown: [],
destCountryId: "",
objectiveId: "",
destWarehouseId: "",
destCountryId: null,
objectiveId: null,
destWarehouseId: null,
}
},
computed: {
......@@ -1327,8 +1236,7 @@ export default {
findByprovinceCode() {
//获取当前省份值id,获取该省份下城市 destCountryId provinceCode
if (this.destCountryId != null && this.destCountryId != "") {
getRegionList(2, this.destCountryId)
.then(({ data }) => {
getRegionList(2, this.destCountryId).then(({ data }) => {
this.AddressCity = data;
})
}
......@@ -1336,48 +1244,30 @@ export default {
findBycityCode() {
//获取当前城市值id,获取该城市下区域
if (this.objectiveId != null && this.objectiveId != "") {
getRegionList(3, this.objectiveId)
.then(({ data }) => {
this.AddressTown = data;
// 去重
// let uniqueDataList = data.filter((item, index, self) => {
// // 返回第一个匹配项的索引,用于判断当前项是否为第一个匹配项
// const firstIndex = self.findIndex((obj) => obj.guojia === item.guojia);
// // 如果当前项是第一个匹配项,则保留,否则过滤掉
// return index === firstIndex;
// });
// this.AddressProvince = uniqueDataList
})
getRegionList(3, this.objectiveId).then(({ data }) => {
this.AddressTown = data;
})
}
},
getData() {
getRegionList(1, 1)
.then(({ data }) => {
this.AddressProvince = data;
console.log(this.AddressProvince);
})
.catch((error) => {
console.log(error);
});
//目的城市
getRegionList(4, 4)
.then(({ data }) => {
this.AddressCity = data;
})
.catch((error) => {
console.log(error);
});
//目的仓
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
this.getAddressProvince()
this.getAddressCity()
this.getAddressTown()
},
getAddressProvince() {
getRegionList(1, 1).then(({ data }) => {
this.AddressProvince = data;
})
},
getAddressCity() {
getRegionList(4, 4).then(({ data }) => {
this.AddressCity = data;
})
},
getAddressTown() {
getRegionList(5, 5).then(({ data }) => {
this.AddressTown = data;
})
},
/** 搜索按钮操作 */
handleQuery() {
......
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