From fdc7bb01fd6513a1624f473394b22bfbbc78a4b0 Mon Sep 17 00:00:00 2001 From: liweijie Date: Fri, 18 Sep 2026 19:51:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=AD=A6=E4=B8=9A=E5=8A=A1-=E7=8F=AD?= =?UTF-8?q?=E6=AC=A1=E5=AD=A6=E6=9C=9F=E4=BF=A1=E6=81=AF=E7=AE=A1=E7=90=86?= =?UTF-8?q?-=E6=93=8D=E4=BD=9C=E5=88=97=E7=82=B9=E5=87=BB=E6=95=99?= =?UTF-8?q?=E5=AD=A6=E4=BB=BB=E5=8A=A1-=E6=96=B0=E5=A2=9E=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E4=BB=BB=E5=8A=A1=EF=BC=8C=E8=AF=BE=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E8=A6=81=E6=B1=82=E4=B8=8B=E6=8B=89=E9=80=89=E6=8B=A9=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E8=83=BD=E5=B8=A6=E5=87=BA=E6=89=80=E9=80=89=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E7=9A=84=E5=AF=B9=E5=BA=94=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shiftSemester/ClassCalendarDialog.vue | 84 ++++++++++++++++++- .../views/teachOffice/shiftSemester/index.vue | 8 +- 2 files changed, 86 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/teachOffice/shiftSemester/ClassCalendarDialog.vue b/frontend/src/views/teachOffice/shiftSemester/ClassCalendarDialog.vue index 4f7a4ebd..2a663980 100644 --- a/frontend/src/views/teachOffice/shiftSemester/ClassCalendarDialog.vue +++ b/frontend/src/views/teachOffice/shiftSemester/ClassCalendarDialog.vue @@ -109,8 +109,27 @@ - - + + + + @@ -419,11 +438,14 @@ export default { editForm: this.createEmptyEditForm(), editRules: { jc: [{ required: true, message: '请输入课程简称', trigger: 'blur' }], + kbh: [{ required: true, message: '请选择课程', trigger: 'change' }], // 以下三列在库中「非空且无默认值」,留空会写入无意义值,这里前置拦截 xs: [{ required: true, message: '请输入学时', trigger: 'blur' }], klx: [{ required: true, message: '请输入课类型', trigger: 'blur' }], jysdh: [{ required: true, message: '请输入教研室代号', trigger: 'blur' }] }, + kbOptions: [], + kbLoading: false, // ==================== 复制到其它班次 ==================== teamSelectVisible: false, @@ -649,12 +671,70 @@ export default { }) form.xydxqbh = s.bh || row.xydxqbh this.editForm = form + this.ensureKbOption(form.kbh, row) this.editVisible = true this.$nextTick(() => { if (this.$refs.editFormRef) this.$refs.editFormRef.clearValidate() }) }, + /* ---------- 课程下拉(课编号带出课程信息) ---------- */ + kbOptionLabel(item) { + const name = item.kmc || item.jc || '' + return name ? `${name}(${item.kbh})` : item.kbh + }, + ensureKbOption(kbh, row) { + if (!kbh) return + if (this.kbOptions.some(item => item.kbh === kbh)) return + this.kbOptions = [{ kbh, kmc: (row && (row.kmc || row.jc)) || '', jc: row && row.jc }].concat(this.kbOptions) + }, + searchKbOptions(keyword) { + this.kbLoading = true + const kw = (keyword || '').trim() + const unwrap = res => { + const data = (res && res.data) || {} + return data.records || (Array.isArray(data) ? data : []) + } + const requests = kw + ? [listKb({ pageNum: 1, pageSize: 30, kmc: kw }), listKb({ pageNum: 1, pageSize: 30, jc: kw })] + : [listKb({ pageNum: 1, pageSize: 30 })] + Promise.all(requests).then(results => { + const merged = [] + const seen = {} + results.forEach(res => { + unwrap(res).forEach(item => { + if (!item.kbh || seen[item.kbh]) return + seen[item.kbh] = true + merged.push(item) + }) + }) + this.kbOptions = merged + this.kbLoading = false + }).catch(() => { + this.kbLoading = false + }) + }, + /** 选中课程后带出课程档案信息(仅覆盖课程有值的字段) */ + handleKbhChange(kbh) { + const course = this.kbOptions.find(item => item.kbh === kbh) + if (!course) return + const fill = (key, val) => { + if (val !== undefined && val !== null && val !== '') this.editForm[key] = val + } + fill('jc', course.jc) + fill('klx', course.klx) + fill('xs', course.xs) + fill('llxs', course.llxs) + fill('sjxs', course.sjxs) + fill('xf', course.xf) + fill('ksks', course.ksks) + fill('cjfz', course.cjfz) + fill('bjrxypjf', course.bjrxypjf) + fill('ksksbxs', course.ksksbxs) + fill('jysdh', course.jysdh) + fill('zks', course.zks) + }, + handleEditSubmit() { this.$refs.editFormRef.validate(valid => { if (!valid) return diff --git a/frontend/src/views/teachOffice/shiftSemester/index.vue b/frontend/src/views/teachOffice/shiftSemester/index.vue index 5d653bee..f0969b64 100644 --- a/frontend/src/views/teachOffice/shiftSemester/index.vue +++ b/frontend/src/views/teachOffice/shiftSemester/index.vue @@ -51,7 +51,7 @@
批量创建班次学期 新增 - 编辑 + 编辑 删除所选 快速设定学期日期 吸取预设日期 @@ -61,9 +61,9 @@ 预设合班 预设拆班 批量生成必修课程 - 编辑班历 - 编辑班次教学任务 - 教学配当 + 编辑班历 + 编辑班次教学任务 + 教学配当 导出配当 发布运行课表 删除运行课表