GuLiMmo
2024-01-15 9fc6db6472b1b8a5e8b78849b9a363d2cb5eb0ee
更新
7 files modified
340 ■■■■■ changed files
src/views/assessment/assessmentTask.vue 11 ●●●● patch | view | raw | blame | history
src/views/assessment/components/assessorDetails.vue 136 ●●●●● patch | view | raw | blame | history
src/views/assessment/components/resultDetail.vue 29 ●●●● patch | view | raw | blame | history
src/views/assessment/components/taskResult.vue 10 ●●●● patch | view | raw | blame | history
src/views/evaluate/components/addSectionTask.vue 67 ●●●●● patch | view | raw | blame | history
src/views/evaluate/components/editSectionTask.vue 81 ●●●●● patch | view | raw | blame | history
src/views/evaluate/components/referrerPopover.vue 6 ●●●●● patch | view | raw | blame | history
src/views/assessment/assessmentTask.vue
@@ -24,11 +24,11 @@
            考核设置
          </el-button>
          <el-button type="primary" icon="el-icon-view" text @click="handleAssessorDetails(row)">
            考核人员详情
            考核结果详情
          </el-button>
          <el-button type="primary" icon="el-icon-view" text @click="handleTaskResult(row)">
          <!-- <el-button type="primary" icon="el-icon-view" text @click="handleTaskResult(row)">
            考核结果
          </el-button>
          </el-button> -->
          <el-button type="danger" icon="el-icon-delete" text @click="rowDel(row)">
            删除
          </el-button>
@@ -142,6 +142,11 @@
      return ids.join(",");
    }
  },
  provide() {
    return {
      type: () => this.defaultTaskType
    }
  },
  methods: {
    handleTaskSetting(row) {
      this.curIndex = 1;
src/views/assessment/components/assessorDetails.vue
@@ -1,11 +1,25 @@
<template>
    <el-dialog v-model="params.visible" :title="params.data.assessmentNo ? `考核编号(${params.data.assessmentNo})` : '考核人员详情'">
    <el-dialog v-model="params.visible" :title="params.data?.assessmentNo ? `考核编号(${params.data.assessmentNo})` : '考核人员详情'"
        width="65%" @open="dialogOpen">
        <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" @search-change="searchChange"
            @search-reset="searchReset" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
            <template #menu="{ row }">
                <el-button type="success" icon="el-icon-view" text @click="handleViewDetails(row)">查看详情</el-button>
            </template>
        </avue-crud>
        <resultDetail :params="detailParams" />
    </el-dialog>
</template>
<script>
import { getList } from '@/api/assessment/assessmentScore'
import resultDetail from './resultDetail.vue'
export default {
    components: {
        resultDetail
    },
    props: {
        params: {
            type: Object,
@@ -16,11 +30,125 @@
                }
            }
        }
    },
    data() {
        return {
            loading: true,
            query: {},
            data: [],
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
            },
            option: {
                height: '400',
                calcHeight: 30,
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                border: true,
                index: true,
                viewBtn: false,
                addBtn: false,
                editBtn: false,
                delBtn: false,
                viewBtn: false,
                menuWidth: 150,
                dialogClickModal: false,
                column: [
                    {
                        label: "工号",
                        prop: 'code',
                        type: "input",
                    },
                    {
                        label: "被考核人",
                        prop: "userName",
                        type: "input",
                        search: true,
                    },
                    {
                        label: "部门",
                        prop: "deptName",
                        type: "select",
                        dicUrl: '/api/blade-system/dept/lazy-list?parentId=1737282385453543425',
                        search: true,
                        props: {
                            label: 'deptName',
                            value: 'fullName'
                        },
                        overHidden: true
                    },
                    {
                        label: "职务",
                        prop: "postName",
                        type: "input",
                    },
                    {
                        label: "考核分",
                        prop: "scoreVal",
                        type: "input",
                    }
                ]
            },
            detailParams: {}
        }
    },
    methods: {
        searchReset() {
            this.query = {};
            this.onLoad(this.page, { type: this.defaultTaskType });
        },
        searchChange(params, done) {
            this.query = {
                ...params,
            };
            this.page.currentPage = 1;
            this.onLoad(this.page, params);
            done();
        },
        currentChange(currentPage) {
            this.page.currentPage = currentPage;
        },
        sizeChange(pageSize) {
            this.page.pageSize = pageSize;
        },
        refreshChange() {
            this.onLoad(this.page, this.query);
        },
        onLoad(page, params = {}) {
            this.loading = true;
            const { id, type } = this.params.data
            const {
            } = this.query;
            let values = {
                ...this.query,
                ...params
            };
            getList(page.currentPage, page.pageSize, values, type, id).then(res => {
                const data = res.data.data;
                this.page.total = data.total;
                this.data = data.records;
                this.loading = false;
            });
        },
        dialogOpen() {
            this.onLoad(this.page)
        },
        handleViewDetails(row) {
            this.detailParams = {
                visible: true,
                isSendBack: true,
                ...row
            }
        }
    }
}
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
src/views/assessment/components/resultDetail.vue
@@ -1,6 +1,9 @@
<template>
    <el-dialog title="详情" v-model="params.visible" width="60%" destroy-on-close>
        <avue-crud :data="data" v-model:page="page" :option="option" @on-load="onLoad" >
            <!-- <template #menu="{row}">
                <el-button type="warning" icon="el-icon-info-filled" text @click="sendBack(row)">驳回</el-button>
            </template> -->
        </avue-crud>
    </el-dialog>
