为综合素质板块的综合模块完善姓名、学号、学院、专业、班级,以方便搜索

This commit is contained in:
2026-01-12 17:07:32 +08:00
parent a40bcccf20
commit 6c56be7c41
7 changed files with 541 additions and 70 deletions

View File

@@ -1,13 +1,26 @@
<template>
<div v-loading.fullscreen.lock="loading" class="app-container">
<el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true" label-width="68px">
<el-form-item label="学院" prop="deptId">
<el-select v-model="queryParams.deptId" placeholder="请选择学院" filterable clearable @change="changeDept">
<el-option v-for="(v, i) in deptList" :key="i" :label="v.label" :value="v.value" />
</el-select>
</el-form-item>
<el-form-item label="专业" prop="majorId">
<el-select v-model="queryParams.majorId" placeholder="请先选择学院再选择专业" filterable clearable @change="changeMajor">
<el-option v-for="(v, i) in majorList" :key="i" :label="v.majorName" :value="v.majorId" />
</el-select>
</el-form-item>
<el-form-item label="班级" prop="classId">
<el-select v-model="queryParams.classId" placeholder="请先选择专业再选择班级" filterable clearable>
<el-option v-for="(v, i) in classList" :key="i" :label="v.className" :value="v.classId" />
</el-select>
</el-form-item>
<el-form-item label="学号" prop="stuNo">
<el-input v-model="queryParams.stuNo" placeholder="请输入学号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="班级" prop="deptId">
<el-cascader ref="cas" v-model="queryParams.classId" style="width: 500px;" :options="cascaderData"
:props="{ checkStrictly: false }" clearable filterable @change="handleChange"
/>
<el-form-item label="姓名" prop="xsxm">
<el-input v-model="queryParams.xsxm" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="学年" prop="stuYearId">
<el-select v-model="queryParams.stuYearId" placeholder="请选择学年" clearable @keyup.enter.native="handleQuery">
@@ -176,6 +189,11 @@ import { treeStudent } from '@/api/stuCQS/basedata/student'
import * as XLSX from 'xlsx'
import { isEmpty, isNumber } from '@/api/helpFunc'
import { listAllYear as listYear } from '@/api/stuCQS/basedata/year'
import { getDeptName } from '@/api/system/dept'
import { listMajors } from '@/api/stuCQS/basedata/majors'
import { listClass } from '@/api/stuCQS/basedata/class'
import { listGrade } from '@/api/stuCQS/basedata/grade'
export default {
name: 'Rankings',
data() {
@@ -230,7 +248,10 @@ export default {
nopass: null,
status: null,
createDate: null,
updateDate: null
updateDate: null,
deptId: null,
majorId: null,
classId: null
},
// 表单参数
form: {},
@@ -246,24 +267,69 @@ export default {
currentPage: 1,
pagesize: 10,
total: 0,
}
},
deptList: [],//学院列表
majorList: [],//专业列表
classList: [],//班级列表
gradeList: [],//年级列表
}
},
created() {
this.listAllStuYear()
this.getList()
this.listDept()
this.listGrade()
this.getCascaderData()
this.listAllStuYear()
},
methods: {
async listGrade() {
let res = await listGrade()
this.gradeList = [...res.rows]
},
async listDept() {
let res = await getDeptName()
this.deptList = [...res.data]
},
async changeMajor() {
if(this.queryParams.majorId) {
let sdata = {
pageNum: 1,
pageSize: 100,
majorId: this.queryParams.majorId
}
let res = await listClass(sdata)
this.classList = [...res.rows]
} else {
this.queryParams.classId = null
this.classList = []
}
},
async changeDept() {
if(this.queryParams.deptId) {
let sdata = {
collegeId: this.queryParams.deptId,
pageNum: 1,
pageSize: 100
}
let res = await listMajors(sdata)
this.majorList = [...res.rows]
} else {
this.queryParams.majorId = null
this.majorList = []
}
},
// 级联选择的项
handleChange(value) {
/*handleChange(value) {
this.queryParams = {
...this.queryParams,
classId: value[2],
}
},
},*/
//列出所有学年
async listAllStuYear() {
let res = await listYear()
@@ -440,8 +506,11 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.class_cas = []
this.queryParams.deptId = null
this.queryParams.majorId = null
this.queryParams.classId = null
this.majorList = []
this.classList = []
this.resetForm('queryForm')
this.handleQuery()
},