| | |
| | | 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) |
| | | } |
| | | } |
| | | } |
| | | } |