Commit 3e29bccd authored by liuzeheng's avatar liuzeheng

目的国、目的城市筛选

parent e130c261
......@@ -1057,10 +1057,10 @@ export function getOrderWarehouseDeleted(orderId,orderItem){
})
}
//获得目的国、目的城市、目的仓
export function getWarehouseTreeRegionList(tradeType){
export function getRegionList(type,regionId){
return request({
url:'/ecw/warehouse/getWarehouseTreeRegionList?tradeType=1',
method: 'get'
url:'/ecw/warehouse/getRegionList?type='+type+'&regionId='+regionId,
method: 'get',
})
}
\ No newline at end of file
......@@ -30,33 +30,43 @@
>
</el-date-picker>
</el-form-item>
<div>
<el-form-item :label="$t('始发仓')" prop="startWarehouseId">
<el-select v-model="queryParams.startWarehouseId" :placeholder="$t('请选择始发仓')" clearable @change="handleQuery">
<el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
<div>
<el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select v-model="queryParams.destCountryId" :placeholder="$t('请选择目的国')" clearable @change="handleQuery">
<el-option v-for="item in importCountryList" :key="item.guojia" :label="item.guojiaName" :value="item.id" /></el-option>
<el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select v-model="destCountryId" :label="destCountryId" :placeholder="$t('请选择目的国')" clearable @change="handleQuery">
<el-option
v-for="item in AddressProvince" :key="item.shi" :label="item.guojiaName" :value="item.guojia"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select v-model="queryParams.objectiveId" :placeholder="$t('请选择目的城市')" clearable @change="handleQuery">
<el-option v-for="item in importCityList" :key="item.shi" :value="item.shi" :label="item.shiName" ></el-option>
<el-select v-model="objectiveId" :placeholder="$t('请根据目的国选择目的城市')" style="width: 200px" clearable @change="handleQuery">
<el-option
v-for="item in AddressCity" :key="item.shi" :label="item.shiName" :value="item.shi"
></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select v-model="queryParams.destWarehouseId" :placeholder="$t('请选择目的仓')" clearable @change="handleQuery">
<el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="item.id" :key="item.id"></el-option>
<el-select v-model="destWarehouseId" :placeholder="$t('请根据目的城市选择目的仓')" style="width: 200px" clearable @change="handleQuery">
<el-option
v-for="item in AddressTown" :key="item.id" :label="item.titleZh" :value="item.id"
></el-option>
</el-select>
</el-form-item>
</div>
<el-form-item :label="$t('运输方式')" prop="transportId" v-if="!transportId">
<dict-selector :type="DICT_TYPE.ECW_TRANSPORT_TYPE" v-model.number="queryParams.transportId" clearable @change="handleQuery"/>
</el-form-item>
......@@ -585,7 +595,7 @@ import {
exportShipFee,
exportUnload, splitCancelApply, orderSplitRevoke, setCanShipment, setCanNotShipment
,getParentOrder,
getWarehouseTreeRegionList
getRegionList
} from "@/api/ecw/order";
/* import { getDictDatas, DICT_TYPE } from '@/utils/dict'; */
......@@ -623,6 +633,16 @@ export default {
},
data() {
return {
AddressCity: [],
AddressProvince: [],
AddressTown: [],
destCountryId: '',
countryId:'',
//destCountryId:'',
objectiveId: '',
destWarehouseId: '',
// 选中数组
ids: [],
//目的国
......@@ -705,8 +725,28 @@ export default {
watch:{
isChinese(){
this.getList()
},
// provinceCode destCountryId
destCountryId: { //监听当前地区值的变化,于与上方地区值进行了双向绑定
deep:true, //深度监听
handler () {
//每当值省份值改变时其下地区值进行清空
this.AddressCity = [];
this.AddressTown = [];
this.objectiveId = "";
this.destWarehouseId = "";
this.findByprovinceCode();
}
},
objectiveId: {
deep:true, //深度监听
handler () {
this.findBycityCode();
}
}
},
computed: {
// 导出的权限字符串
exportPermiString(){
......@@ -733,7 +773,6 @@ export default {
// },
importCountryList(){
return this.countryList.filter(item => item.id !== null)
//return this.countryList.filter(item => item.tradeType == 2 || item.tradeType == 3)
},
importCityList(){
return this.cityList.filter(item => item.id !== null)
......@@ -753,6 +792,7 @@ export default {
timeParams['begin' + this.dateFilterType] = this.dateFilter[0]
timeParams['end' + this.dateFilterType] = this.dateFilter[1]
}
let queryParams = Object.assign({}, this.queryParams, timeParams)
if(this.transportId){
queryParams.transportId = this.transportId
......@@ -763,6 +803,13 @@ export default {
if(this.prodParam.value){
queryParams[this.prodParam.key] = this.prodParam.value
}
//目的国
queryParams.destCountryId = this.destCountryId
//目的城市
queryParams.objectiveId = this.objectiveId
//目的仓
queryParams.destWarehouseId = this.destWarehouseId
return queryParams
},
/*batchWarehouseAdjustment(){
......@@ -783,6 +830,7 @@ export default {
this.getList()
},
created() {
this.init();//
this.getTransportFromRoute()
this.getList();
getProductAttrList().then(res => this.productAttrList = res.data)
......@@ -798,32 +846,42 @@ export default {
getChannelList().then(res => this.channelList = res.data)
}
getWarehouseTreeRegionList().then(res => {
this.countryList = res.data
let cityArray =[]
let shi =[]
let Warehouse =[]
res.data.map( item=>{
},
methods: {
init () {
//加载时发起请求获取所有省份值
getRegionList(1,1).then(({data}) => {
this.AddressProvince = data;
console.log(this.AddressProvince)
item.children.map(c=>{
})
.catch(error => {
console.log(error);
});
},
findByprovinceCode () {
//获取当前省份值id,获取该省份下城市 destCountryId provinceCode
Warehouse.push(c)
shi.push(c)
getRegionList(2, this.destCountryId).then(({data}) => {
this.AddressCity = data;
})
.catch(error => {
console.log(error);
});
},
findBycityCode () {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.objectiveId).then(({data}) => {
this.AddressTown = data;
})
let distinitCity = shi.filter((value, index, self) => {
return self.indexOf(value) === index;
.catch(error => {
console.log(error);
});
this.cityList= distinitCity
this.destWarehouseList = Warehouse
})
},
methods: {
getDictDatas,
......@@ -941,6 +999,7 @@ export default {
query.packageType = query.packageTypeArr.join(',')
}
let func = getOrderPage
if(this.mine){
func = getMyOrderPage
/* return getMyOrderPage(this.combinedQueryParams).then(response => {
......
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