Commit b871f627 authored by dragondean@qq.com's avatar dragondean@qq.com

订单渠道,路线,城市 根据国家相互关联https://zentao.test.jdshangmen.com/task-view-3301.html

parent 3d3079ef
...@@ -896,13 +896,20 @@ export default { ...@@ -896,13 +896,20 @@ export default {
} }
}, },
// 目的地 // 目的地
'form.objectiveId'(objectiveId, oldObjectiveId){ async 'form.objectiveId'(objectiveId, oldObjectiveId){
this.getOpenedRouterList() // 重新获取路线
// 修改目的地后需要重新选择路线 await this.getOpenedRouterList()
if(oldObjectiveId && oldObjectiveId != objectiveId && !this.initing){ // 如果已选择的路线不在可用路线里则重置
console.log('修改目的地,重置lineId', oldObjectiveId, objectiveId) if(this.form.lineId && !this.routerList.find(item => item.id == this.form.lineId)){
this.$set(this.form, 'lineId', null) this.$set(this.form, 'lineId', null)
} }
// 重新获取渠道
await this.getChannelList()
// 如果已选择的渠道不在可用渠道里则重置
if(this.form.channelId && !this.channelList.find(item => item.channelId == this.form.channelId)){
this.$set(this.form, 'channelId', null)
}
}, },
'form.transportId'(transportId, oldTransportId){ 'form.transportId'(transportId, oldTransportId){
// 空运 // 空运
...@@ -941,11 +948,19 @@ export default { ...@@ -941,11 +948,19 @@ export default {
if(this.form.lineId) this.getOfferData() if(this.form.lineId) this.getOfferData()
// 选择渠道后需要筛选目的城市和线路 // 选择渠道后需要筛选目的城市和线路
// 有点卡,改异步 // 有点卡,改异步
this.$nextTick(() => { this.$nextTick(async () => {
// 更新目的城市备选 // 更新目的城市备选
this.getTradeCity() await this.getTradeCity()
// 如果已选择城市,在切换后不可用则重置
if(this.form.objectiveId && !this.importList.find(item => item.id == this.form.objectiveId)){
this.$set(this.form, 'objectiveId', null)
}
// 更新线路备选 // 更新线路备选
this.getOpenedRouterList() await this.getOpenedRouterList()
// 如果已选择路线且切换后原路线不可用则重置
if(this.form.lineId && !this.routerList.find(item => item.id == this.form.lineId)){
this.$set(this.form, 'lineId', null)
}
}) })
}, },
'form.consigneeCountryCode'(){ 'form.consigneeCountryCode'(){
...@@ -1093,7 +1108,7 @@ export default { ...@@ -1093,7 +1108,7 @@ export default {
}) })
this.productAttrList = (await getProductAttrList()).data this.productAttrList = (await getProductAttrList()).data
this.channelList = (await getChannelList()).data await this.getChannelList()
await this.getTradeCity() await this.getTradeCity()
this.currencyList = (await getCurrencyList()).data this.currencyList = (await getCurrencyList()).data
this.unitList = (await getUnitList()).data this.unitList = (await getUnitList()).data
...@@ -1125,6 +1140,12 @@ export default { ...@@ -1125,6 +1140,12 @@ export default {
} }
this.tradeCityList = (await getTradeCityList(query)).data this.tradeCityList = (await getTradeCityList(query)).data
}, },
async getChannelList(){
let query = {
cityId: this.form.objectiveId
}
this.channelList = (await getChannelList(query)).data
},
onTableMounted(e){ onTableMounted(e){
// console.warn('onTableMounted', e) // console.warn('onTableMounted', e)
}, },
......
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