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/trainApply/index.vue |  148 ++++++++++++++++++++++++++++++++++++------------
 1 files changed, 110 insertions(+), 38 deletions(-)

diff --git a/src/views/trainApply/index.vue b/src/views/trainApply/index.vue
index 82aa27c..13066f5 100644
--- a/src/views/trainApply/index.vue
+++ b/src/views/trainApply/index.vue
@@ -2,12 +2,18 @@
  * @Author: Morpheus
  * @Date: 2021-07-05 16:31:54
  * @Last Modified by: liu
- * @Last Modified time: 2021-10-26 15:33:54
+ * @Last Modified time: 2021-11-30 10:23:40
  * menu-name 报名考试
  */
 <template>
   <el-row class="morpheus-box-apply-exam-1">
-    <el-col :span="24" class="hasButOne">
+    <el-col
+      :span="24"
+      :class="[
+        'hasButOne',
+        $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
+      ]"
+    >
       <el-card>
         <div class="exam-card-body">
           <avue-crud
@@ -27,6 +33,7 @@
             @size-change="questionBankSizeChange"
             @row-save="questionBankRowSave"
             @row-del="questionBankRowDel"
+            :row-style="rowStyle"
           >
             <!-- 自定义按钮 -->
             <template slot="menuLeft">
@@ -56,6 +63,14 @@
                 @click="handleImport"
                 >清册导入
               </el-button>
+              <el-button
+                type="warning"
+                size="small"
+                plain
+                icon="el-icon-download"
+                @click="handleApplyInfoExport"
+                >报名清册信息导出
+              </el-button>
             </template>
 
             <template slot-scope="{ type, row }" slot="menu">
@@ -63,7 +78,11 @@
                 :type="type"
                 size="small"
                 icon="el-icon-receiving"
-                :disabled="row.candidateNo == '' || row.cancel == 2"
+                :disabled="
+                  row.candidateNo == '' ||
+                  row.cancel == 2 ||
+                  row.auditStatus == 2
+                "
                 @click="handlePrint(row)"
                 >准考证打印
               </el-button>
@@ -78,6 +97,7 @@
                 >取消报名
               </el-button>
               <el-button
+                style="display: none"
                 :type="type"
                 size="small"
                 icon="el-icon-circle-check"
@@ -85,6 +105,7 @@
                 @click="auditSucess(row)"
                 >审核通过
               </el-button>
+              
             </template>
           </avue-crud>
 
@@ -120,7 +141,8 @@
   auditSucess,
   remove,
 } from "@/api/trainingRegistration/trainingRegistration";
-
+import Qs from "qs";
+import { getToken } from "@/util/auth";
 import { mapState } from "vuex";
 
 var DIC = {
@@ -166,7 +188,7 @@
         dialogClickModal: false,
         // 操作栏宽度
         menuWidth: 200,
-
+        ...this.$store.state.control.clearOtherBut,
         column: [
           {
             label: "保安姓名",
@@ -262,7 +284,7 @@
             width: 220,
           },
           {
-            label: "所属公司",
+            label: "所属企业",
             prop: "deptName",
             search: true,
             slot: true,
@@ -281,7 +303,7 @@
             rules: [
               {
                 required: true,
-                message: "请选择所属公司",
+                message: "请选择所属企业",
                 trigger: "blur",
               },
             ],
@@ -296,6 +318,10 @@
             searchSpan: 4,
             searchValue: 1,
             dicData: [
+              {
+                label: "全部",
+                value: 0,
+              },
               {
                 label: "已报名",
                 value: 1,
@@ -500,26 +526,43 @@
             addDisplay: false,
             width: 100,
           },
-          // {
-          //     label: "报名状态",
-          //     prop: "cancel",
-          //     slot: true,
-          //     // 表单新增时是否禁止
-          //     addDisabled: false,
-          //     // 表单新增时是否可见
-          //     addDisplay: false,
-          //     // 表单新增时是否为查看模式
-          //     addDetail: false,
-          //     // 表单编辑时是否禁止
-          //     editDisabled: false,
-          //     // 表单编辑时是否可见
-          //     editDisplay: true,
-          //     // 表单编辑时是否为查看模式
-          //     editDetail: false,
-          //     dicData:DIC.cancel,
-          //     search:true,
-          //     type:"select"
-          // },
+          {
+            label: "考试状态",
+            search: true,
+            type: "select",
+            searchSpan: 4,
+            prop: "isExam",
+            searchValue: 1,
+            dicData: [
+              {
+                label: "全部",
+                value: 0,
+              },
+              {
+                label: "未考试",
+                value: 1,
+              },
+              {
+                label: "考试结束",
+                value: 2,
+              },
+              {
+                label: "考试中",
+                value: 3,
+              },
+              {
+                label: "缺考",
+                value: 4,
+              },
+            ],
+            props: {
+              label: "label",
+              value: "value",
+            },
+            editDisplay: false,
+            addDisplay: false,
+            width: 100,
+          },
         ],
       },
       questionBankSearch: {},
@@ -529,6 +572,7 @@
         pageSize: 10,
         currentPage: 1,
         total: 16,
+        ...this.$store.state.control.changePageSize,
       },
       questionBankQuery: {},
       questionBankSelectionList: [],
@@ -600,6 +644,7 @@
     }
     this.questionBankSearch["cancel"] = 1;
     this.questionBankSearch["auditStatus"] = 0;
+    this.questionBankSearch["isExam"] = 1;
   },
   mounted() {
     var flag = false,
@@ -631,6 +676,44 @@
     },
   },
   methods: {
+    //报名信息导出
+    handleApplyInfoExport() {
+      this.$confirm("是否导出考试报名信息数据?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        //获取查询条件
+        // const { releaseTimeRange } = this.questionBankSearch;
+        // if (releaseTimeRange) {
+        //   this.questionBankSearch["startTime"] = releaseTimeRange[0];
+        //   this.questionBankSearch["endTime"] = releaseTimeRange[1];
+        // }
+        var data = {
+          cancel: this.questionBankSearch.cancel,
+          auditStatus: this.questionBankSearch.auditStatus,
+          deptName: this.questionBankSearch.deptName,
+          isExam: this.questionBankSearch.isExam,
+          realName: this.questionBankSearch.realName
+        };
+        data["examId"] = this.$route.query.id;
+        //序列号url形式,用&拼接
+        data = Qs.stringify(data);
+        window.open(
+          `/api/trainingRegistration/export-apply-info?${
+            this.website.tokenHeader
+          }=${getToken()}&` + data
+        );
+      });
+    },
+    //行样式调整
+    rowStyle({ row, column, rowIndex }) {
+      if (row.auditStatus == "2") {
+        return {
+          color: "#ff2727",
+        };
+      }
+    },
     //准考证查看
     handlePrint(row) {
       var obj = row;
@@ -800,17 +883,6 @@
         query: obj,
       });
     },
-
-    //导出数据
-    // handleExport() {
-    //     this.$confirm("是否导出清册数据?", "提示", {
-    //         confirmButtonText: "确定",
-    //         cancelButtonText: "取消",
-    //         type: "warning",
-    //     }).then(() => {
-    //         window.open(`/api/trainingRegistration/export-apply?examId=${this.$route.query.id}`);
-    //     });
-    // },
     handleImport() {
       this.excelBox = true;
     },

--
Gitblit v1.9.3