GuLiMmo
2024-01-23 2e80903f72d58a86cd13c2a24a8d3132d015073e
更新
5 files modified
167 ■■■■ changed files
src/api/evaluate/evaluateTask.js 5 ●●●●● patch | view | raw | blame | history
src/views/evaluate/components/IndividualTaskPublic.vue 6 ●●●● patch | view | raw | blame | history
src/views/evaluate/components/candidateResult.vue 2 ●●●●● patch | view | raw | blame | history
src/views/evaluate/components/firstRoundResult.vue 139 ●●●● patch | view | raw | blame | history
src/views/evaluate/components/referrerPopover.vue 15 ●●●● patch | view | raw | blame | history
src/api/evaluate/evaluateTask.js
@@ -113,9 +113,10 @@
// 第一轮候选人结果
export const getCandidateResult = (current, size, evaluateId) => {
export const getCandidateResult = (current, size, evaluateId, evaluateTaskCategoryId) => {
  const params = [evaluateId, evaluateTaskCategoryId].join('/')
  return request({
    url: `/evaluate/evaluateTaskReferrer/list/${evaluateId}`,
    url: `/evaluate/evaluateTaskReferrer/list/${params}`,
    method: 'get',
    params: {
      current,
src/views/evaluate/components/IndividualTaskPublic.vue
@@ -147,7 +147,11 @@
                console.log(this.params.data.pollingPersons);
                const pollingPersons = this.params.data.pollingPersons
                this.form.pollingPersons = pollingPersons !== "0" ? pollingPersons.split(',') : []
                this.form.votePersonObjInfo = JSON.parse(this.params.data.votePersonObjInfo) || []
                if (typeof this.params.data.votePersonObjInfo === 'object') {
                    this.form.votePersonObjInfo = []
                } else {
                    this.form.votePersonObjInfo = JSON.parse(this.params.data.votePersonObjInfo) || []
                }
                this.form.evaluateCutoffTimeStart = this.params.data.evaluateCutoffTimeStart || ''
                this.form.evaluateCutoffTimeEnd = this.params.data.evaluateCutoffTimeEnd || ''
            },
src/views/evaluate/components/candidateResult.vue
@@ -111,9 +111,11 @@
        },
        currentChange(currentPage) {
            this.page.currentPage = currentPage;
            this.onLoad(this.page)
        },
        sizeChange(pageSize) {
            this.page.pageSize = pageSize;
            this.onLoad(this.page)
        },
        refreshChange() {
            this.onLoad(this.page, this.query);
src/views/evaluate/components/firstRoundResult.vue
@@ -1,20 +1,47 @@
<template>
    <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">
        <template #menu="{ row }">
            <referrerPopover :params="{ userId: row.userId, evaluateTaskId: params.data.id }">
                <el-button type="success" icon="el-icon-view" text>推荐人预览</el-button>
            </referrerPopover>
        </template>
        <template #menu-left>
            <el-button type="success" plain icon="el-icon-download" @click="handleExport">导出当前数据</el-button>
        </template>
    </avue-crud>
    <div class="first-result">
        <el-button style="margin-bottom: 10px;" type="success" plain icon="el-icon-download"
            @click="handleExport">导出当前数据</el-button>
        <ul class="type-list">
            <li class="type-item">
                <div class="title">奖项</div>
                <div class="introduction">认定标准</div>
                <div class="number">名额</div>
                <div class="tool">操作</div>
            </li>
            <li class="type-item" v-for="(item, index) in data" :key="index">
                <div class="title">{{ item.category?.categoryName || '' }}</div>
                <el-tooltip effect="dark" placement="top">
                    <template #content>
                        <p style="max-width: 500px;">{{ item.category?.standard || '' }}</p>
                    </template>
                    <div class="introduction">
                        {{ item.category?.standard || '' }}
                    </div>
                </el-tooltip>
                <div class="number">{{ item.category?.peopleNum || 0 }}人</div>
                <div class="tool">
                    <el-button type="primary" text icon="el-icon-view" @click="view(item)">查看第一轮候选结果</el-button>
                </div>
            </li>
        </ul>
        <el-dialog v-model="visible" :title="`第一轮候选结果(${currentCategory.categoryName})`" width="60%" @open="dialogOpen">
            <avue-crud v-model:page="page" :option="option" :table-loading="loading" :data="dialogData"
                @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
                <template #menu="{ row }">
                    <referrerPopover :params="{ userId: row.userId, evaluateTaskId: params.data.id }">
                        <el-button type="success" icon="el-icon-view" text>推荐人预览</el-button>
                    </referrerPopover>
                </template>
            </avue-crud>
        </el-dialog>
    </div>
</template>
<script>
import referrerPopover from './referrerPopover.vue'
import { getCandidateResult } from '@/api/evaluate/evaluateTask'
import { getFinallyResult, getCandidateResult } from '@/api/evaluate/evaluateTask'
import { exportBlob } from "@/api/common";
import { downloadXls } from "@/utils/util";
import { dateNow } from "@/utils/date";
@@ -87,7 +114,10 @@
                    },
                ]
            },
            data: []
            data: [],
            dialogData: [],
            visible: false,
            currentCategory: {}
        }
    },
    methods: {
@@ -108,9 +138,11 @@
        },
        currentChange(currentPage) {
            this.page.currentPage = currentPage;
            this.getDialogDetails()
        },
        sizeChange(pageSize) {
            this.page.pageSize = pageSize;
            this.getDialogDetails()
        },
        refreshChange() {
            this.onLoad(this.page, this.query);
@@ -127,13 +159,30 @@
                ...this.query,
                ...params
            };
            getCandidateResult(page.currentPage, page.pageSize, id).then(res => {
            getFinallyResult(page.currentPage, page.pageSize, id).then(res => {
                const data = res.data.data;
                this.page.total = data.total;
                this.data = data.records;
                this.data = data || [];
                this.loading = false;
            });
        },
        view(item) {
            this.currentCategory = item.category
            this.visible = true
        },
        dialogOpen() {
            this.getDialogDetails()
        },
        getDialogDetails() {
            const { id, evaluateTaskId } = this.currentCategory
            const { currentPage, pageSize } = this.page
            getCandidateResult(currentPage, pageSize, evaluateTaskId, id).then(candidateRes => {
                const res = candidateRes.data
                if (res.code !== 200) return this.$message.error(res.msg)
                console.log(res);
                this.dialogData = res.data.records
                this.page.total = res.data.total
            })
        }
    },
    watch: {
        'params.data': {
@@ -146,4 +195,60 @@
}
</script>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
$borderColor: var(--el-border-color);
.type-list {
    margin: 0;
    padding: 0;
    list-style-type: none;
    width: 100%;
    border: 1px solid $borderColor;
    border-radius: var(--el-border-radius-base);
    box-sizing: border-box;
    .type-item {
        display: flex;
        height: 40px;
        line-height: 40px;
        text-align: center;
        div {
            border-bottom: 1px solid $borderColor;
            flex-shrink: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .title {
            flex: 2;
        }
        .introduction {
            flex: 5;
            flex-shrink: 0;
            border: {
                right: 1px solid $borderColor;
                left: 1px solid $borderColor;
            }
        }
        .number {
            flex: 1;
        }
        .tool {
            flex: 2;
            border-left: 1px solid $borderColor;
        }
        &:last-child {
            div {
                border-bottom: 0;
            }
        }
    }
}
</style>
src/views/evaluate/components/referrerPopover.vue
@@ -1,6 +1,7 @@
<template>
    <el-popover placement="top-end" title="推荐人" :width="700" trigger="hover" @show="init">
        <avue-crud :option="option" :data="tableData" v-model:page="page">
    <el-popover placement="top-end" title="推荐人" :width="800" trigger="hover" @show="init">
        <avue-crud :option="option" :data="tableData" v-model:page="page" @current-change="currentChange"
            @size-change="sizeChange">
        </avue-crud>
        <template #reference>
            <slot name="default"></slot>
@@ -74,6 +75,16 @@
    total: 0,
})
const currentChange = (currentPage) => {
    page.currentPage = currentPage
    init()
}
const sizeChange = (pageSize) => {
    page.pageSize = pageSize
    init()
}
const init = () => {
    const { userId, evaluateTaskId } = props.params
    getReferrer(page.currentPage, page.pageSize, evaluateTaskId, userId).then(res => {