Browse Source

角色编辑

huangb 7 years ago
parent
commit
de007c4752
1 changed files with 5 additions and 3 deletions
  1. 5 3
      components/mobile/staffManagement/StaffList.vue

+ 5 - 3
components/mobile/staffManagement/StaffList.vue

@@ -303,7 +303,6 @@
       },
       // 员工列表当前选中对象
       goEdit (item) {
-        console.log(this.userInfo)
         if (this.isAdmin) {
           if (item.userUU === this.userInfo.userUU) {
             this.onRemind('自己不可修改自己')
@@ -311,11 +310,14 @@
             let currentData = item
             this.currentStaff = this.baseUtils.deepCopy(currentData)
             this.activeTab = 1
-            for (let i = 0; i < this.currentStaff.roles.length; i++) {
-              for (let j = 0; j < this.rolesList.length; j++) {
+            for (let j = 0; j < this.rolesList.length; j++) {
+              for (let i = 0; i < this.currentStaff.roles.length; i++) {
                 //判断已绑定角色
                 if (this.currentStaff.roles[i].id === this.rolesList[j].id) {
                   this.rolesList[j].checked = true
+                  break
+                } else {
+                  this.rolesList[j].checked = false
                 }
               }
             }