GuLiMmo
2024-01-15 98a5aa3ae4aba7302837986f5b3963966d39ddb4
修改
3 files modified
72 ■■■■ changed files
src/views/evaluate/components/IndividualTaskPublic.vue 24 ●●●● patch | view | raw | blame | history
src/views/evaluate/components/candidateResult.vue 41 ●●●● patch | view | raw | blame | history
src/views/evaluate/components/selectionDialog.vue 7 ●●●● patch | view | raw | blame | history
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)
                }
            }
        }
    }
src/views/evaluate/components/candidateResult.vue
@@ -1,9 +1,16 @@
<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
@@ -62,17 +69,17 @@
                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'
                    },
                    {
@@ -83,6 +90,12 @@
                            return value + '票'
                        }
                    },
                    {
                        label: '是否已加入第二轮评优',
                        prop: 'isAddCandidate',
                        type: 'input',
                        slot: true
                    }
                ]
            },
            data: [],
@@ -93,6 +106,9 @@
        }
    },
    methods: {
        dialogOpen() {
            this.onLoad(this.page)
        },
        currentChange(currentPage) {
            this.page.currentPage = currentPage;
        },
@@ -138,19 +154,20 @@
        },
        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)
            })
src/views/evaluate/components/selectionDialog.vue
@@ -42,7 +42,8 @@
                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 })
                })
            }
        },
@@ -69,10 +70,12 @@
            })
        },
        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 = {