|
@@ -65,8 +65,8 @@
|
|
|
<el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
|
|
|
<div class="periodFrom">
|
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
|
|
|
- <el-form-item label="考评部门" prop="department">
|
|
|
- <el-select v-model="ruleForm.department" placeholder="请选择所属部门" filterable @change="changeDeptLead">
|
|
|
+ <el-form-item label="一级部门" prop="department">
|
|
|
+ <el-select v-model="ruleForm.department" placeholder="请选择所属部门" filterable @change="changedepart2Data">
|
|
|
<el-option
|
|
|
v-for="item in departData"
|
|
|
:key="item.id"
|
|
@@ -75,15 +75,25 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="二级部门">
|
|
|
+ <el-select v-model="ruleForm.depart2ment" placeholder="请选择所属部门" >
|
|
|
+ <el-option
|
|
|
+ v-for="item in depart2Data"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="部门领导" prop="departmentLeader">
|
|
|
- <el-select v-model="ruleForm.departmentLeader" placeholder="请选择部门领导">
|
|
|
+ <el-select v-model="ruleForm.departmentLeader" placeholder="请选择部门领导" filterable>
|
|
|
<el-option
|
|
|
v-for="item in deptLeaderOption"
|
|
|
:key="item.id"
|
|
|
- :label="item.userName"
|
|
|
+ :label="item.name"
|
|
|
:value="item.id">
|
|
|
- <span style="float: left;display:inline-block;width:100px">{{ item.userName }}</span>
|
|
|
- <span style="float: right;color: #909399;font-size: 13px;" >{{ item.posName }}</span>
|
|
|
+ <span style="float: left;display:inline-block;width:100px">{{ item.name }}</span>
|
|
|
+ <span style="float: right;color: #909399;font-size: 13px;" >{{ item.no }}</span>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -113,7 +123,7 @@ import seachs from '../seachGroup.vue'
|
|
|
import addW from '../../assets/btnIcon/addW.png'
|
|
|
import addIcon from '../../assets/btnIcon/add.png'
|
|
|
import {apiGetEvaluationDeptList, apiGetevaluationdeptSave, apiGetevaluationdeptremoveAll, apiGetorganizationstructureFromTree,
|
|
|
-apiGetDepartmentallocationLeader, apiGetevaluationdeptremoveItem} from '../../api/api'
|
|
|
+apiGetuserPageList} from '../../api/api'
|
|
|
export default {
|
|
|
components: { importDailog, btns, seachs },
|
|
|
data() {
|
|
@@ -125,12 +135,23 @@ export default {
|
|
|
departmentS: '',
|
|
|
leaderS: '',
|
|
|
evaluationDepartmentData:[],
|
|
|
- departData: [],
|
|
|
+ departData: [
|
|
|
+ {
|
|
|
+ id: '123546',
|
|
|
+ name: 'cesss'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '55552',
|
|
|
+ name: 'sssss'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ depart2Data: [],
|
|
|
deptLeaderOption: [],
|
|
|
addW: addW,
|
|
|
addIcon: addIcon,
|
|
|
ruleForm: {
|
|
|
department: '',
|
|
|
+ depart2ment: '',
|
|
|
departmentLeader: '',
|
|
|
departmentIn: []
|
|
|
},
|
|
@@ -162,6 +183,7 @@ export default {
|
|
|
created() {
|
|
|
this.getEvalCompanyData()
|
|
|
this.getDepartmentFromTreeData()
|
|
|
+ this.getuserPageList()
|
|
|
this.indicatorCategorys = [
|
|
|
{
|
|
|
label: '指标计划',
|
|
@@ -190,7 +212,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 查询部门
|
|
|
+ // 一级部门
|
|
|
getDepartmentFromTreeData() {
|
|
|
let that = this
|
|
|
let params = {
|
|
@@ -200,17 +222,28 @@ export default {
|
|
|
apiGetorganizationstructureFromTree(params).then(datas =>{
|
|
|
if (datas && datas.data) {
|
|
|
that.departData = datas.data[0].children
|
|
|
- // that.changeDeptLead(that.departData[0].id)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 根据部门查询人员
|
|
|
- changeDeptLead(val) {
|
|
|
+ // 二级部门
|
|
|
+ changedepart2Data(val) {
|
|
|
+ let that = this
|
|
|
+ let params = {
|
|
|
+ id: val,
|
|
|
+ num: 2
|
|
|
+ }
|
|
|
+ apiGetorganizationstructureFromTree(params).then(datas =>{
|
|
|
+ if (datas && datas.data) {
|
|
|
+ that.depart2Data = datas.data[0].children
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查询人员
|
|
|
+ getuserPageList(val) {
|
|
|
let that = this
|
|
|
- apiGetDepartmentallocationLeader(val).then(datas =>{
|
|
|
+ apiGetuserPageList(val).then(datas =>{
|
|
|
if (datas && datas.data) {
|
|
|
- that.deptLeaderOption = datas.data
|
|
|
- that.ruleForm.departmentLeader = datas.data[0].id
|
|
|
+ that.deptLeaderOption = datas.data.records
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -258,15 +291,21 @@ export default {
|
|
|
saveAndEditIndicatorData() {
|
|
|
let that = this
|
|
|
let deptNameS = ''
|
|
|
+ let dept2NameS = ''
|
|
|
let deptLeaderNameS = ''
|
|
|
that.departData.forEach(item =>{
|
|
|
if (item.id === that.ruleForm.department) {
|
|
|
deptNameS = item.name
|
|
|
}
|
|
|
})
|
|
|
+ that.depart2Data.forEach(item =>{
|
|
|
+ if (item.id === that.ruleForm.depart2ment) {
|
|
|
+ dept2NameS = item.name
|
|
|
+ }
|
|
|
+ })
|
|
|
that.deptLeaderOption.forEach(item =>{
|
|
|
if (item.id === that.ruleForm.departmentLeader) {
|
|
|
- deptLeaderNameS = item.userName
|
|
|
+ deptLeaderNameS = item.name
|
|
|
}
|
|
|
})
|
|
|
let yjzbjhTypeIn = '0'
|
|
@@ -279,13 +318,19 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
let params = {
|
|
|
- deptId: that.ruleForm.department,
|
|
|
- deptName: deptNameS,
|
|
|
chargePersonId: that.ruleForm.departmentLeader,
|
|
|
chargePersonName: deptLeaderNameS,
|
|
|
yjzbjhType: yjzbjhTypeIn,
|
|
|
jxjgkhsbType: jxjgkhsbTypeIn
|
|
|
}
|
|
|
+ if (that.ruleForm.depart2ment === '') {
|
|
|
+ params.deptId = that.ruleForm.department
|
|
|
+ params.deptName = deptNameS
|
|
|
+ } else {
|
|
|
+ params.parentId = that.ruleForm.department
|
|
|
+ params.deptId = that.ruleForm.depart2ment
|
|
|
+ params.deptName = dept2NameS
|
|
|
+ }
|
|
|
if (that.isSave) {
|
|
|
params.id = that.evalradio.id
|
|
|
}
|