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 {
}
},
// 目的地
'form.objectiveId'(objectiveId, oldObjectiveId){
this.getOpenedRouterList()
// 修改目的地后需要重新选择路线
if(oldObjectiveId && oldObjectiveId != objectiveId && !this.initing){
console.log('修改目的地,重置lineId', oldObjectiveId, objectiveId)
async 'form.objectiveId'(objectiveId, oldObjectiveId){
// 重新获取路线
await this.getOpenedRouterList()
// 如果已选择的路线不在可用路线里则重置
if(this.form.lineId && !this.routerList.find(item => item.id == this.form.lineId)){
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){
// 空运
......@@ -941,11 +948,19 @@ export default {
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'(){
......@@ -1093,7 +1108,7 @@ export default {
})
this.productAttrList = (await getProductAttrList()).data
this.channelList = (await getChannelList()).data
await this.getChannelList()
await this.getTradeCity()
this.currencyList = (await getCurrencyList()).data
this.unitList = (await getUnitList()).data
......@@ -1125,6 +1140,12 @@ export default {
}
this.tradeCityList = (await getTradeCityList(query)).data
},
async getChannelList(){
let query = {
cityId: this.form.objectiveId
}
this.channelList = (await getChannelList(query)).data
},
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