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

优化基础数据加载

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