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

View File

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

View File

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

View File

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