From 2c461eb9efb980d55dfd7407ee70088fc90a4a7a Mon Sep 17 00:00:00 2001
From: 钟日健 <5689795+arsn@user.noreply.gitee.com>
Date: Tue, 08 Feb 2022 14:24:31 +0800
Subject: [PATCH] 保安员详情修改

---
 src/views/trainExam/singleperformance.vue |   91 +++++++++++++++++++++++++++++++++++----------
 1 files changed, 71 insertions(+), 20 deletions(-)

diff --git a/src/views/trainExam/singleperformance.vue b/src/views/trainExam/singleperformance.vue
index 679a8d7..878fc07 100644
--- a/src/views/trainExam/singleperformance.vue
+++ b/src/views/trainExam/singleperformance.vue
@@ -23,6 +23,7 @@
             :table-loading="questionBankLoading"
             :data="questionBankData"
             ref="questionBankCrud"
+            @sort-change="sortChange"
             :permission="permissionList"
             :page.sync="questionBankPage"
             @on-load="questionBankOnLoad"
@@ -114,6 +115,7 @@
 import { mapGetters } from "vuex";
 import { getRoleDetail } from "@/api/system/role";
 import Qs from "qs";
+import { getToken } from "@/util/auth";
 export default {
   data() {
     var validatePass = (rule, value, callback) => {
@@ -149,6 +151,8 @@
         // title: '成绩',
         align: "center",
         height: "auto",
+        sort:"",
+      sortName:"",
         calcHeight: 80,
         tip: false,
         searchShow: true,
@@ -189,13 +193,13 @@
             viewDisplay: false,
           },
           {
-            label: "考试名称",
-            prop: "examName",
-            search: true,
-            searchSpan: 5,
-            searchLabelWidth: 80,
-            slot: true,
-            viewDisplay: false,
+            label: "考试时间",
+            prop: "startTime",
+            type: "datetime",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd",
+            width: 90,
+            viewDisplay: true,
             // 表单新增时是否禁止
             addDisabled: false,
             // 表单新增时是否可见
@@ -204,19 +208,19 @@
             addDetail: false,
             // 表单编辑时是否禁止
             editDisabled: true,
+            viewDisabled: true,
             // 表单编辑时是否可见
-            editDisplay: false,
+            editDisplay: true,
             // 表单编辑时是否为查看模式
             editDetail: false,
             rules: [
               {
                 required: true,
-                message: "请输入试卷名称",
+                message: "请输入考试时间",
                 trigger: "blur",
               },
             ],
-            // overHidden:true,
-            minWidth: 230,
+            overHidden:true,
           },
           {
             label: "姓名",
@@ -307,6 +311,7 @@
             label: "所属公司",
             prop: "companyName",
             search: true,
+            sortable: true,
             searchSpan: 4,
             // dicUrl: '/api/blade-system/dept/tree',
             // props: {
@@ -381,7 +386,7 @@
             editDetail: false,
           },
           {
-            label: "状态",
+            label: "考试状态",
             prop: "isExam",
             type: "select",
             slot: true,
@@ -395,6 +400,14 @@
               {
                 label: "考试中",
                 value: 3,
+              },
+              {
+                label: "纸质考试",
+                value: 5,
+              },
+              {
+                label: "缺考",
+                value: 4,
               },
             ],
             width: 90,
@@ -422,6 +435,7 @@
             label: "理论成绩",
             prop: "theoryGrade",
             slot: true,
+            sortable: true,
             // 表单新增时是否禁止
             addDisabled: false,
             // 表单新增时是否可见
@@ -434,12 +448,13 @@
             editDisplay: true,
             // 表单编辑时是否为查看模式
             editDetail: false,
-            width: 68,
+            width: 95,
           },
           {
             label: "实操成绩",
             prop: "learnGrade",
             slot: true,
+            sortable: true,
             // 表单新增时是否禁止
             addDisabled: false,
             // 表单新增时是否可见
@@ -452,7 +467,7 @@
             editDisplay: true,
             // 表单编辑时是否为查看模式
             editDetail: false,
-            width: 68,
+            width: 95,
             rules: [
               { validator: validatePass, required: true, trigger: "blur" },
             ],
@@ -461,6 +476,7 @@
             label: "总成绩",
             prop: "allGrade",
             slot: true,
+            sortable: true,
             // 表单新增时是否禁止
             addDisabled: false,
             // 表单新增时是否可见
@@ -473,7 +489,7 @@
             editDisplay: true,
             // 表单编辑时是否为查看模式
             editDetail: false,
-            width: 58,
+            width: 80,
             rules: [
               {
                 required: true,
@@ -486,11 +502,11 @@
             label: "是否合格",
             prop: "qualified",
             type: "select",
+            sortable: true,
             slot: true,
             search: true,
             searchSpan: 4,
-            // width: 110,
-            width: 68,
+            width: 120,
             dicData: [
               {
                 label: "合格",
@@ -542,7 +558,8 @@
   },
   created() {
     // console.log(this.$route.query,111);
-    this.questionBankSearch["examName"] = this.$route.query.examName;
+    this.questionBankSearch["examId"] = this.$route.query.id;
+    // console.log(this.$route.query,111);
   },
   mounted() {},
   computed: {
@@ -570,6 +587,30 @@
         query: obj,
       });
     },
+    //排序
+    sortChange(value) {
+      if(value.order=="ascending"){
+        this.sort = "asc";
+      }
+      if(value.order=="descending"){
+        this.sort = "desc";
+      }
+      this.sortName = value.prop;
+      //字段匹配
+      if(value.prop=="theoryGrade"){
+        this.sortName = "theory_grade";
+      }
+      if(value.prop=="learnGrade"){
+        this.sortName = "learn_grade";
+      }
+      if(value.prop=="allGrade"){
+        this.sortName = "all_grade";
+      }
+      if(value.prop=="companyName"){
+        this.sortName = "companyName";
+      }
+      this.questionBankOnLoad(this.questionBankPage);
+    },
     questionBankOnLoad(page, params = {}) {
       //判断角色,如果是保安公司管理员或保安,只能查看当前公司的考试成绩
       var that = this;
@@ -593,6 +634,12 @@
           }
           that.questionBankLoading = false;
           params["examType"] = 2;
+          if(this.sort){
+            params["sort"] = this.sort;
+          }
+          if(this.sortName){
+            params["sortName"] = this.sortName;
+          }
           getList(
             page.currentPage,
             page.pageSize,
@@ -670,7 +717,7 @@
           isExam: this.questionBankSearch.isExam,
           qualified: this.questionBankSearch.qualified,
           securityName: this.questionBankSearch.securityName,
-          examName: this.questionBankSearch.examName,
+          examId:this.questionBankSearch.examId,
         };
         //导出
         if (
@@ -685,9 +732,13 @@
           data["trainUnitId"] = this.userInfo.dept_id;
         }
         data["examType"] = 2;
+        console.log(data,1234567989);
         //序列号url形式,用&拼接
         data = Qs.stringify(data);
-        window.open(`/api/examScore/export-examScore?` + data);
+        window.open(`/api/examScore/export-examScore?${
+            this.website.tokenHeader
+          }=${getToken()}&` + data
+        );
       });
     },
   },

--
Gitblit v1.9.3