Commit fff0095f authored by xiongjinke's avatar xiongjinke

修改

parent 591da3b3
...@@ -165,17 +165,28 @@ export default { ...@@ -165,17 +165,28 @@ export default {
return this.$store.state.permission.routes return this.$store.state.permission.routes
} }
}, },
beforeRouteEnter(to, from, next) { watch: {
next(vm => { '$route'(to, from) {
if(from.name){ // 检测查询参数的变化
if (to.query.customerId){ if (to.query.customerId) {
let customerId = to.query.customerId if (this.companyId == 0) {
if(to.query.path){ let customerId = to.query.customerId
vm.currentPath.pathName = to.query.path this.association(customerId)
} }
vm.association(customerId)
} }
if (to.query.path) {
this.currentPath.pathName = to.query.path
} }
}
},
beforeRouteLeave(to, from, next) {
next(vm => {
})
},
beforeRouteEnter(to, from, next){
next(vm => {
}) })
}, },
created() { created() {
...@@ -237,10 +248,8 @@ export default { ...@@ -237,10 +248,8 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.customerInfo = res.data this.customerInfo = res.data
this.customerId = res.data.customerId this.customerId = res.data.customerId
this.isCustomer = true
this.isCompanyId = true
}) })
if(res.data.companyId == this.companyId && this.companyInfo){ if(res.data.companyId == this.companyId){
this.$nextTick(() => { this.$nextTick(() => {
this.isCustomer = true this.isCustomer = true
this.isCompany = true this.isCompany = true
...@@ -260,20 +269,23 @@ export default { ...@@ -260,20 +269,23 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.isCustomer = true this.isCustomer = true
this.isCompany = true this.isCompany = true
this.currentPath.pathName = 'overview'
}) })
this.currentPath.pathName = 'overview'
} }
} }
}).catch(err => { }).catch(err => {
this.currentPath.pathName = 'overview'
this.$nextTick(() => { this.$nextTick(() => {
this.currentPath.pathName = 'overview'
this.isCompany = true this.isCompany = true
}) })
}) })
}else{ }else{
this.isCompany = true this.$nextTick(() => {
this.isCompany = true
this.currentPath.pathName = 'overview'
})
} }
} },
} }
} }
......
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