From 3cf33734b481bd6bf5ced2e6e24873748116332f Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Sat, 27 Nov 2021 10:01:58 +0800
Subject: [PATCH] +培训考试成绩管理 加证书制证申请

---
 src/views/trainExam/performance.vue |  122 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 119 insertions(+), 3 deletions(-)

diff --git a/src/views/trainExam/performance.vue b/src/views/trainExam/performance.vue
index a7edb17..30beb7e 100644
--- a/src/views/trainExam/performance.vue
+++ b/src/views/trainExam/performance.vue
@@ -2,7 +2,7 @@
  * @Author: Morpheus
  * @Date: 2021-07-05 16:31:54
  * @Last Modified by: liu
- * @Last Modified time: 2021-11-27 09:36:23
+ * @Last Modified time: 2021-11-27 10:00:37
  * menu-name 成绩管理
  */
 <template>
@@ -88,6 +88,15 @@
                 v-if="permission.trainExam_performance_export"
                 @click="handleExport"
                 >成绩导出
+              </el-button>
+              <el-button
+                type="primary"
+                size="small"
+                plain
+                v-if="permission.securityGuard_security_paper_apply"
+                icon="el-icon-collection-tag"
+                @click="handleSecurityPaperApply"
+                >证书制证申请
               </el-button>
             </template>
 
@@ -264,6 +273,7 @@
 } from "@/api/examapi/performance";
 import { mapGetters } from "vuex";
 import { getRoleDetail } from "@/api/system/role";
+import { securityApply } from "@/api/accreditationRecords/accreditationRecords";
 import Qs from "qs";
 export default {
   components: {
@@ -315,11 +325,18 @@
         delBtn: false,
         editBtn: true,
         addBtn: false,
-        selection: false,
+        selection: true,
         // 导出按钮
         // excelBtn: true,
         // excelBtnText: "成绩导出",
         viewBtn: true,
+        selectable: (row) => {
+          if (row.qualified != "0") {
+            return false;
+          } else {
+            return true;
+          }
+        },
         // title: '成绩',
         align: "center",
         height: "auto",
@@ -652,6 +669,7 @@
             prop: "qualified",
             type: "select",
             slot: true,
+            hide: true,
             search: true,
             searchSpan: 3,
             width: 68,
@@ -683,6 +701,44 @@
             editDisabled: true,
             // 表单编辑时是否可见
             editDisplay: true,
+            // 表单编辑时是否为查看模式
+            editDetail: false,
+          },
+          {
+            label: "是否合格",
+            prop: "qualifieds",
+            type: "select",
+            // search: true,
+            searchSpan: 3,
+            width: 68,
+            dicData: [
+              {
+                label: "合格",
+                value: 0,
+              },
+              {
+                label: "不合格",
+                value: 1,
+              },
+              {
+                label: "暂未录实操成绩",
+                value: 2,
+              },
+              {
+                label: "缺考,成绩无效",
+                value: 3,
+              },
+            ],
+            // 表单新增时是否禁止
+            addDisabled: false,
+            // 表单新增时是否可见
+            addDisplay: false,
+            // 表单新增时是否为查看模式
+            addDetail: false,
+            // 表单编辑时是否禁止
+            editDisabled: false,
+            // 表单编辑时是否可见
+            editDisplay: false,
             // 表单编辑时是否为查看模式
             editDetail: false,
           },
@@ -751,6 +807,7 @@
           },
         ],
       },
+      choiceList: [],
     };
   },
   created() {},
@@ -777,6 +834,53 @@
     },
   },
   methods: {
+    selectionChange(list) {
+      // this.selectionList = list;
+      this.choiceList = [];
+      for (let k in list) {
+        this.choiceList.push({
+          id: list[k].userId,
+        });
+      }
+    },
+    //证书制证申请
+    handleSecurityPaperApply() {
+      if (this.choiceList.length === 0) {
+        this.$message.warning("请勾选至少一位持证保安员");
+        return;
+      }
+      this.$confirm(
+        "共选择制证申请人数" + this.choiceList.length + "人,确定申请制证?",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      )
+        .then(() => {
+          let cho = this.choiceList;
+          let str = "";
+          for (let k in cho) {
+            str += cho[k].id;
+            if (k != cho.length - 1) {
+              str += ",";
+            }
+          }
+          const data = {
+            ids: str,
+            createUser: this.userInfo.user_id,
+            type: 2,
+          };
+          return securityApply(data);
+        })
+        .then(() => {
+          // this.$refs.crud.toggleSelection();
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
     openzhengjian(row) {
       this.baoanzdata = {
         realName: row.securityName,
@@ -824,6 +928,12 @@
                 : item.theoryGrade;
               item.learnGrade == -1 ? (item.learnGrade = "") : item.learnGrade;
             });
+            for (let k in data.records) {
+              data.records[k]["qualifieds"] =
+                data.records[k]["qualified"] == -1
+                  ? ""
+                  : data.records[k]["qualified"];
+            }
             that.questionBankPage.total = data.total;
             that.questionBankData = data.records;
             that.questionBankLoading = false;
@@ -919,7 +1029,13 @@
       this.$refs.questionBankCrud.toggleSelection();
     },
     questionBankSelectionChange(list) {
-      this.questionBankSelectionList = list;
+      // this.questionBankSelectionList = list;
+      this.choiceList = [];
+      for (let k in list) {
+        this.choiceList.push({
+          id: list[k].userId,
+        });
+      }
     },
     questionBankSearchChange(params, done) {
       this.questionBankQuery = params;

--
Gitblit v1.9.3