From bee92e3c4ea9032786c02cddc237955effd5e330 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 24 Sep 2021 20:21:38 +0800
Subject: [PATCH] 用户新增  如果是公司登入   取消其他权限

---
 src/views/system/user.vue |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/src/views/system/user.vue b/src/views/system/user.vue
index eda8308..c3ca953 100644
--- a/src/views/system/user.vue
+++ b/src/views/system/user.vue
@@ -729,11 +729,11 @@
   watch: {
     "form.tenantId"() {
       if (this.form.tenantId !== "" && this.initFlag) {
-        this.initData(this.form.tenantId);
+        this.initData(this.form.tenantId, this.userInfo.role_name);
       }
     },
     "form.deptId"() {
-      this.initData(this.form.tenantId);
+      this.initData(this.form.tenantId, this.userInfo.role_name);
     },
     "excelForm.isCovered"() {
       if (this.excelForm.isCovered !== "") {
@@ -774,7 +774,9 @@
       this.deptids = this.userInfo.dept_id;
       this.sizes = [0, 24];
       this.isguanli = false;
-      // this.option.group[2].value = this.userInfo.Id;
+      this.option.group[0].column[0]["value"] = this.userInfo.dept_id;
+      this.option.group[0].column[0]["disabled"] = true;
+      // this.option.group[2].column[1]["disabled"] = true;
     } else {
       this.deptids = null;
       this.sizes = [5, 19];
@@ -783,7 +785,7 @@
   mounted() {
     // 非保安单位模式默认加载管理组数据
     if (!website.tenantMode) {
-      this.initData(website.tenantId);
+      this.initData(website.tenantId, this.userInfo.role_name);
     }
   },
   methods: {
@@ -792,10 +794,22 @@
       this.page.currentPage = 1;
       this.onLoad(this.page);
     },
-    initData(tenantId) {
+    initData(tenantId, d) {
       getRoleTree(tenantId).then((res) => {
         const column = this.findObject(this.option.group, "roleId");
-        column.dicData = res.data.data;
+        var k = res.data.data;
+        var b = [];
+        if (d == "保安公司管理员") {
+          console.log(k);
+          for (var n in k) {
+            if (k[n].title == "保安" || k[n].title == "保安公司管理员") {
+              b.push(k[n]);
+            }
+          }
+          column.dicData = b;
+        } else {
+          column.dicData = k;
+        }
       });
       getDeptTree(tenantId).then((res) => {
         const column = this.findObject(this.option.group, "deptId");

--
Gitblit v1.9.3