Explorar el Código

修改职员状态组织选中

zhaoke hace 3 años
padre
commit
ad2b5dd5b3

+ 10 - 0
src/components/organization/organization.scss

@@ -109,6 +109,16 @@
             border-radius: 0;
             background: #747ebb;
           }
+          .is-disabled {
+            .el-checkbox__inner::after {
+              width: 3px;
+              height: 7px;
+              left: 4px;
+              top: 1px;
+              border-radius: 0;
+              background: #fff;
+            }
+          }
         }
       }
     }

+ 28 - 8
src/views/staffManagement/compontents/staffEdit.vue

@@ -214,7 +214,8 @@ export default {
       alljobArr: [],//全部岗位
       GroupIds: [], //当前选中的用户组
       userGroupKeys: [], //当前回调选中的用户组
-      orgList: []
+      orgList: [],
+      setStatus: []
     };
   },
   computed: {
@@ -223,8 +224,8 @@ export default {
   watch: {
     //监听上级组织数据
     dataList: {
-      handler (val) {
-        this.data = [val];
+      handler () {
+        this.setStatus.push(true);
       },
       deep: true,
     },
@@ -241,16 +242,34 @@ export default {
         }
       },
       deep: true,
+    },
+    Status: {
+      handler () {
+        this.setStatus.push(true);
+      },
+      deep: true
+    },
+    setStatus: {
+      handler (arr) {
+        if (arr && arr.length >= 2) {
+          const flag = Number(this.Status);
+          const val = this.dataList;
+          if (!flag) {
+            this.decompose([val]);
+          }
+          this.data = [val];
+        }
+      },
+      deep: true
     }
   },
   created () {
-    const { OrganId, Status, OfficerId } = this.$route.query;
+    const { OrganId, OfficerId } = this.$route.query;
     const { OpenRole, PwdLengthBegin, PwdLengthEnd, PwdStruc, OpenGroup, UserOfficerMulti } =
       typeof this.systemSet === "string"
         ? JSON.parse(this.systemSet)
         : this.systemSet; //1是请求角色 0是请求用户
     // this.form.loginPwd = pwdProduce(PwdLengthBegin, PwdLengthEnd, PwdStruc);
-    this.Status = Status;
     this.OfficerId = OfficerId;
     this.openRole = OpenRole;
     this.OpenGroup = OpenGroup;
@@ -283,6 +302,7 @@ export default {
             TacList,
             GroupList,
             UserList,
+            Status
           } = obj;
           this.form.name = OfficerName;
           this.form.loginName = OfficerLoginName;
@@ -295,6 +315,7 @@ export default {
           this.JobId = JobId;
           this.isMainJob = false;
           this.AppId = OrganId;
+          this.Status = Status;
           this.getJobListByOrgan(OrganId);
           if (this.OpenAuthData) {
             this.roleType = 'account';
@@ -394,9 +415,8 @@ export default {
     //获取指定数据
     decompose (data, id) {
       for (let i = 0; i < data.length; i++) {
-        if (data[i].OrganId == id) {
-          this.dataObj = data[i];
-        } else if (data[i].children && data[i].children.length > 0) {
+        data[i]['disabled'] = true;
+        if (data[i].children && data[i].children.length > 0) {
           this.decompose(data[i].children, id);
         }
       }