GuLiMmo
2024-01-15 98a5aa3ae4aba7302837986f5b3963966d39ddb4
src/views/evaluate/components/IndividualTaskPublic.vue
@@ -211,9 +211,13 @@
            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) {
@@ -224,12 +228,22 @@
            })
        },
        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)
                }
            }
        }
    }