From 6fef81e2e783f2628900a819c99976640d8ad1eb Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Fri, 12 Nov 2021 17:53:20 +0800
Subject: [PATCH] 制证导出修改

---
 src/views/accreditationRecords/accreditationRecords.vue      |   24 +++++++-----
 src/views/accreditationRecords/accreditationRecordsPaper.vue |   33 +++++++++-------
 src/views/securityGuard/securityGuard.vue                    |    2 
 src/views/system/user.vue                                    |   56 +++++++++++++++------------
 4 files changed, 65 insertions(+), 50 deletions(-)

diff --git a/src/views/accreditationRecords/accreditationRecords.vue b/src/views/accreditationRecords/accreditationRecords.vue
index 3c9f9c5..adc53c8 100644
--- a/src/views/accreditationRecords/accreditationRecords.vue
+++ b/src/views/accreditationRecords/accreditationRecords.vue
@@ -86,6 +86,8 @@
 import { mapGetters } from "vuex";
 import { mapState } from "vuex";
 import Qs from "qs";
+import website from "@/config/website";
+import { getToken } from "@/util/auth";
 export default {
   data() {
     return {
@@ -508,6 +510,8 @@
             this.questionBankSearch['endTime'] = releaseTimeRange[1];
         }
         var data = {
+          type:1,
+          applyUnit:this.questionBankSearch.applyUnit,
           deptName: this.questionBankSearch.deptName,
           idCardNo: this.questionBankSearch.idCardNo,
           realName: this.questionBankSearch.realName,
@@ -516,21 +520,21 @@
           endTime: this.questionBankSearch.endTime,
         };
         //导出
-        // if (
-        //   this.userInfo.role_name == "保安公司管理员" ||
-        //   this.userInfo.role_name == "保安"
-        // ) {
-        //   //如果是保安公司管理员
-        //   data["deptId"] = this.userInfo.dept_id;
-        // }
+        if (this.userInfo.role_name == "保安公司管理员") {
+          //如果是保安公司管理员
+          data["deptId"] = this.userInfo.dept_id;
+        }
         if (this.userInfo.role_name == "培训公司管理员") {
           //如果是培训公司管理员
-          data["trainUnitId"] = this.userInfo.dept_id;
+          data["createUser"] = this.userInfo.Id;
         }
-        // data["examType"] = 2;
+        if (this.userInfo.role_name == "公安管理员") {
+          //如果是公安管理员
+          data["jurisdiction"] = this.userInfo.jurisdiction;
+        }
         //序列号url形式,用&拼接
         data = Qs.stringify(data);
-        window.open(`/api/accreditationRecords/export-security-paper?` + data);
+        window.open(`/api/accreditationRecords/export-security-paper?${this.website.tokenHeader}=${getToken()}&`+data);
       });
     },
   },
diff --git a/src/views/accreditationRecords/accreditationRecordsPaper.vue b/src/views/accreditationRecords/accreditationRecordsPaper.vue
index 938bbca..996ab4e 100644
--- a/src/views/accreditationRecords/accreditationRecordsPaper.vue
+++ b/src/views/accreditationRecords/accreditationRecordsPaper.vue
@@ -34,14 +34,13 @@
           >删 除
         </el-button>
         <el-button
-          style="display:none"
           type="warning"
           size="small"
           plain
           icon="el-icon-download"
-          v-if="permission.accreditationRecords_export"
+          v-if="permission.accreditationRecords_paper_export"
           @click="handleExport"
-          >保安员证信息导出
+          >制证信息导出
         </el-button>
         <el-button
               type="primary"
@@ -193,6 +192,8 @@
 import { mapGetters } from "vuex";
 import { mapState } from "vuex";
 import Qs from "qs";
