|
|
@ -110,7 +110,8 @@ |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
per: true, // 是否有权限 |
|
|
|
per: true, // 是否有权限 |
|
|
|
teamId: uni.getStorageSync('team').teamId || '', |
|
|
|
// teamId: uni.getStorageSync('team').teamId || '', |
|
|
|
|
|
|
|
teamId: '', |
|
|
|
list: [], |
|
|
|
list: [], |
|
|
|
id: '', |
|
|
|
id: '', |
|
|
|
teamList: [] |
|
|
|
teamList: [] |
|
|
@ -133,6 +134,7 @@ |
|
|
|
teamId: this.teamId, |
|
|
|
teamId: this.teamId, |
|
|
|
platformId: 4 |
|
|
|
platformId: 4 |
|
|
|
}).then(({ permissionMenu }) => { |
|
|
|
}).then(({ permissionMenu }) => { |
|
|
|
|
|
|
|
uni.hideLoading() |
|
|
|
const auth = [] |
|
|
|
const auth = [] |
|
|
|
const generateAuth = (list, parent) => { |
|
|
|
const generateAuth = (list, parent) => { |
|
|
|
list.map(e => { |
|
|
|
list.map(e => { |
|
|
@ -146,28 +148,36 @@ |
|
|
|
this.$forceUpdate() |
|
|
|
this.$forceUpdate() |
|
|
|
this.initRole() |
|
|
|
this.initRole() |
|
|
|
}).catch(e => { |
|
|
|
}).catch(e => { |
|
|
|
|
|
|
|
uni.hideLoading() |
|
|
|
uni.setStorageSync('auth', []) |
|
|
|
uni.setStorageSync('auth', []) |
|
|
|
this.initRole() |
|
|
|
this.initRole() |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取团队 |
|
|
|
// 获取团队 |
|
|
|
getInfo() { |
|
|
|
getInfo() { |
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
|
|
title: '加载中' |
|
|
|
|
|
|
|
}) |
|
|
|
getTeamsByAccountId().then(({ data }) => { |
|
|
|
getTeamsByAccountId().then(({ data }) => { |
|
|
|
data.map(e => { |
|
|
|
data.map(e => { |
|
|
|
const n = e.partnerClassificationList |
|
|
|
const n = e.partnerClassificationList |
|
|
|
e.id = n.id |
|
|
|
e.id = n.id |
|
|
|
e.teamId = e.partnerClassificationId |
|
|
|
e.teamId = n.isTeam == 1 ? e.partnerClassificationId : n.id |
|
|
|
e.partnerClassificationName = n.partnerClassificationName |
|
|
|
e.partnerClassificationName = n.partnerClassificationName |
|
|
|
delete e.partnerClassificationList |
|
|
|
delete e.partnerClassificationList |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (data.length) { |
|
|
|
if (data.length) { |
|
|
|
// 如果是第一次进,则默认选中第一个团队,并把该团队的信息存入缓存 |
|
|
|
/** |
|
|
|
if (!this.teamId) { |
|
|
|
* @description 如果是第一次进,则默认选中第一个团队,并把该团队的信息存入缓存 |
|
|
|
|
|
|
|
* 或者团队列表里没有该id,则说明超管已经被转让,也需要重新选中团队 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
if (!this.teamId || !data.find(e => e.teamId == this.teamId)) { |
|
|
|
this.teamId = data[0].teamId |
|
|
|
this.teamId = data[0].teamId |
|
|
|
uni.setStorageSync('team', data[0]) |
|
|
|
uni.setStorageSync('team', data[0]) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// 如果没有团队,则退出登录 |
|
|
|
// 如果没有团队,则退出登录 |
|
|
|
|
|
|
|
uni.hideLoading() |
|
|
|
uni.clearStorageSync() |
|
|
|
uni.clearStorageSync() |
|
|
|
uni.navigateTo({ |
|
|
|
uni.navigateTo({ |
|
|
|
url: '../login/login' |
|
|
|
url: '../login/login' |
|
|
@ -176,7 +186,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
this.list = data |
|
|
|
this.list = data |
|
|
|
this.getAuth() |
|
|
|
this.getAuth() |
|
|
|
}).catch(e => {}) |
|
|
|
}).catch(e => { |
|
|
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 团队选择回调 |
|
|
|
// 团队选择回调 |
|
|
|
teamChange() { |
|
|
|
teamChange() { |
|
|
|