学员成绩管理条件查询
This commit is contained in:
@@ -45,7 +45,7 @@ export function delStudentRecord(bh) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分页查询学员课程成绩(xybh 学员编号必传;nd 年度可选)
|
// 分页查询学员课程成绩(kcbh/xydbh/xh/nd 查询)
|
||||||
export function listStudentGrades(query) {
|
export function listStudentGrades(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/student-records/grades',
|
url: '/student-records/grades',
|
||||||
@@ -54,7 +54,7 @@ export function listStudentGrades(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 分页查询学员课程过程成绩(xybh 学员编号必传;nd 年度可选)
|
// 分页查询学员课程过程成绩(kcbh/xydbh/xh/nd 查询)
|
||||||
export function listStudentProcessGrades(query) {
|
export function listStudentProcessGrades(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/student-records/process-grades',
|
url: '/student-records/process-grades',
|
||||||
@@ -63,22 +63,22 @@ export function listStudentProcessGrades(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出学员课程成绩 Excel(xybh 学员编号必传)
|
// 导出学员课程成绩 Excel(kcbh/xydbh/xh/nd 查询)
|
||||||
export function exportStudentGrades(xybh) {
|
export function exportStudentGrades(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/student-records/export-grades',
|
url: '/student-records/export-grades',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { xybh: xybh },
|
params: query,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出学员课程过程成绩 Excel(xybh 学员编号必传)
|
// 导出学员课程过程成绩 Excel(kcbh/xydbh/xh/nd 查询)
|
||||||
export function exportStudentProcessGrades(xybh) {
|
export function exportStudentProcessGrades(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/student-records/export-process-grades',
|
url: '/student-records/export-process-grades',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { xybh: xybh },
|
params: query,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -3,12 +3,22 @@
|
|||||||
<!-- ==================== 1. 查询条件区域 ==================== -->
|
<!-- ==================== 1. 查询条件区域 ==================== -->
|
||||||
<el-card shadow="never" class="search-card">
|
<el-card shadow="never" class="search-card">
|
||||||
<el-form :model="queryForm" label-width="90px" inline class="search-form">
|
<el-form :model="queryForm" label-width="90px" inline class="search-form">
|
||||||
<el-form-item label="学员编号">
|
<el-form-item label="学号">
|
||||||
<el-input v-model="queryForm.xybh" placeholder="请输入学员编号" clearable style="width: 200px" />
|
<el-input v-model="queryForm.xh" placeholder="请输入学号" clearable style="width: 180px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="年度">
|
<el-form-item label="年度">
|
||||||
<el-input v-model="queryForm.nd" placeholder="如 2026" clearable style="width: 140px" />
|
<el-input v-model="queryForm.nd" placeholder="如 2026" clearable style="width: 140px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="课程名称">
|
||||||
|
<el-select v-model="queryForm.kcbh" placeholder="请选择课程名称" clearable filterable style="width: 200px">
|
||||||
|
<el-option v-for="item in kbOptions" :key="item.kbh" :label="item.kmc" :value="item.kbh" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="班次">
|
||||||
|
<el-select v-model="queryForm.xydbh" placeholder="请选择班次" clearable filterable style="width: 200px">
|
||||||
|
<el-option v-for="item in teamOptions" :key="item.xydbh" :label="item.xydmc" :value="item.xydbh" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="handleSearch">查询</el-button>
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -27,7 +37,6 @@
|
|||||||
<el-tab-pane label="课程成绩" name="grades">
|
<el-tab-pane label="课程成绩" name="grades">
|
||||||
<el-table v-loading="loading" :data="gradesData" stripe border style="width: 100%">
|
<el-table v-loading="loading" :data="gradesData" stripe border style="width: 100%">
|
||||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||||
<el-table-column prop="xybh" label="学员编号" min-width="110" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="kmbh" label="科目编号" min-width="110" show-overflow-tooltip />
|
<el-table-column prop="kmbh" label="科目编号" min-width="110" show-overflow-tooltip />
|
||||||
<el-table-column prop="klx" label="课类型" min-width="90" align="center" />
|
<el-table-column prop="klx" label="课类型" min-width="90" align="center" />
|
||||||
<el-table-column prop="kscj" label="考试成绩" min-width="90" align="center" />
|
<el-table-column prop="kscj" label="考试成绩" min-width="90" align="center" />
|
||||||
@@ -37,7 +46,7 @@
|
|||||||
<el-table-column prop="bkcs" label="补考次数" min-width="90" align="center" />
|
<el-table-column prop="bkcs" label="补考次数" min-width="90" align="center" />
|
||||||
<el-table-column prop="ksqk" label="考试情况" min-width="90" align="center" />
|
<el-table-column prop="ksqk" label="考试情况" min-width="90" align="center" />
|
||||||
<el-table-column prop="qwxf" label="期望学分" min-width="90" align="center" />
|
<el-table-column prop="qwxf" label="期望学分" min-width="90" align="center" />
|
||||||
<el-table-column prop="ytg" label="已通过" min-width="80" align="center" />
|
<el-table-column prop="ytg" label="考试结果" min-width="90" align="center" :formatter="formatExamResult" />
|
||||||
<el-table-column prop="nd" label="年度" min-width="80" align="center" />
|
<el-table-column prop="nd" label="年度" min-width="80" align="center" />
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-empty v-if="!loading && gradesData.length === 0" description="暂无课程成绩数据" :image-size="60" />
|
<el-empty v-if="!loading && gradesData.length === 0" description="暂无课程成绩数据" :image-size="60" />
|
||||||
@@ -47,7 +56,6 @@
|
|||||||
<el-tab-pane label="课程过程成绩" name="process">
|
<el-tab-pane label="课程过程成绩" name="process">
|
||||||
<el-table v-loading="loading" :data="processGradesData" stripe border style="width: 100%">
|
<el-table v-loading="loading" :data="processGradesData" stripe border style="width: 100%">
|
||||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||||
<el-table-column prop="xybh" label="学员编号" min-width="110" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="kmbh" label="科目编号" min-width="110" show-overflow-tooltip />
|
<el-table-column prop="kmbh" label="科目编号" min-width="110" show-overflow-tooltip />
|
||||||
<el-table-column prop="klx" label="课类型" min-width="90" align="center" />
|
<el-table-column prop="klx" label="课类型" min-width="90" align="center" />
|
||||||
<el-table-column prop="yscj" label="原始成绩" min-width="90" align="center" />
|
<el-table-column prop="yscj" label="原始成绩" min-width="90" align="center" />
|
||||||
@@ -78,6 +86,8 @@ import {
|
|||||||
exportStudentGrades,
|
exportStudentGrades,
|
||||||
exportStudentProcessGrades
|
exportStudentProcessGrades
|
||||||
} from "@/api/studentRecords/studentRecords"
|
} from "@/api/studentRecords/studentRecords"
|
||||||
|
import { listKb } from "@/api/teachOffice/kb"
|
||||||
|
import { listTeam } from "@/api/studentRecords/team"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ScoreIndex',
|
name: 'ScoreIndex',
|
||||||
@@ -85,10 +95,16 @@ export default {
|
|||||||
return {
|
return {
|
||||||
// ==================== 查询条件 ====================
|
// ==================== 查询条件 ====================
|
||||||
queryForm: {
|
queryForm: {
|
||||||
xybh: '',
|
xh: '',
|
||||||
nd: ''
|
nd: '',
|
||||||
|
kcbh: '',
|
||||||
|
xydbh: ''
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// ==================== 下拉选项 ====================
|
||||||
|
kbOptions: [],
|
||||||
|
teamOptions: [],
|
||||||
|
|
||||||
// ==================== 数据表格 ====================
|
// ==================== 数据表格 ====================
|
||||||
// 数据来源:grades 课程成绩 / process 课程过程成绩
|
// 数据来源:grades 课程成绩 / process 课程过程成绩
|
||||||
activeTab: 'grades',
|
activeTab: 'grades',
|
||||||
@@ -107,15 +123,48 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.loadKbOptions()
|
||||||
|
this.loadTeamOptions()
|
||||||
this.loadData()
|
this.loadData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/** 格式化考试结果:1 已通过,0 不通过 */
|
||||||
|
formatExamResult(row, column, cellValue) {
|
||||||
|
if (cellValue === 1 || cellValue === '1') return '已通过'
|
||||||
|
if (cellValue === 0 || cellValue === '0') return '不通过'
|
||||||
|
return ''
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 加载课程名称下拉选项 */
|
||||||
|
loadKbOptions() {
|
||||||
|
listKb({ pageNum: 1, pageSize: 1000 }).then(res => {
|
||||||
|
const data = res.data || {}
|
||||||
|
this.kbOptions = data.records || []
|
||||||
|
}).catch(() => {
|
||||||
|
this.kbOptions = []
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 加载班次下拉选项 */
|
||||||
|
loadTeamOptions() {
|
||||||
|
listTeam({ pageNum: 1, pageSize: 1000 }).then(res => {
|
||||||
|
const data = res.data || {}
|
||||||
|
this.teamOptions = data.records || []
|
||||||
|
}).catch(() => {
|
||||||
|
this.teamOptions = []
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
/** 组装查询参数,仅传非空值 */
|
/** 组装查询参数,仅传非空值 */
|
||||||
buildQueryParams(params) {
|
buildQueryParams(params) {
|
||||||
const xybh = this.queryForm.xybh && this.queryForm.xybh.trim()
|
const xh = this.queryForm.xh && this.queryForm.xh.trim()
|
||||||
const nd = this.queryForm.nd && this.queryForm.nd.trim()
|
const nd = this.queryForm.nd && this.queryForm.nd.trim()
|
||||||
if (xybh) params.xybh = xybh
|
const kcbh = this.queryForm.kcbh && this.queryForm.kcbh.trim()
|
||||||
|
const xydbh = this.queryForm.xydbh && this.queryForm.xydbh.trim()
|
||||||
|
if (xh) params.xh = xh
|
||||||
if (nd) params.nd = nd
|
if (nd) params.nd = nd
|
||||||
|
if (kcbh) params.kcbh = kcbh
|
||||||
|
if (xydbh) params.xydbh = xydbh
|
||||||
},
|
},
|
||||||
|
|
||||||
loadData() {
|
loadData() {
|
||||||
@@ -170,23 +219,19 @@ export default {
|
|||||||
URL.revokeObjectURL(link.href)
|
URL.revokeObjectURL(link.href)
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 校验导出所需学员编号 */
|
/** 构建导出查询参数 */
|
||||||
requireXybh(exportName) {
|
buildExportQuery() {
|
||||||
const xybh = this.queryForm.xybh && this.queryForm.xybh.trim()
|
const query = {}
|
||||||
if (!xybh) {
|
this.buildQueryParams(query)
|
||||||
this.$message.warning('导出' + exportName + '前请先输入学员编号')
|
return query
|
||||||
return null
|
|
||||||
}
|
|
||||||
return xybh
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 导出课程成绩 Excel */
|
/** 导出课程成绩 Excel */
|
||||||
handleExportGrades() {
|
handleExportGrades() {
|
||||||
const xybh = this.requireXybh('课程成绩')
|
const query = this.buildExportQuery()
|
||||||
if (!xybh) return
|
|
||||||
this.exportLoading = true
|
this.exportLoading = true
|
||||||
exportStudentGrades(xybh).then(res => {
|
exportStudentGrades(query).then(res => {
|
||||||
this.downloadBlob(res, `课程成绩_${xybh}.xls`)
|
this.downloadBlob(res, `课程成绩_${Date.now()}.xls`)
|
||||||
this.$message.success('课程成绩导出成功')
|
this.$message.success('课程成绩导出成功')
|
||||||
}).catch(() => { }).finally(() => {
|
}).catch(() => { }).finally(() => {
|
||||||
this.exportLoading = false
|
this.exportLoading = false
|
||||||
@@ -195,11 +240,10 @@ export default {
|
|||||||
|
|
||||||
/** 导出课程过程成绩 Excel */
|
/** 导出课程过程成绩 Excel */
|
||||||
handleExportProcessGrades() {
|
handleExportProcessGrades() {
|
||||||
const xybh = this.requireXybh('课程过程成绩')
|
const query = this.buildExportQuery()
|
||||||
if (!xybh) return
|
|
||||||
this.exportLoading = true
|
this.exportLoading = true
|
||||||
exportStudentProcessGrades(xybh).then(res => {
|
exportStudentProcessGrades(query).then(res => {
|
||||||
this.downloadBlob(res, `课程过程成绩_${xybh}.xls`)
|
this.downloadBlob(res, `课程过程成绩_${Date.now()}.xls`)
|
||||||
this.$message.success('课程过程成绩导出成功')
|
this.$message.success('课程过程成绩导出成功')
|
||||||
}).catch(() => { }).finally(() => {
|
}).catch(() => { }).finally(() => {
|
||||||
this.exportLoading = false
|
this.exportLoading = false
|
||||||
|
|||||||
Reference in New Issue
Block a user