forked from liweijie/education
J教学日志管理
This commit is contained in:
+20
-1
@@ -85,6 +85,24 @@ export function rejectTeachingLog(bh, thyj) {
|
||||
})
|
||||
}
|
||||
|
||||
// 批量上报教学日志,接口形态:POST /log/teaching-log/batch-report(body 为裸数组 ["",""])
|
||||
export function batchReportTeachingLog(bhList) {
|
||||
return request({
|
||||
url: '/log/teaching-log/batch-report',
|
||||
method: 'post',
|
||||
data: bhList
|
||||
})
|
||||
}
|
||||
|
||||
// 批量审核教学日志,接口形态:POST /log/teaching-log/batch-audit(body 为裸数组 ["",""])
|
||||
export function batchAuditTeachingLog(bhList) {
|
||||
return request({
|
||||
url: '/log/teaching-log/batch-audit',
|
||||
method: 'post',
|
||||
data: bhList
|
||||
})
|
||||
}
|
||||
|
||||
// 根据课表自动创建教学日志,接口形态:POST /log/teaching-log/auto-create?tybh=
|
||||
export function autoCreateTeachingLog(tybh) {
|
||||
return request({
|
||||
@@ -101,7 +119,8 @@ export function importTeachingLogExcel(file) {
|
||||
return request({
|
||||
url: '/log/teaching-log/import-excel',
|
||||
method: 'post',
|
||||
data: formData
|
||||
data: formData,
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -114,11 +114,6 @@
|
||||
<el-table-column prop="zt" label="日志状态" width="100" align="center" />
|
||||
<el-table-column prop="gdqk" label="变动汇总" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="jxrzcjfs" label="创建方式" width="100" align="center" />
|
||||
<el-table-column label="操作" width="80" align="center" fixed="right" class-name="table-action-column">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="handleDetail(scope.row)">详细</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
@@ -225,6 +220,11 @@ export default {
|
||||
this.selectedRows = rows
|
||||
},
|
||||
|
||||
/** 组件方法:包一层全局 formatDate,供模板调用 */
|
||||
formatDate(val) {
|
||||
return formatDate(val)
|
||||
},
|
||||
|
||||
/** 根据已填写的查询值构建实际查询参数 */
|
||||
buildSearchParams() {
|
||||
const form = this.searchForm
|
||||
@@ -255,11 +255,10 @@ export default {
|
||||
this.loading = true
|
||||
return getAuditedTeachingLogList(this.buildSearchParams())
|
||||
.then((res) => {
|
||||
if (res.code === 200 || res.code === 0) {
|
||||
const { list, total } = this.extractListData(res)
|
||||
this.tableData = list
|
||||
this.total = total
|
||||
}
|
||||
// 列表接口返回裸 PageResult(无 code 包装),拦截器已保证成功,直接取数据
|
||||
const { list, total } = this.extractListData(res)
|
||||
this.tableData = list
|
||||
this.total = total
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
|
||||
@@ -94,8 +94,7 @@
|
||||
<div class="left-group">
|
||||
<el-button type="primary" @click="handleBatchReport">批准上报所选</el-button>
|
||||
<!-- <el-button @click="handleRecheck">重新检查通报变更情况</el-button> -->
|
||||
<el-button type="danger" plain @click="handleDeleteSelected">删除所选</el-button>
|
||||
<el-button icon="el-icon-download" @click="handleExport">导出到 Word</el-button>
|
||||
<el-button icon="el-icon-download" @click="handleExport">导出</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="handleRefresh">刷新</el-button>
|
||||
<el-button icon="el-icon-upload2" :loading="importing" @click="handleImportExcel">导入教学日志</el-button>
|
||||
<el-button icon="el-icon-download" @click="handleDownloadTemplate">下载模板</el-button>
|
||||
@@ -137,7 +136,6 @@
|
||||
<el-table-column prop="jxrzcjfs" label="创建方式" width="100" align="center" />
|
||||
<el-table-column label="操作" width="80" align="center" fixed="right" class-name="table-action-column">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="handleDetail(scope.row)">详细</el-button>
|
||||
<el-button type="text" @click="handleReport(scope.row)">上报</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -191,11 +189,11 @@
|
||||
import { formatDate } from '@/utils/index'
|
||||
import {
|
||||
getTeachingLogList,
|
||||
submitTeachingLog,
|
||||
exportTeachingLog,
|
||||
importTeachingLogExcel,
|
||||
downloadTeachingLogTemplate,
|
||||
getTeachingLogByBh
|
||||
getTeachingLogByBh,
|
||||
batchReportTeachingLog
|
||||
} from '@/api/log'
|
||||
|
||||
export default {
|
||||
@@ -247,6 +245,8 @@ export default {
|
||||
|
||||
// ==================== 导入 ====================
|
||||
importing: false,
|
||||
// 导入成功后是否跳到最后一页(定位到刚导入的数据)
|
||||
importJumpLast: false,
|
||||
|
||||
// ==================== 详情 ====================
|
||||
detailVisible: false,
|
||||
@@ -258,6 +258,10 @@ export default {
|
||||
this.fetchList()
|
||||
},
|
||||
methods: {
|
||||
formatDate(val) {
|
||||
return formatDate(val)
|
||||
},
|
||||
|
||||
handleSelectionChange(rows) {
|
||||
this.selectedRows = rows
|
||||
},
|
||||
@@ -294,11 +298,20 @@ export default {
|
||||
this.loading = true
|
||||
return getTeachingLogList(this.buildSearchParams())
|
||||
.then((res) => {
|
||||
if (res.code === 200 || res.code === 0) {
|
||||
const { list, total } = this.extractListData(res)
|
||||
this.tableData = list
|
||||
this.total = total
|
||||
// 列表接口返回裸 PageResult(无 code 包装),拦截器已保证成功,直接取数据
|
||||
const { list, total } = this.extractListData(res)
|
||||
// 导入成功后:跳到最后一页,定位刚导入的数据
|
||||
if (this.importJumpLast) {
|
||||
this.importJumpLast = false
|
||||
const lastPage = total > 0 ? Math.ceil(total / this.pageSize) : 1
|
||||
if (lastPage !== this.pageNum) {
|
||||
this.pageNum = lastPage
|
||||
this.fetchList()
|
||||
return
|
||||
}
|
||||
}
|
||||
this.tableData = list
|
||||
this.total = total
|
||||
})
|
||||
.catch(() => {
|
||||
// 错误已由拦截器统一处理
|
||||
@@ -337,11 +350,6 @@ export default {
|
||||
return ids
|
||||
},
|
||||
|
||||
handleDeleteSelected() {
|
||||
// 后端暂未提供删除接口,仅作提示
|
||||
this.$message.info('后端暂未提供该接口')
|
||||
},
|
||||
|
||||
handleBatchReport() {
|
||||
const ids = this.getSelectedBhs()
|
||||
if (ids.length === 0) return
|
||||
@@ -351,12 +359,8 @@ export default {
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
// 提交教学日志审核,逐条上报至「已上报」状态
|
||||
let settled = Promise.resolve()
|
||||
ids.forEach((bh) => {
|
||||
settled = settled.then(() => submitTeachingLog(bh, '已上报'))
|
||||
})
|
||||
return settled
|
||||
// 批量上报教学日志
|
||||
return batchReportTeachingLog(ids)
|
||||
})
|
||||
.then(() => {
|
||||
this.$message.success(`已上报 ${ids.length} 条记录`)
|
||||
@@ -376,7 +380,7 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => submitTeachingLog(String(bh), '已上报'))
|
||||
.then(() => batchReportTeachingLog([String(bh)]))
|
||||
.then(() => {
|
||||
this.$message.success('上报成功')
|
||||
this.fetchList()
|
||||
@@ -425,6 +429,7 @@ export default {
|
||||
.then((res) => {
|
||||
if (res.code === 200 || res.code === 0) {
|
||||
this.$message.success(res.message || '导入成功')
|
||||
this.importJumpLast = true
|
||||
this.fetchList()
|
||||
} else {
|
||||
this.$message.error(res.message || '导入失败')
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
<div class="search-actions">
|
||||
<div class="left-group">
|
||||
<el-button type="primary" @click="handleBatchAudit">审核通过所选</el-button>
|
||||
<el-button v-if="!isTeacher" type="primary" @click="handleBatchAudit">审核通过所选</el-button>
|
||||
<el-button icon="el-icon-download" @click="handleExport">导出到 Word</el-button>
|
||||
</div>
|
||||
<div class="right-group">
|
||||
@@ -92,7 +92,7 @@
|
||||
<el-card shadow="never" class="table-card">
|
||||
<el-table v-loading="loading" :data="tableData" stripe border highlight-current-row
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column v-if="!isTeacher" type="selection" width="50" align="center" />
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="rwlb" label="任务类别" width="120" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="jyxm" label="主讲教员" width="100" align="center" />
|
||||
@@ -104,23 +104,22 @@
|
||||
{{ scope.row.qsjc && scope.row.jsjc ? `${scope.row.qsjc}-${scope.row.jsjc}节` : (scope.row.qsjc || '-') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="kcmc" label="课程名称" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="pxqbxx" label="培训期班信息" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column label="人数" width="70" align="center">
|
||||
<el-table-column prop="kcmc" label="课程名称" width="80" show-overflow-tooltip />
|
||||
<el-table-column prop="pxqbxx" label="培训期班信息" show-overflow-tooltip />
|
||||
<el-table-column label="人数" width="80" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.sdrs || scope.row.ydrs || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分组指导教员" width="120" align="center">
|
||||
<el-table-column label="分组指导教员" width="100" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.fzyzdjy || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="jsfs" label="教学方法" width="100" align="center" />
|
||||
<el-table-column prop="jsfs" label="教学方法" width="80" align="center" />
|
||||
<el-table-column prop="zt" label="日志状态" width="100" align="center" />
|
||||
<el-table-column prop="gdqk" label="变动汇总" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="gdqk" label="变动汇总" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="jxrzcjfs" label="创建方式" width="100" align="center" />
|
||||
<el-table-column label="操作" width="80" align="center" fixed="right" class-name="table-action-column">
|
||||
<el-table-column v-if="!isTeacher" label="操作" width="160" align="center" fixed="right" class-name="table-action-column">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="handleAudit(scope.row)">审核</el-button>
|
||||
<el-button type="text" @click="handleReject(scope.row)">退回</el-button>
|
||||
<el-button type="text" @click="handleDetail(scope.row)">详细</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -173,14 +172,21 @@
|
||||
import { formatDate } from '@/utils/index'
|
||||
import {
|
||||
getReportedTeachingLogList,
|
||||
approveTeachingLog,
|
||||
rejectTeachingLog,
|
||||
exportTeachingLog,
|
||||
getTeachingLogByBh
|
||||
getTeachingLogByBh,
|
||||
batchAuditTeachingLog
|
||||
} from '@/api/log'
|
||||
|
||||
export default {
|
||||
name: 'ReportedView',
|
||||
props: {
|
||||
/** 当前用户是否为教员角色,用于隐藏审核相关操作 */
|
||||
isTeacher: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// ==================== 查询表单 ====================
|
||||
@@ -239,6 +245,11 @@ export default {
|
||||
this.selectedRows = rows
|
||||
},
|
||||
|
||||
/** 组件方法:包一层全局 formatDate,供模板调用 */
|
||||
formatDate(val) {
|
||||
return formatDate(val)
|
||||
},
|
||||
|
||||
/** 根据已填写的查询值构建实际查询参数 */
|
||||
buildSearchParams() {
|
||||
const form = this.searchForm
|
||||
@@ -266,11 +277,10 @@ export default {
|
||||
this.loading = true
|
||||
return getReportedTeachingLogList(this.buildSearchParams())
|
||||
.then((res) => {
|
||||
if (res.code === 200 || res.code === 0) {
|
||||
const { list, total } = this.extractListData(res)
|
||||
this.tableData = list
|
||||
this.total = total
|
||||
}
|
||||
// 列表接口返回裸 PageResult(无 code 包装),拦截器已保证成功,直接取数据
|
||||
const { list, total } = this.extractListData(res)
|
||||
this.tableData = list
|
||||
this.total = total
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
@@ -333,12 +343,8 @@ export default {
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
// 审核通过教学日志,逐条审核
|
||||
let settled = Promise.resolve()
|
||||
ids.forEach((bh) => {
|
||||
settled = settled.then(() => approveTeachingLog(bh, ''))
|
||||
})
|
||||
return settled
|
||||
// 批量审核教学日志
|
||||
return batchAuditTeachingLog(ids)
|
||||
})
|
||||
.then(() => {
|
||||
this.$message.success(`已审核通过 ${ids.length} 条记录`)
|
||||
@@ -358,7 +364,7 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => approveTeachingLog(String(bh), ''))
|
||||
.then(() => batchAuditTeachingLog([String(bh)]))
|
||||
.then(() => {
|
||||
this.$message.success('审核通过成功')
|
||||
this.fetchList()
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
<div class="page-container">
|
||||
<el-card shadow="never" class="tab-card">
|
||||
<el-tabs v-model="activeTab" class="organ-tabs">
|
||||
<el-tab-pane label="教学日志管理查询" name="query">
|
||||
<!-- 教学日志管理查询页:仅管理员/教研室等非教员、非机关人员可见 -->
|
||||
<el-tab-pane v-if="hasQueryAccess" label="教学日志管理查询" name="query">
|
||||
<log-view v-if="activeTab === 'query'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="已上报机关教学日志" name="reported">
|
||||
<reported-view v-if="activeTab === 'reported'" />
|
||||
<reported-view v-if="activeTab === 'reported'" :is-teacher="isTeacher" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="机关已审核教学日志" name="audited">
|
||||
<audited-view v-if="activeTab === 'audited'" />
|
||||
@@ -28,6 +29,29 @@ export default {
|
||||
return {
|
||||
activeTab: 'query'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
roles() {
|
||||
return this.$store.getters.roles || []
|
||||
},
|
||||
/** 教员角色 */
|
||||
isTeacher() {
|
||||
return this.roles.includes('TEACHER')
|
||||
},
|
||||
/** 机关人员角色 */
|
||||
isDepartmentPersonnel() {
|
||||
return this.roles.includes('DEPARTMENT_PERSONNEL')
|
||||
},
|
||||
/** 教学日志管理查询页仅非教员、非机关人员可见 */
|
||||
hasQueryAccess() {
|
||||
return !this.isTeacher && !this.isDepartmentPersonnel
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 教员/机关人员无法查看教学日志管理查询页,默认落在已上报页
|
||||
if (!this.hasQueryAccess) {
|
||||
this.activeTab = 'reported'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user