From 3f572e4e6114775c3c6918ba8380657c0ade91f4 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 21 Oct 2021 15:55:28 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises
---
src/views/trainExam/singleperformance.vue | 84 +++++++++++++++++++++++++++++++++++++++--
1 files changed, 79 insertions(+), 5 deletions(-)
diff --git a/src/views/trainExam/singleperformance.vue b/src/views/trainExam/singleperformance.vue
index 35a3aa1..c08fff2 100644
--- a/src/views/trainExam/singleperformance.vue
+++ b/src/views/trainExam/singleperformance.vue
@@ -52,6 +52,18 @@
}}
</template>
+ <!-- 自定义按钮 -->
+ <template slot="menuLeft">
+ <el-button
+ type="warning"
+ size="small"
+ plain
+ icon="el-icon-download"
+ v-if="permission.trainExam_singleperformance_export"
+ @click="handleExport"
+ >成绩导出
+ </el-button>
+ </template>
<template slot-scope="{ row }" slot="menu">
<el-button
type="text"
@@ -96,7 +108,7 @@
import { getList, update } from "@/api/examapi/performance";
import { mapGetters } from "vuex";
import { getRoleDetail } from "@/api/system/role";
-
+import Qs from 'qs';
export default {
data() {
var validatePass = (rule, value, callback) => {
@@ -126,11 +138,10 @@
addBtn: false,
selection: false,
// 导出按钮
- excelBtn: true,
- excelBtnText: "成绩导出",
+ // excelBtn: true,
+ // excelBtnText: "成绩导出",
viewBtn: false,
// title: '成绩',
-
align: "center",
height: "auto",
calcHeight: 80,
@@ -147,10 +158,35 @@
labelWidth: 120,
column: [
{
+ label: "考试时间",
+ prop: "examDate",
+ type: "date",
+ hide: true,
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ width: 140,
+ slot: true,
+ search: true,
+ searchSpan: 4,
+ // 表单新增时是否禁止
+ addDisabled: false,
+ // 表单新增时是否可见
+ addDisplay: false,
+ // 表单新增时是否为查看模式
+ addDetail: false,
+ // 表单编辑时是否禁止
+ editDisabled: false,
+ // 表单编辑时是否可见
+ editDisplay: false,
+ // 表单编辑时是否为查看模式
+ editDetail: false,
+ viewDisplay: false,
+ },
+ {
label: "考试名称",
prop: "examName",
search: true,
- searchSpan: 4,
+ searchSpan: 5,
slot: true,
viewDisplay: false,
// 表单新增时是否禁止
@@ -573,6 +609,44 @@
refreshChange() {
this.questionBankOnLoad(this.questionBankPage, this.questionBankQuery);
},
+ //成绩导出
+ handleExport() {
+ this.$confirm("是否导出成绩数据?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ }).then(() => {
+ //获取查询条件
+ // console.log(this.questionBankSearch,456);
+ var data = {
+ account: this.questionBankSearch.account,
+ companyName: this.questionBankSearch.companyName,
+ examDate: this.questionBankSearch.examDate,
+ isExam: this.questionBankSearch.isExam,
+ qualified: this.questionBankSearch.qualified,
+ securityName: this.questionBankSearch.securityName,
+ examName: this.questionBankSearch.examName,
+ };
+ //导出
+ if (
+ this.userInfo.role_name == "保安公司管理员" ||
+ this.userInfo.role_name == "保安"
+ ) {
+ //如果是保安公司管理员
+ data["deptId"] = this.userInfo.dept_id;
+ }
+ if (this.userInfo.role_name == "培训公司管理员") {
+ //如果是培训公司管理员
+ data["trainUnitId"] = this.userInfo.dept_id;
+ }
+ data["examType"] = 2;
+ //序列号url形式,用&拼接
+ data = Qs.stringify(data);
+ window.open(
+ `/api/examScore/export-examScore?` + data
+ );
+ });
+ },
},
};
</script>
--
Gitblit v1.9.3