班次学期信息管理
This commit is contained in:
@@ -0,0 +1,105 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// ======================== 班历管理(实体 XYDRWB 学员队任务表) ========================
|
||||||
|
// 接口依据:api2.txt「班次学期日历(班历)」分组 + StudentTeamTaskController
|
||||||
|
// 每个班次学期(xydxqbh)下挂若干条课程任务记录:
|
||||||
|
// bh 编号、nd 年度、xydbh 学员队编号、kbh 课编号、xqdc 学期第次、jybh 教员编号、kcxh 课次序号、
|
||||||
|
// jsbh 教室编号、rs 人数、zks 周课时、xs 学时、klx 课类型、jc 简称、ksdd 考试地点、ksbh 考试编号、
|
||||||
|
// jysdh 教研室代号、jysjhjybh 教研室计划教员编号、jysjhbz 教研室计划备注、jhkcxh 计划课次序号、
|
||||||
|
// xhbs 序号标识、xydxqbh 学员队学期编号、bz 备注、xf 学分、cjsj/bdsj/kbbdsj 时间、
|
||||||
|
// ksks 考试课时、bz2 编组、cjfz 成绩分制、bjrxypjf 不计入学员平均分、llxs 理论学时、sjxs 实践学时、
|
||||||
|
// ksksbxs 考试课时不显示、pdxh 配档序号、pdqsz 配档起始周、pdaz 配档按周、pdzzksj 配档占正课时间、
|
||||||
|
// pdbz 配档编组、pdtbykxxbz 配当同班异课选修编组、pdzdyxsfbsj 配档自定义学时分布数据、
|
||||||
|
// pdqyzdyxs 配档启用自定义学时
|
||||||
|
|
||||||
|
// 查询某班次学期下的全部班历记录(xydxqbh 学员队学期编号)
|
||||||
|
export function listClassCalendar(xydxqbh) {
|
||||||
|
return request({
|
||||||
|
url: '/classCalendar/all',
|
||||||
|
method: 'get',
|
||||||
|
params: { xydxqbh: xydxqbh }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据主键查询班历记录
|
||||||
|
export function getClassCalendar(bh) {
|
||||||
|
return request({
|
||||||
|
url: '/classCalendar/get',
|
||||||
|
method: 'get',
|
||||||
|
params: { bh: bh }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新班历记录(请求体 XYDRWB,bh 必传)
|
||||||
|
export function updateClassCalendar(data) {
|
||||||
|
return request({
|
||||||
|
url: '/classCalendar/update',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选定区域设置应用于其它班次(请求体 { sourceBhList: 源记录编号, targetBhList: 目标班次学期编号 })
|
||||||
|
export function batchCopyCalendar(data) {
|
||||||
|
return request({
|
||||||
|
url: '/classCalendar/batchCopy',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 整个班历应用于其它班次(请求体 { sourceXydxqbh: 源班次学期编号, targetBhList: 目标班次学期编号 })
|
||||||
|
export function batchCopyCalendarBySemester(data) {
|
||||||
|
return request({
|
||||||
|
url: '/classCalendar/batchCopyBySemester',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// ======================== 学员队任务表操作(/studentTeamTask) ========================
|
||||||
|
|
||||||
|
// 新增班历记录(请求体 XYDRWB;bh 留空后端生成 UUID)
|
||||||
|
export function addTeamTask(data) {
|
||||||
|
return request({
|
||||||
|
url: '/studentTeamTask/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除班历记录(bh 编号)
|
||||||
|
export function delTeamTask(bh) {
|
||||||
|
return request({
|
||||||
|
url: '/studentTeamTask/delete',
|
||||||
|
method: 'post',
|
||||||
|
params: { bh: bh }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量预设合班(请求体 { bhList },按年度排序生成统一课次序号)
|
||||||
|
export function batchPresetMerge(bhList) {
|
||||||
|
return request({
|
||||||
|
url: '/studentTeamTask/batchPresetMerge',
|
||||||
|
method: 'post',
|
||||||
|
data: { bhList: bhList }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量预设拆班(请求体 { bhList },清空课次序号)
|
||||||
|
export function batchPresetSplit(bhList) {
|
||||||
|
return request({
|
||||||
|
url: '/studentTeamTask/batchPresetSplit',
|
||||||
|
method: 'post',
|
||||||
|
data: { bhList: bhList }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 自动生成必修课程(按学员队+学期第次从专业教学计划生成班历记录)
|
||||||
|
export function autoGenerateRequiredCourses(xydbh, xqdc) {
|
||||||
|
return request({
|
||||||
|
url: '/studentTeamTask/autoGenerateRequiredCourses',
|
||||||
|
method: 'post',
|
||||||
|
params: { xydbh: xydbh, xqdc: xqdc }
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// ======================== 班次学期管理(实体 XYDNDXQJBXXB 学员队年度学期基本信息表) ========================
|
||||||
|
// 接口依据:api1.txt「班次学期」分组,实际后端位于 StudentRecordsController (/student-records/semester/*)
|
||||||
|
// 列表仅支持 xydbh(学员队编号)模糊筛选,无年度筛选,前端需本地过滤
|
||||||
|
// 新增 bh 留空由后端生成 UUID;字段 nd 年度、xydbh 学员队编号、kxrq 开学日期、jsrq 结束日期、
|
||||||
|
// xqdc 学期第次、zyjsbh 专用教室编号、jxrwbh 教学任务编号、bdsj 变动时间、bz 备注、
|
||||||
|
// xhbs 序号标识、ysbbh 预设编班号、jclb 节次类别、xtms 系统模式、kfjypk 开放教员排课(0/1)、
|
||||||
|
// jsonzd、fxbgscsj 分析报告生成时间、fxbgwd1bh/fxbgwd2bh/fxbgwd3bh 分析报告文档编号
|
||||||
|
|
||||||
|
// 分页查询班次学期列表(支持 xydbh 模糊)
|
||||||
|
export function listSemester(query) {
|
||||||
|
return request({
|
||||||
|
url: '/student-records/semester/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询所有有效班次学期(DEL_FLAG = 0)
|
||||||
|
export function allSemester() {
|
||||||
|
return request({
|
||||||
|
url: '/student-records/semester/all',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询班次学期详情(bh 编号)
|
||||||
|
export function getSemester(bh) {
|
||||||
|
return request({
|
||||||
|
url: '/student-records/semester/get',
|
||||||
|
method: 'get',
|
||||||
|
params: { bh: bh }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增班次学期(请求体 XYDNDXQJBXXB;bh 留空后端生成 UUID,delFlag 后端置 0)
|
||||||
|
export function addSemester(data) {
|
||||||
|
return request({
|
||||||
|
url: '/student-records/semester/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编辑班次学期(bh 编号必传,请求体 XYDNDXQJBXXB)
|
||||||
|
export function updateSemester(data) {
|
||||||
|
return request({
|
||||||
|
url: '/student-records/semester/update',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除班次学期(逻辑删除并级联删除其班历记录)
|
||||||
|
export function delSemester(bh) {
|
||||||
|
return request({
|
||||||
|
url: '/student-records/semester/delete',
|
||||||
|
method: 'post',
|
||||||
|
params: { bh: bh }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量删除班次学期(请求体为编号数组)
|
||||||
|
export function batchDeleteSemester(bhList) {
|
||||||
|
return request({
|
||||||
|
url: '/student-records/semester/batchDelete',
|
||||||
|
method: 'post',
|
||||||
|
data: bhList
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量设定学期日期(请求体 { bhList, xqkssj, xqjssj })
|
||||||
|
export function batchUpdateDateRange(data) {
|
||||||
|
return request({
|
||||||
|
url: '/student-records/semester/batchUpdateDateRange',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量修改开放教员排课状态(请求体 { bhList, kfjypk },0-否 1-是)
|
||||||
|
export function batchUpdateKfjypk(data) {
|
||||||
|
return request({
|
||||||
|
url: '/student-records/semester/batchUpdateKfjypk',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量修改学期第次(请求体 { bhList, xqdc })
|
||||||
|
export function batchUpdateXqdc(data) {
|
||||||
|
return request({
|
||||||
|
url: '/student-records/semester/batchUpdateXqdc',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量设置教学任务(请求体 { bhList, jxrwbh })
|
||||||
|
export function batchUpdateJxrwbh(data) {
|
||||||
|
return request({
|
||||||
|
url: '/student-records/semester/batchUpdateJxrwbh',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量创建班次学期(按时间范围筛选可建班的学员队;xqdc 传 春季学期/夏季学期/秋季学期)
|
||||||
|
// 参数:startTime 起始日、endTime 截止日、nd 年度、xqdc 学期
|
||||||
|
export function batchAddFromElective(params) {
|
||||||
|
return request({
|
||||||
|
url: '/student-records/semester/batchAddFromElective',
|
||||||
|
method: 'post',
|
||||||
|
params: params
|
||||||
|
})
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,82 +1,79 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:visible="dialogVisible"
|
:visible="dialogVisible"
|
||||||
title="教学班次学期信息明细"
|
:title="isEdit ? '编辑班次学期信息' : '教学班次学期信息明细'"
|
||||||
width="720px"
|
width="620px"
|
||||||
class="class-detail-dialog"
|
class="class-detail-dialog"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
@update:visible="val => dialogVisible = val"
|
@update:visible="val => dialogVisible = val"
|
||||||
>
|
>
|
||||||
<el-form label-width="100px" class="detail-form">
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="110px" class="detail-form">
|
||||||
<el-row :gutter="24">
|
<!-- 班次信息(只读展示) -->
|
||||||
<!-- 左列 -->
|
<el-row :gutter="16">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="班次">
|
<el-form-item label="班次">
|
||||||
<el-input v-model="form.bc" readonly />
|
<el-input :value="form.xydmc || form.xydbh" readonly />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="专业">
|
|
||||||
<el-input v-model="form.xkzy" readonly />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="年级">
|
|
||||||
<el-input v-model="form.nj" readonly />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="学期">
|
|
||||||
<div class="semester-field">
|
|
||||||
<el-input v-model="form.xq" readonly />
|
|
||||||
<el-input v-model="form.ghn" class="plan-input" placeholder="" />
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="开学日期">
|
|
||||||
<el-date-picker v-model="form.kxrq" type="date" format="yyyy年M月d日" value-format="yyyy-MM-dd" style="width: 100%" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="结束日期">
|
|
||||||
<el-date-picker v-model="form.jsrq" type="date" format="yyyy年M月d日" value-format="yyyy-MM-dd" style="width: 100%" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="学期周数">
|
|
||||||
<el-input v-model="form.zs" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- 右列 -->
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="教学任务">
|
<el-form-item label="班次编号">
|
||||||
<el-select v-model="form.jxrw" clearable placeholder="请选择" style="width: 100%">
|
<el-input v-model="form.xydbh" :readonly="isEdit" :disabled="isEdit" placeholder="编辑模式不可修改" />
|
||||||
<el-option v-for="opt in taskOptions" :key="opt" :label="opt" :value="opt" />
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="年度" prop="nd">
|
||||||
|
<el-select v-model="form.nd" placeholder="请选择年度" style="width: 100%">
|
||||||
|
<el-option v-for="y in yearOptions" :key="y" :label="`${y}年`" :value="y" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="学期层次">
|
</el-col>
|
||||||
<el-select v-model="form.xqcc" style="width: 100%">
|
<el-col :span="12">
|
||||||
<el-option v-for="opt in levelOptions" :key="opt" :label="opt" :value="opt" />
|
<el-form-item label="学期第次" prop="xqdc">
|
||||||
</el-select>
|
<el-select v-model="form.xqdc" placeholder="请选择学期" style="width: 100%">
|
||||||
</el-form-item>
|
<el-option v-for="opt in levelOptions" :key="opt.value" :label="opt.label" :value="opt.value" />
|
||||||
<el-form-item label="开放教员排课">
|
|
||||||
<el-checkbox v-model="form.kfpy" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="查找教室">
|
|
||||||
<el-select v-model="form.zxjs" style="width: 100%">
|
|
||||||
<el-option v-for="opt in roomOptions" :key="opt" :label="opt" :value="opt" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="教学楼">
|
|
||||||
<el-select v-model="form.jxl" style="width: 100%">
|
|
||||||
<el-option v-for="opt in buildingOptions" :key="opt" :label="opt" :value="opt" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="专用教室">
|
|
||||||
<el-select v-model="form.zyjs" style="width: 100%">
|
|
||||||
<el-option v-for="opt in zyjsOptions" :key="opt" :label="opt" :value="opt" />
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- 备注 -->
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="开学日期" prop="kxrq">
|
||||||
|
<el-date-picker v-model="form.kxrq" type="date" value-format="yyyy-MM-dd" placeholder="请选择" style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="结束日期" prop="jsrq">
|
||||||
|
<el-date-picker v-model="form.jsrq" type="date" value-format="yyyy-MM-dd" placeholder="请选择" style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="专用教室">
|
||||||
|
<el-input v-model="form.zyjsbh" placeholder="请输入专用教室编号" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="教学任务">
|
||||||
|
<el-select v-model="form.jxrwbh" clearable filterable placeholder="请选择教学任务" style="width: 100%">
|
||||||
|
<el-option v-for="opt in taskOptions" :key="opt.bh" :label="opt.rwmc" :value="opt.bh" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item label="开放教员排课">
|
||||||
|
<el-checkbox v-model="form.kfjypk">开放教员排课</el-checkbox>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="form.bz" type="textarea" :rows="3" placeholder="" style="width: 100%" />
|
<el-input v-model="form.bz" type="textarea" :rows="3" placeholder="请输入备注" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="handleConfirm">确定</el-button>
|
<el-button type="primary" :loading="saving" @click="handleSubmit">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@@ -86,35 +83,32 @@ export default {
|
|||||||
name: 'ClassSemesterDetailDialog',
|
name: 'ClassSemesterDetailDialog',
|
||||||
props: {
|
props: {
|
||||||
visible: { type: Boolean, default: false },
|
visible: { type: Boolean, default: false },
|
||||||
/** 选中的班次信息 */
|
/** 编辑模式:edit / add */
|
||||||
classInfo: { type: Object, default: null },
|
mode: { type: String, default: 'add' },
|
||||||
/** 学期名称 */
|
/** 编辑时的班次学期记录 */
|
||||||
semesterName: { type: String, default: '2017年秋季学期' }
|
semester: { type: Object, default: null },
|
||||||
|
/** 新增时选中的班次(学员队)信息 */
|
||||||
|
teamInfo: { type: Object, default: null },
|
||||||
|
/** 年度下拉 */
|
||||||
|
yearOptions: { type: Array, default: () => [] },
|
||||||
|
/** 教学任务下拉({ bh, rwmc }) */
|
||||||
|
taskOptions: { type: Array, default: () => [] }
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
form: this.createEmptyForm(),
|
||||||
bc: '班次0633', // 班次
|
levelOptions: [
|
||||||
xkzy: '专业209', // 专业
|
{ label: '第1学期', value: 1 },
|
||||||
nj: '2017级', // 年级
|
{ label: '第2学期', value: 2 },
|
||||||
xq: this.semesterName, // 学期
|
{ label: '第3学期', value: 3 }
|
||||||
ghn: '规划内', // 规划内
|
],
|
||||||
kxrq: '2017-09-03', // 开学日期
|
saving: false,
|
||||||
jsrq: '2018-02-11', // 结束日期
|
rules: {
|
||||||
zs: 24, // 学期周数
|
nd: [{ required: true, message: '请选择年度', trigger: 'change' }],
|
||||||
jxrw: '', // 教学任务
|
xqdc: [{ required: true, message: '请选择学期第次', trigger: 'change' }],
|
||||||
xqcc: '第1学期', // 学期层次
|
kxrq: [{ required: true, message: '请选择开学日期', trigger: 'change' }],
|
||||||
kfpy: true, // 开放教员排课
|
jsrq: [{ required: true, message: '请选择结束日期', trigger: 'change' }]
|
||||||
zxjs: '10-03&10-03(50)', // 查找教室
|
}
|
||||||
jxl: '5号楼', // 教学楼
|
|
||||||
zyjs: '作战实验中心学术报告厅', // 专用教室
|
|
||||||
bz: '' // 备注
|
|
||||||
},
|
|
||||||
taskOptions: ['2017年下半年教学任务', '研究生2017下半年教学任务'],
|
|
||||||
levelOptions: ['第1学期', '第2学期', '第3学期'],
|
|
||||||
roomOptions: ['10-03&10-03(50)', '10-04&10-04(40)', '9-01'],
|
|
||||||
buildingOptions: ['5号楼', '6号楼', '综合楼'],
|
|
||||||
zyjsOptions: ['作战实验中心学术报告厅', '综合教学楼101', '学术报告厅']
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -125,22 +119,93 @@ export default {
|
|||||||
set(val) {
|
set(val) {
|
||||||
this.$emit('update:visible', val)
|
this.$emit('update:visible', val)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
isEdit() {
|
||||||
|
return this.mode === 'edit'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// 每次打开时按传入的班次信息初始化表单
|
|
||||||
visible(val) {
|
visible(val) {
|
||||||
if (!val) return
|
if (!val) return
|
||||||
this.form.bc = (this.classInfo && this.classInfo.bc) || '班次0633'
|
this.initForm()
|
||||||
this.form.xkzy = (this.classInfo && this.classInfo.xkzy) || '专业209'
|
this.$nextTick(() => {
|
||||||
this.form.nj = (this.classInfo && this.classInfo.nj) || '2017级'
|
if (this.$refs.formRef) this.$refs.formRef.clearValidate()
|
||||||
this.form.xq = this.semesterName
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleConfirm() {
|
createEmptyForm() {
|
||||||
this.$emit('confirm')
|
return {
|
||||||
this.dialogVisible = false
|
bh: '',
|
||||||
|
xydbh: '',
|
||||||
|
xydmc: '',
|
||||||
|
nd: undefined,
|
||||||
|
xqdc: undefined,
|
||||||
|
kxrq: '',
|
||||||
|
jsrq: '',
|
||||||
|
zyjsbh: '',
|
||||||
|
jxrwbh: undefined,
|
||||||
|
kfjypk: false,
|
||||||
|
bz: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 打开时按编辑/新增模式初始化表单 */
|
||||||
|
initForm() {
|
||||||
|
const form = this.createEmptyForm()
|
||||||
|
if (this.isEdit && this.semester) {
|
||||||
|
const row = this.semester
|
||||||
|
form.bh = row.bh || ''
|
||||||
|
form.xydbh = row.xydbh || ''
|
||||||
|
form.xydmc = row.xydmc || ''
|
||||||
|
form.nd = row.nd
|
||||||
|
form.xqdc = row.xqdc
|
||||||
|
form.kxrq = row.kxrq ? String(row.kxrq).slice(0, 10) : ''
|
||||||
|
form.jsrq = row.jsrq ? String(row.jsrq).slice(0, 10) : ''
|
||||||
|
form.zyjsbh = row.zyjsbh || ''
|
||||||
|
form.jxrwbh = row.jxrwbh || undefined
|
||||||
|
form.kfjypk = Number(row.kfjypk) === 1
|
||||||
|
form.bz = row.bz || ''
|
||||||
|
} else if (this.teamInfo) {
|
||||||
|
form.xydbh = this.teamInfo.xydbh || ''
|
||||||
|
form.xydmc = this.teamInfo.xydmc || ''
|
||||||
|
// 默认取当前选中年度的第一学期,日期可后续修改
|
||||||
|
form.nd = this.yearOptions[0]
|
||||||
|
form.xqdc = 1
|
||||||
|
}
|
||||||
|
this.form = form
|
||||||
|
},
|
||||||
|
/** 移除空值(保留 0 等有效值) */
|
||||||
|
cleanPayload(obj) {
|
||||||
|
const payload = {}
|
||||||
|
Object.keys(obj).forEach(key => {
|
||||||
|
const value = obj[key]
|
||||||
|
if (value !== '' && value !== null && value !== undefined) {
|
||||||
|
payload[key] = value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return payload
|
||||||
|
},
|
||||||
|
handleSubmit() {
|
||||||
|
this.$refs.formRef.validate(valid => {
|
||||||
|
if (!valid) return
|
||||||
|
if (!this.form.xydbh) {
|
||||||
|
this.$message.warning('缺少班次编号,无法保存')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const payload = this.cleanPayload({
|
||||||
|
bh: this.form.bh,
|
||||||
|
xydbh: this.form.xydbh,
|
||||||
|
nd: this.form.nd,
|
||||||
|
xqdc: this.form.xqdc,
|
||||||
|
kxrq: this.form.kxrq,
|
||||||
|
jsrq: this.form.jsrq,
|
||||||
|
zyjsbh: this.form.zyjsbh,
|
||||||
|
jxrwbh: this.form.jxrwbh,
|
||||||
|
kfjypk: this.form.kfjypk ? 1 : 0,
|
||||||
|
bz: this.form.bz
|
||||||
|
})
|
||||||
|
this.$emit('submit', payload)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,22 +218,6 @@ export default {
|
|||||||
::v-deep .el-input__inner[readonly] {
|
::v-deep .el-input__inner[readonly] {
|
||||||
background-color: #f5f7fa;
|
background-color: #f5f7fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.semester-field {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.el-input:first-child {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.plan-input {
|
|
||||||
flex-shrink: 0;
|
|
||||||
width: 120px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,148 +1,71 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:visible="dialogVisible"
|
:visible="dialogVisible"
|
||||||
title="学员队选取"
|
:title="title"
|
||||||
width="90%"
|
width="900px"
|
||||||
top="5vh"
|
top="8vh"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
class="team-select-dialog"
|
class="team-select-dialog"
|
||||||
@update:visible="val => dialogVisible = val"
|
@update:visible="val => dialogVisible = val"
|
||||||
>
|
>
|
||||||
<div class="team-select">
|
<div class="team-select">
|
||||||
<!-- ==================== 1. 查询条件区域 ==================== -->
|
<!-- ==================== 操作说明 ==================== -->
|
||||||
|
<div v-if="excludeNote" class="note-bar">
|
||||||
|
<i class="el-icon-info"></i>
|
||||||
|
<span>{{ excludeNote }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ==================== 查询条件区域 ==================== -->
|
||||||
<div class="query-panel">
|
<div class="query-panel">
|
||||||
<el-form label-width="88px" class="query-form">
|
<el-form :inline="true" class="query-form" @submit.native.prevent>
|
||||||
<el-row :gutter="20">
|
<el-form-item label="班次编号">
|
||||||
<el-col :span="12">
|
<el-input
|
||||||
<el-form-item label="专业">
|
v-model="queryForm.xydbh"
|
||||||
<div class="check-field">
|
placeholder="请输入班次编号(模糊)"
|
||||||
<el-checkbox v-model="queryForm.zyEnabled" />
|
clearable
|
||||||
<el-select v-model="queryForm.zy" :disabled="!queryForm.zyEnabled" style="flex: 1">
|
style="width: 220px"
|
||||||
<el-option v-for="opt in zyOptions" :key="opt" :label="opt" :value="opt" />
|
@keyup.enter.native="handleQuery"
|
||||||
</el-select>
|
/>
|
||||||
</div>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="年级">
|
<el-form-item>
|
||||||
<div class="check-field">
|
<el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button>
|
||||||
<el-checkbox v-model="queryForm.njEnabled" />
|
<el-button size="small" @click="handleResetQuery">重置</el-button>
|
||||||
<el-input v-model="queryForm.nj" :disabled="!queryForm.njEnabled" placeholder="" />
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="在校状态">
|
|
||||||
<div class="check-field">
|
|
||||||
<el-checkbox v-model="queryForm.zxztEnabled" />
|
|
||||||
<el-select v-model="queryForm.zxzt" :disabled="!queryForm.zxztEnabled" style="flex: 1">
|
|
||||||
<el-option v-for="opt in zxztOptions" :key="opt" :label="opt" :value="opt" />
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="学员队名称">
|
|
||||||
<div class="check-field">
|
|
||||||
<el-checkbox v-model="queryForm.xydmcEnabled" />
|
|
||||||
<el-input v-model="queryForm.xydmc" :disabled="!queryForm.xydmcEnabled" placeholder="" />
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="任务类别">
|
|
||||||
<div class="check-field">
|
|
||||||
<el-checkbox v-model="queryForm.rwlbEnabled" />
|
|
||||||
<el-select v-model="queryForm.rwlb" :disabled="!queryForm.rwlbEnabled" style="flex: 1">
|
|
||||||
<el-option v-for="opt in rwlbOptions" :key="opt" :label="opt" :value="opt" />
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<!-- 分页控制区域 -->
|
|
||||||
<div class="pager-row">
|
|
||||||
<button type="button" class="gray-btn" @click="handleQuery">查询</button>
|
|
||||||
<button type="button" class="gray-btn" @click="handleFirst">首页</button>
|
|
||||||
<button type="button" class="gray-btn" @click="handlePrev">上页</button>
|
|
||||||
<button type="button" class="gray-btn" @click="handleNext">下页</button>
|
|
||||||
<button type="button" class="gray-btn" @click="handleLast">末页</button>
|
|
||||||
<el-input-number v-model="currentPage" :min="1" size="small" controls-position="right" style="width: 90px" />
|
|
||||||
<span class="pager-label">每页条数</span>
|
|
||||||
<el-select v-model="pageSize" size="small" style="width: 70px">
|
|
||||||
<el-option v-for="n in pageSizeOptions" :key="n" :label="String(n)" :value="n" />
|
|
||||||
</el-select>
|
|
||||||
<button type="button" class="gray-btn" @click="handleLocate">定位</button>
|
|
||||||
<el-select v-model="displaySize" size="small" style="width: 80px">
|
|
||||||
<el-option v-for="n in displaySizeOptions" :key="n" :label="String(n)" :value="n" />
|
|
||||||
</el-select>
|
|
||||||
<button type="button" class="blue-btn" @click="handleSetPageSize">设置页项数</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ==================== 2. 上方数据表格 ==================== -->
|
<!-- ==================== 目标班次学期表格 ==================== -->
|
||||||
<div class="table-panel">
|
<div class="table-panel">
|
||||||
<el-table
|
<el-table
|
||||||
:data="teamList"
|
ref="tableRef"
|
||||||
border
|
v-loading="loading"
|
||||||
stripe
|
:data="filteredList"
|
||||||
highlight-current-row
|
|
||||||
size="small"
|
|
||||||
class="team-table"
|
|
||||||
@selection-change="handleTopSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="40" align="center" />
|
|
||||||
<el-table-column prop="xzdbm" label="行政队别名称" width="100" align="center" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="xydmc" label="学员队名称" width="90" align="center" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="nj" label="年级" width="70" align="center" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="zy" label="专业" width="80" align="center" show-overflow-tooltip />
|
|
||||||
<el-table-column label="人数" width="60" align="center">
|
|
||||||
<template slot-scope="{ row }">{{ row.rs }}人</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="zxzt" label="在校状态" width="80" align="center" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="rwlb" label="任务类别" width="80" align="center" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="zyjs" label="专用教室" width="120" align="center" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="rxrq" label="入学日期" width="120" align="center" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="byrq" label="毕业日期" width="120" align="center" show-overflow-tooltip />
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ==================== 3. 中间操作按钮区域 ==================== -->
|
|
||||||
<div class="mid-actions">
|
|
||||||
<span class="mid-label">已选择列表项</span>
|
|
||||||
<button type="button" class="gray-btn" @click="handleAdd">加入</button>
|
|
||||||
<button type="button" class="gray-btn" @click="handleRemove">移除</button>
|
|
||||||
<button type="button" class="gray-btn" @click="handleClear">清除</button>
|
|
||||||
<button type="button" class="gray-btn" @click="handleReset">重置</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ==================== 4. 下方数据表格(已选学员队列表) ==================== -->
|
|
||||||
<div class="table-panel">
|
|
||||||
<el-table
|
|
||||||
:data="selectedList"
|
|
||||||
border
|
border
|
||||||
stripe
|
stripe
|
||||||
size="small"
|
size="small"
|
||||||
|
max-height="360"
|
||||||
class="team-table"
|
class="team-table"
|
||||||
@selection-change="handleBottomSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="40" align="center" />
|
<el-table-column type="selection" width="44" align="center" reserve-selection />
|
||||||
<el-table-column prop="zy" label="专业" width="80" align="center" show-overflow-tooltip />
|
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||||
<el-table-column prop="xydmc" label="学员队名称" width="90" align="center" show-overflow-tooltip />
|
<el-table-column prop="nd" label="年度" width="80" align="center" show-overflow-tooltip />
|
||||||
<el-table-column prop="nj" label="年级" width="70" align="center" show-overflow-tooltip />
|
<el-table-column label="学期第次" width="90" align="center">
|
||||||
<el-table-column label="人数" width="60" align="center">
|
<template slot-scope="{ row }">{{ xqdcLabel(row.xqdc) }}</template>
|
||||||
<template slot-scope="{ row }">{{ row.rs }}人</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="rwlb" label="任务类别" width="80" align="center" show-overflow-tooltip />
|
<el-table-column prop="xydbh" label="班次编号" min-width="150" align="left" header-align="center" show-overflow-tooltip />
|
||||||
<el-table-column prop="zxzt" label="在校状态" width="80" align="center" show-overflow-tooltip />
|
<el-table-column prop="kxrq" label="开学日期" width="110" align="center" :formatter="fmtDate" />
|
||||||
<el-table-column prop="zyjs" label="专用教室" width="120" align="center" show-overflow-tooltip />
|
<el-table-column prop="jsrq" label="结束日期" width="110" align="center" :formatter="fmtDate" />
|
||||||
<el-table-column prop="rxrq" label="入学日期" width="120" align="center" show-overflow-tooltip />
|
<el-table-column prop="bz" label="备注" min-width="120" align="left" header-align="center" show-overflow-tooltip />
|
||||||
<el-table-column prop="byrq" label="毕业日期" width="120" align="center" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="bz" label="备注" width="80" align="center" show-overflow-tooltip />
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-empty v-if="!selectedList.length" description="暂无已选学员队,请从上方表格加入" :image-size="60" />
|
<el-empty v-if="!filteredList.length" description="暂无可选的目标班次学期" :image-size="60" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ==================== 5. 底部按钮区域 ==================== -->
|
<!-- ==================== 底部按钮区域 ==================== -->
|
||||||
<div class="footer-actions">
|
<div class="footer-actions">
|
||||||
<button type="button" class="gray-btn" @click="handleConfirm">确定</button>
|
<span class="selected-count">已选择 {{ selection.length }} 个班次学期</span>
|
||||||
<button type="button" class="gray-btn" @click="handleCancel">取消</button>
|
<el-button size="small" @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button size="small" type="primary" :disabled="!selection.length" @click="handleConfirm">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -152,52 +75,21 @@
|
|||||||
export default {
|
export default {
|
||||||
name: 'ClassTeamSelectDialog',
|
name: 'ClassTeamSelectDialog',
|
||||||
props: {
|
props: {
|
||||||
visible: { type: Boolean, default: false }
|
visible: { type: Boolean, default: false },
|
||||||
|
/** 标题(可选) */
|
||||||
|
title: { type: String, default: '目标班次学期选取' },
|
||||||
|
/** 可选的目标班次学期列表(含 bh/nd/xqdc/xydbh/kxrq/jsrq 等) */
|
||||||
|
semesterList: { type: Array, default: () => [] },
|
||||||
|
/** 需要排除的班次学期编号(当前班次学期,不可复制给自己) */
|
||||||
|
excludeBh: { type: String, default: '' },
|
||||||
|
/** 顶部操作说明 */
|
||||||
|
excludeNote: { type: String, default: '' }
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// ==================== 查询条件区域 ====================
|
loading: false,
|
||||||
queryForm: {
|
queryForm: { xydbh: '' },
|
||||||
zyEnabled: false, // 专业启用复选框(未勾选)
|
selection: []
|
||||||
zy: '专业219', // 专业(默认值)
|
|
||||||
njEnabled: true, // 年级启用复选框(已勾选)
|
|
||||||
nj: '', // 年级(空值)
|
|
||||||
zxztEnabled: false, // 在校状态启用复选框(未勾选)
|
|
||||||
zxzt: '毕业', // 在校状态(默认值)
|
|
||||||
xydmcEnabled: true, // 学员队名称启用复选框(已勾选)
|
|
||||||
xydmc: '', // 学员队名称(空值)
|
|
||||||
rwlbEnabled: false, // 任务类别启用复选框(未勾选)
|
|
||||||
rwlb: '规划内' // 任务类别(默认值)
|
|
||||||
},
|
|
||||||
zyOptions: ['专业219', '专业220', '专业221'],
|
|
||||||
zxztOptions: ['毕业', '在校'],
|
|
||||||
rwlbOptions: ['规划内', '规划外'],
|
|
||||||
|
|
||||||
// ==================== 分页控制区域 ====================
|
|
||||||
currentPage: 1,
|
|
||||||
pageSize: 1,
|
|
||||||
displaySize: 100,
|
|
||||||
pageSizeOptions: [1, 5, 10, 20],
|
|
||||||
displaySizeOptions: [50, 100, 200],
|
|
||||||
|
|
||||||
// ==================== 上方数据表格(可选学员队列表) ====================
|
|
||||||
teamList: [
|
|
||||||
{ xzdbm: '教学五系', xydmc: '班次0417', nj: '2016级', zy: '专业113', rs: 36, zxzt: '毕业', rwlb: '规划内', zyjs: '8-011', rxrq: '2016年8月26日', byrq: '2018年1月21日' },
|
|
||||||
{ xzdbm: '教学七系', xydmc: '班次0423', nj: '2016级', zy: '专业114', rs: 9, zxzt: '毕业', rwlb: '规划内', zyjs: '8-212(南楼)', rxrq: '2016年8月26日', byrq: '2018年1月21日' },
|
|
||||||
{ xzdbm: '教学七系', xydmc: '班次0411', nj: '2016级', zy: '专业112', rs: 38, zxzt: '毕业', rwlb: '规划内', zyjs: '6-203', rxrq: '2016年8月26日', byrq: '2018年1月21日' },
|
|
||||||
{ xzdbm: '教学七系', xydmc: '班次0405', nj: '2016级', zy: '专业111', rs: 34, zxzt: '毕业', rwlb: '规划内', zyjs: '8-007', rxrq: '2016年8月26日', byrq: '2018年1月21日' },
|
|
||||||
{ xzdbm: '教学五系', xydmc: '班次0429', nj: '2017级', zy: '专业117', rs: 43, zxzt: '毕业', rwlb: '规划内', zyjs: '6-202', rxrq: '2017年8月24日', byrq: '2019年1月21日' },
|
|
||||||
{ xzdbm: '教学五系', xydmc: '班次0431', nj: '2017级', zy: '专业118', rs: 22, zxzt: '毕业', rwlb: '规划内', zyjs: '2-403', rxrq: '2017年8月24日', byrq: '2019年1月21日' },
|
|
||||||
{ xzdbm: '教学七系', xydmc: '班次0425', nj: '2017级', zy: '专业115', rs: 19, zxzt: '毕业', rwlb: '规划内', zyjs: '2-406', rxrq: '2017年8月24日', byrq: '2019年1月21日' },
|
|
||||||
{ xzdbm: '教学七系', xydmc: '班次0432', nj: '2017级', zy: '专业119', rs: 15, zxzt: '毕业', rwlb: '规划内', zyjs: '8-009(南楼)', rxrq: '2017年8月24日', byrq: '2019年1月21日' },
|
|
||||||
{ xzdbm: '教学七系', xydmc: '班次0434', nj: '2017级', zy: '专业120', rs: 45, zxzt: '毕业', rwlb: '规划内', zyjs: '6-303', rxrq: '2017年8月24日', byrq: '2019年1月21日' },
|
|
||||||
{ xzdbm: '教学六系', xydmc: '班次0427', nj: '2017级', zy: '专业116', rs: 64, zxzt: '毕业', rwlb: '规划内', zyjs: '2-501', rxrq: '2017年8月24日', byrq: '2019年1月21日' }
|
|
||||||
],
|
|
||||||
/** 上方表格多选 */
|
|
||||||
topSelection: [],
|
|
||||||
/** 下方数据表格(已选学员队列表) */
|
|
||||||
selectedList: [],
|
|
||||||
bottomSelection: []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -208,105 +100,54 @@ export default {
|
|||||||
set(val) {
|
set(val) {
|
||||||
this.$emit('update:visible', val)
|
this.$emit('update:visible', val)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
/** 排除当前班次学期后的可选列表 */
|
||||||
|
availableList() {
|
||||||
|
const excludeBh = this.excludeBh || ''
|
||||||
|
return (this.semesterList || []).filter(item => item.bh && String(item.bh) !== String(excludeBh))
|
||||||
|
},
|
||||||
|
/** 本地过滤后的列表 */
|
||||||
|
filteredList() {
|
||||||
|
const kw = (this.queryForm.xydbh || '').trim()
|
||||||
|
if (!kw) return this.availableList
|
||||||
|
return this.availableList.filter(item => item.xydbh && String(item.xydbh).includes(kw))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
visible(val) {
|
||||||
|
if (val) {
|
||||||
|
this.selection = []
|
||||||
|
this.queryForm.xydbh = ''
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.tableRef) this.$refs.tableRef.clearSelection()
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleTopSelectionChange(rows) {
|
fmtDate(val) {
|
||||||
this.topSelection = rows
|
if (!val) return '-'
|
||||||
|
return String(val).slice(0, 10)
|
||||||
},
|
},
|
||||||
handleBottomSelectionChange(rows) {
|
xqdcLabel(val) {
|
||||||
this.bottomSelection = rows
|
if (val === 1 || val === '1') return '第1学期'
|
||||||
|
if (val === 2 || val === '2') return '第2学期'
|
||||||
|
if (val === 3 || val === '3') return '第3学期'
|
||||||
|
return val !== undefined && val !== null && val !== '' ? `第${val}学期` : '-'
|
||||||
},
|
},
|
||||||
|
handleSelectionChange(rows) {
|
||||||
// ==================== 分页控制 ====================
|
this.selection = rows
|
||||||
handleQuery() {
|
|
||||||
this.$message.success('查询(前端演示)')
|
|
||||||
},
|
},
|
||||||
handleFirst() {
|
handleQuery() {},
|
||||||
this.currentPage = 1
|
handleResetQuery() {
|
||||||
this.$message.success('已跳转首页')
|
this.queryForm.xydbh = ''
|
||||||
},
|
},
|
||||||
handlePrev() {
|
|
||||||
if (this.currentPage > 1) this.currentPage--
|
|
||||||
},
|
|
||||||
handleNext() {
|
|
||||||
this.currentPage++
|
|
||||||
},
|
|
||||||
handleLast() {
|
|
||||||
this.currentPage = this.teamList.length || 1
|
|
||||||
},
|
|
||||||
handleLocate() {
|
|
||||||
this.$message.success(`已定位到第 ${this.currentPage} 页`)
|
|
||||||
},
|
|
||||||
handleSetPageSize() {
|
|
||||||
this.$message.success(`每页显示条数已设置为 ${this.displaySize}`)
|
|
||||||
},
|
|
||||||
|
|
||||||
// ==================== 中间操作按钮 ====================
|
|
||||||
/** 加入:将上方表格选中行加入已选列表(去重) */
|
|
||||||
handleAdd() {
|
|
||||||
if (!this.topSelection.length) {
|
|
||||||
this.$message.warning('请先在上方表格选择学员队')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const existing = new Set(this.selectedList.map((r) => r.xydmc))
|
|
||||||
let added = 0
|
|
||||||
this.topSelection.forEach((r) => {
|
|
||||||
if (!existing.has(r.xydmc)) {
|
|
||||||
this.selectedList.push({ ...r, bz: '' })
|
|
||||||
added++
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (added) this.$message.success(`已加入 ${added} 个学员队`)
|
|
||||||
else this.$message.info('所选学员队已在列表中')
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 移除:将下方表格选中行移除 */
|
|
||||||
handleRemove() {
|
|
||||||
if (!this.bottomSelection.length) {
|
|
||||||
this.$message.warning('请先在下方表格选择要移除的学员队')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const removeKeys = new Set(this.bottomSelection.map((r) => r.xydmc))
|
|
||||||
this.selectedList = this.selectedList.filter((r) => !removeKeys.has(r.xydmc))
|
|
||||||
this.$message.success(`已移除 ${this.bottomSelection.length} 个学员队`)
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 清除:清空已选列表 */
|
|
||||||
handleClear() {
|
|
||||||
if (!this.selectedList.length) {
|
|
||||||
this.$message.info('已选列表为空')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.selectedList = []
|
|
||||||
this.$message.success('已清空已选列表')
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 重置:清空已选列表并重置查询条件 */
|
|
||||||
handleReset() {
|
|
||||||
this.selectedList = []
|
|
||||||
Object.assign(this.queryForm, {
|
|
||||||
zyEnabled: false, zy: '专业219',
|
|
||||||
njEnabled: true, nj: '',
|
|
||||||
zxztEnabled: false, zxzt: '毕业',
|
|
||||||
xydmcEnabled: true, xydmc: '',
|
|
||||||
rwlbEnabled: false, rwlb: '规划内'
|
|
||||||
})
|
|
||||||
this.currentPage = 1
|
|
||||||
this.$message.success('已重置')
|
|
||||||
},
|
|
||||||
|
|
||||||
// ==================== 底部按钮 ====================
|
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
if (!this.selectedList.length) {
|
if (!this.selection.length) {
|
||||||
this.$message.warning('请先选择要应用的学员队')
|
this.$message.warning('请先勾选目标班次学期')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$emit('confirm', this.selectedList.slice())
|
this.$emit('confirm', this.selection.slice())
|
||||||
this.dialogVisible = false
|
|
||||||
this.$message.success(`选定区域设置已应用于 ${this.selectedList.length} 个班次`)
|
|
||||||
},
|
|
||||||
handleCancel() {
|
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -319,40 +160,34 @@ export default {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
|
||||||
// ========== 1. 查询条件区域 ==========
|
// ========== 操作说明 ==========
|
||||||
|
.note-bar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 8px 12px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #1e6fff;
|
||||||
|
background: #ecf5ff;
|
||||||
|
border: 1px solid #d9ecff;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== 查询条件区域 ==========
|
||||||
.query-panel {
|
.query-panel {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: 1px solid #ebeef5;
|
border: 1px solid #ebeef5;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 12px 16px 8px;
|
padding: 10px 12px 2px;
|
||||||
|
|
||||||
.query-form {
|
.query-form {
|
||||||
.check-field {
|
::v-deep .el-form-item {
|
||||||
display: flex;
|
margin-bottom: 8px;
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.pager-row {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 8px;
|
|
||||||
padding-top: 10px;
|
|
||||||
border-top: 1px solid #ebeef5;
|
|
||||||
margin-top: 4px;
|
|
||||||
|
|
||||||
.pager-label {
|
|
||||||
font-size: 13px;
|
|
||||||
color: #606266;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 2/4. 表格区域 ==========
|
// ========== 表格区域 ==========
|
||||||
.table-panel {
|
.table-panel {
|
||||||
position: relative;
|
position: relative;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
@@ -370,69 +205,19 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 3. 中间操作按钮区域 ==========
|
// ========== 底部按钮区域 ==========
|
||||||
.mid-actions {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 8px;
|
|
||||||
|
|
||||||
.mid-label {
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #303133;
|
|
||||||
white-space: nowrap;
|
|
||||||
margin-right: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 5. 底部按钮区域 ==========
|
|
||||||
.footer-actions {
|
.footer-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
padding-top: 12px;
|
padding-top: 12px;
|
||||||
border-top: 1px solid #ebeef5;
|
border-top: 1px solid #ebeef5;
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 银灰色 / 蓝色边框按钮 ==========
|
.selected-count {
|
||||||
.gray-btn {
|
flex: 1;
|
||||||
min-width: 70px;
|
font-size: 13px;
|
||||||
height: 28px;
|
color: #606266;
|
||||||
padding: 0 14px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #000;
|
|
||||||
background: linear-gradient(180deg, #fdfdfd 0%, #ececec 50%, #dcdcdc 100%);
|
|
||||||
border: 1px solid #7a7a7a;
|
|
||||||
border-radius: 2px;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: linear-gradient(180deg, #ffffff 0%, #f4f4f4 50%, #e6e6e6 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
background: #c8c8c8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.blue-btn {
|
|
||||||
min-width: 110px;
|
|
||||||
height: 28px;
|
|
||||||
padding: 0 14px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #1e6fff;
|
|
||||||
background: #ecf5ff;
|
|
||||||
border: 1px solid #1e6fff;
|
|
||||||
border-radius: 2px;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: #d9ecff;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
background: #c6e2ff;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,369 +1,591 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container shift-semester-page">
|
<div class="app-container shift-semester-page">
|
||||||
<!-- ==================== 1. 学年学期标题 ==================== -->
|
<!-- ==================== 页面标题 ==================== -->
|
||||||
<div class="list-title">{{ semesterName }}</div>
|
<div class="page-title">班次学期信息管理</div>
|
||||||
|
|
||||||
<!-- ==================== 2. 校历 / 预设日期信息区 ==================== -->
|
<!-- ==================== 1. 查询条件区域 ==================== -->
|
||||||
<el-card shadow="never" class="search-card">
|
<el-card shadow="never" class="search-card">
|
||||||
<el-form class="search-form">
|
<el-form :inline="true" :model="searchForm" class="search-form">
|
||||||
<div class="date-group">
|
<el-form-item label="班次编号">
|
||||||
<span class="date-group-label">校历</span>
|
<el-input
|
||||||
<el-form-item label="开学日期">
|
v-model="searchForm.xydbh"
|
||||||
<el-date-picker v-model="semester.kxrq" type="date" format="yyyy年M月d日" value-format="yyyy-MM-dd" style="width: 160px" />
|
placeholder="请输入班次编号(模糊)"
|
||||||
|
clearable
|
||||||
|
style="width: 220px"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="结束日期">
|
<el-form-item label="年度">
|
||||||
<el-date-picker v-model="semester.jsrq" type="date" format="yyyy年M月d日" value-format="yyyy-MM-dd" style="width: 160px" />
|
<el-select v-model="filterYear" placeholder="全部年度" clearable style="width: 140px" @change="handleYearChange">
|
||||||
|
<el-option v-for="y in yearFilterOptions" :key="y" :label="`${y}年`" :value="y" />
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="学期周数">
|
<el-form-item>
|
||||||
<el-input-number v-model="semester.weeks" :min="1" controls-position="right" style="width: 90px" />
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
|
||||||
<div class="date-group">
|
|
||||||
<span class="date-group-label">预设</span>
|
|
||||||
<el-form-item label="开学日期">
|
|
||||||
<el-date-picker v-model="preset.kxrq" type="date" format="yyyy年M月d日" value-format="yyyy-MM-dd" style="width: 160px" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="结束日期">
|
|
||||||
<el-date-picker v-model="preset.jsrq" type="date" format="yyyy年M月d日" value-format="yyyy-MM-dd" style="width: 160px" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="学期周数">
|
|
||||||
<el-input-number v-model="preset.weeks" :min="1" controls-position="right" style="width: 90px" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-button class="absorb-btn" type="primary" plain @click="handleAbsorbDate">吸取日期</el-button>
|
|
||||||
</div>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- ==================== 3. 工具栏按钮区 ==================== -->
|
<!-- ==================== 2. 工具栏按钮区 ==================== -->
|
||||||
<div class="list-toolbar">
|
<div class="list-toolbar">
|
||||||
<div class="left-group">
|
<div class="left-group">
|
||||||
<!-- 新添:下拉列出可新建学期信息的班次 -->
|
<el-button type="primary" icon="el-icon-plus" @click="handleBatchAdd">批量创建班次学期</el-button>
|
||||||
<el-dropdown trigger="click" @command="handleNewCommand">
|
<el-button type="primary" plain icon="el-icon-document-add" @click="handleAdd">新增</el-button>
|
||||||
<el-button type="primary">
|
<el-button type="primary" plain icon="el-icon-edit" :disabled="!currentRow" @click="handleEdit">编辑</el-button>
|
||||||
<i class="el-icon-plus"></i>
|
<el-button type="danger" plain icon="el-icon-delete" :disabled="!selection.length" @click="handleDelete">删除所选</el-button>
|
||||||
<span>新添</span>
|
<el-button type="primary" plain icon="el-icon-date" :disabled="!selection.length" @click="handleQuickSetDates">快速设定学期日期</el-button>
|
||||||
<i class="el-icon-arrow-down el-icon--right"></i>
|
<el-button type="primary" plain icon="el-icon-notebook-2" :disabled="!selection.length" @click="handleSetJxrw">批量设置教学任务</el-button>
|
||||||
</el-button>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown" class="new-class-menu">
|
<div class="right-group">
|
||||||
<el-dropdown-item v-for="item in newableClasses" :key="item.bc" :command="item">
|
<el-button type="success" plain icon="el-icon-calendar" :disabled="!currentRow" @click="handleEditCalendar">编辑班历</el-button>
|
||||||
{{ item.bc }}({{ item.xkzy }}、{{ item.nj }})
|
|
||||||
</el-dropdown-item>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
|
|
||||||
<el-button type="primary" plain @click="handleAction('编辑')">编辑</el-button>
|
|
||||||
<el-button type="primary" plain @click="handleQuickSetDates">快速设定学期日期</el-button>
|
|
||||||
<el-button type="danger" @click="handleAction('删除')">删除</el-button>
|
|
||||||
<el-button type="primary" plain @click="handleEditCalendar">编辑班历</el-button>
|
|
||||||
<el-button type="primary" plain @click="handleAction('自动生成教学计划')">自动生成教学计划</el-button>
|
|
||||||
<el-button type="primary" plain @click="handleAction('教学计划管理')">教学计划管理</el-button>
|
|
||||||
|
|
||||||
<!-- 序号排序:带下拉箭头,点击弹出排序方式 -->
|
|
||||||
<el-dropdown trigger="click" @command="handleSortCommand">
|
|
||||||
<el-button type="primary" plain>
|
|
||||||
<span>{{ sortLabel }}</span>
|
|
||||||
<i class="el-icon-arrow-down el-icon--right"></i>
|
|
||||||
</el-button>
|
|
||||||
<el-dropdown-menu slot="dropdown">
|
|
||||||
<el-dropdown-item command="xh">序号排序</el-dropdown-item>
|
|
||||||
<el-dropdown-item command="bw">波次排序</el-dropdown-item>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
|
|
||||||
<el-button type="primary" plain @click="handleMerge">预设合班</el-button>
|
|
||||||
<el-button type="primary" plain @click="handleAction('预设拆班')">预设拆班</el-button>
|
|
||||||
<el-button type="primary" plain @click="handlePeidangEdit">配档编辑</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ==================== 4. 班次学期信息列表 ==================== -->
|
<!-- ==================== 3. 班次学期信息列表 ==================== -->
|
||||||
<el-card shadow="never" class="table-card">
|
<el-card shadow="never" class="table-card">
|
||||||
<el-table
|
<el-table
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
|
v-loading="loading"
|
||||||
:data="displayData"
|
:data="displayData"
|
||||||
border
|
border
|
||||||
stripe
|
stripe
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
:span-method="spanMethod"
|
size="small"
|
||||||
:row-class-name="rowClassName"
|
|
||||||
:header-cell-class-name="headerCellClassName"
|
|
||||||
max-height="480"
|
max-height="480"
|
||||||
class="class-table"
|
class="class-table"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
>
|
>
|
||||||
<el-table-column prop="xzdw" label="行政队别" width="90" align="center" show-overflow-tooltip />
|
<template slot="empty">
|
||||||
<el-table-column prop="xh" label="班次序号" width="70" align="center" />
|
<span>无数据!</span>
|
||||||
<el-table-column prop="bc" label="班级" width="70" align="center" show-overflow-tooltip />
|
</template>
|
||||||
<el-table-column prop="rs" label="人数" width="55" align="center" show-overflow-tooltip />
|
<el-table-column type="selection" width="44" align="center" />
|
||||||
<el-table-column prop="nj" label="年级" width="85" align="center" show-overflow-tooltip />
|
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||||
<el-table-column prop="xkzy" label="学科专业" width="85" align="center" show-overflow-tooltip />
|
<el-table-column prop="xydbh" label="班次编号" min-width="150" align="left" header-align="center" show-overflow-tooltip />
|
||||||
<el-table-column prop="kxrq" label="开学日期" width="90" align="center" show-overflow-tooltip />
|
<el-table-column prop="nd" label="年度" width="80" align="center" show-overflow-tooltip />
|
||||||
<el-table-column prop="jsrq" label="结束日期" width="90" align="center" show-overflow-tooltip />
|
<el-table-column label="学期第次" width="90" align="center">
|
||||||
<el-table-column prop="xqcc" label="学期第次" width="80" align="center" show-overflow-tooltip />
|
<template slot-scope="{ row }">{{ xqdcLabel(row.xqdc) }}</template>
|
||||||
<el-table-column prop="zyjs" label="专用教室" width="80" align="center" show-overflow-tooltip />
|
</el-table-column>
|
||||||
<el-table-column prop="jxrw" label="教学任务" min-width="160" align="left" header-align="center" show-overflow-tooltip />
|
<el-table-column prop="kxrq" label="开学日期" width="110" align="center" :formatter="fmtDate" />
|
||||||
<el-table-column prop="zs" label="周数" width="55" align="center" show-overflow-tooltip />
|
<el-table-column prop="jsrq" label="结束日期" width="110" align="center" :formatter="fmtDate" />
|
||||||
<el-table-column prop="kcrws" label="总课程数" width="80" align="center" show-overflow-tooltip />
|
<el-table-column prop="zyjsbh" label="专用教室" width="100" align="center" show-overflow-tooltip />
|
||||||
<el-table-column prop="kczs" label="总课时数" width="80" align="center" show-overflow-tooltip />
|
<el-table-column label="教学任务" min-width="160" align="left" header-align="center" show-overflow-tooltip>
|
||||||
<el-table-column label="周学时" width="80" align="center">
|
<template slot-scope="{ row }">{{ taskName(row.jxrwbh) }}</template>
|
||||||
<template slot-scope="{ row }">{{ row.zxs.toFixed(2) }}</template>
|
</el-table-column>
|
||||||
|
<el-table-column label="开放教员排课" width="110" align="center">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<el-tag v-if="Number(row.kfjypk) === 1" type="success" size="small">开放</el-tag>
|
||||||
|
<el-tag v-else type="info" size="small">关闭</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="bz" label="备注" min-width="120" align="left" header-align="center" show-overflow-tooltip />
|
||||||
|
<el-table-column label="操作" width="200" align="center" fixed="right">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<el-button type="text" size="small" @click="handleEdit(row)">编辑</el-button>
|
||||||
|
<el-button type="text" size="small" @click="handleEditCalendar(row)">班历</el-button>
|
||||||
|
<el-button type="text" size="small" class="text-danger" @click="handleDeleteRow(row)">删除</el-button>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="zxf" label="总学分" width="70" align="center" show-overflow-tooltip />
|
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
|
<el-pagination
|
||||||
|
class="list-pagination"
|
||||||
|
:current-page="pageNum"
|
||||||
|
:page-size="pageSize"
|
||||||
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
|
:total="total"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handlePageChange"
|
||||||
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- ==================== 教学班次学期信息明细弹窗(新添) ==================== -->
|
<!-- ==================== 班次学期新增/编辑弹窗 ==================== -->
|
||||||
<ClassSemesterDetailDialog
|
<ClassSemesterDetailDialog
|
||||||
:visible="detailVisible"
|
:visible="detailVisible"
|
||||||
:class-info="selectedNewClass"
|
:mode="detailMode"
|
||||||
:semester-name="semesterName"
|
:semester="detailSemester"
|
||||||
|
:team-info="detailTeamInfo"
|
||||||
|
:year-options="yearOptions"
|
||||||
|
:task-options="taskOptions"
|
||||||
@update:visible="val => detailVisible = val"
|
@update:visible="val => detailVisible = val"
|
||||||
@confirm="handleDetailConfirm"
|
@submit="handleDetailSubmit"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- ==================== 班历设置弹窗(编辑班历) ==================== -->
|
<!-- ==================== 班历管理弹窗 ==================== -->
|
||||||
<ClassCalendarDialog
|
<ClassCalendarDialog
|
||||||
:visible="calendarVisible"
|
:visible="calendarVisible"
|
||||||
:bc="currentRow ? currentRow.bc : ''"
|
:semester="calendarSemester"
|
||||||
:semester-name="semesterName"
|
:semester-options="semesterOptions"
|
||||||
@update:visible="val => calendarVisible = val"
|
@update:visible="val => calendarVisible = val"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- ==================== 预设合班弹窗 ==================== -->
|
<!-- ==================== 批量创建班次学期弹窗 ==================== -->
|
||||||
<ClassTeamSelectDialog
|
<el-dialog
|
||||||
:visible="teamVisible"
|
:visible="batchAddVisible"
|
||||||
@update:visible="val => teamVisible = val"
|
title="批量创建班次学期"
|
||||||
@confirm="handleTeamConfirm"
|
width="520px"
|
||||||
/>
|
:close-on-click-modal="false"
|
||||||
|
@update:visible="val => batchAddVisible = val"
|
||||||
|
>
|
||||||
|
<el-form ref="batchAddFormRef" :model="batchAddForm" :rules="batchAddRules" label-width="100px">
|
||||||
|
<el-form-item label="年度" prop="nd">
|
||||||
|
<el-select v-model="batchAddForm.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="xqdc">
|
||||||
|
<el-select v-model="batchAddForm.xqdc" placeholder="请选择学期" style="width: 100%">
|
||||||
|
<el-option label="春季学期" value="春季学期" />
|
||||||
|
<el-option label="夏季学期" value="夏季学期" />
|
||||||
|
<el-option label="秋季学期" value="秋季学期" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开始日期" prop="startTime">
|
||||||
|
<el-date-picker v-model="batchAddForm.startTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择开始日期" style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="结束日期" prop="endTime">
|
||||||
|
<el-date-picker v-model="batchAddForm.endTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择结束日期" style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button @click="batchAddVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="saving" @click="handleBatchAddSubmit">确定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<!-- ==================== 班次学期配档编辑弹窗 ==================== -->
|
<!-- ==================== 快速设定学期日期弹窗 ==================== -->
|
||||||
<PeidangEditDialog
|
<el-dialog
|
||||||
:visible="peidangVisible"
|
:visible="dateRangeVisible"
|
||||||
:semester-name="semesterName"
|
title="快速设定学期日期"
|
||||||
:class-label="peidangClassLabel"
|
width="480px"
|
||||||
@update:visible="val => peidangVisible = val"
|
:close-on-click-modal="false"
|
||||||
@confirm="handleAction('配档编辑')"
|
@update:visible="val => dateRangeVisible = val"
|
||||||
|
>
|
||||||
|
<el-alert
|
||||||
|
type="info"
|
||||||
|
:closable="false"
|
||||||
|
show-icon
|
||||||
|
:title="`将对选中的 ${selection.length} 条班次学期统一设定开学/结束日期`"
|
||||||
|
style="margin-bottom: 16px"
|
||||||
/>
|
/>
|
||||||
|
<el-form ref="dateRangeFormRef" :model="dateRangeForm" :rules="dateRangeRules" label-width="100px">
|
||||||
|
<el-form-item label="开学日期" prop="kxrq">
|
||||||
|
<el-date-picker v-model="dateRangeForm.kxrq" type="date" value-format="yyyy-MM-dd" placeholder="请选择开学日期" style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="结束日期" prop="jsrq">
|
||||||
|
<el-date-picker v-model="dateRangeForm.jsrq" type="date" value-format="yyyy-MM-dd" placeholder="请选择结束日期" style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button @click="dateRangeVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="saving" @click="handleDateRangeSubmit">确定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- ==================== 批量设置教学任务弹窗 ==================== -->
|
||||||
|
<el-dialog
|
||||||
|
:visible="jxrwVisible"
|
||||||
|
title="批量设置教学任务"
|
||||||
|
width="480px"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
@update:visible="val => jxrwVisible = val"
|
||||||
|
>
|
||||||
|
<el-alert
|
||||||
|
type="info"
|
||||||
|
:closable="false"
|
||||||
|
show-icon
|
||||||
|
:title="`将对选中的 ${selection.length} 条班次学期统一设置教学任务`"
|
||||||
|
style="margin-bottom: 16px"
|
||||||
|
/>
|
||||||
|
<el-form ref="jxrwFormRef" :model="jxrwForm" :rules="jxrwRules" label-width="100px">
|
||||||
|
<el-form-item label="教学任务" prop="jxrwbh">
|
||||||
|
<el-select v-model="jxrwForm.jxrwbh" placeholder="请选择教学任务" filterable style="width: 100%">
|
||||||
|
<el-option v-for="opt in taskOptions" :key="opt.bh" :label="opt.rwmc" :value="opt.bh" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button @click="jxrwVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="saving" @click="handleJxrwSubmit">确定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ClassSemesterDetailDialog from './ClassSemesterDetailDialog.vue'
|
import ClassSemesterDetailDialog from './ClassSemesterDetailDialog.vue'
|
||||||
import ClassCalendarDialog from './ClassCalendarDialog.vue'
|
import ClassCalendarDialog from './ClassCalendarDialog.vue'
|
||||||
import ClassTeamSelectDialog from './ClassTeamSelectDialog.vue'
|
import { listSemester, allSemester, addSemester, updateSemester, delSemester, batchDeleteSemester, batchUpdateDateRange, batchUpdateJxrwbh, batchAddFromElective } from '@/api/studentRecords/semester'
|
||||||
import PeidangEditDialog from './PeidangEditDialog.vue'
|
import { listAllSemester } from '@/api/teachBusiness/semester'
|
||||||
|
import { listTeachingTask } from '@/api/teachBusiness/teachingTask'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ShiftSemester',
|
name: 'ShiftSemester',
|
||||||
components: {
|
components: {
|
||||||
ClassSemesterDetailDialog,
|
ClassSemesterDetailDialog,
|
||||||
ClassCalendarDialog,
|
ClassCalendarDialog
|
||||||
ClassTeamSelectDialog,
|
|
||||||
PeidangEditDialog
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// ==================== 1. 学年学期标题区 ====================
|
loading: false,
|
||||||
semesterName: '2017-2018学年第一学期',
|
saving: false,
|
||||||
|
|
||||||
// ==================== 2. 校历 / 预设日期信息区 ====================
|
// ==================== 查询条件 ====================
|
||||||
/** 校历日期 */
|
searchForm: { xydbh: '' },
|
||||||
semester: {
|
filterYear: undefined,
|
||||||
kxrq: '2017-07-08', // 校历开学日期
|
yearFilterOptions: [],
|
||||||
jsrq: '2018-02-11', // 校历结束日期
|
|
||||||
weeks: 32 // 学期周数
|
|
||||||
},
|
|
||||||
/** 预设(班次)日期 */
|
|
||||||
preset: {
|
|
||||||
kxrq: '2017-07-08', // 预设开学日期
|
|
||||||
jsrq: '2018-02-11', // 预设结束日期
|
|
||||||
weeks: 32 // 预设学期周数
|
|
||||||
},
|
|
||||||
|
|
||||||
// ==================== 3. 工具栏按钮区 ====================
|
// ==================== 列表与分页 ====================
|
||||||
/** 可新建学期信息的班次 */
|
tableData: [],
|
||||||
newableClasses: [
|
selection: [],
|
||||||
{ bc: '班次0633', xkzy: '专业209', nj: '2017级' },
|
|
||||||
{ bc: '班次0634', xkzy: '专业209', nj: '2017级' },
|
|
||||||
{ bc: '班次0709', xkzy: '专业205', nj: '2017级' },
|
|
||||||
{ bc: '班次0710', xkzy: '专业205', nj: '2017级' },
|
|
||||||
{ bc: '班次0901', xkzy: '专业301', nj: '2017级' }
|
|
||||||
],
|
|
||||||
|
|
||||||
/** 教学班次学期信息明细弹窗(新添) */
|
|
||||||
detailVisible: false,
|
|
||||||
selectedNewClass: null,
|
|
||||||
|
|
||||||
/** 班历设置弹窗(编辑班历) */
|
|
||||||
calendarVisible: false,
|
|
||||||
currentRow: null,
|
currentRow: null,
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
|
||||||
/** 预设合班弹窗 */
|
// ==================== 下拉数据 ====================
|
||||||
teamVisible: false,
|
/** 年度下拉(来自 /semester/all) */
|
||||||
|
yearOptions: [],
|
||||||
|
/** 教学任务下拉({ bh, rwmc }) */
|
||||||
|
taskOptions: [],
|
||||||
|
/** 全部班次学期(用于班历复制目标选择) */
|
||||||
|
semesterOptions: [],
|
||||||
|
|
||||||
/** 配档编辑弹窗(班次学期配档)显示状态 */
|
// ==================== 班次学期新增/编辑 ====================
|
||||||
peidangVisible: false,
|
detailVisible: false,
|
||||||
/** 配档编辑弹窗标题(班次学期配档——...——班次) */
|
detailMode: 'add',
|
||||||
peidangClassLabel: '',
|
detailSemester: null,
|
||||||
|
detailTeamInfo: null,
|
||||||
|
|
||||||
/** 排序方式:xh=序号排序 / bw=波次排序 */
|
// ==================== 班历管理 ====================
|
||||||
sortType: 'xh',
|
calendarVisible: false,
|
||||||
|
calendarSemester: null,
|
||||||
|
|
||||||
/** 波次背景色(同一波次使用同一颜色连在一起显示) */
|
// ==================== 批量创建班次学期 ====================
|
||||||
bwColors: [
|
batchAddVisible: false,
|
||||||
'#e3f2fd', // 浅蓝
|
batchAddForm: { nd: undefined, xqdc: '', startTime: '', endTime: '' },
|
||||||
'#e8f5e9', // 浅绿
|
batchAddRules: {
|
||||||
'#fff8e1', // 浅黄
|
nd: [{ required: true, message: '请选择年度', trigger: 'change' }],
|
||||||
'#f3e5f5', // 浅紫
|
xqdc: [{ required: true, message: '请选择学期', trigger: 'change' }],
|
||||||
'#e0f2f1' // 浅青
|
startTime: [{ required: true, message: '请选择开始日期', trigger: 'change' }],
|
||||||
],
|
endTime: [{ required: true, message: '请选择结束日期', trigger: 'change' }]
|
||||||
|
},
|
||||||
|
|
||||||
// ==================== 4. 班次学期信息列表 ====================
|
// ==================== 快速设定学期日期 ====================
|
||||||
tableData: [
|
dateRangeVisible: false,
|
||||||
// ---- 学员1队(跨 10 行) ----
|
dateRangeForm: { kxrq: '', jsrq: '' },
|
||||||
{ xzdw: '学员1队', xh: 1, bw: 1, bc: '0150', rs: 40, nj: '2017级秋', xkzy: '专业5', kxrq: '2017-09-03', jsrq: '2018-02-05', xqcc: '第1学期', zyjs: '1-307', jxrw: '2017年下半年教学任务', zs: 24, kcrws: 14, kczs: 512, zxs: 21.33, zxf: 40 },
|
dateRangeRules: {
|
||||||
{ xzdw: '学员1队', xh: 2, bw: 1, bc: '0151', rs: 40, nj: '2017级秋', xkzy: '专业5', kxrq: '2017-09-03', jsrq: '2018-02-05', xqcc: '第1学期', zyjs: '1-307', jxrw: '2017年下半年教学任务', zs: 24, kcrws: 14, kczs: 512, zxs: 21.33, zxf: 40 },
|
kxrq: [{ required: true, message: '请选择开学日期', trigger: 'change' }],
|
||||||
{ xzdw: '学员1队', xh: 3, bw: 1, bc: '0152', rs: 40, nj: '2017级秋', xkzy: '专业5', kxrq: '2017-09-03', jsrq: '2018-02-05', xqcc: '第1学期', zyjs: '1-308', jxrw: '2017年下半年教学任务', zs: 24, kcrws: 14, kczs: 512, zxs: 21.33, zxf: 40 },
|
jsrq: [{ required: true, message: '请选择结束日期', trigger: 'change' }]
|
||||||
{ xzdw: '学员1队', xh: 4, bw: 1, bc: '0153', rs: 40, nj: '2017级秋', xkzy: '专业5', kxrq: '2017-09-03', jsrq: '2018-02-05', xqcc: '第1学期', zyjs: '1-308', jxrw: '2017年下半年教学任务', zs: 24, kcrws: 14, kczs: 512, zxs: 21.33, zxf: 40 },
|
},
|
||||||
{ xzdw: '学员1队', xh: 5, bw: 1, bc: '0154', rs: 42, nj: '2017级秋', xkzy: '专业5', kxrq: '2017-09-03', jsrq: '2018-02-05', xqcc: '第1学期', zyjs: '1-309', jxrw: '2017年下半年教学任务', zs: 24, kcrws: 14, kczs: 528, zxs: 22.0, zxf: 42 },
|
|
||||||
{ xzdw: '学员1队', xh: 6, bw: 1, bc: '0155', rs: 42, nj: '2017级秋', xkzy: '专业5', kxrq: '2017-09-03', jsrq: '2018-02-05', xqcc: '第1学期', zyjs: '1-309', jxrw: '2017年下半年教学任务', zs: 24, kcrws: 14, kczs: 528, zxs: 22.0, zxf: 42 },
|
// ==================== 批量设置教学任务 ====================
|
||||||
{ xzdw: '学员1队', xh: 7, bw: 1, bc: '0156', rs: 42, nj: '2017级秋', xkzy: '专业5', kxrq: '2017-09-03', jsrq: '2018-02-05', xqcc: '第1学期', zyjs: '1-310', jxrw: '2017年下半年教学任务', zs: 24, kcrws: 15, kczs: 540, zxs: 22.5, zxf: 43 },
|
jxrwVisible: false,
|
||||||
{ xzdw: '学员1队', xh: 8, bw: 1, bc: '0157', rs: 38, nj: '2017级秋', xkzy: '专业5', kxrq: '2017-09-03', jsrq: '2018-02-05', xqcc: '第1学期', zyjs: '1-310', jxrw: '2017年下半年教学任务', zs: 24, kcrws: 15, kczs: 540, zxs: 22.5, zxf: 43 },
|
jxrwForm: { jxrwbh: undefined },
|
||||||
{ xzdw: '学员1队', xh: 9, bw: 1, bc: '0158', rs: 38, nj: '2017级秋', xkzy: '专业5', kxrq: '2017-09-03', jsrq: '2018-02-05', xqcc: '第1学期', zyjs: '1-311', jxrw: '2017年下半年教学任务', zs: 24, kcrws: 14, kczs: 512, zxs: 21.33, zxf: 40 },
|
jxrwRules: {
|
||||||
{ xzdw: '学员1队', xh: 10, bw: 1, bc: '0159', rs: 38, nj: '2017级秋', xkzy: '专业5', kxrq: '2017-09-03', jsrq: '2018-02-05', xqcc: '第1学期', zyjs: '1-311', jxrw: '2017年下半年教学任务', zs: 24, kcrws: 14, kczs: 512, zxs: 21.33, zxf: 40 },
|
jxrwbh: [{ required: true, message: '请选择教学任务', trigger: 'change' }]
|
||||||
// ---- 教学五系(跨 2 行) ----
|
}
|
||||||
{ xzdw: '教学五系', xh: 11, bw: 2, bc: '0201', rs: 30, nj: '2016级', xkzy: '专业113', kxrq: '2017-08-24', jsrq: '2018-02-05', xqcc: '第3学期', zyjs: '6-202', jxrw: '2017年下半年教学任务', zs: 25, kcrws: 12, kczs: 480, zxs: 19.2, zxf: 36 },
|
|
||||||
{ xzdw: '教学五系', xh: 12, bw: 2, bc: '0202', rs: 30, nj: '2016级', xkzy: '专业113', kxrq: '2017-08-24', jsrq: '2018-02-05', xqcc: '第3学期', zyjs: '6-202', jxrw: '2017年下半年教学任务', zs: 25, kcrws: 12, kczs: 480, zxs: 19.2, zxf: 36 },
|
|
||||||
// ---- 教学七系(跨 3 行) ----
|
|
||||||
{ xzdw: '教学七系', xh: 13, bw: 3, bc: '0203', rs: 36, nj: '2016级', xkzy: '专业115', kxrq: '2017-08-24', jsrq: '2018-02-05', xqcc: '第3学期', zyjs: '8-007', jxrw: '2017年下半年教学任务', zs: 25, kcrws: 13, kczs: 520, zxs: 20.8, zxf: 38 },
|
|
||||||
{ xzdw: '教学七系', xh: 14, bw: 3, bc: '0204', rs: 36, nj: '2016级', xkzy: '专业115', kxrq: '2017-08-24', jsrq: '2018-02-05', xqcc: '第3学期', zyjs: '8-007', jxrw: '2017年下半年教学任务', zs: 25, kcrws: 13, kczs: 520, zxs: 20.8, zxf: 38 },
|
|
||||||
{ xzdw: '教学七系', xh: 15, bw: 3, bc: '0205', rs: 36, nj: '2016级', xkzy: '专业115', kxrq: '2017-08-24', jsrq: '2018-02-05', xqcc: '第3学期', zyjs: '8-008', jxrw: '2017年下半年教学任务', zs: 25, kcrws: 13, kczs: 520, zxs: 20.8, zxf: 38 }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
/** 排序方式标签 */
|
/** 本地按年度过滤(后端 /semester/list 仅支持 xydbh 模糊筛选) */
|
||||||
sortLabel() {
|
|
||||||
return this.sortType === 'bw' ? '波次排序' : '序号排序'
|
|
||||||
},
|
|
||||||
/** 根据排序方式展示列表:波次排序时按波次分组连排 */
|
|
||||||
displayData() {
|
displayData() {
|
||||||
if (this.sortType === 'bw') {
|
if (!this.filterYear) return this.tableData
|
||||||
return [...this.tableData].sort((a, b) => a.bw - b.bw || a.xh - b.xh)
|
return this.tableData.filter(item => String(item.nd) === String(this.filterYear))
|
||||||
}
|
|
||||||
return this.tableData
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 默认选中第一行 班次0150(高亮)
|
this.loadYearOptions()
|
||||||
this.$nextTick(() => {
|
this.loadTaskOptions()
|
||||||
if (this.tableData.length && this.$refs.tableRef) {
|
this.loadSemesterOptions()
|
||||||
this.$refs.tableRef.setCurrentRow(this.tableData[0])
|
this.loadList()
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// ==================== 2. 校历 / 预设日期 ====================
|
/* ==================== 格式化 ==================== */
|
||||||
/** 吸取日期:将校历日期复制到预设日期 */
|
fmtDate(val) {
|
||||||
handleAbsorbDate() {
|
if (!val) return '-'
|
||||||
this.preset.kxrq = this.semester.kxrq
|
return String(val).slice(0, 10)
|
||||||
this.preset.jsrq = this.semester.jsrq
|
|
||||||
this.preset.weeks = this.semester.weeks
|
|
||||||
this.$message.success('已吸取校历日期到预设日期')
|
|
||||||
},
|
},
|
||||||
|
xqdcLabel(val) {
|
||||||
/** 快速设定学期日期 */
|
if (val === 1 || val === '1') return '第1学期'
|
||||||
handleQuickSetDates() {
|
if (val === 2 || val === '2') return '第2学期'
|
||||||
this.$message.success('快速设定学期日期(前端演示)')
|
if (val === 3 || val === '3') return '第3学期'
|
||||||
|
return val !== undefined && val !== null && val !== '' ? `第${val}学期` : '-'
|
||||||
},
|
},
|
||||||
|
/** 教学任务编号 → 名称 */
|
||||||
// ==================== 3. 工具栏按钮区 ====================
|
taskName(bh) {
|
||||||
/** 通用操作(前端演示) */
|
if (!bh) return '-'
|
||||||
handleAction(name) {
|
const opt = this.taskOptions.find(o => o.bh === bh)
|
||||||
this.$message.success(`${name}(前端演示)`)
|
return opt ? opt.rwmc : bh
|
||||||
},
|
},
|
||||||
|
cleanPayload(obj) {
|
||||||
/** 新添:从下拉选择班次后打开明细弹窗 */
|
const payload = {}
|
||||||
handleNewCommand(item) {
|
Object.keys(obj).forEach(key => {
|
||||||
if (typeof item === 'string') return
|
const value = obj[key]
|
||||||
this.selectedNewClass = item
|
if (value !== '' && value !== null && value !== undefined) {
|
||||||
this.detailVisible = true
|
payload[key] = value
|
||||||
},
|
|
||||||
|
|
||||||
handleDetailConfirm() {
|
|
||||||
this.$message.success('已创建班次学期信息(前端演示)')
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 编辑班历 */
|
|
||||||
handleEditCalendar() {
|
|
||||||
if (!this.currentRow) {
|
|
||||||
this.$message.warning('请先在列表中选择一条班次学期信息')
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
this.calendarVisible = true
|
})
|
||||||
|
return payload
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 预设合班 */
|
/* ==================== 下拉数据加载 ==================== */
|
||||||
handleMerge() {
|
loadYearOptions() {
|
||||||
this.teamVisible = true
|
listAllSemester().then(res => {
|
||||||
|
const list = (res && res.data) || []
|
||||||
|
const years = list.map(x => x.nd).filter(v => v !== undefined && v !== null && v !== '')
|
||||||
|
this.yearOptions = [...new Set(years)].sort((a, b) => Number(a) - Number(b))
|
||||||
|
}).catch(() => {
|
||||||
|
this.yearOptions = []
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleTeamConfirm(teams) {
|
loadTaskOptions() {
|
||||||
this.$message.success(`预设合班已应用于 ${teams.length} 个班次(前端演示)`)
|
listTeachingTask({ pageNum: 1, pageSize: 1000 }).then(res => {
|
||||||
|
const list = (res && res.data && res.data.records) || []
|
||||||
|
this.taskOptions = list.filter(o => o.bh)
|
||||||
|
}).catch(() => {
|
||||||
|
this.taskOptions = []
|
||||||
|
})
|
||||||
|
},
|
||||||
|
loadSemesterOptions() {
|
||||||
|
allSemester().then(res => {
|
||||||
|
this.semesterOptions = (res && res.data) || []
|
||||||
|
}).catch(() => {
|
||||||
|
this.semesterOptions = []
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 配档编辑:选择班次后打开班次学期配档窗口 */
|
/* ==================== 列表加载 ==================== */
|
||||||
handlePeidangEdit() {
|
loadList() {
|
||||||
if (!this.currentRow) {
|
this.loading = true
|
||||||
this.$message.warning('请先在列表中选择一个班次')
|
const query = this.cleanPayload({
|
||||||
return
|
pageNum: this.pageNum,
|
||||||
}
|
pageSize: this.pageSize,
|
||||||
const row = this.currentRow
|
xydbh: this.searchForm.xydbh
|
||||||
this.peidangClassLabel = `${row.xzdw}${row.nj}${row.xkzy}班次${row.bc}`
|
})
|
||||||
this.peidangVisible = true
|
listSemester(query).then(res => {
|
||||||
|
const data = (res && res.data) || {}
|
||||||
|
this.tableData = data.records || []
|
||||||
|
this.total = data.total || 0
|
||||||
|
this.buildYearFilterOptions()
|
||||||
|
this.loading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.tableData = []
|
||||||
|
this.total = 0
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
/** 本地年度过滤下拉(从当前数据动态生成,避免硬编码) */
|
||||||
handleSortCommand(command) {
|
buildYearFilterOptions() {
|
||||||
this.sortType = command
|
const years = this.tableData.map(r => r.nd).filter(v => v !== undefined && v !== null && v !== '')
|
||||||
|
this.yearFilterOptions = [...new Set(years)].sort((a, b) => Number(a) - Number(b))
|
||||||
},
|
},
|
||||||
|
handleYearChange() {
|
||||||
/** 行样式:波次排序时同一波次使用同一背景色 */
|
this.$nextTick(() => {
|
||||||
rowClassName({ row }) {
|
if (this.$refs.tableRef) this.$refs.tableRef.setCurrentRow(null)
|
||||||
if (this.sortType !== 'bw') return ''
|
this.currentRow = null
|
||||||
const colorIndex = (row.bw - 1) % this.bwColors.length
|
})
|
||||||
return `bw-row bw-row-${colorIndex}`
|
},
|
||||||
|
handleSizeChange(size) {
|
||||||
|
this.pageSize = size
|
||||||
|
this.loadList()
|
||||||
|
},
|
||||||
|
handlePageChange(page) {
|
||||||
|
this.pageNum = page
|
||||||
|
this.loadList()
|
||||||
|
},
|
||||||
|
handleSelectionChange(rows) {
|
||||||
|
this.selection = rows
|
||||||
},
|
},
|
||||||
|
|
||||||
// ==================== 4. 班次学期信息列表 ====================
|
|
||||||
handleCurrentChange(row) {
|
handleCurrentChange(row) {
|
||||||
this.currentRow = row
|
this.currentRow = row
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 合并单元格:行政队别列(第一列)纵向合并相同值 */
|
/* ==================== 查询 / 重置 ==================== */
|
||||||
spanMethod({ rowIndex, columnIndex }) {
|
handleQuery() {
|
||||||
if (columnIndex === 0) {
|
this.pageNum = 1
|
||||||
const list = this.displayData
|
this.loadList()
|
||||||
const current = list[rowIndex]
|
},
|
||||||
// 非分组首行,隐藏
|
handleReset() {
|
||||||
if (rowIndex > 0 && list[rowIndex - 1].xzdw === current.xzdw) {
|
this.searchForm.xydbh = ''
|
||||||
return { rowspan: 0, colspan: 0 }
|
this.filterYear = undefined
|
||||||
}
|
this.pageNum = 1
|
||||||
// 统计连续相同行政队别的行数
|
this.loadList()
|
||||||
let rowspan = 1
|
|
||||||
for (let i = rowIndex + 1; i < list.length; i++) {
|
|
||||||
if (list[i].xzdw === current.xzdw) rowspan++
|
|
||||||
else break
|
|
||||||
}
|
|
||||||
return { rowspan, colspan: 1 }
|
|
||||||
}
|
|
||||||
return { rowspan: 1, colspan: 1 }
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 表头特殊样式:总课程数 / 总课时数列红色框标注 */
|
/* ==================== 新增 / 编辑 ==================== */
|
||||||
headerCellClassName({ column }) {
|
handleAdd() {
|
||||||
if (column.property === 'kcrws' || column.property === 'kczs') {
|
this.detailMode = 'add'
|
||||||
return 'red-header-cell'
|
this.detailSemester = null
|
||||||
|
this.detailTeamInfo = null
|
||||||
|
this.detailVisible = true
|
||||||
|
},
|
||||||
|
handleEdit(row) {
|
||||||
|
const target = row || this.currentRow
|
||||||
|
if (!target) {
|
||||||
|
this.$message.warning('请先选择一条班次学期信息')
|
||||||
|
return
|
||||||
}
|
}
|
||||||
return ''
|
this.detailMode = 'edit'
|
||||||
|
this.detailSemester = target
|
||||||
|
this.detailTeamInfo = null
|
||||||
|
this.detailVisible = true
|
||||||
|
},
|
||||||
|
handleDetailSubmit(payload) {
|
||||||
|
this.saving = true
|
||||||
|
const req = this.detailMode === 'edit'
|
||||||
|
? updateSemester(payload)
|
||||||
|
: addSemester(payload)
|
||||||
|
req.then(() => {
|
||||||
|
this.saving = false
|
||||||
|
this.detailVisible = false
|
||||||
|
this.$message.success(this.detailMode === 'edit' ? '班次学期已更新' : '班次学期已新增')
|
||||||
|
this.loadList()
|
||||||
|
this.loadSemesterOptions()
|
||||||
|
}).catch(() => {
|
||||||
|
this.saving = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/* ==================== 删除 ==================== */
|
||||||
|
handleDelete() {
|
||||||
|
if (!this.selection.length) {
|
||||||
|
this.$message.warning('请先勾选要删除的班次学期')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$confirm(`确定删除选中的 ${this.selection.length} 条班次学期吗?删除后其下班历记录将一并删除。`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
const bhList = this.selection.map(r => r.bh)
|
||||||
|
batchDeleteSemester(bhList).then(() => {
|
||||||
|
this.$message.success('已删除')
|
||||||
|
this.loadList()
|
||||||
|
this.loadSemesterOptions()
|
||||||
|
})
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
handleDeleteRow(row) {
|
||||||
|
this.$confirm(`确定删除班次学期「${row.xydbh || row.bh}」吗?删除后其下班历记录将一并删除。`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
delSemester(row.bh).then(() => {
|
||||||
|
this.$message.success('已删除')
|
||||||
|
this.loadList()
|
||||||
|
this.loadSemesterOptions()
|
||||||
|
})
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
|
||||||
|
/* ==================== 编辑班历 ==================== */
|
||||||
|
handleEditCalendar(row) {
|
||||||
|
const target = row || this.currentRow
|
||||||
|
if (!target) {
|
||||||
|
this.$message.warning('请先在列表中选择一条班次学期信息')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.calendarSemester = target
|
||||||
|
this.calendarVisible = true
|
||||||
|
},
|
||||||
|
|
||||||
|
/* ==================== 批量创建班次学期 ==================== */
|
||||||
|
handleBatchAdd() {
|
||||||
|
this.batchAddForm = { nd: this.yearOptions[0] || undefined, xqdc: '', startTime: '', endTime: '' }
|
||||||
|
this.batchAddVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.batchAddFormRef) this.$refs.batchAddFormRef.clearValidate()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleBatchAddSubmit() {
|
||||||
|
this.$refs.batchAddFormRef.validate(valid => {
|
||||||
|
if (!valid) return
|
||||||
|
const f = this.batchAddForm
|
||||||
|
this.saving = true
|
||||||
|
batchAddFromElective({
|
||||||
|
nd: f.nd,
|
||||||
|
xqdc: f.xqdc,
|
||||||
|
startTime: f.startTime,
|
||||||
|
endTime: f.endTime
|
||||||
|
}).then(res => {
|
||||||
|
this.saving = false
|
||||||
|
this.batchAddVisible = false
|
||||||
|
const count = (res && res.data) || 0
|
||||||
|
this.$message.success(`已创建 ${count} 个班次学期`)
|
||||||
|
this.loadList()
|
||||||
|
this.loadSemesterOptions()
|
||||||
|
}).catch(() => {
|
||||||
|
this.saving = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/* ==================== 快速设定学期日期 ==================== */
|
||||||
|
handleQuickSetDates() {
|
||||||
|
if (!this.selection.length) {
|
||||||
|
this.$message.warning('请先勾选要设定日期的班次学期')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.dateRangeForm = { kxrq: '', jsrq: '' }
|
||||||
|
this.dateRangeVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.dateRangeFormRef) this.$refs.dateRangeFormRef.clearValidate()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDateRangeSubmit() {
|
||||||
|
this.$refs.dateRangeFormRef.validate(valid => {
|
||||||
|
if (!valid) return
|
||||||
|
const f = this.dateRangeForm
|
||||||
|
this.saving = true
|
||||||
|
batchUpdateDateRange({
|
||||||
|
bhList: this.selection.map(r => r.bh),
|
||||||
|
xqkssj: f.kxrq,
|
||||||
|
xqjssj: f.jsrq
|
||||||
|
}).then(res => {
|
||||||
|
this.saving = false
|
||||||
|
this.dateRangeVisible = false
|
||||||
|
const count = (res && res.data) || 0
|
||||||
|
this.$message.success(`已更新 ${count} 条班次学期的日期`)
|
||||||
|
this.loadList()
|
||||||
|
}).catch(() => {
|
||||||
|
this.saving = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/* ==================== 批量设置教学任务 ==================== */
|
||||||
|
handleSetJxrw() {
|
||||||
|
if (!this.selection.length) {
|
||||||
|
this.$message.warning('请先勾选要设置教学任务的班次学期')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.jxrwForm = { jxrwbh: undefined }
|
||||||
|
this.jxrwVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.jxrwFormRef) this.$refs.jxrwFormRef.clearValidate()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleJxrwSubmit() {
|
||||||
|
this.$refs.jxrwFormRef.validate(valid => {
|
||||||
|
if (!valid) return
|
||||||
|
this.saving = true
|
||||||
|
batchUpdateJxrwbh({
|
||||||
|
bhList: this.selection.map(r => r.bh),
|
||||||
|
jxrwbh: this.jxrwForm.jxrwbh
|
||||||
|
}).then(res => {
|
||||||
|
this.saving = false
|
||||||
|
this.jxrwVisible = false
|
||||||
|
const count = (res && res.data) || 0
|
||||||
|
this.$message.success(`已更新 ${count} 条班次学期的教学任务`)
|
||||||
|
this.loadList()
|
||||||
|
}).catch(() => {
|
||||||
|
this.saving = false
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -375,8 +597,8 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.shift-semester-page {
|
.shift-semester-page {
|
||||||
// ========== 1. 学年学期标题 ==========
|
// ========== 页面标题 ==========
|
||||||
.list-title {
|
.page-title {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #303133;
|
color: #303133;
|
||||||
@@ -385,44 +607,12 @@ export default {
|
|||||||
border-left: 4px solid var(--edu-green-primary);
|
border-left: 4px solid var(--edu-green-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 2. 校历 / 预设日期信息区 ==========
|
// ========== 1. 查询条件区域 ==========
|
||||||
.search-card {
|
.search-card {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
|
|
||||||
.search-form {
|
|
||||||
.date-group {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 4px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.date-group-label {
|
// ========== 2. 工具栏按钮区 ==========
|
||||||
flex-shrink: 0;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #303133;
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.absorb-btn {
|
|
||||||
margin-left: auto;
|
|
||||||
align-self: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-form-item {
|
|
||||||
margin-bottom: 0;
|
|
||||||
margin-right: 16px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 3. 工具栏按钮区 ==========
|
|
||||||
.list-toolbar {
|
.list-toolbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -440,46 +630,19 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 新建下拉菜单 ==========
|
// ========== 3. 数据表格区 ==========
|
||||||
.new-class-menu {
|
|
||||||
max-height: 320px;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 4. 数据表格区 ==========
|
|
||||||
$bwColors: (#e3f2fd, #e8f5e9, #fff8e1, #f3e5f5, #e0f2f1);
|
|
||||||
|
|
||||||
.table-card {
|
.table-card {
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
.class-table {
|
.class-table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
// 波次背景色(同一合班波次使用同一背景颜色连在一起显示)
|
|
||||||
@for $i from 0 through length($bwColors) - 1 {
|
|
||||||
::v-deep(.el-table__body tr.bw-row-#{$i} > td.el-table__cell) {
|
|
||||||
background-color: nth($bwColors, $i + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep(.el-table__body tr.bw-row-#{$i}:hover > td.el-table__cell) {
|
.text-danger {
|
||||||
background-color: nth($bwColors, $i + 1);
|
color: #f56c6c;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当前行高亮(优先于波次背景色)
|
.list-pagination {
|
||||||
::v-deep(.el-table__body tr.current-row > td.el-table__cell) {
|
margin-top: 12px;
|
||||||
background-color: #e1f5ec;
|
text-align: right;
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep(.el-table__body tr.current-row:hover > td.el-table__cell) {
|
|
||||||
background-color: #e1f5ec;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 表头红色框标注列(总课程数 / 总课时数)
|
|
||||||
::v-deep(th.red-header-cell) {
|
|
||||||
border: 2px solid #f56c6c !important;
|
|
||||||
background: #fdeaea !important;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user