From 21c7375b7b38ebf2c8a2ca8fbf6fe9fb4f28250f Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 12 Jan 2022 10:59:40 +0800
Subject: [PATCH] 新增公司注册机公司注册审核

---
 src/views/exam/performance.vue |   86 +++++++++++++++++++++++++++++++-----------
 1 files changed, 63 insertions(+), 23 deletions(-)

diff --git a/src/views/exam/performance.vue b/src/views/exam/performance.vue
index d68d933..94b2325 100644
--- a/src/views/exam/performance.vue
+++ b/src/views/exam/performance.vue
@@ -1,15 +1,26 @@
 /*
  * @Author: Morpheus
  * @Date: 2021-07-05 16:31:54
- * @Last Modified by: Morpheus
- * @Last Modified time: 2021-07-18 19:44:47
+ * @Last Modified by: liu
+ * @Last Modified time: 2021-11-23 14:17:22
  * menu-name 成绩管理
  */
 <template>
   <el-row class="morpheus-box">
-    <el-col :span="24" class="recruitmentManagement">
+    <el-col
+      :span="24"
+      :class="[
+        'recruitmentManagement',
+        $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
+      ]"
+    >
       <el-card>
-        <div class="exam-card-body">
+        <div
+          :class="[
+            'exam-card-body',
+            $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
+          ]"
+        >
           <avue-crud
             v-model="obj"
             class="company-box"
@@ -38,7 +49,15 @@
               {{ row.allGrade == -1 ? "" : row.allGrade }}
             </template>
             <template slot-scope="{ row }" slot="qualified">
-              {{ row.qualified == -1 ? "" : row.qualified==0?"合格":row.qualified==1?"不合格":'' }}
+              {{
+                row.qualified == -1
+                  ? ""
+                  : row.qualified == 0
+                  ? "合格"
+                  : row.qualified == 1
+                  ? "不合格"
+                  : ""
+              }}
             </template>
 
             <!-- 自定义按钮 -->
@@ -73,7 +92,7 @@
                 icon="el-icon-collection"
                 class="start-kaoshi"
                 v-if="permission.performance_print"
-                :disabled="row.qualified==1"
+                :disabled="row.qualified == 1"
                 @click="securityPrint(row)"
                 >保安证打印
               </el-button>
@@ -84,7 +103,6 @@
             title="实操成绩导入"
             append-to-body
             :visible.sync="excelBox"
-            
             width="555px"
           >
             <avue-form
@@ -108,10 +126,11 @@
 <script>
 import { getList, update } from "@/api/examapi/performance";
 import { mapGetters } from "vuex";
+import { getRoleDetail } from "@/api/system/role";
+
 export default {
   data() {
     var validatePass = (rule, value, callback) => {
-      console.log(value);
       if (value == undefined || value == "") {
         callback(new Error("请输入实操成绩"));
         return;
@@ -156,7 +175,7 @@
         menu: true,
         menuWidth: 186,
         labelWidth: 120,
-
+        ...this.$store.state.control.clearOtherBut,
         column: [
           {
             label: "考试名称",
@@ -184,7 +203,8 @@
                 trigger: "blur",
               },
             ],
-            overHidden: true,
+            // overHidden: true,
+            width: 230,
           },
           {
             label: "用户名",
@@ -211,6 +231,7 @@
                 trigger: "blur",
               },
             ],
+            width: 160,
           },
           {
             label: "所属公司",
@@ -242,6 +263,7 @@
                 trigger: "blur",
               },
             ],
+            width: 250,
           },
           {
             label: "考试开始时间",
@@ -435,6 +457,7 @@
         pageSize: 10,
         currentPage: 1,
         total: 16,
+        ...this.$store.state.control.changePageSize,
       },
       questionBankQuery: {},
       questionBankSelectionList: [],
@@ -492,7 +515,7 @@
       },
     };
   },
-  computed:{
+  computed: {
     ...mapGetters(["userInfo", "permission"]),
     permissionList() {
       return {
@@ -508,18 +531,35 @@
   mounted() {},
   methods: {
     questionBankOnLoad(page, params = {}) {
-      this.questionBankLoading = false;
-      params["examType"] = 1;
-      getList(
-        page.currentPage,
-        page.pageSize,
-        Object.assign(params, this.query)
-      ).then((res) => {
-        const data = res.data.data;
-        this.questionBankPage.total = data.total;
-        this.questionBankData = data.records;
-        this.questionBankLoading = false;
-        this.questionBankSelectionClear();
+      //判断角色,如果是保安公司管理员或保安,只能查看当前公司的考试成绩
+      var that = this;
+      //获取当前登录人员的角色信息
+      var roleIds = this.userInfo.role_id.split(",");
+      roleIds.forEach((roleId) => {
+        getRoleDetail(roleId).then((res) => {
+          var roleAlias = res.data.data.roleAlias;
+          if (
+            roleAlias == "保安公司管理员" ||
+            roleAlias == "保安" ||
+            roleAlias == "未持证保安"
+          ) {
+            //如果是保安公司管理员
+            params["deptId"] = that.userInfo.dept_id;
+          }
+          that.questionBankLoading = false;
+          params["examType"] = 1;
+          getList(
+            page.currentPage,
+            page.pageSize,
+            Object.assign(params, this.query)
+          ).then((res) => {
+            const data = res.data.data;
+            that.questionBankPage.total = data.total;
+            that.questionBankData = data.records;
+            that.questionBankLoading = false;
+            that.questionBankSelectionClear();
+          });
+        });
       });
     },
     questionBankSelectionClear() {

--
Gitblit v1.9.3