| | |
| | | getEmployeeLevelList(dictKey).then((res) => { |
| | | const { code, data } = res.data |
| | | if (code !== 200) return this.$message.error('当前级别人员加载失败,请重试!!') |
| | | const participateInList = data.map(item => { |
| | | const { id, name, deptId, deptName, postId, postName } = item |
| | | return { id, name, deptId, deptName, postId, postName } |
| | | }) |
| | | const params = { |
| | | employeeType: dictKey, |
| | | participateIn: data, |
| | | participateIn: participateInList, |
| | | notParticipateIn: [] |
| | | } |
| | | if (index === -1) { |
| | |
| | | }) |
| | | }, |
| | | addEvaluateParams(params) { |
| | | const index = this.form.votePersonObjInfo.findIndex(item => item.employeeType === params.employeeType) |
| | | const { participateIn, employeeType } = params |
| | | const index = this.form.votePersonObjInfo.findIndex(item => item.employeeType === employeeType) |
| | | const typeIndex = this.form.pollingPersons.findIndex(item => item === employeeType) |
| | | |
| | | if (index === -1) { |
| | | this.form.votePersonObjInfo.push(params) |
| | | this.form.pollingPersons.push(params.employeeType) |
| | | if (participateIn.length > 0) { |
| | | this.form.votePersonObjInfo.push(params) |
| | | this.form.pollingPersons.push(params.employeeType) |
| | | } |
| | | } else { |
| | | this.form.votePersonObjInfo[index] = params |
| | | if (participateIn.length > 0) { |
| | | this.form.votePersonObjInfo[index] = params |
| | | } else { |
| | | this.form.votePersonObjInfo.splice(index, 1) |
| | | this.form.pollingPersons.splice(typeIndex, 1) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <el-dialog v-model="params.visible" title="第一轮评优结果"> |
| | | <el-dialog v-model="params.visible" title="第一轮评优结果" @open="dialogOpen"> |
| | | <avue-crud v-model:page="page" :option="option" :table-loading="loading" :data="data" |
| | | @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange"> |
| | | <!-- @on-load="onLoad" --> |
| | | <template #isAddCandidate="{ row }"> |
| | | <el-tag :type="row.isAddCandidate ? 'success' : 'warning'">{{ row.isAddCandidate ? '已加入' : '未加入' }}</el-tag> |
| | | </template> |
| | | <template #menu="{ row }"> |
| | | <el-button type="primary" icon="el-icon-plus" text @click="addEvaluateTypeHandler(row)">添加至第二轮</el-button> |
| | | <el-button :type="row.isAddCandidate ? 'success' : 'primary'" |
| | | :icon="row.isAddCandidate ? 'el-icon-edit' : 'el-icon-plus'" text @click="addEvaluateTypeHandler(row)"> |
| | | {{ row.isAddCandidate ? '修改评优类别' : '添加至第二轮' }} |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog v-model="addEvaluateTypeVisible" width="400px" title="请选择添加至评优类别" append-to-body |
| | |
| | | column: [ |
| | | { |
| | | label: '姓名', |
| | | prop: 'user_name', |
| | | prop: 'userName', |
| | | type: 'input' |
| | | }, |
| | | { |
| | | label: '部门', |
| | | prop: 'dept_name', |
| | | prop: 'deptName', |
| | | type: 'input' |
| | | }, |
| | | { |
| | | label: '职位', |
| | | prop: 'post_name', |
| | | prop: 'postName', |
| | | type: 'input' |
| | | }, |
| | | { |
| | |
| | | return value + '票' |
| | | } |
| | | }, |
| | | { |
| | | label: '是否已加入第二轮评优', |
| | | prop: 'isAddCandidate', |
| | | type: 'input', |
| | | slot: true |
| | | } |
| | | ] |
| | | }, |
| | | data: [], |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | dialogOpen() { |
| | | this.onLoad(this.page) |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | |
| | | }, |
| | | addSecondRoundHandler() { |
| | | if (!this.selectEvaluateType) return this.$message.warning('请选择当前候选人要填至的评优类别') |
| | | const { user_id, user_name, dept_id, dept_name, post_name } = this.currentRow |
| | | const { userId, userName, deptId, deptName, postName } = this.currentRow |
| | | const requestParams = { |
| | | evaluateTaskCategoryId: this.selectEvaluateType, |
| | | userId: user_id, |
| | | userName: user_name, |
| | | deptId: dept_id, |
| | | deptName: dept_name, |
| | | postName: post_name, |
| | | userId: userId, |
| | | userName: userName, |
| | | deptId: deptId, |
| | | deptName: deptName, |
| | | postName: postName, |
| | | } |
| | | addEtaskCc(requestParams).then(res => { |
| | | this.$message.success('添加成功') |
| | | this.addEvaluateTypeVisible = false |
| | | this.selectEvaluateType = '' |
| | | this.currentRow.isAddCandidate = true |
| | | }, error => { |
| | | this.$message.error(error) |
| | | }) |
| | |
| | | this.notParticipateIn = [] |
| | | newVal.forEach(item => { |
| | | const is = this.userList.find(user => user.id === item) |
| | | this.notParticipateIn.push(is) |
| | | const { id, name, deptId, deptName, postId, postName } = is |
| | | this.notParticipateIn.push({ id, name, deptId, deptName, postId, postName }) |
| | | }) |
| | | } |
| | | }, |
| | |
| | | }) |
| | | }, |
| | | submit() { |
| | | this.participateIn = [] |
| | | this.userList.forEach(item => { |
| | | const is = this.notParticipateIn.find(user => user.id === item.id) |
| | | if (!is) { |
| | | this.participateIn.push(item) |
| | | const { id, name, deptId, deptName, postId, postName } = item |
| | | this.participateIn.push({ id, name, deptId, deptName, postId, postName }) |
| | | } |
| | | }) |
| | | const params = { |