diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 38235044..d774ddf9 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -232,7 +232,7 @@ + @input="checkRole"/> @@ -414,6 +414,8 @@ export default { dateRange: [], // 岗位选项 postOptions: [], + // 所有部门 + deptListAll: [], // 角色选项 roleOptions: [], roleListAll: [], @@ -515,10 +517,12 @@ export default { /** 查询部门下拉树结构 */ getDeptTree() { listDept(this.queryParams).then(response => { + this.deptListAll = response.data const deptList = response.data.map(dept => { return { id: dept.deptId, label: dept.deptName, + firmCode: dept.firmCode, parentId: dept.parentId, children: null } @@ -572,19 +576,16 @@ export default { this.resetForm("form"); }, // 选择部门筛选角色 - checkRole() { - console.log(this.roleOptions) - console.log(this.roleListAll) + checkRole(vuler) { let firmCode = '' - this.roleListAll.forEach(item => { - if (this.form.deptId === item.deptId) { - firmCode = item.firmCode; + this.deptListAll.forEach(item => { + if (item.deptId == vuler){ + firmCode = item.firmCode } }) - console.log(firmCode) this.roleOptions = this.roleListAll.filter(item => item.firmCode === firmCode); + console.log(firmCode) console.log(this.roleOptions) - console.log(this.roleListAll) }, /** 搜索按钮操作 */ handleQuery() {