| | |
| | | <template> |
| | | <el-dialog v-model="params.visible" title="第一轮评优结果"> |
| | | <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}"> |
| | | <el-button type="primary" icon="el-icon-plus" text>添加至第二轮</el-button> |
| | | <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 }"> |
| | | <el-button type="primary" icon="el-icon-plus" text @click="addEvaluateTypeHandler(row)">添加至第二轮</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog v-model="addEvaluateTypeVisible" width="400px" title="请选择添加至评优类别" append-to-body |
| | | @open="evaluateTypeOpen"> |
| | | <el-select v-model="selectEvaluateType" placeholder="请选择要添加至的评优类别" style="width: 100%;"> |
| | | <el-option v-for="item in evaluateTypeList" :key="item.id" :label="item.categoryName" :value="item.id" /> |
| | | </el-select> |
| | | <template #footer> |
| | | <el-button @click="addEvaluateTypeVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="addSecondRoundHandler">确定</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getCandidateResult } from '@/api/evaluate/evaluateTask' |
| | | import { getCandidateResult, getEcList, addEtaskCc } from '@/api/evaluate/evaluateTask' |
| | | |
| | | export default { |
| | | props: { |
| | |
| | | { |
| | | label: '票数', |
| | | prop: 'voteNum', |
| | | type: 'input' |
| | | type: 'input', |
| | | formatter: (_row, value) => { |
| | | return value + '票' |
| | | } |
| | | }, |
| | | ] |
| | | }, |
| | | data: [] |
| | | data: [], |
| | | currentRow: {}, |
| | | selectEvaluateType: '', |
| | | evaluateTypeList: [], |
| | | addEvaluateTypeVisible: false, |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | initEvalutateType() { |
| | | const { id } = this.params.data |
| | | getEcList(1, 10, id).then(ecResult => { |
| | | const { code, data: { records } } = ecResult.data |
| | | if (code !== 200) return this.$message.error('评优类别加载失败') |
| | | this.evaluateTypeList = records |
| | | }) |
| | | }, |
| | | evaluateTypeOpen() { |
| | | this.initEvalutateType() |
| | | }, |
| | | addEvaluateTypeHandler(row) { |
| | | this.addEvaluateTypeVisible = true; |
| | | this.currentRow = row |
| | | }, |
| | | addSecondRoundHandler() { |
| | | if (!this.selectEvaluateType) return this.$message.warning('请选择当前候选人要填至的评优类别') |
| | | const { user_id, user_name, dept_id, dept_name, post_name } = this.currentRow |
| | | const requestParams = { |
| | | evaluateTaskCategoryId: this.selectEvaluateType, |
| | | userId: user_id, |
| | | userName: user_name, |
| | | deptId: dept_id, |
| | | deptName: dept_name, |
| | | postName: post_name, |
| | | } |
| | | addEtaskCc(requestParams).then(res => { |
| | | this.$message.success('添加成功') |
| | | this.addEvaluateTypeVisible = false |
| | | this.selectEvaluateType = '' |
| | | }, error => { |
| | | this.$message.error(error) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | viewBtn: false, |
| | | header: false, |
| | | menuWidth: 150, |
| | | menu: false, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | |
| | | { |
| | | label: '票数', |
| | | prop: 'voteNum', |
| | | type: 'input' |
| | | type: 'input', |
| | | formatter: (_row, value) => { |
| | | return value + '票' |
| | | } |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | }, |
| | | watch: { |
| | | 'params.data': { |
| | | handler(value) { |
| | | this.onLoad(this.page) |
| | | }, |
| | | deep: true |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <el-drawer v-model="props.params.visible" open="openDrawer" direction="rtl" size="50%"> |
| | | <el-drawer v-model="props.params.visible" @open="openDrawer" direction="rtl" size="50%"> |
| | | <template #header> |
| | | <div class="title">评优任务详情</div> |
| | | <div class="drawer-title">{{ this.params.data?.taskName || '评优任务详情' }}</div> |
| | | </template> |
| | | <el-collapse v-model="collapseParams.activeNames"> |
| | | <el-collapse-item title="当前任务评优类别" name="1"> |
| | | <ul class="type-list"> |
| | | <li class="type-item"> |
| | | <div class="title">类别</div> |
| | | <div class="introduction">认定标准</div> |
| | | <div class="number">名额</div> |
| | | </li> |
| | | <li class="type-item" v-for="(item, index) in collapseParams.categoryEntities" :key="index"> |
| | | <div class="title">{{ item.categoryName }}</div> |
| | | <el-tooltip effect="dark" placement="top"> |
| | | <template #content> |
| | | <p style="max-width: 500px;">{{ item.standard }}</p> |
| | | </template> |
| | | <div class="introduction"> |
| | | {{ item.standard }} |
| | | </div> |
| | | </el-tooltip> |
| | | |
| | | <div class="number">{{ item.peopleNum }}人</div> |
| | | </li> |
| | | </ul> |
| | | </el-collapse-item> |
| | | <el-collapse-item title="第一轮候选结果" name="2"> |
| | | <firstRoundResult :params="{ data: props.params.data }" /> |
| | | </el-collapse-item> |
| | | <el-collapse-item title="最终评优结果" name="3"> |
| | | |
| | | </el-collapse-item> |
| | | </el-collapse> |
| | | </el-drawer> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import firstRoundResult from './firstRoundResult.vue'; |
| | | import { reactive } from 'vue'; |
| | | import { getEcList } from '@/api/evaluate/evaluateTask' |
| | | |
| | | const props = defineProps({ |
| | | params: { |
| | |
| | | } |
| | | }) |
| | | |
| | | const openDrawer = () => { |
| | | const collapseParams = reactive({ |
| | | activeNames: ['1'], |
| | | categoryEntities: [] |
| | | }) |
| | | |
| | | const pageParams = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | total: 0 |
| | | }) |
| | | |
| | | const currentTaskParams = reactive({ |
| | | data: {} |
| | | }) |
| | | |
| | | const openDrawer = () => { |
| | | const { id } = props.params.data |
| | | const { current, size } = pageParams |
| | | getEcList(current, size, id).then(ecResult => { |
| | | const { code, data: { records } } = ecResult.data |
| | | if (code !== 200) return this.$message.error('评优类别加载失败') |
| | | collapseParams.categoryEntities = records |
| | | }) |
| | | currentTaskParams.data = props.params.data |
| | | } |
| | | |
| | | |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .title { |
| | | $borderColor: var(--el-border-color); |
| | | |
| | | .drawer-title { |
| | | border-left: 3px solid #409eff; |
| | | padding-left: 10px; |
| | | } |
| | | |
| | | .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> |