| | |
| | | <template> |
| | | <template v-if="!type()"> |
| | | <div class="export_xlsx"> |
| | | <el-button type="success" plain @click="handleExport">导出当前数据</el-button> |
| | | </div> |
| | | <ul class="type-list"> |
| | | <li class="type-item"> |
| | | <div class="title">类别</div> |
| | |
| | | </ul> |
| | | <el-dialog v-model="dialogParams.visible" :title="dialogParams.title"> |
| | | <avue-crud :option="dialogOption" :table-loading="dialogLoading" :data="dialogParams.data" @on-load="onLoad"> |
| | | </avue-crud> |
| | | <template #menu-row> |
| | | <el-button type="success" plain @click="handleExport">导出当前数据</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </el-dialog> |
| | | </template> |
| | | <template v-else> |
| | | <div class="export_xlsx"> |
| | | <el-button type="success" plain @click="handleExport">导出当前数据</el-button> |
| | | </div> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" |
| | | @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template #menu-left> |
| | | <el-button type="success" plain icon="el-icon-download" @click="handleExport">导出</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </template> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getFinallyResult, getFinallyTypeResult } from '@/api/evaluate/evaluateTask' |
| | | import { exportBlob } from "@/api/common"; |
| | | import { downloadXls } from "@/utils/util"; |
| | | import { dateNow } from "@/utils/date"; |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | |
| | | export default { |
| | | inject: ['type'], |
| | |
| | | const { category, resultList } = result |
| | | this.dialogParams = { |
| | | visible: true, |
| | | title: `最终结果(${category.categoryName })`, |
| | | title: `最终结果(${category.categoryName})`, |
| | | data: resultList |
| | | } |
| | | this.dialogLoading = false |
| | | }, |
| | | handleExport() { |
| | | const { id } = this.params.data |
| | | const downloadUrl = `/evaluate/evaluateCandidateResult/exportEmp/${id}`; |
| | | const sectionDownloadUrl = `/evaluate/evaluateCandidateResult/exportDept/${id}`; |
| | | this.$confirm("是否导出数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | NProgress.start(); |
| | | const url = this.type() ? sectionDownloadUrl : downloadUrl; |
| | | exportBlob(url, {}).then(res => { |
| | | downloadXls(res.data, `最终评优结果(${dateNow()}).xlsx`); |
| | | NProgress.done(); |
| | | }) |
| | | }); |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | <style lang="scss" scoped> |
| | | $borderColor: var(--el-border-color); |
| | | |
| | | .export_xlsx { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .type-list { |
| | | margin: 0; |
| | | padding: 0; |