diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 3a8f4c6..4ced732 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -19,7 +19,8 @@ const getDefaultState = () => { name: '', info: {}, avatar: '', - roles: [] + roles: [], + myRole: [], } } @@ -43,6 +44,9 @@ const mutations = { }, SET_ROLES: (state, roles) => { state.roles = roles + }, + SET_MYROLE: (state, roles) => { + state.myRole = roles } } @@ -117,13 +121,13 @@ const actions = { } response["roles"] = ["admin"]; const { + role, roles, name, avatar } = response - - + commit('SET_MYROLE', role) commit('SET_ROLES', roles) commit('SET_NAME', name) commit('SET_AVATAR', avatar) diff --git a/src/views/budget/component/payPlan.vue b/src/views/budget/component/payPlan.vue index d298b69..eee78df 100644 --- a/src/views/budget/component/payPlan.vue +++ b/src/views/budget/component/payPlan.vue @@ -127,6 +127,7 @@ export default { { - /* - - */ + (this.$store.state.user.myRole.find(i => /领导|系统管理员/g.test(i.name)) && row.id && (row.status === 0 || row.status === undefined || row.status === null)) ? + () : "" + } + { + (this.$store.state.user.myRole.find(i => /领导|系统管理员/g.test(i.name)) && row.id && (row.status === 1)) ? + () : "" } );