From 386a53eac26e87b95324e1da3967ae115f990297 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 24 Sep 2021 16:29:50 +0800
Subject: [PATCH] 公司保安用户权限

---
 src/api/securityGuard/securityGuard.js           |    3 
 src/views/securityAnalysis/child/certificate.vue |   18 +++++-
 src/views/securityAnalysis/child/situation.vue   |   29 ++++++---
 src/views/system/user.vue                        |   27 +++++++-
 src/views/securityAnalysis/child/dispatch.vue    |   43 ++++++--------
 src/views/securityAnalysis/index.vue             |   10 +-
 6 files changed, 83 insertions(+), 47 deletions(-)

diff --git a/src/api/securityGuard/securityGuard.js b/src/api/securityGuard/securityGuard.js
index b95ca3c..091a3fa 100644
--- a/src/api/securityGuard/securityGuard.js
+++ b/src/api/securityGuard/securityGuard.js
@@ -7,7 +7,8 @@
         params: {
             ...params,
             current,
-            size
+            size,
+            roleAlias: 111 //筛选保安员  固定
         }
     })
 }
diff --git a/src/views/securityAnalysis/child/certificate.vue b/src/views/securityAnalysis/child/certificate.vue
index 6d21504..b5f2087 100644
--- a/src/views/securityAnalysis/child/certificate.vue
+++ b/src/views/securityAnalysis/child/certificate.vue
@@ -19,6 +19,19 @@
 export default {
   props: ["card"],
   data() {
+    var dicUrl =
+        "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+      search = true;
+    if (this.card.jurisdiction != "") {
+      dicUrl =
+        "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697&jurisdiction=" +
+        this.card.jurisdiction;
+    } else if (this.card.jurisdiction == 1372091709474910209) {
+      // a = "";
+    }
+    if (this.card.deptId != "") {
+      search = false;
+    }
     return {
       securityid1: "",
       ExperienceVisible: false,
@@ -64,8 +77,7 @@
             // prop: "deptName",
             prop: "deptId",
             type: "tree",
-            dicUrl:
-              "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+            dicUrl: dicUrl,
             props: {
               label: "title",
               value: "id",
@@ -74,7 +86,7 @@
             // slot: true,
             searchSpan: 5,
             display: false,
-            search: true,
+            search: search,
             minWidth: 220,
           },
           {
diff --git a/src/views/securityAnalysis/child/dispatch.vue b/src/views/securityAnalysis/child/dispatch.vue
index 1dc10e9..f82a5b6 100644
--- a/src/views/securityAnalysis/child/dispatch.vue
+++ b/src/views/securityAnalysis/child/dispatch.vue
@@ -19,10 +19,19 @@
 export default {
   props: ["card"],
   data() {
-    var jurisdiction =
-      this.card.jurisdiction == "1372091709474910209"
-        ? "1372091709474910209"
-        : this.card.jurisdiction;
+    var dicUrl =
+        "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+      search = true;
+    if (this.card.jurisdiction != "") {
+      dicUrl =
+        "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697&jurisdiction=" +
+        this.card.jurisdiction;
+    } else if (this.card.jurisdiction == 1372091709474910209) {
+      // a = "";
+    }
+    if (this.card.deptId != "") {
+      search = false;
+    }
     return {
       securityid1: "",
       ExperienceVisible: false,
@@ -80,8 +89,7 @@
             prop: "deptName",
             type: "tree",
             overHidden: true,
-            dicUrl:
-              "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+            dicUrl: dicUrl,
             props: {
               label: "title",
               value: "id",
@@ -101,7 +109,7 @@
             labelWidth: 118,
             width: 230,
             searchLabelWidth: 80,
-            search: true,
+            search: search,
             searchSpan: 4,
             // editDisplay: false,
             // addDisplay: false,
@@ -219,7 +227,7 @@
             prop: "jurisdiction",
             hide: true,
             searchLabelWidth: 80,
-            search: true,
+            search: search,
             searchSpan: 4,
             overHidden: true,
             labelWidth: 118,
@@ -291,19 +299,6 @@
       return "";
     },
     getPractitionersPageInfo(page, params = {}) {
-      // this.card.jurisdiction = "130";
-      // this.card.this.card = "1425365571343515649";
-      // if (params.hold == undefined) {
-      //   params.hold = 1;
-      // }
-      if (this.card.jurisdiction != "" || this.card.jurisdiction != undefined) {
-        if (this.query1.deptId != "" || this.query1.deptId != undefined) {
-          this.card.deptId = this.query1.deptId;
-        }
-        this.option1.column[2].search = true;
-      } else {
-        this.option1.column[2].search = false;
-      }
       if (this.card.jurisdiction == 1372091709474910209) {
         this.card.jurisdiction = "";
       }
@@ -312,22 +307,22 @@
       if (releaseTimeRange) {
         params = {
           ...params,
+          ...this.card,
           beginTime: releaseTimeRange[0],
           overTime: releaseTimeRange[1],
           status: 1,
           ...this.query1,
-          ...this.card,
         };
         // values.releaseTimeRange = null;
       } else {
         params = {
           ...params,
+          ...this.card,
           ...this.query1,
           status: 1,
-          ...this.card,
         };
       }
-      console.log(params);
+      // console.log(params);
       getdata(page.currentPage, page.pageSize, params).then((res) => {
         // console.log(res.data.data.records);
         const data = res.data.data;
diff --git a/src/views/securityAnalysis/child/situation.vue b/src/views/securityAnalysis/child/situation.vue
index 90af1cb..0ba7cd5 100644
--- a/src/views/securityAnalysis/child/situation.vue
+++ b/src/views/securityAnalysis/child/situation.vue
@@ -19,6 +19,20 @@
 export default {
   props: ["card"],
   data() {
+    var dicUrl =
+        "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+      search = true;
+    if (this.card.jurisdiction != "") {
+      dicUrl =
+        "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697&jurisdiction=" +
+        this.card.jurisdiction;
+    } else if (this.card.jurisdiction == 1372091709474910209) {
+      // a = "";
+    }
+    // console.log(this.card);
+    if (this.card.deptId != "") {
+      search = false;
+    }
     return {
       securityid1: "",
       ExperienceVisible: false,
@@ -64,8 +78,7 @@
             // prop: "deptName",
             prop: "deptId",
             type: "tree",
-            dicUrl:
-              "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+            dicUrl: dicUrl,
             props: {
               label: "title",
               value: "id",
@@ -74,7 +87,7 @@
             // slot: true,
             searchSpan: 4,
             display: false,
-            search: true,
+            search: search,
             minWidth: 220,
           },
           {
@@ -166,14 +179,12 @@
       if (this.card.jurisdiction == 1372091709474910209) {
         this.card.jurisdiction = "";
       }
-      // if (params.hold == undefined) {
-      //   params.hold = 1;
-      // }
+
       params = {
-        ...params,
-        ...this.query1,
-        status: 1,
         ...this.card,
+        ...params,
+        status: 1,
+        ...this.query1,
       };
       getList(page.currentPage, page.pageSize, params).then((res) => {
         // console.log(res.data.data.records);
diff --git a/src/views/securityAnalysis/index.vue b/src/views/securityAnalysis/index.vue
index 4e3ad01..493788d 100644
--- a/src/views/securityAnalysis/index.vue
+++ b/src/views/securityAnalysis/index.vue
@@ -57,14 +57,14 @@
         top="9vh"
       >
         <situation
-          :card="{ deptid: deptid, jurisdiction: jurisdiction }"
+          :card="{ deptId: deptid, jurisdiction: jurisdiction }"
           v-if="sees == 1"
         >
           <!-- 保安员审查情况统计 -->
         </situation>
 
         <certificate
-          :card="{ deptid: deptid, jurisdiction: jurisdiction }"
+          :card="{ deptId: deptid, jurisdiction: jurisdiction }"
           v-if="sees == 2"
         >
           <!-- 保安员持证情况统计 -->
@@ -254,7 +254,7 @@
         feature: {
           myTool1: {
             show: true,
-            title: title,
+            title: "",
             icon: "image://img/table.png",
             onclick: function () {
               that.dialogVisible = true;
@@ -854,10 +854,10 @@
           // console.log(roleName);
           // console.log(res.data.data);
           // console.log(roleAlias);
-          if (roleName == "超级管理员" || roleName == "公安管理员") {
+          if (roleName != "保安公司管理员") {
             this.deptid = "";
             this.jurisdiction = this.userInfo.jurisdiction;
-          } else if (roleName == "保安公司管理员") {
+          } else {
             this.deptid = this.userInfo.dept_id;
             this.jurisdiction = "";
           }
diff --git a/src/views/system/user.vue b/src/views/system/user.vue
index df4243e..37f37bf 100644
--- a/src/views/system/user.vue
+++ b/src/views/system/user.vue
@@ -1,6 +1,6 @@
 <template>
   <el-row class="user">
-    <el-col :span="5">
+    <el-col :span="sizes[0]">
       <div class="box">
         <el-scrollbar>
           <basic-container>
@@ -13,7 +13,7 @@
         </el-scrollbar>
       </div>
     </el-col>
-    <el-col :span="19">
+    <el-col :span="sizes[1]">
       <basic-container>
         <avue-crud
           :option="option"
@@ -221,6 +221,9 @@
       }
     };
     return {
+      sizes: [5, 19],
+      deptids: null,
+
       form: {},
       search: {},
       roleBox: false,
@@ -303,18 +306,21 @@
             label: "所属组织机构",
             prop: "deptName",
             slot: true,
+            overHidden: true,
             display: false,
           },
           {
             label: "用户姓名",
             prop: "realName",
             search: true,
+            width: 90,
             display: false,
           },
           {
             label: "所属角色",
             prop: "roleName",
             slot: true,
+            width: 130,
             display: false,
           },
           // {
@@ -753,6 +759,16 @@
       return ids.join(",");
     },
   },
+  created() {
+    console.log(this.userInfo.role_name);
+    if (this.userInfo.role_name == "保安公司管理员") {
+      this.deptids = this.userInfo.dept_id;
+      this.sizes = [0, 24];
+    } else {
+      this.deptids = null;
+      this.sizes = [5, 19];
+    }
+  },
   mounted() {
     // 非保安单位模式默认加载管理组数据
     if (!website.tenantMode) {
@@ -999,12 +1015,12 @@
     },
     onLoad(page, params = {}) {
       this.loading = true;
-      params["status"] = 1;
+      var deptid = this.deptids == null ? this.treeDeptId : this.deptids;
       getList(
         page.currentPage,
         page.pageSize,
         Object.assign(params, this.query),
-        this.treeDeptId
+        deptid
       ).then((res) => {
         const data = res.data.data;
         this.page.total = data.total;
@@ -1065,11 +1081,12 @@
     },
     platformOnLoad(page, params = {}) {
       this.platformLoading = true;
+      var deptid = this.deptids == null ? this.treeDeptId : this.deptids;
       getList(
         page.currentPage,
         page.pageSize,
         Object.assign(params, this.query),
-        this.treeDeptId
+        deptid
       ).then((res) => {
         const data = res.data.data;
         this.platformPage.total = data.total;

--
Gitblit v1.9.3