From 66d85a91a9fbf30d9dc778658fa7d0a0709e5693 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Fri, 26 Nov 2021 23:08:54 +0800
Subject: [PATCH] 用户保安员列表组织机构tree 修改

---
 src/views/securityGuard/securityGuard.vue |    8 +++++---
 src/views/securityGuard/data.js           |    2 +-
 src/views/system/user.vue                 |   28 ++++++++++++++++++----------
 src/api/system/dept.js                    |   12 ++++++++++++
 4 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/src/api/system/dept.js b/src/api/system/dept.js
index befcc24..16320b3 100644
--- a/src/api/system/dept.js
+++ b/src/api/system/dept.js
@@ -80,6 +80,18 @@
     })
 }
 
+export const getSecurityDeptTree = (jurisdiction, parentId, deptId) => {
+    return request({
+        url: '/api/blade-system/dept/security_lazy-tree',
+        method: 'get',
+        params: {
+            jurisdiction,
+            parentId,
+            deptId
+        }
+    })
+}
+
 
 export const getDeptLazyTreeUser = (parentId) => {
     return request({
diff --git a/src/views/securityGuard/data.js b/src/views/securityGuard/data.js
index c1b1cf1..9197916 100644
--- a/src/views/securityGuard/data.js
+++ b/src/views/securityGuard/data.js
@@ -479,7 +479,7 @@
         // prop: "deptName",
         prop: "deptId",
         type: "tree",
-        dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+        // dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
         props: {
             label: "title",
             value: "id",
diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index b7f89bc..387fb09 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -2269,12 +2269,14 @@
           ) {
             //去除保安公司查询
             const column = that.findObject(that.option.column, "deptId");
-            column.search = false;
+            // column.search = false;
+            column.dicUrl =
+              "/api/blade-system/dept/security_lazy-tree?deptId="+that.userInfo.dept_id;
             const deptColumn = that.findObject(that.option.group, "deptId");
             deptColumn.dicUrl =
-              "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
+              "/api/blade-system/dept/security_lazy-tree?deptId="+that.userInfo.dept_id;
             //禁止编辑
-            deptColumn.disabled = true;
+            // deptColumn.disabled = true;
             deptColumn.value = that.userInfo.dept_id;
             that.isSecurity = false;
             //如果是保安公司管理员
diff --git a/src/views/system/user.vue b/src/views/system/user.vue
index 6371b30..9ee33e2 100644
--- a/src/views/system/user.vue
+++ b/src/views/system/user.vue
@@ -200,7 +200,7 @@
   resetPassword,
   getJurisdiction,
 } from "@/api/system/user";
-import { getDeptTree, getDeptLazyTree } from "@/api/system/dept";
+import { getSecurityDeptTree, getDeptLazyTree } from "@/api/system/dept";
 import { getRoleTree } from "@/api/system/role";
 import { getPostList } from "@/api/system/post";
 import { mapGetters } from "vuex";
@@ -697,7 +697,7 @@
     },
   },
   created() {
-    console.log(this.userInfo.role_name);
+    // console.log(this.userInfo.role_name);
     if (
       this.userInfo.role_name == "保安公司管理员" ||
       this.userInfo.role_name == "分公司管理员"
@@ -706,7 +706,7 @@
       this.sizes = [0, 24];
       this.isguanli = false;
       this.option.group[0].column[0]["value"] = this.userInfo.dept_id;
-      this.option.group[0].column[0]["disabled"] = true;
+      // this.option.group[0].column[0]["disabled"] = true;
       // this.option.group[2].column[1]["disabled"] = true;
     } else {
       this.deptids = null;
@@ -739,7 +739,11 @@
       //     );
       //   });
       // };
-      getDeptLazyTree(0).then((res) => {
+      // getDeptLazyTree(0).then((res) => {
+      //   that.treeData = res.data.data;
+      // });
+      // var parentId1 = this.userInfo.dept_id;
+      getSecurityDeptTree(null,null,this.userInfo.dept_id).then((res) => {
         that.treeData = res.data.data;
       });
     }
@@ -784,11 +788,11 @@
           column.dicData = k;
         }
       });
-
+// this.userInfo.role_name == "保安公司管理员"
       //公安局进入
       if (
-        this.userInfo.role_name == "公安管理员" ||
-        this.userInfo.role_name == "保安公司管理员"
+        this.userInfo.role_name == "公安管理员"
+        
       ) {
         var parentId = this.userInfo.dept_id;
         var userId = this.userInfo.Id;
@@ -797,9 +801,13 @@
           column.dicData = res.data.data;
         });
       } else {
-        getDeptLazyTree(0).then((res) => {
-          const column = this.findObject(this.option.group, "deptId");
-          column.dicData = res.data.data;
+        // getDeptLazyTree(0).then((res) => {
+        //   const column = this.findObject(this.option.group, "deptId");
+        //   column.dicData = res.data.data;
+        // });
+        getSecurityDeptTree(null,null,this.userInfo.dept_id).then((res) => {
+            const column = this.findObject(this.option.group, "deptId");
+            column.dicData = res.data.data;
         });
       }
       // getDeptTree(tenantId).then((res) => {

--
Gitblit v1.9.3