Commit 62e1194f authored by caixingbing's avatar caixingbing
parents e1adecce 218f1389
......@@ -165,17 +165,50 @@ export default {
return this.$store.state.permission.routes
}
},
beforeRouteEnter(to, from, next) {
next(vm => {
if(from.name){
if (to.query.customerId){
let customerId = to.query.customerId
if(to.query.path){
vm.currentPath.pathName = to.query.path
watch: {
'$route'(to, from) {
if(to.name == 'PartyA' && to.query.customerId){
if (to.query.customerId && to.query.path == 'business' || to.query.path == 'gjjl') {
if (this.companyId == 0) {
customerInfo(to.query.customerId).then(res => {
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() {
......@@ -237,10 +270,8 @@ export default {
this.$nextTick(() => {
this.customerInfo = res.data
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.isCustomer = true
this.isCompany = true
......@@ -260,20 +291,23 @@ export default {
this.$nextTick(() => {
this.isCustomer = true
this.isCompany = true
this.currentPath.pathName = 'overview'
})
this.currentPath.pathName = 'overview'
}
}
}).catch(err => {
this.currentPath.pathName = 'overview'
this.$nextTick(() => {
this.currentPath.pathName = 'overview'
this.isCompany = true
})
})
}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