forked from liweijie/education
817 lines
33 KiB
Vue
817 lines
33 KiB
Vue
<template>
|
||
<div class="page-container">
|
||
<!-- 统计卡片 -->
|
||
<div class="section-card">
|
||
<div class="stat-grid">
|
||
<div
|
||
v-for="card in statCards"
|
||
:key="card.title"
|
||
class="stat-card"
|
||
:style="{ background: card.gradient }"
|
||
tabindex="0"
|
||
role="button"
|
||
@click="handleStatClick(card)"
|
||
@keydown.enter="handleStatClick(card)"
|
||
>
|
||
<span class="stat-text">{{ card.title }}</span>
|
||
<span class="stat-value">{{ card.value }}</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 查询条件 -->
|
||
<div class="section-card">
|
||
<el-form :model="queryParams" :inline="true" size="small" class="search-form" @submit.native.prevent>
|
||
<el-form-item label="年度">
|
||
<el-select v-model="queryParams.nd" placeholder="请选择年度" clearable style="width: 140px">
|
||
<el-option v-for="y in yearOptions" :key="y" :label="y" :value="y" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item label="申请教员编号">
|
||
<el-input v-model="queryParams.sqjybh" placeholder="请输入申请教员编号" clearable style="width: 180px" @keyup.enter.native="handleQuery" />
|
||
</el-form-item>
|
||
<el-form-item label="教研室审批状态">
|
||
<el-select v-model="queryParams.jyspzzt" placeholder="请选择" clearable style="width: 150px">
|
||
<el-option v-for="item in auditStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item>
|
||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
|
||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||
</el-form-item>
|
||
</el-form>
|
||
</div>
|
||
|
||
<!-- 调课调整申请列表 -->
|
||
<div class="section-card">
|
||
<div class="section-header">
|
||
<div class="section-title">调停补课申请列表</div>
|
||
<div class="header-actions">
|
||
<el-button type="primary" plain icon="el-icon-plus" size="small" @click="openAdd">新增申请</el-button>
|
||
</div>
|
||
</div>
|
||
|
||
<el-table :data="tableData" v-loading="loading" size="small" border stripe class="compact-table" max-height="520">
|
||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||
<el-table-column prop="kcmc" label="课程名称" width="200" show-overflow-tooltip header-align="center" />
|
||
<el-table-column label="申请教员" width="150" align="center" show-overflow-tooltip>
|
||
<template slot-scope="scope">{{ scope.row.sqjyxm || scope.row.sqjybh || '-' }}</template>
|
||
</el-table-column>
|
||
<el-table-column prop="sy" label="调课事由" width="230" show-overflow-tooltip header-align="center" />
|
||
<el-table-column label="拟调整时间" width="200" align="center" show-overflow-tooltip>
|
||
<template slot-scope="scope">{{ fmtRqJc(scope.row.rq, scope.row.jc) }}</template>
|
||
</el-table-column>
|
||
<el-table-column prop="nd" label="年度" width="150" align="center" />
|
||
<el-table-column label="教研室审批状态" width="150" align="center">
|
||
<template slot-scope="scope">
|
||
<el-tag :type="auditStatusTag(scope.row.jyspzzt).type" size="mini">{{ auditStatusTag(scope.row.jyspzzt).label }}</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="教研室查收状态" width="150" align="center">
|
||
<template slot-scope="scope">
|
||
<el-tag :type="receiveStatusTag(scope.row.jyscszt).type" size="mini">{{ receiveStatusTag(scope.row.jyscszt).label }}</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="创建时间" width="150" align="center">
|
||
<template slot-scope="scope">{{ fmtDateTime(scope.row.cjsj) }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="操作" width="180" align="center" fixed="right">
|
||
<template slot-scope="scope">
|
||
<div class="ops-cell">
|
||
<el-button type="text" size="mini" icon="el-icon-view" @click="openDetail(scope.row)">详情</el-button>
|
||
<el-dropdown v-if="showAuditMenu(scope.row)" trigger="click" @command="cmd => openAudit(scope.row, cmd)">
|
||
<el-button type="text" size="mini" @click.stop>审批<i class="el-icon-arrow-down el-icon--right" /></el-button>
|
||
<el-dropdown-menu slot="dropdown">
|
||
<el-dropdown-item v-if="scope.row.jyspzzt === 0" command="jys">教研室审批</el-dropdown-item>
|
||
<el-dropdown-item v-if="scope.row.jyspzzt === 1" command="jxx">教学系审批</el-dropdown-item>
|
||
<el-dropdown-item v-if="scope.row.jyspzzt === 1" command="jg">机关审批</el-dropdown-item>
|
||
</el-dropdown-menu>
|
||
</el-dropdown>
|
||
<el-dropdown v-if="showReceiveMenu(scope.row)" trigger="click" @command="cmd => openReceive(scope.row, cmd)">
|
||
<el-button type="text" size="mini" @click.stop>查收<i class="el-icon-arrow-down el-icon--right" /></el-button>
|
||
<el-dropdown-menu slot="dropdown">
|
||
<el-dropdown-item v-if="scope.row.jyscszt === 0" command="jys">教研室查收</el-dropdown-item>
|
||
<el-dropdown-item command="jg">机关查收</el-dropdown-item>
|
||
</el-dropdown-menu>
|
||
</el-dropdown>
|
||
<el-button v-if="scope.row.sczt === 0 && scope.row.jyspzzt !== 1" type="text" size="mini" class="danger-btn" @click="handleCancel(scope.row)">撤销</el-button>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<el-empty v-show="!loading && tableData.length === 0" description="暂无调整申请" />
|
||
<pagination
|
||
v-show="total > 0"
|
||
:total="total"
|
||
:page.sync="queryParams.pageNum"
|
||
:limit.sync="queryParams.pageSize"
|
||
@pagination="loadList"
|
||
/>
|
||
</div>
|
||
|
||
<!-- 新增申请弹窗 -->
|
||
<el-dialog title="新增课表调整申请" :visible.sync="addVisible" width="640px" append-to-body>
|
||
<el-form ref="addForm" :model="addForm" :rules="addRules" label-width="110px">
|
||
<el-form-item label="年度" prop="nd">
|
||
<el-select v-model="addForm.nd" placeholder="请选择年度" style="width: 100%">
|
||
<el-option v-for="y in yearOptions" :key="y" :label="y" :value="y" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item label="课次编号" prop="sskcbbh">
|
||
<el-input v-model="addForm.sskcbbh" placeholder="请输入课次编号" />
|
||
<el-button type="primary" plain size="mini" class="pick-lesson-btn" :loading="lessonLoading" @click="loadAdjustableLessons">选择可供调课课次</el-button>
|
||
</el-form-item>
|
||
<el-form-item label="调课事由" prop="sy">
|
||
<el-input v-model="addForm.sy" type="textarea" :rows="2" placeholder="请输入调课事由" />
|
||
</el-form-item>
|
||
<el-form-item label="拟调整日期" prop="rq">
|
||
<el-date-picker v-model="addForm.rq" type="date" value-format="yyyy-MM-dd" placeholder="请选择日期" style="width: 100%" />
|
||
</el-form-item>
|
||
<el-form-item label="拟调整节次" prop="jc">
|
||
<el-select v-model="addForm.jc" placeholder="请选择节次" style="width: 100%">
|
||
<el-option v-for="n in jcOptions" :key="n" :label="jcLabel(n)" :value="n" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item label="申请教员编号" prop="sqjybh">
|
||
<el-input v-model="addForm.sqjybh" placeholder="请输入申请教员编号" />
|
||
</el-form-item>
|
||
<el-form-item label="教学内容">
|
||
<el-input v-model="addForm.jxnr" placeholder="选填" />
|
||
</el-form-item>
|
||
<el-form-item label="教学要点">
|
||
<el-input v-model="addForm.jxyd" placeholder="选填" />
|
||
</el-form-item>
|
||
<el-form-item label="教学方法">
|
||
<el-input v-model="addForm.jxff" placeholder="选填" />
|
||
</el-form-item>
|
||
<el-form-item label="教学保障备注">
|
||
<el-input v-model="addForm.jxbzbz" placeholder="选填" />
|
||
</el-form-item>
|
||
<el-form-item label="用车信息">
|
||
<el-input v-model="addForm.ycxx" placeholder="选填" />
|
||
</el-form-item>
|
||
<el-form-item label="备注">
|
||
<el-input v-model="addForm.bz" type="textarea" :rows="2" placeholder="选填" />
|
||
</el-form-item>
|
||
</el-form>
|
||
<div slot="footer" class="dialog-footer">
|
||
<el-button type="primary" :loading="addLoading" @click="submitAdd">提交申请</el-button>
|
||
<el-button @click="addVisible = false">取消</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
|
||
<!-- 可供调课课次选择弹窗 -->
|
||
<el-dialog title="选择可供调课课次" :visible.sync="lessonDialogVisible" width="760px" append-to-body>
|
||
<el-table :data="lessonOptions" v-loading="lessonLoading" size="small" border stripe max-height="420">
|
||
<el-table-column prop="kcmc" label="课程名称" min-width="140" show-overflow-tooltip header-align="center" />
|
||
<el-table-column label="原上课时间" width="160" align="center">
|
||
<template slot-scope="scope">{{ fmtRqJc(scope.row.rq, scope.row.jc) }}</template>
|
||
</el-table-column>
|
||
<el-table-column prop="xydmc" label="学员队" min-width="120" show-overflow-tooltip header-align="center" />
|
||
<el-table-column prop="kcxh" label="课次序号" width="90" align="center" />
|
||
<el-table-column prop="jsbh" label="教室编号" width="110" show-overflow-tooltip header-align="center" />
|
||
<el-table-column label="操作" width="90" align="center">
|
||
<template slot-scope="scope">
|
||
<el-button type="text" size="mini" @click="pickLesson(scope.row)">选择</el-button>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<el-empty v-show="!lessonLoading && lessonOptions.length === 0" description="暂无可供调课课次" />
|
||
</el-dialog>
|
||
|
||
<!-- 审批弹窗 -->
|
||
<el-dialog :title="auditTitle" :visible.sync="auditVisible" width="520px" append-to-body>
|
||
<el-form ref="auditForm" :model="auditForm" label-width="100px">
|
||
<el-form-item label="审批结果" required>
|
||
<el-radio-group v-model="auditForm.spzt">
|
||
<el-radio :label="1">同意</el-radio>
|
||
<el-radio :label="2">发回</el-radio>
|
||
<el-radio :label="3">拒绝</el-radio>
|
||
</el-radio-group>
|
||
</el-form-item>
|
||
<el-form-item label="审批意见">
|
||
<el-input v-model="auditForm.fhyj" type="textarea" :rows="3" placeholder="请输入审批意见(发回/拒绝时必填)" />
|
||
</el-form-item>
|
||
<el-form-item label="审批人编号" required>
|
||
<el-input v-model="auditForm.sprbh" placeholder="请输入审批人编号" />
|
||
</el-form-item>
|
||
<el-form-item v-if="auditForm.auditRole === 'jg'" label="机关编号" required>
|
||
<el-input v-model="auditForm.jgbh" placeholder="请输入机关编号" />
|
||
</el-form-item>
|
||
</el-form>
|
||
<div slot="footer" class="dialog-footer">
|
||
<el-button type="primary" :loading="auditLoading" @click="submitAudit">确定</el-button>
|
||
<el-button @click="auditVisible = false">取消</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
|
||
<!-- 查收弹窗 -->
|
||
<el-dialog :title="receiveTitle" :visible.sync="receiveVisible" width="460px" append-to-body>
|
||
<el-form ref="receiveForm" :model="receiveForm" label-width="100px">
|
||
<el-form-item v-if="receiveForm.type === 'jg'" label="机关编号" required>
|
||
<el-input v-model="receiveForm.jgbh" placeholder="请输入机关编号" />
|
||
</el-form-item>
|
||
<el-form-item label="查收人编号" required>
|
||
<el-input v-model="receiveForm.csrbh" placeholder="请输入查收人编号" />
|
||
</el-form-item>
|
||
</el-form>
|
||
<div slot="footer" class="dialog-footer">
|
||
<el-button type="primary" :loading="receiveLoading" @click="submitReceive">确定</el-button>
|
||
<el-button @click="receiveVisible = false">取消</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
|
||
<!-- 查看详情弹窗 -->
|
||
<el-dialog title="申请详情" :visible.sync="detailVisible" width="760px" append-to-body>
|
||
<div v-loading="detailLoading">
|
||
<el-descriptions v-if="detailData" :column="2" border size="small">
|
||
<el-descriptions-item label="课程名称">{{ detailData.kcmc || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="申请教员">{{ detailData.sqjyxm || detailData.sqjybh || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="调课事由" :span="2">{{ detailData.sy || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="拟调整时间">{{ fmtRqJc(detailData.rq, detailData.jc) }}</el-descriptions-item>
|
||
<el-descriptions-item label="年度">{{ detailData.nd || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="创建时间">{{ fmtDateTime(detailData.cjsj) }}</el-descriptions-item>
|
||
<el-descriptions-item label="教研室审批状态">
|
||
<el-tag :type="auditStatusTag(detailData.jyspzzt).type" size="mini">{{ auditStatusTag(detailData.jyspzzt).label }}</el-tag>
|
||
</el-descriptions-item>
|
||
<el-descriptions-item label="教研室查收状态">
|
||
<el-tag :type="receiveStatusTag(detailData.jyscszt).type" size="mini">{{ receiveStatusTag(detailData.jyscszt).label }}</el-tag>
|
||
</el-descriptions-item>
|
||
<el-descriptions-item label="教研室审批人">{{ detailData.jyspzrbh || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="教研室审批时间">{{ fmtDateTime(detailData.jyspzsj) }}</el-descriptions-item>
|
||
<el-descriptions-item label="教研室查收人">{{ detailData.jyscsrbh || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="教研室查收时间">{{ fmtDateTime(detailData.jyscssj) }}</el-descriptions-item>
|
||
<el-descriptions-item label="发回意见" :span="2">{{ detailData.fhyj || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="教学内容" :span="2">{{ detailData.jxnr || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="教学要点" :span="2">{{ detailData.jxyd || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="教学方法" :span="2">{{ detailData.jxff || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="教学保障备注" :span="2">{{ detailData.jxbzbz || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="用车信息" :span="2">{{ detailData.ycxx || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="备注" :span="2">{{ detailData.bz || '-' }}</el-descriptions-item>
|
||
</el-descriptions>
|
||
|
||
<!-- 新教室 -->
|
||
<div v-if="detailData && detailData.roomList && detailData.roomList.length" class="sub-section">
|
||
<div class="sub-title">新教室</div>
|
||
<el-table :data="detailData.roomList" size="small" border stripe>
|
||
<el-table-column prop="jsbh" label="教室编号" min-width="120" show-overflow-tooltip header-align="center" />
|
||
<el-table-column prop="jsmc" label="教室名称" min-width="140" show-overflow-tooltip header-align="center" />
|
||
<el-table-column prop="bz" label="备注" min-width="160" show-overflow-tooltip header-align="center" />
|
||
</el-table>
|
||
</div>
|
||
|
||
<!-- 新辅助教员 -->
|
||
<div v-if="detailData && detailData.teacherList && detailData.teacherList.length" class="sub-section">
|
||
<div class="sub-title">新辅助教员</div>
|
||
<el-table :data="detailData.teacherList" size="small" border stripe>
|
||
<el-table-column prop="fzjybh" label="教员编号" min-width="120" show-overflow-tooltip header-align="center" />
|
||
<el-table-column prop="fzjyxm" label="教员姓名" min-width="120" show-overflow-tooltip header-align="center" />
|
||
<el-table-column label="是否主教员" width="100" align="center">
|
||
<template slot-scope="scope">{{ scope.row.zjy === 1 ? '是' : '否' }}</template>
|
||
</el-table-column>
|
||
<el-table-column prop="bz" label="备注" min-width="140" show-overflow-tooltip header-align="center" />
|
||
</el-table>
|
||
</div>
|
||
|
||
<!-- 新学员队 -->
|
||
<div v-if="detailData && detailData.teamList && detailData.teamList.length" class="sub-section">
|
||
<div class="sub-title">新学员队</div>
|
||
<el-table :data="detailData.teamList" size="small" border stripe>
|
||
<el-table-column prop="xydbh" label="学员队编号" min-width="140" show-overflow-tooltip header-align="center" />
|
||
<el-table-column prop="xydmc" label="学员队名称" min-width="140" show-overflow-tooltip header-align="center" />
|
||
</el-table>
|
||
</div>
|
||
|
||
<!-- 新保障明细 -->
|
||
<div v-if="detailData && detailData.supportList && detailData.supportList.length" class="sub-section">
|
||
<div class="sub-title">新保障明细</div>
|
||
<el-table :data="detailData.supportList" size="small" border stripe>
|
||
<el-table-column prop="bztgmxbh" label="保障编号" min-width="140" show-overflow-tooltip header-align="center" />
|
||
<el-table-column prop="bztgmxmc" label="保障名称" min-width="160" show-overflow-tooltip header-align="center" />
|
||
<el-table-column prop="sl" label="数量" width="80" align="center" />
|
||
<el-table-column prop="bz" label="备注" min-width="140" show-overflow-tooltip header-align="center" />
|
||
</el-table>
|
||
</div>
|
||
|
||
<!-- 机关审批记录 -->
|
||
<div v-if="detailData && detailData.auditList && detailData.auditList.length" class="sub-section">
|
||
<div class="sub-title">机关审批记录</div>
|
||
<el-table :data="detailData.auditList" size="small" border stripe>
|
||
<el-table-column prop="jgmc" label="机关" min-width="140" show-overflow-tooltip header-align="center">
|
||
<template slot-scope="scope">{{ scope.row.jgmc || scope.row.jgbh || '-' }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="审批状态" width="100" align="center">
|
||
<template slot-scope="scope">
|
||
<el-tag :type="auditStatusTag(scope.row.spzt).type" size="mini">{{ auditStatusTag(scope.row.spzt).label }}</el-tag>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="sprxm" label="审批人" min-width="110" show-overflow-tooltip header-align="center">
|
||
<template slot-scope="scope">{{ scope.row.sprxm || scope.row.sprbh || '-' }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="审批时间" width="150" align="center">
|
||
<template slot-scope="scope">{{ fmtDateTime(scope.row.spsj) }}</template>
|
||
</el-table-column>
|
||
<el-table-column prop="fhyj" label="发回意见" min-width="140" show-overflow-tooltip header-align="center" />
|
||
</el-table>
|
||
</div>
|
||
</div>
|
||
<div slot="footer" class="dialog-footer">
|
||
<el-button @click="detailVisible = false">关闭</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import {
|
||
listScheduleAdjust,
|
||
listAdjustableLessons,
|
||
getScheduleAdjustDetail,
|
||
submitScheduleAdjust,
|
||
auditByTeachingOffice,
|
||
auditByTeachingDepartment,
|
||
auditByAuthority,
|
||
receiveByTeachingOffice,
|
||
receiveByAuthority,
|
||
cancelScheduleAdjust
|
||
} from '@/api/teachBusiness/courseRunning'
|
||
import { listAllSemester } from '@/api/teachBusiness/semester'
|
||
|
||
// 节次 -> 节次区间映射
|
||
const JC_SECTION = {
|
||
1: '1-2节', 2: '3-4节', 3: '5-6节', 4: '7-8节', 5: '9-10节', 6: '11-12节'
|
||
}
|
||
|
||
// 审批状态:0-未审批,1-已同意,2-已发回,3-已拒绝
|
||
const AUDIT_STATUS = {
|
||
0: { label: '未审批', type: 'info' },
|
||
1: { label: '已同意', type: 'success' },
|
||
2: { label: '已发回', type: 'warning' },
|
||
3: { label: '已拒绝', type: 'danger' }
|
||
}
|
||
|
||
// 查收状态:0-未查收,1-已查收
|
||
const RECEIVE_STATUS = {
|
||
0: { label: '未查收', type: 'info' },
|
||
1: { label: '已查收', type: 'success' }
|
||
}
|
||
|
||
export default {
|
||
name: 'TimetableAdjust',
|
||
data() {
|
||
const curUserName = (this.$store.state.user && this.$store.state.user.name) || ''
|
||
return {
|
||
curUserName: curUserName,
|
||
loading: false,
|
||
tableData: [],
|
||
total: 0,
|
||
queryParams: {
|
||
nd: undefined,
|
||
sqjybh: undefined,
|
||
jyspzzt: undefined,
|
||
pageNum: 1,
|
||
pageSize: 20
|
||
},
|
||
// 年度下拉数据来自 /semester/all(真实后端数据)
|
||
yearOptions: [],
|
||
defaultNd: undefined,
|
||
jcOptions: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
||
auditStatusOptions: [
|
||
{ label: '未审批', value: 0 },
|
||
{ label: '已同意', value: 1 },
|
||
{ label: '已发回', value: 2 },
|
||
{ label: '已拒绝', value: 3 }
|
||
],
|
||
statCards: [],
|
||
// 新增申请
|
||
addVisible: false,
|
||
addLoading: false,
|
||
addForm: {},
|
||
addRules: {
|
||
nd: [{ required: true, message: '请选择年度', trigger: 'change' }],
|
||
sskcbbh: [{ required: true, message: '请输入课次编号', trigger: 'blur' }],
|
||
sy: [{ required: true, message: '请输入调课事由', trigger: 'blur' }],
|
||
rq: [{ required: true, message: '请选择拟调整日期', trigger: 'change' }],
|
||
jc: [{ required: true, message: '请选择拟调整节次', trigger: 'change' }],
|
||
sqjybh: [{ required: true, message: '请输入申请教员编号', trigger: 'blur' }]
|
||
},
|
||
// 可供调课课次
|
||
lessonDialogVisible: false,
|
||
lessonLoading: false,
|
||
lessonOptions: [],
|
||
// 审批
|
||
auditVisible: false,
|
||
auditLoading: false,
|
||
auditTitle: '审批',
|
||
auditForm: { ssdksqbh: '', auditRole: 'jys', spzt: 1, fhyj: '', sprbh: '', jgbh: '' },
|
||
// 查收
|
||
receiveVisible: false,
|
||
receiveLoading: false,
|
||
receiveTitle: '查收',
|
||
receiveForm: { ssdksqbh: '', type: 'jys', csrbh: '', jgbh: '' },
|
||
// 详情
|
||
detailVisible: false,
|
||
detailLoading: false,
|
||
detailData: null
|
||
}
|
||
},
|
||
created() {
|
||
this.loadYearOptions().then(() => this.loadList())
|
||
},
|
||
methods: {
|
||
/* ---------- 年度下拉(数据来自 /semester/all) ---------- */
|
||
loadYearOptions() {
|
||
return listAllSemester().then(response => {
|
||
const list = response.data || []
|
||
// 去重并按年度倒序
|
||
const map = {}
|
||
list.forEach(item => {
|
||
if (item.nd !== null && item.nd !== undefined && item.nd !== '') map[item.nd] = item
|
||
})
|
||
const arr = Object.keys(map).sort((a, b) => String(b).localeCompare(String(a)))
|
||
this.yearOptions = arr
|
||
// 默认年度:优先当前学期(dqxq=true),否则取最新年度
|
||
const current = list.find(item => item.dqxq === true)
|
||
this.defaultNd = (current && current.nd) || arr[0]
|
||
if (!this.queryParams.nd) this.queryParams.nd = this.defaultNd
|
||
return arr
|
||
}).catch(() => {
|
||
this.yearOptions = []
|
||
this.defaultNd = undefined
|
||
return []
|
||
})
|
||
},
|
||
/* ---------- 通用格式化 ---------- */
|
||
fmtDateTime(v) {
|
||
if (!v) return '-'
|
||
return String(v).replace('T', ' ').substring(0, 16)
|
||
},
|
||
fmtRqJc(rq, jc) {
|
||
if (!rq) return '-'
|
||
const date = String(rq).substring(0, 10)
|
||
const sec = jc === null || jc === undefined || jc === '' ? '第?节' : (JC_SECTION[jc] || '第' + jc + '节')
|
||
return date + ' ' + sec
|
||
},
|
||
jcLabel(n) {
|
||
return JC_SECTION[n] || ('第' + n + '节')
|
||
},
|
||
auditStatusTag(v) {
|
||
return AUDIT_STATUS[v] || { label: '-', type: 'info' }
|
||
},
|
||
receiveStatusTag(v) {
|
||
return RECEIVE_STATUS[v] || { label: '-', type: 'info' }
|
||
},
|
||
/* ---------- 列表查询 ---------- */
|
||
loadList() {
|
||
const params = {
|
||
pageNum: this.queryParams.pageNum,
|
||
pageSize: this.queryParams.pageSize
|
||
}
|
||
if (this.queryParams.nd) params.nd = this.queryParams.nd
|
||
if (this.queryParams.sqjybh) params.sqjybh = this.queryParams.sqjybh
|
||
if (this.queryParams.jyspzzt !== undefined && this.queryParams.jyspzzt !== '') {
|
||
params.jyspzzt = this.queryParams.jyspzzt
|
||
}
|
||
this.loading = true
|
||
listScheduleAdjust(params).then(response => {
|
||
const data = response.data || {}
|
||
this.tableData = data.records || []
|
||
this.total = data.total || 0
|
||
this.refreshStatCards()
|
||
this.loading = false
|
||
}).catch(() => {
|
||
this.tableData = []
|
||
this.total = 0
|
||
this.refreshStatCards()
|
||
this.loading = false
|
||
})
|
||
},
|
||
handleQuery() {
|
||
this.queryParams.pageNum = 1
|
||
this.loadList()
|
||
},
|
||
resetQuery() {
|
||
this.queryParams = {
|
||
nd: this.defaultNd,
|
||
sqjybh: undefined,
|
||
jyspzzt: undefined,
|
||
pageNum: 1,
|
||
pageSize: 20
|
||
}
|
||
this.loadList()
|
||
},
|
||
refreshStatCards() {
|
||
const list = this.tableData
|
||
this.statCards = [
|
||
{ title: '本页申请', value: list.length, gradient: 'linear-gradient(135deg, #00875a 0%, #00b877 100%)', filter: undefined },
|
||
{ title: '教研室待审批', value: list.filter(i => i.jyspzzt === 0).length, gradient: 'linear-gradient(135deg, #e6a23c 0%, #f8b04c 100%)', filter: 0 },
|
||
{ title: '教研室已同意', value: list.filter(i => i.jyspzzt === 1).length, gradient: 'linear-gradient(135deg, #409eff 0%, #66b1ff 100%)', filter: 1 },
|
||
{ title: '教研室已拒绝', value: list.filter(i => i.jyspzzt === 3).length, gradient: 'linear-gradient(135deg, #f56c6c 0%, #f78989 100%)', filter: 3 }
|
||
]
|
||
},
|
||
handleStatClick(card) {
|
||
if (card.filter === undefined) return
|
||
this.queryParams.jyspzzt = this.queryParams.jyspzzt === card.filter ? undefined : card.filter
|
||
this.handleQuery()
|
||
},
|
||
/* ---------- 新增申请 ---------- */
|
||
openAdd() {
|
||
this.addForm = {
|
||
nd: this.defaultNd || this.yearOptions[0],
|
||
sskcbbh: '',
|
||
sy: '',
|
||
rq: '',
|
||
jc: 1,
|
||
sqjybh: this.curUserName,
|
||
jxnr: '',
|
||
jxyd: '',
|
||
jxff: '',
|
||
jxbzbz: '',
|
||
ycxx: '',
|
||
bz: ''
|
||
}
|
||
this.$nextTick(() => this.$refs.addForm && this.$refs.addForm.clearValidate())
|
||
this.addVisible = true
|
||
},
|
||
loadAdjustableLessons() {
|
||
if (!this.addForm.nd) {
|
||
this.$message.warning('请先选择年度')
|
||
return
|
||
}
|
||
this.lessonLoading = true
|
||
listAdjustableLessons({ nd: this.addForm.nd }).then(response => {
|
||
this.lessonOptions = response.data || []
|
||
this.lessonLoading = false
|
||
this.lessonDialogVisible = true
|
||
}).catch(() => {
|
||
this.lessonLoading = false
|
||
this.$message.info('后端暂未提供可供调课课次接口,请手动填写课次编号')
|
||
})
|
||
},
|
||
pickLesson(row) {
|
||
this.addForm.sskcbbh = row.sskcbbh
|
||
this.lessonDialogVisible = false
|
||
this.$message.success('已选择课次:' + (row.kcmc || row.sskcbbh))
|
||
},
|
||
submitAdd() {
|
||
this.$refs.addForm.validate(valid => {
|
||
if (!valid) return
|
||
const payload = {
|
||
sskcbbh: this.addForm.sskcbbh,
|
||
sy: this.addForm.sy,
|
||
rq: this.addForm.rq + 'T00:00:00',
|
||
jc: this.addForm.jc,
|
||
nd: this.addForm.nd,
|
||
sqjybh: this.addForm.sqjybh
|
||
}
|
||
;['jxnr', 'jxyd', 'jxff', 'jxbzbz', 'ycxx', 'bz'].forEach(key => {
|
||
if (this.addForm[key]) payload[key] = this.addForm[key]
|
||
})
|
||
this.addLoading = true
|
||
submitScheduleAdjust(payload).then(() => {
|
||
this.addLoading = false
|
||
this.addVisible = false
|
||
this.$message.success('申请提交成功')
|
||
this.loadList()
|
||
}).catch(() => {
|
||
this.addLoading = false
|
||
})
|
||
})
|
||
},
|
||
/* ---------- 审批 ---------- */
|
||
showAuditMenu(row) {
|
||
return row.sczt === 0 && (row.jyspzzt === 0 || row.jyspzzt === 1)
|
||
},
|
||
openAudit(row, role) {
|
||
const titleMap = { jys: '教研室审批', jxx: '教学系审批', jg: '机关审批' }
|
||
this.auditTitle = titleMap[role] || '审批'
|
||
this.auditForm = {
|
||
ssdksqbh: row.ssdksqbh,
|
||
auditRole: role,
|
||
spzt: 1,
|
||
fhyj: '',
|
||
sprbh: this.curUserName,
|
||
jgbh: ''
|
||
}
|
||
this.auditVisible = true
|
||
},
|
||
submitAudit() {
|
||
const f = this.auditForm
|
||
if (!f.sprbh) {
|
||
this.$message.warning('请填写审批人编号')
|
||
return
|
||
}
|
||
if (f.auditRole === 'jg' && !f.jgbh) {
|
||
this.$message.warning('请填写机关编号')
|
||
return
|
||
}
|
||
const payload = {
|
||
ssdksqbh: f.ssdksqbh,
|
||
auditRole: f.auditRole,
|
||
spzt: f.spzt,
|
||
fhyj: f.fhyj,
|
||
sprbh: f.sprbh
|
||
}
|
||
if (f.jgbh) payload.jgbh = f.jgbh
|
||
const apiMap = {
|
||
jys: auditByTeachingOffice,
|
||
jxx: auditByTeachingDepartment,
|
||
jg: auditByAuthority
|
||
}
|
||
this.auditLoading = true
|
||
apiMap[f.auditRole](payload).then(() => {
|
||
this.auditLoading = false
|
||
this.auditVisible = false
|
||
this.$message.success('审批成功')
|
||
this.loadList()
|
||
}).catch(() => {
|
||
this.auditLoading = false
|
||
})
|
||
},
|
||
/* ---------- 查收 ---------- */
|
||
showReceiveMenu(row) {
|
||
return row.sczt === 0 && row.jyspzzt === 1
|
||
},
|
||
openReceive(row, type) {
|
||
this.receiveTitle = type === 'jys' ? '教研室查收' : '机关查收'
|
||
this.receiveForm = {
|
||
ssdksqbh: row.ssdksqbh,
|
||
type: type,
|
||
csrbh: this.curUserName,
|
||
jgbh: ''
|
||
}
|
||
this.receiveVisible = true
|
||
},
|
||
submitReceive() {
|
||
const f = this.receiveForm
|
||
if (!f.csrbh) {
|
||
this.$message.warning('请填写查收人编号')
|
||
return
|
||
}
|
||
if (f.type === 'jg' && !f.jgbh) {
|
||
this.$message.warning('请填写机关编号')
|
||
return
|
||
}
|
||
const params = { ssdksqbh: f.ssdksqbh, csrbh: f.csrbh }
|
||
if (f.jgbh) params.jgbh = f.jgbh
|
||
const api = f.type === 'jys' ? receiveByTeachingOffice : receiveByAuthority
|
||
this.receiveLoading = true
|
||
api(params).then(() => {
|
||
this.receiveLoading = false
|
||
this.receiveVisible = false
|
||
this.$message.success('查收成功')
|
||
this.loadList()
|
||
}).catch(() => {
|
||
this.receiveLoading = false
|
||
})
|
||
},
|
||
/* ---------- 撤销 ---------- */
|
||
handleCancel(row) {
|
||
this.$confirm('确认撤销该调课申请?撤销后课次将恢复原时间。', '提示', { type: 'warning' })
|
||
.then(() => {
|
||
cancelScheduleAdjust({ ssdksqbh: row.ssdksqbh, sqjybh: row.sqjybh }).then(() => {
|
||
this.$message.success('撤销成功')
|
||
this.loadList()
|
||
}).catch(() => {})
|
||
})
|
||
.catch(() => {})
|
||
},
|
||
/* ---------- 详情 ---------- */
|
||
openDetail(row) {
|
||
this.detailVisible = true
|
||
this.detailLoading = true
|
||
this.detailData = null
|
||
getScheduleAdjustDetail(row.ssdksqbh).then(response => {
|
||
this.detailData = response.data || {}
|
||
this.detailLoading = false
|
||
}).catch(() => {
|
||
this.detailData = null
|
||
this.detailLoading = false
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
.page-container {
|
||
padding: 16px;
|
||
|
||
.section-card {
|
||
background: #fff;
|
||
border: 1px solid #ebeef5;
|
||
border-radius: 6px;
|
||
padding: 16px 20px;
|
||
margin-bottom: 16px;
|
||
|
||
.section-title {
|
||
font-size: 16px;
|
||
font-weight: 700;
|
||
color: #303133;
|
||
}
|
||
|
||
.section-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
flex-wrap: wrap;
|
||
gap: 12px;
|
||
margin-bottom: 16px;
|
||
|
||
.header-actions {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
}
|
||
}
|
||
}
|
||
|
||
/* 统计卡片 */
|
||
.stat-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(4, 1fr);
|
||
gap: 16px;
|
||
margin-top: 14px;
|
||
}
|
||
|
||
.stat-card {
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: center;
|
||
padding: 16px 20px;
|
||
border-radius: 6px;
|
||
color: #fff;
|
||
cursor: pointer;
|
||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||
|
||
&:hover {
|
||
transform: translateY(-2px);
|
||
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
|
||
}
|
||
|
||
.stat-text {
|
||
font-size: 13px;
|
||
opacity: 0.92;
|
||
}
|
||
|
||
.stat-value {
|
||
margin-top: 8px;
|
||
font-size: 26px;
|
||
font-weight: 700;
|
||
line-height: 1;
|
||
}
|
||
}
|
||
|
||
/* 查询区域 */
|
||
.search-form {
|
||
margin-bottom: -16px;
|
||
|
||
::v-deep .el-form-item {
|
||
margin-bottom: 16px;
|
||
}
|
||
}
|
||
|
||
.compact-table {
|
||
width: 100%;
|
||
}
|
||
|
||
.danger-btn {
|
||
color: #f56c6c;
|
||
|
||
&:hover {
|
||
color: #f78989;
|
||
}
|
||
}
|
||
|
||
.ops-cell {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-wrap: wrap;
|
||
gap: 0 4px;
|
||
}
|
||
|
||
.pick-lesson-btn {
|
||
margin-top: 6px;
|
||
width: 100%;
|
||
}
|
||
|
||
.sub-section {
|
||
margin-top: 16px;
|
||
|
||
.sub-title {
|
||
font-size: 14px;
|
||
font-weight: 700;
|
||
color: #303133;
|
||
margin-bottom: 8px;
|
||
}
|
||
}
|
||
}
|
||
|
||
@media (max-width: 992px) {
|
||
.page-container .stat-grid {
|
||
grid-template-columns: repeat(2, 1fr);
|
||
}
|
||
}
|
||
</style>
|