| | |
| | | <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> |
| | | </template> |
| | | |
| | | <script> |
| | | import referrerPopover from './referrerPopover.vue' |
| | | import { getCandidateResult } 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 { |
| | | components: { |
| | | referrerPopover |
| | | }, |
| | | props: { |
| | | params: { |
| | | type: Object, |
| | |
| | | editBtn: false, |
| | | delBtn: false, |
| | | viewBtn: false, |
| | | header: false, |
| | | header: true, |
| | | menuWidth: 150, |
| | | menu: false, |
| | | // menu: false, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: '姓名', |
| | | prop: 'user_name', |
| | | prop: 'userName', |
| | | type: 'input' |
| | | }, |
| | | { |
| | | label: '部门', |
| | | prop: 'user_name', |
| | | prop: 'deptName', |
| | | type: 'input' |
| | | }, |
| | | { |
| | | label: '职位', |
| | | prop: 'dept_name', |
| | | prop: 'postName', |
| | | type: 'input' |
| | | }, |
| | | { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | handleExport() { |
| | | const { id } = this.params.data |
| | | const downloadUrl = `/evaluate/evaluateTaskReferrer/export/${id}`; |
| | | this.$confirm("是否导出数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | NProgress.start(); |
| | | exportBlob(downloadUrl, {}).then(res => { |
| | | downloadXls(res.data, `第一轮候选结果(${dateNow()}).xlsx`); |
| | | NProgress.done(); |
| | | }) |
| | | }); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |