This commit is contained in:
熊成强 2020-11-06 17:43:41 +08:00
commit 1014eeb81a
4 changed files with 276 additions and 126 deletions

View File

@ -1,6 +1,7 @@
<!-- -->
<template>
<popup-right
v-if="showChooseList"
@cancel="hundlePopupHide"
@submit="handleSubmitPopup"
:title="popupRightTitle"
@ -36,11 +37,13 @@
<el-table-column
label="全选"
width="250"
><template slot-scope="scope"><span>{{scope.row.name}}</span><el-tag style="margin:0 0 0 10px;" v-if="scope.row.score ===1">已开始评分</el-tag></template></el-table-column>
<el-table-column
width="80"
align="right"
><template slot-scope="scope">{{scope.row.counts}}</template></el-table-column>
><template slot-scope="scope"><span>{{scope.row.name}}</span>
<el-tag
style="margin:0 0 0 10px;"
v-if="scope.row.score ===1"
>已开始评分</el-tag>
</template></el-table-column>
<el-table-column align="right"><template slot-scope="scope">{{scope.row.counts}}</template></el-table-column>
</el-table>
<div
v-else

View File

@ -136,6 +136,7 @@ export default {
}
}
&-content {
width: 480px;
flex: 1;
padding: 20px 20px;
overflow: auto;

View File

@ -13,11 +13,11 @@
</div>
<div class="comonPrompt">绩效应用的主管理员可由钉钉主管理员设置绩效主管理员具有应用所有权限且可以设置智能绩效应用子管理员</div>
<div class="authority-main-info">
<el-avatar
icon="el-icon-user-solid"
:size="40"
:src="mainData.masterFirst.headerUrl?mainData.masterFirst.headerUrl:''"
></el-avatar>
<el-avatar
icon="el-icon-user-solid"
:size="40"
:src="mainData.masterFirst.headerUrl?mainData.masterFirst.headerUrl:''"
></el-avatar>
<div class="authority-main-info-name">{{mainData.masterFirst.name}}</div>
</div>
</div>
@ -49,7 +49,6 @@
:size="40"
:src="scope.row.headerUrl?scope.row.headerUrl:''"
></el-avatar>
</template>
</el-table-column>
<el-table-column
@ -71,7 +70,7 @@
label="管理范围"
align="center"
>
<template slot-scope="scope">{{handleGetChildeMangeRange(scope.row.departmentId)}}</template>
<template slot-scope="scope">{{handleGetChildeMangeRange(scope.row)}}</template>
</el-table-column>
<el-table-column
label="是否可见考核结果"
@ -79,11 +78,10 @@
> <template slot-scope="scope">{{scope.row.canSee===0?'不可见':'可见'}}</template></el-table-column>
<el-table-column
label="菜单权限"
:show-overflow-tooltip="true"
align="center"
>
<template slot-scope="scope">
{{scope.row.menuNames.join()}}
{{scope.row.menuId===0?'全部权限':'部分权限'}}
</template>
</el-table-column>
<el-table-column
@ -147,23 +145,24 @@
<dialog-personnel
v-if="showDialogPersonnel"
title="更换智能绩效主管理员"
:title="dialogPersonnelTitle"
:len=1
:isShow.sync='showDialogPersonnel'
@cb="handleDialogSubmitDepart"
></dialog-personnel>
<dialog-depart
v-if="showDialogDepart"
:isShow.sync='showDialogDepart'
:showDataList.sync='popupFromSub.shwoDepartData'
/>
<popup-right
v-if="showPopupAddSub"
@cancel="hundlePopupAddSubHide"
@cancel="showPopupAddSub = false"
@submit="handlePopupAddSubSubmit"
title="智能绩效子管理员设置"
class="popup"
>
<div
slot="content"
style="width: 480px;"
>
<div slot="content">
<el-form
:model="popupFromSub"
label-width="110px"
@ -172,12 +171,20 @@
size="small"
>
<el-form-item label="子管理员">
<el-button
type="primary"
size="small"
plain
@click="handlePopupChooseSub"
>请选择</el-button>
<div
v-if="popupFromSub.subPersonData"
class="line-space"
>
<el-tag size="small">{{popupFromSub.subPersonData.title}}</el-tag>
</div>
<div v-if="!popupSubMngEdit">
<el-button
type="primary"
size="small"
plain
@click="handlePopupChooseSub"
>请选择</el-button>
</div>
</el-form-item>
<el-form-item
label="功能模块"
@ -195,7 +202,7 @@
</el-col>
<el-col :span="11">
<el-checkbox-group
v-model="popupFromSub.checkList"
v-model="popupFromSub.featuresChckList"
@change="handlePopupCheckModel"
>
<el-checkbox label="0">OKR</el-checkbox>
@ -221,26 +228,34 @@
<el-col :span="23">
<el-col :span="10">
<el-radio-group v-model="popupFromSub.radioScope">
<el-radio :label="3">全公司</el-radio>
<el-radio :label="6">所在部门及以下部门</el-radio>
<el-radio :label="9">特定部门</el-radio>
<el-radio :label="0">全公司</el-radio>
<el-radio :label="1">所在部门及以下部门</el-radio>
<el-radio :label="2">特定部门</el-radio>
</el-radio-group>
</el-col>
<el-col :span="24">
<el-col
:span="24"
v-if="popupFromSub.radioScope===2"
>
<el-tag
v-for="tag in tags"
:key="tag.name"
v-for="tag in popupFromSub.shwoDepartData.list"
:key="tag.departmentId"
closable
:type="tag.type"
@close="handleDeleteScopeSubDepte"
size="small"
>
{{tag.name}}
{{tag.departmentName}}
</el-tag>
</el-col>
<el-col :span="10">
<el-col
:span="10"
v-if="popupFromSub.radioScope===2"
>
<el-button
type="primary"
plain
@click="handlePopupChooseDept"
size="small"
@click="showDialogDepart = true"
>请选择</el-button>
</el-col>
</el-col>
@ -251,34 +266,43 @@
<el-form-item label="菜单权限">
<div>
<el-checkbox
v-model="popupFromSub.popupMenu"
v-model="popupFromSub.menuCheckAllState"
@change="handleMenuCheckAllChange"
>全部权限</el-checkbox>
</div>
<div>
<el-checkbox
:indeterminate="popupFromSub.isIndeterminate"
v-model="popupFromSub.menuMngCheckAll"
@change="handleMenuMngCheckAllChange"
>考核管理</el-checkbox>
<el-checkbox-group
v-model="popupFromSub.menuManage"
@change="handleMenuMngCheckChange"
class="popup-menu-mange-group"
>
<el-checkbox label="发起考核"></el-checkbox>
<el-checkbox label="发起考核"></el-checkbox>
<el-checkbox label="发起考核"></el-checkbox>
<el-checkbox label="发起考核"></el-checkbox>
<el-checkbox label="发起考核"></el-checkbox>
</el-checkbox-group>
</div>
<div>
<el-checkbox label="指标库"></el-checkbox>
</div>
<el-checkbox-group
v-model="popupFromSub.menuCheckData"
@change="handleMenuChange"
>
<div>
<el-checkbox
@change="handleMenuMngCheckAllChange"
:label="2"
>考核管理</el-checkbox>
<el-checkbox-group
class="popup-menu-mange-group"
v-model="popupFromSub.menuMngCheck"
>
<el-checkbox
:label="15"
:disabled="popupFromSub.menuCheckData.indexOf(2)<0?true:false"
>发起考核</el-checkbox>
<el-checkbox
:label="16"
:disabled="popupFromSub.menuCheckData.indexOf(2)<0?true:false"
>开始评分</el-checkbox>
</el-checkbox-group>
</div>
<div>
<el-checkbox :label="21">考评组</el-checkbox>
</div>
<div>
<el-checkbox :label="23">绩效报表</el-checkbox>
</div>
</el-checkbox-group>
</el-form-item>
<el-form-item
v-if="popupFromSub.showGroup"
v-if="popupFromSub.menuCheckData.indexOf('考评组')>-1"
label="考评组权限"
>
<div>
@ -294,33 +318,66 @@
>特定考评组</el-radio>
</div>
<div v-if="popupFromSub.groupRadio ==='1'">
<el-button
type="primary"
plain
@click="handlePopupChooseGroup"
>请选择</el-button>
<div class="line-space">
<el-tag
v-for="item in popupFromSub.assessmentList"
:key="item.id"
closable
@close="handlePopupCloseAssessment"
size="small"
>
{{item.name}}
</el-tag>
</div>
<div>
<el-button
type="primary"
plain
@click="dialogVisibleTeamFilter = true"
>请选择</el-button>
</div>
</div>
</el-form-item>
</div>
</el-form>
</div>
</popup-right>
<ChooseInitiate
@cb='handleCallBackChoose'
popupRightTitle='选择考评组'
:oldSelectedList='popupFromSub.assessmentList'
:showChooseList.sync="dialogVisibleTeamFilter"
/>
</div>
</template>
<script>
import dialogPersonnel from '@/components/getPersonnel'
import popupRight from '@/components/PopupRight'
import { apiSetPermissionsInfo, apiSetPermissionsRoleChange, apiSetPermissionsRoleDelete } from '@/api/setPermissions'
import dialogDepart from '@/components/getDepart'
import ChooseInitiate from '@/components/ChooseInitiate'
import { apiSetPermissionsInfo, apiSetPermissionsRoleChange, apiSetPermissionsRoleDelete, apiSetPermissionsRoleDetail } from '@/api/setPermissions'
import invokeThingService$ from 'dingtalk-jsapi/api/biz/iot/invokeThingService'
export default {
components: {
dialogPersonnel,
popupRight
popupRight,
dialogDepart,
ChooseInitiate
},
data () {
return {
dialogPersonnelTitle: '更换智能绩效主管理员',
showDialogPersonnel: false, // /
showPopupAddSub: false, //
showDialogDepart: false, //
dialogVisibleTeamFilter: false, //
popupSubMngEdit: false, // false true
menuCheckAllData: [2, 21, 23],
menuMngCheckAll: [15, 16], //
menuIdOrNameData: { '全部权限': 1, '考核管理': 2, '发起考核': 15, '开始评分': 16, '考评组': 21, '绩效报表': 23 },
mainData: {
masterFirst: {
headerUrl: '',
@ -331,34 +388,51 @@ export default {
masterPM: [], //
boss: []//
},
url: '',
showDialogPersonnel: false,
showPopupAddSub: false, //
popupFromSub: {
showChoosePerformance: true, //
radioScope: 3, //
subPersonData: null, //
shwoDepartData: {
title: '',
list: []
}, //
featuresChckList: ['0', '1'], //
showChoosePerformance: true, //
radioScope: 0, //
resultsVisible: true, //
checkList: ['1'],
menuManage: [], //
menuCheckAll: false,
menuMngCheckAll: false, //
isIndeterminate: true, //
showGroup: true, //
groupRadio: '0' // 0 1
},
tags: [
{ name: '标签一', type: '' },
{ name: 'llkk卡卡街坊邻里', type: 'success' },
{ name: '标签三', type: 'info' },
{ name: '标签四', type: 'warning' },
{ name: '标签五', type: 'danger' }
]
menuCheckAllState: true, //
menuCheckData: [], //
menuMngCheck: [], //
groupRadio: '0', // 0 1
assessmentList: [] //
}
}
},
created () {
this.handleGetSetPageInfo()
},
watch: {
'showPopupAddSub': function (newVal, oldVal) {
console.log('showPopupAddSub==--===', newVal, oldVal)
if (!newVal) {
this.popupSubMngEdit = false
this.popupFromSub = {
subPersonData: null, //
shwoDepartData: {
title: '',
list: []
}, //
featuresChckList: ['0', '1'], //
showChoosePerformance: true, //
radioScope: 0, //
resultsVisible: true, //
menuCheckAllState: true, //
menuCheckData: [], //
menuMngCheck: [], //
groupRadio: '0', // 0 1
assessmentList: [] //
}
}
}
},
methods: {
handleGetChildeModel (type) {
let modelStr = ''
@ -371,9 +445,9 @@ export default {
}
return modelStr
},
handleGetChildeMangeRange (type) {
handleGetChildeMangeRange (row) {
let typeStr = ''
switch (type) {
switch (row.departmentId) {
case 0:
typeStr = '全公司'
break
@ -381,7 +455,9 @@ export default {
typeStr = '所在部门及以下部门'
break
case 2:
typeStr = '特定部门'
if (row.deparmentNames) {
typeStr = row.deparmentNames.join()
}
break
default:
break
@ -415,17 +491,10 @@ export default {
},
handleChangeDirector () {
//
this.dialogPersonnelTitle = '更换智能绩效主管理员'
this.showDialogPersonnel = true
},
handleDialogSubmitDepart (val) {
if (val.list.length <= 0) {
this.$message({
showClose: true,
message: '请选择主管理员',
type: 'error'
}); return
}
console.log('handleDialogSubmitDepart== ', val)
handleChangeDirectorRg (val) {
let msg = '是否将智能绩效主管理员变更为' + val.title
this.$confirm(msg, '提示')
.then(_ => {
@ -436,25 +505,64 @@ export default {
apiSetPermissionsRoleChange(dicPara).then(res => {
if (res.code === 200) {
this.showDialogPersonnel = false
this.$router.push({name: 'workbench-home'})
this.$router.push({ name: 'workbench-home' })
}
})
})
.catch(_ => { })
},
// /
handleDialogSubmitDepart (val) {
if (val.list.length <= 0) {
let msg = this.showPopupAddSub ? '请选择子管理员' : '请选择主管理员'
this.$message({
showClose: true,
message: msg,
type: 'error'
}); return
}
if (this.showPopupAddSub) {
//
this.popupFromSub.subPersonData = val
this.showDialogPersonnel = false
} else {
this.handleChangeDirectorRg(val)
}
console.log('handleDialogSubmitDepart== ', val)
},
handleSubAdd () {
this.popupFromSub.menuCheckData = this.menuCheckAllData
this.popupFromSub.menuMngCheck = this.menuMngCheckAll
this.showPopupAddSub = true
},
handleChildEdit (row) {
console.log('子管理员编辑', row)
this.popupSubMngEdit = true
this.showPopupAddSub = true
//
console.log('编辑-----=====', row)
apiSetPermissionsRoleDetail({ id: row.id }).then(res => {
if (res.code !== 200) {
return
}
const data = res.data
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()
})
console.log('权限详情---', res)
})
},
handleChildDelete (row) {
//
this.$confirm('确认删除该管理员,删除后该子管理员将失去智能绩效的子管理员权限', '提示').then(_ => {
console.log('删除子管理员', row)
apiSetPermissionsRoleDelete({id: row.id}).then(res => {
apiSetPermissionsRoleDelete({ id: row.id }).then(res => {
if (res.code === 200) {
//
//
this.$message({
message: '删除子管理成功',
type: 'success'
@ -466,36 +574,79 @@ export default {
})
},
hundlePopupAddSubHide () {
this.showPopupAddSub = false
},
handlePopupAddSubSubmit () {
this.showPopupAddSub = false
if (!this.popupFromSub.subPersonData) {
this.$message.error('请选择子管理员')
} else if (this.popupFromSub.featuresChckList.length <= 0) {
this.$message.error('至少选择一个权限类型')
} else {
//
// id
const assessmentIdsStr = this.popupFromSub.assessmentList.map((item, index) => {
return item.id
}).join(',')
const departmentInfoStr = this.popupFromSub.shwoDepartData.list.map((item, index) => {
return item.departmentId
}).join(',')
// id
let menuIdStr = ''
let paraDic = {
id: '',
staffId: this.popupFromSub.subPersonData.value,
departmentId: this.popupFromSub.radioScope, //
departmentInfoStr: departmentInfoStr,
evaluationGroupId: this.popupFromSub.groupRadio, //
evaluationGroupInfoStr: assessmentIdsStr,
selectStaffMenuInfoStr: menuIdStr, //
departmentLevel: 'CHILD_PM'
}
console.log('提交---============', paraDic)
}
// this.popupFromSub.subPersonData
// this.showPopupAddSub = false
},
handlePopupChooseSub () {
//
this.dialogPersonnelTitle = '选择成员'
this.showDialogPersonnel = true
},
handlePopupCheckModel (val) {
console.log(val.indexOf('1'))
this.popupFromSub.showChoosePerformance = val.indexOf('1') > -1
//
console.log('功能模块--======', val, this.popupFromSub.checkList)
},
handlePopupChooseDept () {
//
handleDeleteScopeSubDepte (tag) {
//
this.popupFromSub.shwoDepartData.list.splice(this.popupFromSub.shwoDepartData.list.indexOf(tag), 1)
},
//
handleMenuCheckAllChange () {
handleMenuCheckAllChange (val) {
//
this.popupFromSub.menuCheckData = val ? this.menuCheckAllData : []
this.popupFromSub.menuMngCheck = val ? this.menuMngCheckAll : []
},
handleMenuMngCheckAllChange () {
handleMenuChange (val) {
//
this.popupFromSub.menuCheckAllState = this.menuCheckAllData.length === this.popupFromSub.menuCheckData.length
},
handleMenuMngCheckAllChange (val) {
//
if (val) {
//
this.popupFromSub.menuMngCheck = this.menuMngCheckAll
} else {
this.popupFromSub.menuMngCheck = []
}
},
handleMenuMngCheckChange () {
//
handleCallBackChoose (val) {
//
this.popupFromSub.assessmentList = val.list
this.dialogVisibleTeamFilter = false
console.log('特定考评组选择 ', val, this.dialogVisibleTeamFilter)
},
handlePopupChooseGroup () {
//
handlePopupCloseAssessment (item) {
this.popupFromSub.assessmentList.splice(this.popupFromSub.assessmentList.indexOf(item), 1)
},
handleGetSetPageInfo () {
let paraDic = {
@ -521,7 +672,7 @@ export default {
background-color: white;
padding-top: 40px;
.line-space {
margin-bottom: 18px;
margin-bottom: 10px;
}
&-main {
&-header {

View File

@ -97,7 +97,6 @@
</el-form>
<div>
<ChooseInitiate
v-if="showChooseList"
@cb='handleCallBackChoose'
subumitText='确定'
:popupRightTitle='popupTitle'
@ -171,10 +170,6 @@ export default {
}
this.formData.mergeType.name = nameStr
},
hundlePopupHide () {
this.$refs.popupMultipleTable.clearSelection()
this.showChooseList = false
},
handleChooseGroup () {
this.showChooseList = !this.showChooseList
},