From 21c7375b7b38ebf2c8a2ca8fbf6fe9fb4f28250f Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 12 Jan 2022 10:59:40 +0800
Subject: [PATCH] 新增公司注册机公司注册审核

---
 src/views/system/user.vue |   40 +++++++++++++++++++++++++++++++---------
 1 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/src/views/system/user.vue b/src/views/system/user.vue
index 6371b30..3ed7870 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;
@@ -742,6 +742,10 @@
       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;
+      // });
     }
   },
   mounted() {
@@ -768,12 +772,26 @@
         if (d == "保安公司管理员") {
           // console.log(k);
           for (var n in k) {
-            if (k[n].title == "保安" || k[n].title == "保安公司管理员") {
+            if (k[n].title == "保安" || k[n].title == "保安公司管理员" || k[n].title == "分公司管理员") {
               b.push(k[n]);
             }
           }
           column.dicData = b;
-        } else if (d == "公安管理员") {
+        } else if (d == "分公司管理员") {
+          for (var j in k) {
+            if (k[j].title == "分公司管理员" || k[j].title == "保安") {
+              b.push(k[j]);
+            }
+            if(k[j].children){
+              for (var h in k[j].children) {
+                if (k[j].children[h].title == "分公司管理员" || k[j].children[h].title == "保安") {
+                  b.push(k[j].children[h]);
+                }
+              }
+            }
+          }
+          column.dicData = b;
+        }else if (d == "公安管理员") {
           for (var i in k) {
             if (k[i].title == "公安管理员") {
               b.push(k[i]);
@@ -784,11 +802,10 @@
           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;
@@ -796,11 +813,16 @@
           const column = this.findObject(this.option.group, "deptId");
           column.dicData = res.data.data;
         });
-      } else {
+      } else if( this.userInfo.role_name == "administrator"){
         getDeptLazyTree(0).then((res) => {
           const column = this.findObject(this.option.group, "deptId");
           column.dicData = res.data.data;
         });
+      }else {
+        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) => {
       //   const column = this.findObject(this.option.group, "deptId");

--
Gitblit v1.9.3