| | |
| | | <template> |
| | | <el-dialog v-model="params.visible" :title="`发布评优任务(${params.data?.taskName || ''})`" width="65%" @open="openDialog" @close="dialogClose"> |
| | | <el-dialog v-model="params.visible" :title="`发布评优任务(${params.data?.taskName || ''})`" width="65%" @open="openDialog" |
| | | @close="dialogClose"> |
| | | <div class="content"> |
| | | <el-form :model="form" ref="formRef" :rules="rules" label-position="top"> |
| | | <el-form-item prop="categoryEntities"> |
| | | <template #label> |
| | | 评优奖项 |
| | | <el-button type="primary" icon="el-icon-view" text @click="viewCandidateResult">查看第一轮候选结果</el-button> |
| | | <el-button type="primary" icon="el-icon-view" text |
| | | @click="viewCandidateResult">查看第一轮候选结果</el-button> |
| | | </template> |
| | | <ul class="type-list"> |
| | | <li class="type-item"> |
| | |
| | | |
| | | <div class="number">{{ item.peopleNum }}</div> |
| | | <div class="tool"> |
| | | <el-button type="primary" icon="el-icon-plus" text @click="addEcCandidateHandler(item)">添加候选人</el-button> |
| | | <el-button type="primary" icon="el-icon-plus" text |
| | | @click="addEcCandidateHandler(item)">添加候选人</el-button> |
| | | </div> |
| | | </li> |
| | | </ul> |
| | | </el-form-item> |
| | | <el-form-item label="投票人员" prop="pollingPersons"> |
| | | <el-checkbox-group v-model="form.pollingPersons"> |
| | | <el-checkbox v-for="item in employeeDict" :key="item.id" :label="item.dictKey"> |
| | | <el-checkbox v-for="item in employeeDict" :key="item.id" :label="item.dictKey" |
| | | @change="checkBoxChange($event, item)"> |
| | | {{ item.dictValue }} |
| | | <el-button type="primary" icon="el-icon-edit" text @click="selectionHandler(item)">设置人员</el-button> |
| | | <el-button type="primary" icon="el-icon-edit" text |
| | | @click="selectionHandler(item)">设置人员</el-button> |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | |
| | | <!-- 添加评优种类候选人 --> |
| | | <addEcCandidate :params="addEcCandidateParams" /> |
| | | <!-- 人员选择 --> |
| | | <selectionDialog :params="selectionParams" /> |
| | | <selectionDialog :params="selectionParams" @addEvaluateParams="addEvaluateParams" /> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import _ from 'lodash'; |
| | | import { getDict } from '@/api/dict' |
| | | import { update, getEcList } from '@/api/evaluate/evaluateTask' |
| | | import { update, getEcList, getEmployeeLevelList } from '@/api/evaluate/evaluateTask' |
| | | import addEcCandidate from './addEcCandidate.vue'; |
| | | import candidateResult from './candidateResult.vue'; |
| | | import selectionDialog from './selectionDialog.vue'; |
| | |
| | | form: { |
| | | categoryEntities: [], |
| | | pollingPersons: [], |
| | | votePersonObjInfo: [], |
| | | evaluateCutoffTimeStart: '', |
| | | evaluateCutoffTimeEnd: '' |
| | | }, |
| | |
| | | addEcCandidateParams: {}, |
| | | candidateResultParams: {}, |
| | | selectionParams: {} |
| | | } |
| | | }, |
| | | watch: { |
| | | 'params.visible': { |
| | | handler(value) { |
| | | if (!value) return |
| | | this.form.pollingPersons = this.params.data.pollingPersons.split(',') || [] |
| | | this.form.votePersonObjInfo = JSON.parse(this.params.data.votePersonObjInfo) || [] |
| | | this.form.evaluateCutoffTimeStart = this.params.data.evaluateCutoffTimeStart || '' |
| | | this.form.evaluateCutoffTimeEnd = this.params.data.evaluateCutoffTimeEnd || '' |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | delete data.categoryEntities |
| | | update(data).then(res => { |
| | | if (res.data.code !== 200) return |
| | | this.params.visible = false |
| | | this.$emit('refreshTable', { currentPage:1, pageSize: 10 }) |
| | | this.params.visible = false |
| | | this.$emit('refreshTable', { currentPage: 1, pageSize: 10 }) |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | } |
| | | }, |
| | | selectionHandler(row) { |
| | | const obj = this.form.votePersonObjInfo.find(item => item.employeeType === row.dictKey) || {} |
| | | this.selectionParams = { |
| | | visible: true, |
| | | data: row |
| | | data: row, |
| | | values: obj |
| | | } |
| | | }, |
| | | checkBoxChange(e, { dictKey }) { |
| | | const index = this.form.votePersonObjInfo.findIndex(item => item.employeeType === dictKey) |
| | | if (!e) { |
| | | this.form.votePersonObjInfo.splice(index, 1) |
| | | return |
| | | } |
| | | getEmployeeLevelList(dictKey).then((res) => { |
| | | const { code, data } = res.data |
| | | if (code !== 200) return this.$message.error('当前级别人员加载失败,请重试!!') |
| | | const params = { |
| | | employeeType: dictKey, |
| | | participateIn: data, |
| | | notParticipateIn: [] |
| | | } |
| | | if (index === -1) { |
| | | this.form.votePersonObjInfo.push(params) |
| | | } else { |
| | | this.form.votePersonObjInfo[index] = params |
| | | } |
| | | }) |
| | | }, |
| | | addEvaluateParams(params) { |
| | | const index = this.form.votePersonObjInfo.findIndex(item => item.employeeType === params.employeeType) |
| | | if (index === -1) { |
| | | this.form.votePersonObjInfo.push(params) |
| | | this.form.pollingPersons.push(params.employeeType) |
| | | } else { |
| | | this.form.votePersonObjInfo[index] = params |
| | | } |
| | | } |
| | | } |