Commit 9c37f493 authored by dragondean@qq.com's avatar dragondean@qq.com

优化基础数据加载

parent 70ceb1ca
......@@ -755,15 +755,22 @@ export default {
},
// 始发地
'form.departureId'(departureId, oldDepartureId){
console.log('departureId', departureId)
this.getOpenedRouterList()
// 修改始发地后需要重新选择路线
if(oldDepartureId && oldDepartureId != departureId)this.$set(this.form, 'lineId', null)
if(oldDepartureId && oldDepartureId != departureId){
console.log('修改始发地,重置lineId', oldDepartureId, departureId)
this.$set(this.form, 'lineId', null)
}
},
// 目的地
'form.objectiveId'(objectiveId, oldObjectiveId){
this.getOpenedRouterList()
// 修改目的地后需要重新选择路线
if(oldObjectiveId && oldObjectiveId != objectiveId)this.$set(this.form, 'lineId', null)
if(oldObjectiveId && oldObjectiveId != objectiveId){
console.log('修改目的地,重置lineId', oldObjectiveId, objectiveId)
this.$set(this.form, 'lineId', null)
}
},
'form.transportId'(transportId, oldTransportId){
// 海运拼柜给表单默认值
......@@ -796,7 +803,6 @@ export default {
'form.lineId'(lineId){
let router = this.routerList.find(item => item.id == lineId)
if(!router){
console.log('未选择路线', router, lineId, JSON.stringify(this.routerList))
return
}
this.$set(this.form, 'departureId', router.startCityId)
......@@ -850,16 +856,14 @@ export default {
this.getOrder()
}
},
created() {
async created() {
defaultFormData = Object.assign({}, this.form)
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.productAttrList = (await getProductAttrList()).data
this.channelList = (await getChannelList()).data
this.tradeCityList = (await getTradeCityList()).data
this.currencyList = (await getCurrencyList()).data
this.unitList = (await getUnitList()).data
this.transportList = this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE)
this.getDictDatas(this.DICT_TYPE.ECW_CUSTOM_DRAWEE).forEach(item => {
this.customDraweeList.push({
......
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