J教学日志管理
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user