权限管理完成
This commit is contained in:
parent
8a67774b63
commit
d788b45d3d
@ -111,6 +111,17 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-pagination
|
||||
:hide-on-single-page="true"
|
||||
:current-page.sync="rqInfoParameter.currPage"
|
||||
:page-size="rqInfoParameter.pageSize"
|
||||
:total="rqInfoParameter.totalCount"
|
||||
:page-count="rqInfoParameter.totalPage"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, prev, pager, next, jumper"
|
||||
></el-pagination>
|
||||
|
||||
</div>
|
||||
<div class="authority-ceo line-space comonPrompt">
|
||||
<div class="comonTitle line-space">企业负责人</div>
|
||||
@ -194,20 +205,24 @@
|
||||
<el-tooltip
|
||||
class="item"
|
||||
effect="dark"
|
||||
content="分别控制管理员有1.发起OKR考核权限(基础设置-OKR模块需要开启,开启后OKR全公司可见)2.发起绩效考核的权限"
|
||||
content="分别控制管理员有1.发起绩效考核的权限"
|
||||
placement="bottom"
|
||||
>
|
||||
<i class="el-icon-info" />
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<el-checkbox-group
|
||||
<el-checkbox
|
||||
v-model="popupFromSub.featuresCheck"
|
||||
@change="popupFromSub.featuresCheck=true"
|
||||
>绩效考核</el-checkbox>
|
||||
<!-- <el-checkbox-group
|
||||
v-model="popupFromSub.featuresChckList"
|
||||
@change="handlePopupCheckModel"
|
||||
>
|
||||
<el-checkbox label="0">OKR</el-checkbox>
|
||||
<el-checkbox label="1">绩效考核</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-checkbox-group> -->
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<div v-if="popupFromSub.showChoosePerformance">
|
||||
@ -260,9 +275,9 @@
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否可见考核结果">
|
||||
<!-- <el-form-item label="是否可见考核结果">
|
||||
<el-switch v-model="popupFromSub.resultsVisible"></el-switch>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="菜单权限">
|
||||
<div>
|
||||
<el-checkbox
|
||||
@ -302,7 +317,7 @@
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="popupFromSub.menuCheckData.indexOf('考评组')>-1"
|
||||
v-if="popupFromSub.menuCheckData.indexOf(2)>-1"
|
||||
label="考评组权限"
|
||||
>
|
||||
<div>
|
||||
@ -377,7 +392,7 @@ export default {
|
||||
popupSubMngEdit: false, // 子管理员 false 添加 true 编辑
|
||||
menuCheckAllData: [2, 21, 23],
|
||||
menuMngCheckAll: [15, 16], // 考核管理全选
|
||||
menuIdOrNameData: { '全部权限': 1, '考核管理': 2, '发起考核': 15, '开始评分': 16, '考评组': 21, '绩效报表': 23 },
|
||||
// menuIdOrNameData: { '全部权限': 1, '考核管理': 2, '发起考核': 15, '开始评分': 16, '考评组': 21, '绩效报表': 23 },
|
||||
mainData: {
|
||||
masterFirst: {
|
||||
headerUrl: '',
|
||||
@ -389,6 +404,8 @@ export default {
|
||||
boss: []// 老板
|
||||
},
|
||||
popupFromSub: {
|
||||
id: '', // 权限id
|
||||
featuresCheck: true,
|
||||
subPersonData: null, // 选中要添加的子管理员
|
||||
shwoDepartData: {
|
||||
title: '',
|
||||
@ -403,6 +420,12 @@ export default {
|
||||
menuMngCheck: [], // 考核管理
|
||||
groupRadio: '0', // 考评组选择 0 全部考评组 1 特定考评组
|
||||
assessmentList: [] // 选中的考评组
|
||||
},
|
||||
rqInfoParameter: {
|
||||
currPage: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 1,
|
||||
totalPage: 1
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -415,11 +438,13 @@ export default {
|
||||
if (!newVal) {
|
||||
this.popupSubMngEdit = false
|
||||
this.popupFromSub = {
|
||||
id: '', // 权限id
|
||||
subPersonData: null, // 选中要添加的子管理员
|
||||
shwoDepartData: {
|
||||
title: '',
|
||||
list: []
|
||||
}, // 指定部门
|
||||
featuresCheck: true,
|
||||
featuresChckList: ['0', '1'], // 功能模块
|
||||
showChoosePerformance: true, // 绩效考核
|
||||
radioScope: 0, // 管理范围
|
||||
@ -535,6 +560,11 @@ export default {
|
||||
this.popupFromSub.menuMngCheck = this.menuMngCheckAll
|
||||
this.showPopupAddSub = true
|
||||
},
|
||||
handleCurrentChange (val) {
|
||||
// 页面切换
|
||||
this.rqInfoParameter.currPage = val
|
||||
this.handleGetSetPageInfo()
|
||||
},
|
||||
handleChildEdit (row) {
|
||||
this.popupSubMngEdit = true
|
||||
this.showPopupAddSub = true
|
||||
@ -544,16 +574,45 @@ export default {
|
||||
if (res.code !== 200) {
|
||||
return
|
||||
}
|
||||
this.showPopupAddSub = true
|
||||
const data = res.data
|
||||
this.popupFromSub.id = row.id
|
||||
this.popupFromSub.subPersonData = { title: row.name, value: row.staffId }
|
||||
this.popupFromSub.radioScope = data.departmentId // 管理范围
|
||||
this.popupFromSub.shwoDepartData.list = data.departmentInfos // 指定部门
|
||||
this.popupFromSub.evaluationGroupId = data.evaluationGroupId // 考评组
|
||||
this.popupFromSub.assessmentList = data.departmentInfos
|
||||
data.selectStaffMenuInfos.map((item, index) => {
|
||||
return this.menuIdOrNameData.value()
|
||||
this.popupFromSub.menuCheckAllState = false // 全选中状态
|
||||
console.log('selectStaffMenuInfos====', data.selectStaffMenuInfos)
|
||||
let selectStaffMenuInfos = data.selectStaffMenuInfos ? data.selectStaffMenuInfos : []
|
||||
selectStaffMenuInfos.forEach(item => {
|
||||
switch (item) {
|
||||
case 1:
|
||||
this.popupFromSub.menuCheckAllState = true
|
||||
break
|
||||
case 2:
|
||||
case 21:
|
||||
case 23:
|
||||
console.log('item ======', item)
|
||||
if (this.popupFromSub.menuCheckData.indexOf(item) < 0) {
|
||||
this.popupFromSub.menuCheckData.push(item)
|
||||
}
|
||||
break
|
||||
case 15:
|
||||
case 16:
|
||||
if (this.popupFromSub.menuMngCheck.indexOf(item) < 0) {
|
||||
this.popupFromSub.menuMngCheck.push(item)
|
||||
}
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
})
|
||||
console.log('权限详情---', res)
|
||||
if (this.popupFromSub.menuCheckData.indexOf(2) < 0) {
|
||||
this.popupFromSub.menuMngCheck = []
|
||||
}
|
||||
console.log('编辑====', this.popupFromSub)
|
||||
// console.log('权限详情---', res)
|
||||
})
|
||||
},
|
||||
handleChildDelete (row) {
|
||||
@ -567,6 +626,7 @@ export default {
|
||||
message: '删除子管理成功',
|
||||
type: 'success'
|
||||
}) // 刷新页面信息
|
||||
this.rqInfoParameter.currPage = 1
|
||||
this.handleGetSetPageInfo()
|
||||
}
|
||||
})
|
||||
@ -590,8 +650,14 @@ export default {
|
||||
}).join(',')
|
||||
// 菜单id
|
||||
let menuIdStr = ''
|
||||
let menuCheckList = this.popupFromSub.menuCheckData.concat(this.popupFromSub.menuMngCheck)
|
||||
if (this.popupFromSub.menuCheckAllState) {
|
||||
// 添加权限
|
||||
menuCheckList.push('1')
|
||||
}
|
||||
menuIdStr = menuCheckList.join(',')
|
||||
let paraDic = {
|
||||
id: '',
|
||||
id: this.popupFromSub.id,
|
||||
staffId: this.popupFromSub.subPersonData.value,
|
||||
departmentId: this.popupFromSub.radioScope, // 管理范围
|
||||
departmentInfoStr: departmentInfoStr,
|
||||
@ -600,7 +666,13 @@ export default {
|
||||
selectStaffMenuInfoStr: menuIdStr, // 选中的菜单权限
|
||||
departmentLevel: 'CHILD_PM'
|
||||
}
|
||||
console.log('提交---============', paraDic)
|
||||
apiSetPermissionsRoleChange(paraDic).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.showPopupAddSub = false
|
||||
// 管理员权限 修改成功
|
||||
this.handleGetSetPageInfo()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// this.popupFromSub.subPersonData
|
||||
@ -649,14 +721,17 @@ export default {
|
||||
this.popupFromSub.assessmentList.splice(this.popupFromSub.assessmentList.indexOf(item), 1)
|
||||
},
|
||||
handleGetSetPageInfo () {
|
||||
let paraDic = {
|
||||
currPage: 1,
|
||||
pageSize: 400
|
||||
let rqDic = {
|
||||
currPage: this.rqInfoParameter.currPage,
|
||||
pageSize: this.rqInfoParameter.pageSize
|
||||
}
|
||||
apiSetPermissionsInfo(paraDic).then(res => {
|
||||
apiSetPermissionsInfo(rqDic).then(res => {
|
||||
if (res.code !== 200) {
|
||||
return
|
||||
}
|
||||
this.rqInfoParameter.currPage = res.currPage
|
||||
this.rqInfoParameter.totalCount = res.totalCount
|
||||
this.rqInfoParameter.totalPage = res.totalPage
|
||||
this.mainData.masterFirst = res.data.masterPM.length > 0 ? res.data.masterPM[0] : {}
|
||||
this.mainData.childPm = res.data.childPm
|
||||
this.mainData.boss = res.data.boss
|
||||
@ -697,6 +772,10 @@ export default {
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.el-pagination {
|
||||
margin-top: 10px;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
&-ceo {
|
||||
align-content: start;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user