From 6d4df5cbb1def7e0da95fe9cdd8570e9019a6033 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Wed, 03 Nov 2021 15:40:04 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises

---
 src/views/securityGuard/securityGuard.vue |   72 +++++++++++++++++++++++++++++++++--
 1 files changed, 67 insertions(+), 5 deletions(-)

diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index 56c52e5..26a1a35 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -58,6 +58,17 @@
               >个人照片批量上传
             </el-button>
             <el-button
+              style="display:none"
+              type="primary"
+              size="small"
+              plain
+              v-if="permission.securityGuard_security_apply"
+              icon="el-icon-s-promotion"
+              @click="handleSecurityApply"
+              >制证申请
+            </el-button>
+            
+            <el-button
               type="danger"
               style="display: none"
               size="small"
@@ -299,6 +310,7 @@
   getUserPractitionersInfo,
   saveOrUpdateUserPractitionersInfo,
 } from "@/api/system/user";
+import {securityApply} from '@/api/accreditationRecords/accreditationRecords'
 import { getList } from "@/api/securityGuard/securityGuard";
 import { getDeptLazyTree } from "@/api/system/dept";
 import { getRoleTree, getRoleDetail } from "@/api/system/role";
@@ -505,12 +517,20 @@
           children: "children",
         },
       },
+      choiceList: [],
       option: {
         height: "auto",
         calcHeight: 80,
-        tip: false,
+        tip: true,
         searchShow: true,
-
+        reserveSelection:true,
+        selectable: (row) => {
+          if (row.hold!=="1") {
+            return false;
+          } else {
+            return true;
+          }
+        },
         indexWidth: 55,
         searchMenuSpan: 6,
         stripe: true,
@@ -1101,6 +1121,42 @@
         this.onLoad(this.page);
       });
     },
+    //制证申请
+    handleSecurityApply(){
+      if (this.choiceList.length === 0) {
+        this.$message.warning("请勾选至少一位持证保安员");
+        return;
+      }
+        this.$confirm("共选择制证申请人数"+this.choiceList.length+"人,确定申请制证?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          let cho = this.choiceList;
+          console.log(this.choiceList,14521);
+          let str = "";
+          for (let k in cho) {
+            str += cho[k].id;
+            if (k != cho.length - 1) {
+              str += ",";
+            }
+          }
+          console.log(str,1132);
+          const data = {
+            ids:str,
+            createUser:this.userInfo.user_id
+          }
+          return securityApply(data);
+        })
+        .then(() => {
+          // this.$refs.crud.toggleSelection();
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
     rowSave(row, done, loading) {
       if (row.deptId) {
         row.deptId = row.deptId;
@@ -1266,11 +1322,17 @@
       done();
     },
     selectionChange(list) {
-      this.selectionList = list;
+      // this.selectionList = list;
+      this.choiceList = [];
+      for (let k in list) {
+        this.choiceList.push({
+          id: list[k].id,
+        });
+      }
     },
     selectionClear() {
-      this.selectionList = [];
-      this.$refs.crud.toggleSelection();
+      // this.selectionList = [];
+      // this.$refs.crud.toggleSelection();
     },
     handleDelete() {
       if (this.selectionList.length === 0) {

--
Gitblit v1.9.3