Commit 62e1194f authored by caixingbing's avatar caixingbing
parents e1adecce 218f1389
...@@ -165,17 +165,50 @@ export default { ...@@ -165,17 +165,50 @@ 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.name == 'PartyA' && to.query.customerId){
if (to.query.customerId){ if (to.query.customerId && to.query.path == 'business' || to.query.path == 'gjjl') {
let customerId = to.query.customerId if (this.companyId == 0) {
if(to.query.path){ customerInfo(to.query.customerId).then(res => {
vm.currentPath.pathName = to.query.path if (res.code == 200) {
if (res.data.userId == this.$store.state.user.userId) {
this.$nextTick(() => {
this.customerInfo = res.data
this.customerId = res.data.customerId
this.isCustomer = true
this.isCompany = false
this.currentPath.pathName = this.$route.query.path || 'business'
this.companyInfo = {
companyName: this.customerInfo.companyName
}
document.getElementById('tagTitle').innerText = this.customerInfo.companyName
})
}
}
})
}
if (to.query.customerId == this.customerId && to.query.path) {
this.currentPath.pathName = to.query.path
} }
vm.association(customerId) }
}else{
if(from.name == 'PartyA' && !from.query.customerId){
this.$nextTick(() => {
this.isCompany = true
})
} }
} }
}
},
beforeRouteLeave(to, from, next) {
next(vm => {
})
},
beforeRouteEnter(to, from, next){
next(vm => {
}) })
}, },
created() { created() {
...@@ -237,10 +270,8 @@ export default { ...@@ -237,10 +270,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 +291,23 @@ export default { ...@@ -260,20 +291,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