|
|
|
@ -1,10 +1,11 @@ |
|
|
|
import {getStaffbasicinfo} from "../../utils/api"; |
|
|
|
|
|
|
|
const app = getApp() |
|
|
|
import {getOwnedRolesOfStaffId} from '../../utils/statisticsApi.js' |
|
|
|
import {getOwnedRolesOfStaffId,editstaffinit} from '../../utils/statisticsApi.js' |
|
|
|
|
|
|
|
Component({ |
|
|
|
data: { |
|
|
|
manageOrgNameList:[], |
|
|
|
selected: 0, |
|
|
|
color: "#999", |
|
|
|
selectedColor: "#3A80E7", |
|
|
|
@ -57,23 +58,35 @@ Component({ |
|
|
|
selected: app.globalData.selected |
|
|
|
}) |
|
|
|
// secretary 书记 admin 管理员
|
|
|
|
console.log( app.globalData.roleList.filter(item => item.roleKey === 'secretary')) |
|
|
|
if(app.globalData.roleList.length <= 0) { |
|
|
|
|
|
|
|
getStaffbasicinfo().then(res=>{ |
|
|
|
editstaffinit({ |
|
|
|
agencyId: res.data.agencyId, |
|
|
|
staffId: res.data.id |
|
|
|
}).then(res4 => { |
|
|
|
this.setData({ |
|
|
|
manageOrgNameList: res4.data.manageOrgNameList |
|
|
|
}) |
|
|
|
}) |
|
|
|
getOwnedRolesOfStaffId(res.data.id).then(res2 => { |
|
|
|
app.globalData.user = res.data |
|
|
|
this.setData({ |
|
|
|
"list[3].show": res2.data.filter(item => item.roleKey === 'secretary' || item.roleKey === 'administrator' || item.roleKey === 'street_secretary').length > 0 |
|
|
|
"list[3].show": res2.data.filter(item => item.roleKey === 'secretary' || item.roleKey === 'administrator' || item.roleKey === 'street_secretary').length > 0||manageOrgNameList |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
editstaffinit({ agencyId:app.globalData.user.agencyId, staffId:app.globalData.user.id}).then(res4=>{ |
|
|
|
this.setData({ |
|
|
|
manageOrgNameList:res4.data.manageOrgNameList |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
"list[3].show": app.globalData.roleList.filter(item => item.roleKey === 'secretary' || item.roleKey === 'administrator' || item.roleKey === 'street_secretary').length > 0 |
|
|
|
"list[3].show": app.globalData.roleList.filter(item => item.roleKey === 'secretary' || item.roleKey === 'administrator' || item.roleKey === 'street_secretary').length > 0 ||manageOrgNameList |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log(app.globalData.roleList, 'userss') |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
switchTab(e) { |
|
|
|
|