</template>
@@ -23,40 +26,49 @@
    menu: false,
    menuLeft: false,
    header: false,
    menuWidth: 120,
    column: [
        {
            label: '参与考核人',
            type: 'input',
            prop: 'scoreUserName'
            prop: 'scoreUserName',
            minWidth: 100
        },
        {
            label: '职务',
            type: 'input',
            prop: 'scorePostName'
            prop: 'scorePostName',
            minWidth: 100
        },
        {
            label: '部门',
            type: 'input',
            prop: 'scoreDeptName'
            prop: 'scoreDeptName',
            minWidth: 130
        },
        {
            label: '权值',
            type: 'input',
            prop: 'weight'
            prop: 'weight',
            minWidth: 100
        },
        {
            label: '考核分数',
            type: 'input',
            prop: 'scoreVal'
            prop: 'scoreVal',
            minWidth: 100
        },
        {
            label: '考核评语',
            type: 'input',
            prop: 'remark'
            prop: 'remark',
            overHidden: true,
            minWidth: 100
        },
        {
            label: '考核状态',
            type: 'input',
            minWidth: 100,
            formatter: () => {
                return '评分完成'
            }
@@ -78,17 +90,20 @@
        default: () => {
            return {
                visible: false,
                isSendBack: false
            }
        }
    }
})
const sendBack = (row) => {
    console.log(row);
}
const onLoad = () => {
    const { beId, assessmentTaskId, visible } = $props.params
    visible && getDetailList(beId, assessmentTaskId).then(res => {
        data.value = res.data.data.records
        console.log(res.data.data);
    })
}
src/views/assessment/components/taskResult.vue
@@ -58,15 +58,15 @@
                searchLabelWidth: 100,
                column: [
                    {
                        label: "工号",
                        prop: 'code',
                        type: "input",
                    },
                    {
                        label: "被考核人",
                        prop: "userName",
                        type: "input",
                        search: true,
                    },
                    {
                        label: "工号",
                        prop: 'code',
                        type: "input",
                    },
                    {
                        label: "部门",
src/views/evaluate/components/addSectionTask.vue
@@ -13,8 +13,11 @@
                </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-checkbox>
                    </el-checkbox-group>
                </el-form-item>
@@ -35,6 +38,8 @@
            <el-button @click="() => params.visible = false">取消</el-button>
            <el-button type="primary" @click="submit">确定</el-button>
        </template>
        <!-- 人员选择 -->
        <selectionDialog :params="selectionParams" @addEvaluateParams="addEvaluateParams" />
    </el-dialog>
</template>
@@ -42,9 +47,13 @@
import { getDict } from '@/api/dict'
import { update } from '@/api/evaluate/evaluateTask'
import _ from 'lodash';
import selectionDialog from './selectionDialog.vue';
export default {
    inject: ['type'],
    components: {
        selectionDialog
    },
    props: {
        params: {
            type: Object,
@@ -65,6 +74,7 @@
                evaluateAwards: '',
                identificationStandard: '',
                pollingPersons: [],
                votePersonObjInfo: [],
                evaluateCutoffTimeStart: '',
                evaluateCutoffTimeEnd: ''
            },
@@ -122,7 +132,8 @@
                    }
                ]
            },
            employeeDict: []
            employeeDict: [],
            selectionParams: {}
        }
    },
    methods: {
@@ -153,6 +164,58 @@
                }
                this.employeeDict = data
            })
        },
        selectionHandler(row) {
            const obj = this.form.votePersonObjInfo.find(item => item.employeeType === row.dictKey) || {}
            this.selectionParams = {
                visible: true,
                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 participateInList = data.map(item => {
                    const { id, name, deptId, deptName, postId, postName } = item
                    return { id, name, deptId, deptName, postId, postName }
                })
                const params = {
                    employeeType: dictKey,
                    participateIn: participateInList,
                    notParticipateIn: []
                }
                if (index === -1) {
                    this.form.votePersonObjInfo.push(params)
                } else {
                    this.form.votePersonObjInfo[index] = params
                }
            })
        },
        addEvaluateParams(params) {
            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) {
                if (participateIn.length > 0) {
                    this.form.votePersonObjInfo.push(params)
                    this.form.pollingPersons.push(params.employeeType)
                }
            } else {
                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/editSectionTask.vue
@@ -14,8 +14,11 @@
                </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-checkbox>
                    </el-checkbox-group>
                </el-form-item>
@@ -36,6 +39,8 @@
            <el-button @click="() => params.visible = false">取消</el-button>
            <el-button type="primary" @click="submit">确定</el-button>
        </template>
        <!-- 人员选择 -->
        <selectionDialog :params="selectionParams" @addEvaluateParams="addEvaluateParams" />
    </el-dialog>
</template>
@@ -43,9 +48,13 @@
import { getDict } from '@/api/dict'
import { update } from '@/api/evaluate/evaluateTask'
import _ from 'lodash';
import selectionDialog from './selectionDialog.vue';
export default {
    inject: ['type'],
    components: {
        selectionDialog
    },
    props: {
        params: {
            type: Object,
@@ -66,6 +75,7 @@
                evaluateAwards: '',
                identificationStandard: '',
                pollingPersons: [],
                votePersonObjInfo: [],
                evaluateCutoffTimeStart: '',
                evaluateCutoffTimeEnd: ''
            },
@@ -122,7 +132,8 @@
                    }
                ]
            },
            employeeDict: []
            employeeDict: [],
            selectionParams: {}
        }
    },
    methods: {
@@ -131,16 +142,18 @@
        },
        openDialog() {
            this.initDict()
            const { id, taskName, evaluateAwards, identificationStandard, pollingPersons, evaluateCutoffTimeStart, evaluateCutoffTimeEnd } = this.params.data
            const { id, taskName, evaluateAwards, identificationStandard, pollingPersons, votePersonObjInfo, evaluateCutoffTimeStart, evaluateCutoffTimeEnd } = this.params.data
            this.form = {
                id,
                taskName,
                evaluateAwards,
                identificationStandard,
                pollingPersons: pollingPersons.split(','),
                evaluateCutoffTimeStart,
                taskName,
                evaluateAwards,
                identificationStandard,
                pollingPersons: pollingPersons.split(',') || [],
                votePersonObjInfo: JSON.parse(votePersonObjInfo) || [],
                evaluateCutoffTimeStart,
                evaluateCutoffTimeEnd
            }
            console.log(this.form);
        },
        submit() {
            this.$refs.formRef.validate(vaild => {
@@ -164,6 +177,58 @@
                }
                this.employeeDict = data
            })
        },
        selectionHandler(row) {
            const obj = this.form.votePersonObjInfo.find(item => item.employeeType === row.dictKey) || {}
            this.selectionParams = {
                visible: true,
                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 participateInList = data.map(item => {
                    const { id, name, deptId, deptName, postId, postName } = item
                    return { id, name, deptId, deptName, postId, postName }
                })
                const params = {
                    employeeType: dictKey,
                    participateIn: participateInList,
                    notParticipateIn: []
                }
                if (index === -1) {
                    this.form.votePersonObjInfo.push(params)
                } else {
                    this.form.votePersonObjInfo[index] = params
                }
            })
        },
        addEvaluateParams(params) {
            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) {
                if (participateIn.length > 0) {
                    this.form.votePersonObjInfo.push(params)
                    this.form.pollingPersons.push(params.employeeType)
                }
            } else {
                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/referrerPopover.vue
@@ -47,11 +47,17 @@
            label: '职位',
            type: 'input',
            prop: 'postName',
            formatter: (_row, value) => {
                return value.join('、')
            }
        },
        {
            label: '部门',
            type: 'input',
            prop: 'deptName',
            formatter: (_row, value) => {
                return value.join('、')
            }
        },
        {
            label: '推荐理由',