+import website from "@/config/website";
+import { getToken } from "@/util/auth";
 export default {
   data() {
     return {
@@ -954,7 +955,7 @@
     },
     //保安员证信息导出
     handleExport() {
-      this.$confirm("是否导出保安员证信息数据?", "提示", {
+      this.$confirm("是否导出证书制证信息数据?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
@@ -966,6 +967,9 @@
           this.questionBankSearch["endTime"] = releaseTimeRange[1];
         }
         var data = {
+          type:2,
+          applyUnit:this.questionBankSearch.applyUnit,
+          auditStatus:this.questionBankSearch.auditStatus,
           deptName: this.questionBankSearch.deptName,
           idCardNo: this.questionBankSearch.idCardNo,
           realName: this.questionBankSearch.realName,
@@ -973,22 +977,23 @@
           startTime: this.questionBankSearch.startTime,
           endTime: this.questionBankSearch.endTime,
         };
+        // data['Blade-Auth'] = getToken;
         //导出
-        // if (
-        //   this.userInfo.role_name == "保安公司管理员" ||
-        //   this.userInfo.role_name == "保安"
-        // ) {
-        //   //如果是保安公司管理员
-        //   data["deptId"] = this.userInfo.dept_id;
-        // }
+        if (this.userInfo.role_name == "保安公司管理员") {
+          //如果是保安公司管理员
+          data["deptId"] = this.userInfo.dept_id;
+        }
         if (this.userInfo.role_name == "培训公司管理员") {
           //如果是培训公司管理员
-          data["trainUnitId"] = this.userInfo.dept_id;
+          data["createUser"] = this.userInfo.Id;
         }
-        // data["examType"] = 2;
+        if (this.userInfo.role_name == "公安管理员") {
+          //如果是公安管理员
+          data["jurisdiction"] = this.userInfo.jurisdiction;
+        }
         //序列号url形式,用&拼接
         data = Qs.stringify(data);
-        window.open(`/api/accreditationRecords/export-security-paper?` + data);
+        window.open(`/api/accreditationRecords/export-security-book-paper?${this.website.tokenHeader}=${getToken()}&`+data);
       });
     },
   },
diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index 2de38c8..ef31ca4 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -634,7 +634,7 @@
         searchShow: true,
         reserveSelection: true,
         selectable: (row) => {
-          if (row.hold !== "1") {
+          if (row.hold !== "1" || row.securitynumber==null || row.securitynumber=='') {
             return false;
           } else {
             return true;
diff --git a/src/views/system/user.vue b/src/views/system/user.vue
index 3e43dd0..dc7dcb0 100644
--- a/src/views/system/user.vue
+++ b/src/views/system/user.vue
@@ -262,7 +262,8 @@
       treeData: [],
       treeOption: {
         nodeKey: "id",
-        defaultExpandAll:true,
+        defaultExpandedKeys: [],
+        // defaultExpandAll:true,
         // lazy: false,
         // treeLoad: "", //处理权限  在created中
         //  function (node, resolve) {
@@ -364,13 +365,13 @@
                 label: "所属组织机构",
                 prop: "deptId",
                 type: "tree",
-                defaultExpandAll:true,
+                defaultExpandAll: true,
                 // dicUrl: "/api/blade-system/dept/lazy-tree",
                 props: {
                   label: "title",
                   value: "id",
                 },
-                dicData:[],
+                dicData: [],
                 // hide: !website.tenantMode,
                 // addDisplay: website.tenantMode,
                 // editDisplay: website.tenantMode,
@@ -514,7 +515,6 @@
                   },
                 ],
               },
-              
             ],
           },
         ],
@@ -706,10 +706,14 @@
     var that = this;
     //公安局进入
     if (this.userInfo.role_name == "公安管理员") {
-      var  parentId = this.userInfo.dept_id;
-      var  userId = this.userInfo.Id;
+      var parentId = this.userInfo.dept_id;
+      var userId = this.userInfo.Id;
       getDeptLazyTree(parentId, userId).then((res) => {
         that.treeData = res.data.data;
+        that.treeOption.defaultExpandedKeys = [];
+        res.data.data.forEach((item) => {
+          that.treeOption.defaultExpandedKeys.push(item.id);
+        });
       });
     } else {
       // this.treeOption.treeLoad = function (node, resolve) {
@@ -728,7 +732,6 @@
       getDeptLazyTree(0).then((res) => {
         that.treeData = res.data.data;
       });
-      this.treeOption.defaultExpandAll = false;
     }
   },
   mounted() {
@@ -760,32 +763,35 @@
             }
           }
           column.dicData = b;
-        } else if(d == "公安管理员"){
+        } else if (d == "公安管理员") {
           for (var i in k) {
             if (k[i].title == "公安管理员") {
               b.push(k[i]);
             }
           }
           column.dicData = b;
-        }else {
+        } else {
           column.dicData = k;
         }
       });
 
       //公安局进入
-    if (this.userInfo.role_name == "公安管理员" || this.userInfo.role_name == "保安公司管理员") {
-      var  parentId = this.userInfo.dept_id;
-      var  userId = this.userInfo.Id;
-      getDeptLazyTree(parentId, userId).then((res) => {
-        const column = this.findObject(this.option.group, "deptId");
-        column.dicData = res.data.data;
-      });
-    } else {
-      getDeptLazyTree(0).then((res) => {
-        const column = this.findObject(this.option.group, "deptId");
-        column.dicData = res.data.data;
-      });
-    }
+      if (
+        this.userInfo.role_name == "公安管理员" ||
+        this.userInfo.role_name == "保安公司管理员"
+      ) {
+        var parentId = this.userInfo.dept_id;
+        var userId = this.userInfo.Id;
+        getDeptLazyTree(parentId, userId).then((res) => {
+          const column = this.findObject(this.option.group, "deptId");
+          column.dicData = res.data.data;
+        });
+      } else {
+        getDeptLazyTree(0).then((res) => {
+          const column = this.findObject(this.option.group, "deptId");
+          column.dicData = res.data.data;
+        });
+      }
       // getDeptTree(tenantId).then((res) => {
       //   const column = this.findObject(this.option.group, "deptId");
       //   column.dicData = res.data.data;
@@ -985,11 +991,11 @@
     },
     beforeOpen(done, type) {
       if (["edit", "view"].includes(type)) {
-        if(this.userInfo.role_name!="公安管理员"){
+        if (this.userInfo.role_name != "公安管理员") {
           const column = this.findObject(this.option.group, "code");
           column.display = false;
         }
-        
+
         getUser(this.form.id).then((res) => {
           this.form = res.data.data;
           if (this.form.hasOwnProperty("deptId")) {
@@ -1004,7 +1010,7 @@
         });
       }
       if (["add"].includes(type)) {
-        if(this.userInfo.role_name!="公安管理员"){
+        if (this.userInfo.role_name != "公安管理员") {
           const column = this.findObject(this.option.group, "code");
           column.display = false;
         }

--
Gitblit v1.9.3