入住信息按角色权限筛选

This commit is contained in:
2025-12-08 15:19:23 +08:00
parent c8a67a9c85
commit 106116be66

View File

@@ -64,7 +64,7 @@
<el-form-item label="姓名" prop="stuName">
<el-input v-model="queryParams.stuName" placeholder="请输入学生姓名" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="辅导员姓名" prop="teacherName">
<el-form-item label="辅导员姓名" prop="teacherName" v-if="!roleGroup.includes('辅导员')">
<el-input v-model="queryParams.teacherName" placeholder="请输入辅导员姓名" clearable
@keyup.enter.native="handleQuery"
/>
@@ -260,6 +260,7 @@ import { listMajors } from '@/api/stuCQS/basedata/majors'
import { listGrade } from '@/api/stuCQS/basedata/grade'
import { listInSchoolClass as listClass } from '@/api/stuCQS/basedata/class'
import { getTokenKeySessionStorage } from '@/utils/auth'
import { getUserProfile } from '@/api/system/user' // 获取当前登录用户
let id, campusId, buildingId, parkId, floorId
@@ -363,7 +364,8 @@ export default {
sendForm: {
gradeId: null,
endDate: null
}
},
roleGroup: ""
}
},
created() {
@@ -639,11 +641,25 @@ export default {
/** 查询宿舍学生关联列表 */
getList() {
this.loading = true
listStudent(this.queryParams).then(response => {
this.studentList = response.rows
this.total = response.total
this.loading = false
})
getUserProfile().then((response) => {
this.roleGroup = response.roleGroup
if (response.roleGroup.includes('辅导员')) {
this.queryParams.teacherName = response.data.nickName
} else if (response.roleGroup.includes('学务')) {
// this.queryParams.deptId = response.data.deptId
this.deptList.forEach(element => {
if (element.label == response.data.dept.deptName) {
this.queryParams.deptId = element.value
}
});
this.changeDept()
}
listStudent(this.queryParams).then(response => {
this.studentList = response.rows
this.total = response.total
this.loading = false
})
})
},
// 取消按钮
cancel() {