1、正课与学期关系关联;
2、天假删除保护; 3、教学任务计划增加了「结束发布」。已发布或库里的「已发布」都可以结束;结束后写入结束时间,任务书和班次课程任务只读 4、班次学期操作内容调整修改;
This commit is contained in:
@@ -22,11 +22,21 @@
|
||||
clearable
|
||||
filterable
|
||||
style="width: 140px"
|
||||
@change="handleYearChange"
|
||||
@change="handleQuery"
|
||||
>
|
||||
<el-option v-for="y in yearFilterOptions" :key="y" :label="`${y}年`" :value="y" />
|
||||
<el-option v-for="y in yearOptions" :key="y" :label="`${y}年`" :value="y" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期第次">
|
||||
<el-select v-model="searchForm.xqdc" placeholder="全部" clearable style="width: 120px" @change="handleQuery">
|
||||
<el-option label="第1学期" :value="1" />
|
||||
<el-option label="第2学期" :value="2" />
|
||||
<el-option label="第3学期" :value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="sortWave" @change="handleQuery">按波次排序</el-checkbox>
|
||||
</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="handleReset">重置</el-button>
|
||||
@@ -42,10 +52,17 @@
|
||||
<el-button type="primary" plain icon="el-icon-edit" :disabled="!currentRow" @click="handleEdit">编辑</el-button>
|
||||
<el-button type="danger" plain icon="el-icon-delete" :disabled="!selection.length" @click="handleDelete">删除所选</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-date" :disabled="!selection.length" @click="handleQuickSetDates">快速设定学期日期</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-download" :disabled="!currentRow" @click="handleAbsorbDates">吸取预设日期</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-notebook-2" :disabled="!selection.length" @click="handleSetJxrw">批量设置教学任务</el-button>
|
||||
<el-button type="primary" plain :disabled="!selection.length" @click="handleSetXqdc">批量学期第次</el-button>
|
||||
<el-button type="primary" plain :disabled="!selection.length" @click="handleSetKfjypk">开放教员排课</el-button>
|
||||
<el-button type="warning" plain :disabled="selection.length < 2" @click="handleWaveMerge">预设合班</el-button>
|
||||
<el-button type="warning" plain :disabled="!selection.length" @click="handleWaveSplit">预设拆班</el-button>
|
||||
<el-button type="primary" plain :disabled="!selection.length" @click="handleBatchGenerateTasks">批量生成必修课程</el-button>
|
||||
</div>
|
||||
<div class="right-group">
|
||||
<el-button type="success" plain icon="el-icon-calendar" :disabled="!currentRow" @click="handleEditCalendar">编辑班历</el-button>
|
||||
<el-button type="success" plain icon="el-icon-date" :disabled="!currentRow" @click="handleEditEventCalendar">编辑班历</el-button>
|
||||
<el-button type="success" plain icon="el-icon-calendar" :disabled="!currentRow" @click="handleEditCalendar">编辑班次教学任务</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -61,6 +78,7 @@
|
||||
size="small"
|
||||
max-height="480"
|
||||
class="class-table"
|
||||
:row-class-name="waveRowClass"
|
||||
@selection-change="handleSelectionChange"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
@@ -69,17 +87,32 @@
|
||||
</template>
|
||||
<el-table-column type="selection" width="44" align="center" />
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column prop="xydbh" label="班次编号" min-width="150" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="xydmc" label="班次名称" min-width="140" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="{ row }">{{ row.xydmc || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="xydbh" label="班次编号" min-width="130" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="ysbbh" label="预设编班号" width="100" align="center">
|
||||
<template slot-scope="{ row }">{{ waveLabel(row.ysbbh) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="nd" label="年度" width="80" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="学期第次" width="90" align="center">
|
||||
<template slot-scope="{ row }">{{ xqdcLabel(row.xqdc) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="kxrq" label="开学日期" width="110" align="center" :formatter="fmtDate" />
|
||||
<el-table-column prop="jsrq" label="结束日期" width="110" align="center" :formatter="fmtDate" />
|
||||
<el-table-column prop="zyjsbh" label="专用教室" width="100" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="开学日期" width="110" align="center">
|
||||
<template slot-scope="{ row }">{{ formatDate(row.kxrq) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束日期" width="110" align="center">
|
||||
<template slot-scope="{ row }">{{ formatDate(row.jsrq) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="专用教室" min-width="140" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="{ row }">{{ roomLabel(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="教学任务" min-width="160" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="{ row }">{{ taskName(row.jxrwbh) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="zkcs" label="总课程数" width="90" align="center">
|
||||
<template slot-scope="{ row }">{{ row.zkcs == null ? 0 : row.zkcs }}</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>
|
||||
@@ -87,10 +120,11 @@
|
||||
</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">
|
||||
<el-table-column label="操作" width="250" 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" @click="handleEditEventCalendar(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>
|
||||
@@ -116,11 +150,12 @@
|
||||
:team-info="detailTeamInfo"
|
||||
:year-options="yearOptions"
|
||||
:task-options="taskOptions"
|
||||
:preset-dates="presetDates"
|
||||
@update:visible="val => detailVisible = val"
|
||||
@submit="handleDetailSubmit"
|
||||
/>
|
||||
|
||||
<!-- ==================== 班历管理弹窗 ==================== -->
|
||||
<!-- ==================== 班次教学任务弹窗 ==================== -->
|
||||
<ClassCalendarDialog
|
||||
:visible="calendarVisible"
|
||||
:semester="calendarSemester"
|
||||
@@ -128,6 +163,13 @@
|
||||
@update:visible="val => calendarVisible = val"
|
||||
/>
|
||||
|
||||
<ClassEventCalendarDialog
|
||||
:visible="eventCalendarVisible"
|
||||
:semester="eventCalendarSemester"
|
||||
:semester-options="semesterOptions"
|
||||
@update:visible="val => eventCalendarVisible = val"
|
||||
/>
|
||||
|
||||
<!-- ==================== 批量创建班次学期弹窗 ==================== -->
|
||||
<el-dialog
|
||||
:visible="batchAddVisible"
|
||||
@@ -138,15 +180,15 @@
|
||||
>
|
||||
<el-form ref="batchAddFormRef" :model="batchAddForm" :rules="batchAddRules" label-width="100px">
|
||||
<el-form-item label="年度" prop="nd">
|
||||
<el-select v-model="batchAddForm.nd" placeholder="请选择年度" filterable style="width: 100%">
|
||||
<el-select v-model="batchAddForm.nd" placeholder="请选择年度" filterable style="width: 100%" @change="loadBatchPreset">
|
||||
<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 v-model="batchAddForm.xqdc" placeholder="请选择学期" style="width: 100%" @change="loadBatchPreset">
|
||||
<el-option label="第1学期" :value="1" />
|
||||
<el-option label="第2学期" :value="2" />
|
||||
<el-option label="第3学期" :value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始日期" prop="startTime">
|
||||
@@ -155,6 +197,16 @@
|
||||
<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-item>
|
||||
<el-button size="small" @click="loadBatchPreset">按学校学期带出日期</el-button>
|
||||
<el-button size="small" :disabled="!currentRow" @click="absorbIntoBatch">吸取选中班次日期</el-button>
|
||||
</el-form-item>
|
||||
<el-alert
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
:title="`将为未毕业且尚未建立的班次创建学期信息,当前可新建 ${batchEligibleCount} 个班次`"
|
||||
/>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button @click="batchAddVisible = false">取消</el-button>
|
||||
@@ -218,13 +270,58 @@
|
||||
<el-button type="primary" :loading="saving" @click="handleJxrwSubmit">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
:visible="xqdcVisible"
|
||||
title="批量设定学期第次"
|
||||
width="420px"
|
||||
:close-on-click-modal="false"
|
||||
@update:visible="val => xqdcVisible = val"
|
||||
>
|
||||
<el-form label-width="100px">
|
||||
<el-form-item label="学期第次">
|
||||
<el-select v-model="xqdcForm.xqdc" placeholder="请选择学期第次" style="width: 100%">
|
||||
<el-option label="第1学期" :value="1" />
|
||||
<el-option label="第2学期" :value="2" />
|
||||
<el-option label="第3学期" :value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button @click="xqdcVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="saving" @click="handleXqdcSubmit">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
:visible="kfjypkVisible"
|
||||
title="批量设定开放教员排课"
|
||||
width="420px"
|
||||
:close-on-click-modal="false"
|
||||
@update:visible="val => kfjypkVisible = val"
|
||||
>
|
||||
<el-form label-width="120px">
|
||||
<el-form-item label="开放教员排课">
|
||||
<el-radio-group v-model="kfjypkForm.kfjypk">
|
||||
<el-radio :label="1">开放</el-radio>
|
||||
<el-radio :label="0">关闭</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button @click="kfjypkVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="saving" @click="handleKfjypkSubmit">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ClassSemesterDetailDialog from './ClassSemesterDetailDialog.vue'
|
||||
import ClassCalendarDialog from './ClassCalendarDialog.vue'
|
||||
import { listSemester, allSemester, addSemester, updateSemester, delSemester, batchDeleteSemester, batchUpdateDateRange, batchUpdateJxrwbh, batchAddFromElective } from '@/api/studentRecords/semester'
|
||||
import ClassEventCalendarDialog from './ClassEventCalendarDialog.vue'
|
||||
import { batchAutoGenerateTasks } from '@/api/studentRecords/classCalendar'
|
||||
import { listSemester, allSemester, addSemester, updateSemester, delSemester, batchDeleteSemester, batchUpdateDateRange, batchUpdateJxrwbh, batchCreateSemester, batchUpdateXqdc, batchUpdateKfjypk, batchWaveMerge, batchWaveSplit, listCreatableClasses, presetSemesterDates } from '@/api/studentRecords/semester'
|
||||
import { listAllSemester } from '@/api/teachBusiness/semester'
|
||||
import { listTeachingTask } from '@/api/teachBusiness/teachingTask'
|
||||
|
||||
@@ -232,7 +329,8 @@ export default {
|
||||
name: 'ShiftSemester',
|
||||
components: {
|
||||
ClassSemesterDetailDialog,
|
||||
ClassCalendarDialog
|
||||
ClassCalendarDialog,
|
||||
ClassEventCalendarDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -240,9 +338,10 @@ export default {
|
||||
saving: false,
|
||||
|
||||
// ==================== 查询条件 ====================
|
||||
searchForm: { xydbh: '' },
|
||||
searchForm: { xydbh: '', xqdc: undefined },
|
||||
filterYear: undefined,
|
||||
yearFilterOptions: [],
|
||||
sortWave: true,
|
||||
presetDates: { kxrq: '', jsrq: '' },
|
||||
|
||||
// ==================== 列表与分页 ====================
|
||||
tableData: [],
|
||||
@@ -269,10 +368,13 @@ export default {
|
||||
// ==================== 班历管理 ====================
|
||||
calendarVisible: false,
|
||||
calendarSemester: null,
|
||||
eventCalendarVisible: false,
|
||||
eventCalendarSemester: null,
|
||||
|
||||
// ==================== 批量创建班次学期 ====================
|
||||
batchAddVisible: false,
|
||||
batchAddForm: { nd: undefined, xqdc: '', startTime: '', endTime: '' },
|
||||
batchAddForm: { nd: undefined, xqdc: undefined, startTime: '', endTime: '' },
|
||||
batchEligibleCount: 0,
|
||||
batchAddRules: {
|
||||
nd: [{ required: true, message: '请选择年度', trigger: 'change' }],
|
||||
xqdc: [{ required: true, message: '请选择学期', trigger: 'change' }],
|
||||
@@ -293,14 +395,16 @@ export default {
|
||||
jxrwForm: { jxrwbh: undefined },
|
||||
jxrwRules: {
|
||||
jxrwbh: [{ required: true, message: '请选择教学任务', trigger: 'change' }]
|
||||
}
|
||||
},
|
||||
xqdcVisible: false,
|
||||
xqdcForm: { xqdc: 1 },
|
||||
kfjypkVisible: false,
|
||||
kfjypkForm: { kfjypk: 1 }
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
/** 本地按年度过滤(后端 /semester/list 仅支持 xydbh 模糊筛选) */
|
||||
displayData() {
|
||||
if (!this.filterYear) return this.tableData
|
||||
return this.tableData.filter(item => String(item.nd) === String(this.filterYear))
|
||||
return this.tableData
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -311,9 +415,42 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
/* ==================== 格式化 ==================== */
|
||||
fmtDate(val) {
|
||||
if (!val) return '-'
|
||||
return String(val).slice(0, 10)
|
||||
formatDate(val) {
|
||||
if (val == null || val === '') return '-'
|
||||
if (Array.isArray(val) && val.length >= 3) {
|
||||
return `${val[0]}-${String(val[1]).padStart(2, '0')}-${String(val[2]).padStart(2, '0')}`
|
||||
}
|
||||
if (typeof val === 'object') {
|
||||
const year = val.year
|
||||
const month = val.monthValue || val.month
|
||||
const day = val.dayOfMonth || val.day
|
||||
if (year && month && day) {
|
||||
return `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`
|
||||
}
|
||||
return '-'
|
||||
}
|
||||
const text = String(val)
|
||||
return text.length >= 10 ? text.slice(0, 10) : text
|
||||
},
|
||||
yearFromNd(nd) {
|
||||
const text = String(nd || '')
|
||||
if (text.length >= 6) return Number(text.slice(0, 4))
|
||||
const n = Number(text)
|
||||
return Number.isFinite(n) && n > 0 ? n : null
|
||||
},
|
||||
roomLabel(row) {
|
||||
if (!row) return '-'
|
||||
if (row.zyjsmc && row.zyjsbh) return `${row.zyjsmc}(${row.zyjsbh})`
|
||||
return row.zyjsmc || row.zyjsbh || '-'
|
||||
},
|
||||
waveLabel(val) {
|
||||
const n = Number(val)
|
||||
return n > 0 ? n : '未编波'
|
||||
},
|
||||
waveRowClass({ row }) {
|
||||
const n = Number(row.ysbbh)
|
||||
if (!n) return ''
|
||||
return 'wave-row wave-row-' + (n % 8)
|
||||
},
|
||||
xqdcLabel(val) {
|
||||
if (val === 1 || val === '1') return '第1学期'
|
||||
@@ -342,7 +479,7 @@ export default {
|
||||
loadYearOptions() {
|
||||
listAllSemester().then(res => {
|
||||
const list = (res && res.data) || []
|
||||
const years = list.map(x => x.nd).filter(v => v !== undefined && v !== null && v !== '')
|
||||
const years = list.map(x => this.yearFromNd(x.nd)).filter(v => v)
|
||||
this.yearOptions = [...new Set(years)].sort((a, b) => Number(a) - Number(b))
|
||||
}).catch(() => {
|
||||
this.yearOptions = []
|
||||
@@ -370,13 +507,15 @@ export default {
|
||||
const query = this.cleanPayload({
|
||||
pageNum: this.pageNum,
|
||||
pageSize: this.pageSize,
|
||||
xydbh: this.searchForm.xydbh
|
||||
xydbh: this.searchForm.xydbh,
|
||||
nd: this.filterYear,
|
||||
xqdc: this.searchForm.xqdc,
|
||||
sortWave: this.sortWave ? 1 : 0
|
||||
})
|
||||
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 = []
|
||||
@@ -384,17 +523,6 @@ export default {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/** 本地年度过滤下拉(从当前数据动态生成,避免硬编码) */
|
||||
buildYearFilterOptions() {
|
||||
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(() => {
|
||||
if (this.$refs.tableRef) this.$refs.tableRef.setCurrentRow(null)
|
||||
this.currentRow = null
|
||||
})
|
||||
},
|
||||
handleSizeChange(size) {
|
||||
this.pageSize = size
|
||||
this.loadList()
|
||||
@@ -417,6 +545,7 @@ export default {
|
||||
},
|
||||
handleReset() {
|
||||
this.searchForm.xydbh = ''
|
||||
this.searchForm.xqdc = undefined
|
||||
this.filterYear = undefined
|
||||
this.pageNum = 1
|
||||
this.loadList()
|
||||
@@ -462,7 +591,7 @@ export default {
|
||||
this.$message.warning('请先勾选要删除的班次学期')
|
||||
return
|
||||
}
|
||||
this.$confirm(`确定删除选中的 ${this.selection.length} 条班次学期吗?删除后其下班历记录将一并删除。`, '提示', {
|
||||
this.$confirm(`确定删除选中的 ${this.selection.length} 条班次学期吗?若已有课程任务将禁止删除。`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@@ -476,7 +605,7 @@ export default {
|
||||
}).catch(() => {})
|
||||
},
|
||||
handleDeleteRow(row) {
|
||||
this.$confirm(`确定删除班次学期「${row.xydbh || row.bh}」吗?删除后其下班历记录将一并删除。`, '提示', {
|
||||
this.$confirm(`确定删除班次学期「${row.xydbh || row.bh}」吗?若已有课程任务将禁止删除。`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@@ -489,7 +618,33 @@ export default {
|
||||
}).catch(() => {})
|
||||
},
|
||||
|
||||
/* ==================== 编辑班历 ==================== */
|
||||
handleEditEventCalendar(row) {
|
||||
const target = row || this.currentRow
|
||||
if (!target) {
|
||||
this.$message.warning('请先在列表中选择一条班次学期信息')
|
||||
return
|
||||
}
|
||||
this.eventCalendarSemester = target
|
||||
this.eventCalendarVisible = true
|
||||
},
|
||||
|
||||
handleBatchGenerateTasks() {
|
||||
if (!this.selection.length) {
|
||||
this.$message.warning('请先勾选班次学期')
|
||||
return
|
||||
}
|
||||
const ids = this.selection.map(item => item.bh).filter(Boolean)
|
||||
this.$confirm(`将为所选 ${ids.length} 个班次学期按人培补齐必修课程,已有课程不会重复生成。`, '批量生成必修课程', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
batchAutoGenerateTasks(ids).then(res => {
|
||||
this.$message.success(`已生成 ${res.data || 0} 条课程任务`)
|
||||
this.loadList()
|
||||
})
|
||||
}).catch(() => {})
|
||||
},
|
||||
|
||||
/* ==================== 编辑班次教学任务 ==================== */
|
||||
handleEditCalendar(row) {
|
||||
const target = row || this.currentRow
|
||||
if (!target) {
|
||||
@@ -502,26 +657,53 @@ export default {
|
||||
|
||||
/* ==================== 批量创建班次学期 ==================== */
|
||||
handleBatchAdd() {
|
||||
this.batchAddForm = { nd: this.yearOptions[0] || undefined, xqdc: '', startTime: '', endTime: '' }
|
||||
this.batchAddForm = {
|
||||
nd: this.filterYear || this.yearOptions[this.yearOptions.length - 1] || undefined,
|
||||
xqdc: this.searchForm.xqdc || 1,
|
||||
startTime: this.presetDates.kxrq || '',
|
||||
endTime: this.presetDates.jsrq || ''
|
||||
}
|
||||
this.batchEligibleCount = 0
|
||||
this.batchAddVisible = true
|
||||
this.loadBatchPreset()
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.batchAddFormRef) this.$refs.batchAddFormRef.clearValidate()
|
||||
})
|
||||
},
|
||||
loadBatchPreset() {
|
||||
const f = this.batchAddForm
|
||||
if (!f.nd || !f.xqdc) return
|
||||
presetSemesterDates({ nd: f.nd, xqdc: f.xqdc }).then(res => {
|
||||
const data = (res && res.data) || {}
|
||||
if (data.kxrq) this.batchAddForm.startTime = data.kxrq
|
||||
if (data.jsrq) this.batchAddForm.endTime = data.jsrq
|
||||
}).catch(() => {})
|
||||
listCreatableClasses({ nd: f.nd, xqdc: f.xqdc }).then(res => {
|
||||
this.batchEligibleCount = ((res && res.data) || []).length
|
||||
}).catch(() => {
|
||||
this.batchEligibleCount = 0
|
||||
})
|
||||
},
|
||||
absorbIntoBatch() {
|
||||
if (!this.currentRow) return
|
||||
this.absorbDatesFrom(this.currentRow)
|
||||
this.batchAddForm.startTime = this.presetDates.kxrq
|
||||
this.batchAddForm.endTime = this.presetDates.jsrq
|
||||
},
|
||||
handleBatchAddSubmit() {
|
||||
this.$refs.batchAddFormRef.validate(valid => {
|
||||
if (!valid) return
|
||||
const f = this.batchAddForm
|
||||
this.saving = true
|
||||
batchAddFromElective({
|
||||
batchCreateSemester({
|
||||
nd: f.nd,
|
||||
xqdc: f.xqdc,
|
||||
startTime: f.startTime,
|
||||
endTime: f.endTime
|
||||
kxrq: f.startTime,
|
||||
jsrq: f.endTime
|
||||
}).then(res => {
|
||||
this.saving = false
|
||||
this.batchAddVisible = false
|
||||
const count = (res && res.data) || 0
|
||||
const count = Number((res && res.data) || 0)
|
||||
this.$message.success(`已创建 ${count} 个班次学期`)
|
||||
this.loadList()
|
||||
this.loadSemesterOptions()
|
||||
@@ -530,6 +712,79 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
handleAbsorbDates() {
|
||||
if (!this.currentRow) {
|
||||
this.$message.warning('请先选中一条班次学期')
|
||||
return
|
||||
}
|
||||
this.absorbDatesFrom(this.currentRow)
|
||||
this.$message.success(`已吸取开学日期 ${this.presetDates.kxrq}、结束日期 ${this.presetDates.jsrq}`)
|
||||
},
|
||||
absorbDatesFrom(row) {
|
||||
this.presetDates = {
|
||||
kxrq: this.formatDate(row.kxrq) === '-' ? '' : this.formatDate(row.kxrq),
|
||||
jsrq: this.formatDate(row.jsrq) === '-' ? '' : this.formatDate(row.jsrq)
|
||||
}
|
||||
},
|
||||
handleSetXqdc() {
|
||||
if (!this.selection.length) return
|
||||
this.xqdcForm = { xqdc: this.selection[0].xqdc || 1 }
|
||||
this.xqdcVisible = true
|
||||
},
|
||||
handleXqdcSubmit() {
|
||||
this.saving = true
|
||||
batchUpdateXqdc({
|
||||
bhList: this.selection.map(r => r.bh),
|
||||
xqdc: this.xqdcForm.xqdc
|
||||
}).then(res => {
|
||||
this.saving = false
|
||||
this.xqdcVisible = false
|
||||
this.$message.success(`已更新 ${Number((res && res.data) || 0)} 条学期第次`)
|
||||
this.loadList()
|
||||
}).catch(() => {
|
||||
this.saving = false
|
||||
})
|
||||
},
|
||||
handleSetKfjypk() {
|
||||
if (!this.selection.length) return
|
||||
this.kfjypkForm = { kfjypk: 1 }
|
||||
this.kfjypkVisible = true
|
||||
},
|
||||
handleKfjypkSubmit() {
|
||||
this.saving = true
|
||||
batchUpdateKfjypk({
|
||||
bhList: this.selection.map(r => r.bh),
|
||||
kfjypk: this.kfjypkForm.kfjypk
|
||||
}).then(res => {
|
||||
this.saving = false
|
||||
this.kfjypkVisible = false
|
||||
this.$message.success(`已更新 ${Number((res && res.data) || 0)} 条开放教员排课`)
|
||||
this.loadList()
|
||||
}).catch(() => {
|
||||
this.saving = false
|
||||
})
|
||||
},
|
||||
handleWaveMerge() {
|
||||
if (this.selection.length < 2) {
|
||||
this.$message.warning('请至少勾选两个班次')
|
||||
return
|
||||
}
|
||||
this.$confirm(`将选中的 ${this.selection.length} 个班次设为同一预设编班号。只改编波,不改课次序号。`, '预设合班', {
|
||||
type: 'warning'
|
||||
}).then(() => batchWaveMerge({ bhList: this.selection.map(r => r.bh) })).then(res => {
|
||||
this.$message.success(`已合班 ${Number((res && res.data) || 0)} 个班次`)
|
||||
this.loadList()
|
||||
}).catch(() => {})
|
||||
},
|
||||
handleWaveSplit() {
|
||||
if (!this.selection.length) return
|
||||
this.$confirm(`将选中的 ${this.selection.length} 个班次各自独立成波。只改编波,不改课次序号。`, '预设拆班', {
|
||||
type: 'warning'
|
||||
}).then(() => batchWaveSplit({ bhList: this.selection.map(r => r.bh) })).then(res => {
|
||||
this.$message.success(`已拆班 ${Number((res && res.data) || 0)} 个班次`)
|
||||
this.loadList()
|
||||
}).catch(() => {})
|
||||
},
|
||||
|
||||
/* ==================== 快速设定学期日期 ==================== */
|
||||
handleQuickSetDates() {
|
||||
@@ -537,7 +792,10 @@ export default {
|
||||
this.$message.warning('请先勾选要设定日期的班次学期')
|
||||
return
|
||||
}
|
||||
this.dateRangeForm = { kxrq: '', jsrq: '' }
|
||||
this.dateRangeForm = {
|
||||
kxrq: this.presetDates.kxrq || '',
|
||||
jsrq: this.presetDates.jsrq || ''
|
||||
}
|
||||
this.dateRangeVisible = true
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.dateRangeFormRef) this.$refs.dateRangeFormRef.clearValidate()
|
||||
@@ -651,6 +909,15 @@ export default {
|
||||
margin-top: 12px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
::v-deep .wave-row-1 td { background: #f0f9eb !important; }
|
||||
::v-deep .wave-row-2 td { background: #ecf5ff !important; }
|
||||
::v-deep .wave-row-3 td { background: #fdf6ec !important; }
|
||||
::v-deep .wave-row-4 td { background: #fef0f0 !important; }
|
||||
::v-deep .wave-row-5 td { background: #f4f4f5 !important; }
|
||||
::v-deep .wave-row-6 td { background: #f0f9ff !important; }
|
||||
::v-deep .wave-row-7 td { background: #f9f0ff !important; }
|
||||
::v-deep .wave-row-0 td { background: #fff7e6 !important; }
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user