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

报价单的渠道,目的城市,线路联动

parent b17c0dc9
......@@ -795,7 +795,9 @@ export default {
this.getOpenedRouterList()
},
// 目的地
'form.objectiveId'(){
async 'form.objectiveId'(){
await this.$nextTick()
await this.getChannelList()
this.getOpenedRouterList()
},
'form.transportId'(transportId, oldTransportId){
......@@ -818,20 +820,22 @@ export default {
this.$set(this.form, 'lineId', undefined)
}
},
'form.channelId'(){
async 'form.channelId'(){
await this.getTradeCity()
this.getOpenedRouterList()
this.calculationPrice('form.channelId')
},
'form.lineId'(lineId){
async 'form.lineId'(lineId){
let router = this.routerList.find(item => item.id == lineId)
if(router){
this.$set(this.form, 'departureId', router.startCityId)
this.$set(this.form, 'objectiveId', router.destCityId)
}
this.$nextTick(() => {
this.calculationPrice('form.lineId')
})
await this.$nextTick()
await this.getChannelList()
await this.getTradeCity()
await this.calculationPrice('form.lineId')
},
'form.transportVO.packageTypeArr'(val){
this.$set(this.form.transportVO, 'packageType', (val || []).join(','))
......@@ -851,10 +855,10 @@ export default {
this.getOffer()
}
},
created() {
async created() {
await this.getChannelList()
await this.getTradeCity()
getProductAttrList().then(res => this.productAttrList = res.data)
getChannelList().then(res => this.channelList = res.data)
getTradeCityList().then(res => this.tradeCityList = res.data)
getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data)
this.transportList = this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE)
......@@ -864,6 +868,20 @@ export default {
}else this.addProduct()
},
methods: {
async getChannelList(){
let query = {
cityId: this.form.objectiveId,
lineId: this.form.lineId
}
this.channelList = (await getChannelList(query)).data || []
},
async getTradeCity(){
let query = {}
if(this.form.channelId){
query.channelId = this.form.channelId
}
this.tradeCityList = (await getTradeCityList(query)).data || []
},
getOffer(){
getOffer(this.$route.query.id).then(res => {
let formData = res.data
......
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