Compare commits

...

2 Commits

Author SHA1 Message Date
zhaichao 42fb981c8c 教研室管理表格新增停用 2026-08-26 16:13:28 +08:00
zhaichao 2c4cc2aaaf 学员成绩管理条件查询 2026-08-26 16:12:39 +08:00
3 changed files with 83 additions and 34 deletions
@@ -45,7 +45,7 @@ export function delStudentRecord(bh) {
})
}
// 分页查询学员课程成绩(xybh 学员编号必传;nd 年度可选)
// 分页查询学员课程成绩(kcbh/xydbh/xh/nd 查询)
export function listStudentGrades(query) {
return request({
url: '/student-records/grades',
@@ -54,7 +54,7 @@ export function listStudentGrades(query) {
})
}
// 分页查询学员课程过程成绩(xybh 学员编号必传;nd 年度可选)
// 分页查询学员课程过程成绩(kcbh/xydbh/xh/nd 查询)
export function listStudentProcessGrades(query) {
return request({
url: '/student-records/process-grades',
@@ -63,22 +63,22 @@ export function listStudentProcessGrades(query) {
})
}
// 导出学员课程成绩 Excel(xybh 学员编号必传)
export function exportStudentGrades(xybh) {
// 导出学员课程成绩 Excel(kcbh/xydbh/xh/nd 查询)
export function exportStudentGrades(query) {
return request({
url: '/student-records/export-grades',
method: 'get',
params: { xybh: xybh },
params: query,
responseType: 'blob'
})
}
// 导出学员课程过程成绩 Excel(xybh 学员编号必传)
export function exportStudentProcessGrades(xybh) {
// 导出学员课程过程成绩 Excel(kcbh/xydbh/xh/nd 查询)
export function exportStudentProcessGrades(query) {
return request({
url: '/student-records/export-process-grades',
method: 'get',
params: { xybh: xybh },
params: query,
responseType: 'blob'
})
}
+69 -25
View File
@@ -3,12 +3,22 @@
<!-- ==================== 1. 查询条件区域 ==================== -->
<el-card shadow="never" class="search-card">
<el-form :model="queryForm" label-width="90px" inline class="search-form">
<el-form-item label="学员编号">
<el-input v-model="queryForm.xybh" placeholder="请输入学员编号" clearable style="width: 200px" />
<el-form-item label="学号">
<el-input v-model="queryForm.xh" placeholder="请输入学号" clearable style="width: 180px" />
</el-form-item>
<el-form-item label="年度">
<el-input v-model="queryForm.nd" placeholder="如 2026" clearable style="width: 140px" />
</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-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
@@ -27,7 +37,6 @@
<el-tab-pane label="课程成绩" name="grades">
<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 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="klx" 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="ksqk" 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>
<el-empty v-if="!loading && gradesData.length === 0" description="暂无课程成绩数据" :image-size="60" />
@@ -47,7 +56,6 @@
<el-tab-pane label="课程过程成绩" name="process">
<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 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="klx" label="课类型" min-width="90" align="center" />
<el-table-column prop="yscj" label="原始成绩" min-width="90" align="center" />
@@ -78,6 +86,8 @@ import {
exportStudentGrades,
exportStudentProcessGrades
} from "@/api/studentRecords/studentRecords"
import { listKb } from "@/api/teachOffice/kb"
import { listTeam } from "@/api/studentRecords/team"
export default {
name: 'ScoreIndex',
@@ -85,10 +95,16 @@ export default {
return {
// ==================== 查询条件 ====================
queryForm: {
xybh: '',
nd: ''
xh: '',
nd: '',
kcbh: '',
xydbh: ''
},
// ==================== 下拉选项 ====================
kbOptions: [],
teamOptions: [],
// ==================== 数据表格 ====================
// 数据来源:grades 课程成绩 / process 课程过程成绩
activeTab: 'grades',
@@ -107,15 +123,48 @@ export default {
}
},
mounted() {
this.loadKbOptions()
this.loadTeamOptions()
this.loadData()
},
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) {
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()
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 (kcbh) params.kcbh = kcbh
if (xydbh) params.xydbh = xydbh
},
loadData() {
@@ -170,23 +219,19 @@ export default {
URL.revokeObjectURL(link.href)
},
/** 校验导出所需学员编号 */
requireXybh(exportName) {
const xybh = this.queryForm.xybh && this.queryForm.xybh.trim()
if (!xybh) {
this.$message.warning('导出' + exportName + '前请先输入学员编号')
return null
}
return xybh
/** 构建导出查询参数 */
buildExportQuery() {
const query = {}
this.buildQueryParams(query)
return query
},
/** 导出课程成绩 Excel */
handleExportGrades() {
const xybh = this.requireXybh('课程成绩')
if (!xybh) return
const query = this.buildExportQuery()
this.exportLoading = true
exportStudentGrades(xybh).then(res => {
this.downloadBlob(res, `课程成绩_${xybh}.xls`)
exportStudentGrades(query).then(res => {
this.downloadBlob(res, `课程成绩_${Date.now()}.xls`)
this.$message.success('课程成绩导出成功')
}).catch(() => { }).finally(() => {
this.exportLoading = false
@@ -195,11 +240,10 @@ export default {
/** 导出课程过程成绩 Excel */
handleExportProcessGrades() {
const xybh = this.requireXybh('课程过程成绩')
if (!xybh) return
const query = this.buildExportQuery()
this.exportLoading = true
exportStudentProcessGrades(xybh).then(res => {
this.downloadBlob(res, `课程过程成绩_${xybh}.xls`)
exportStudentProcessGrades(query).then(res => {
this.downloadBlob(res, `课程过程成绩_${Date.now()}.xls`)
this.$message.success('课程过程成绩导出成功')
}).catch(() => { }).finally(() => {
this.exportLoading = false
@@ -1,4 +1,4 @@
<template>
<template>
<div class="app-container teach-office">
<!-- 查询条件区域 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="88px" v-show="showSearch">
@@ -64,6 +64,11 @@
<el-tag :type="scope.row.jgxz ? 'primary' : 'info'" size="mini">{{ scope.row.jgxz ? '是' : '否' }}</el-tag>
</template>
</el-table-column>
<el-table-column label="停用" align="center" min-width="80">
<template slot-scope="scope">
<el-tag :type="scope.row.ty ? 'danger' : 'success'" size="mini">{{ scope.row.ty ? '是' : '否' }}</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="bz" min-width="120" :show-overflow-tooltip="true" />
<el-table-column label="操作" align="center" min-width="140" class-name="small-padding fixed-width">
<template slot-scope="scope">