优化用户新增的角色选择
parent
57ce2e523c
commit
8827e1bbff
|
@ -232,7 +232,7 @@
|
||||||
<treeselect v-model="form.deptId" :options="deptOptions"
|
<treeselect v-model="form.deptId" :options="deptOptions"
|
||||||
:show-count="true"
|
:show-count="true"
|
||||||
placeholder="请选择归属部门"
|
placeholder="请选择归属部门"
|
||||||
@change="checkRole()"/>
|
@input="checkRole"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -414,6 +414,8 @@ export default {
|
||||||
dateRange: [],
|
dateRange: [],
|
||||||
// 岗位选项
|
// 岗位选项
|
||||||
postOptions: [],
|
postOptions: [],
|
||||||
|
// 所有部门
|
||||||
|
deptListAll: [],
|
||||||
// 角色选项
|
// 角色选项
|
||||||
roleOptions: [],
|
roleOptions: [],
|
||||||
roleListAll: [],
|
roleListAll: [],
|
||||||
|
@ -515,10 +517,12 @@ export default {
|
||||||
/** 查询部门下拉树结构 */
|
/** 查询部门下拉树结构 */
|
||||||
getDeptTree() {
|
getDeptTree() {
|
||||||
listDept(this.queryParams).then(response => {
|
listDept(this.queryParams).then(response => {
|
||||||
|
this.deptListAll = response.data
|
||||||
const deptList = response.data.map(dept => {
|
const deptList = response.data.map(dept => {
|
||||||
return {
|
return {
|
||||||
id: dept.deptId,
|
id: dept.deptId,
|
||||||
label: dept.deptName,
|
label: dept.deptName,
|
||||||
|
firmCode: dept.firmCode,
|
||||||
parentId: dept.parentId,
|
parentId: dept.parentId,
|
||||||
children: null
|
children: null
|
||||||
}
|
}
|
||||||
|
@ -572,19 +576,16 @@ export default {
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
// 选择部门筛选角色
|
// 选择部门筛选角色
|
||||||
checkRole() {
|
checkRole(vuler) {
|
||||||
console.log(this.roleOptions)
|
|
||||||
console.log(this.roleListAll)
|
|
||||||
let firmCode = ''
|
let firmCode = ''
|
||||||
this.roleListAll.forEach(item => {
|
this.deptListAll.forEach(item => {
|
||||||
if (this.form.deptId === item.deptId) {
|
if (item.deptId == vuler){
|
||||||
firmCode = item.firmCode;
|
firmCode = item.firmCode
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(firmCode)
|
|
||||||
this.roleOptions = this.roleListAll.filter(item => item.firmCode === firmCode);
|
this.roleOptions = this.roleListAll.filter(item => item.firmCode === firmCode);
|
||||||
|
console.log(firmCode)
|
||||||
console.log(this.roleOptions)
|
console.log(this.roleOptions)
|
||||||
console.log(this.roleListAll)
|
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
|
|
Loading…
Reference in New Issue