This commit is contained in:
熊成强 2020-11-09 09:07:15 +08:00
commit 238c6ecd4a

View File

@ -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;