From 13d72c54f2f04cf35809e1b3bec441fe6e0955bc Mon Sep 17 00:00:00 2001 From: yangbin <1796443586@qq.com> Date: Tue, 25 Aug 2026 19:25:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=81=9C=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/teachBusiness/courseRunning.js | 4 +- .../views/student/warningCondition/index.vue | 21 ++-- .../views/subjectMajor/discipline/index.vue | 12 +- .../src/views/subjectMajor/major/index.vue | 19 ++- frontend/src/views/system/dept/index.vue | 16 +-- frontend/src/views/system/dict/data.vue | 16 +-- frontend/src/views/system/dict/index.vue | 23 ++-- frontend/src/views/system/menu/index.vue | 17 ++- frontend/src/views/system/post/index.vue | 16 +-- frontend/src/views/system/role/index.vue | 23 ++-- frontend/src/views/system/user/index.vue | 11 +- .../views/teachBusiness/syllabus/index.vue | 22 ++-- .../teachBusiness/timetableAdjust/index.vue | 108 ++++++++++++++---- .../src/views/teachBusiness/venue/index.vue | 12 +- .../src/views/teachOffice/office/index.vue | 12 +- frontend/src/views/textbook/index.vue | 16 ++- 16 files changed, 185 insertions(+), 163 deletions(-) diff --git a/frontend/src/api/teachBusiness/courseRunning.js b/frontend/src/api/teachBusiness/courseRunning.js index 04ecfd69..af854637 100644 --- a/frontend/src/api/teachBusiness/courseRunning.js +++ b/frontend/src/api/teachBusiness/courseRunning.js @@ -71,8 +71,8 @@ export function getScheduleAdjustDetail(ssdksqbh) { * 提交调课申请 * POST /course-running/adjust/submit * 请求体(ScheduleAdjustApplyDTO)核心字段:sskcbbh 课次编号、sy 调课事由、rq 调课后新日期、 - * jc 调课后新节次、nd 年度、sqjybh 申请教员编号(可选 ydsjap 原日期节次描述、xydrwbh/kbh/ - * kcbbh/xydmc/jysdh/yjsbh/xjsbh/kcmc/sqjyxm 由课次自动带出) + * jc 调课后新节次、nd 年度;sqjybh/xydrwbh/kbh/kcbbh/xjsbh 为可选关联字段, + * roomList/teacherList/teamList/supportList 为调整后的关联明细。 */ export function submitScheduleAdjust(data) { return request({ diff --git a/frontend/src/views/student/warningCondition/index.vue b/frontend/src/views/student/warningCondition/index.vue index d81be073..a31c3073 100644 --- a/frontend/src/views/student/warningCondition/index.vue +++ b/frontend/src/views/student/warningCondition/index.vue @@ -20,11 +20,11 @@ - - - - - + + + + + @@ -253,7 +253,7 @@ export default { mc: '', pxlx: '', pxcc: '', - ty: '' + ty: 0 }, // ==================== 列表数据 ==================== @@ -317,10 +317,7 @@ export default { pageNum: this.pageNum, pageSize: this.pageSize } - // 状态:0 启用 / 1 停用(选中时才传) - if (this.searchForm.ty !== '' && this.searchForm.ty !== null && this.searchForm.ty !== undefined) { - params.ty = this.searchForm.ty - } + params.ty = this.searchForm.ty // 其余文本条件非空时才传 ;['mc', 'pxlx', 'pxcc'].forEach(key => { if (this.searchForm[key] !== '' && this.searchForm[key] !== null && this.searchForm[key] !== undefined) { @@ -349,7 +346,7 @@ export default { mc: '', pxlx: '', pxcc: '', - ty: '' + ty: 0 } this.pageNum = 1 this.fetchList() @@ -541,4 +538,4 @@ export default { user-select: none; } } - \ No newline at end of file + diff --git a/frontend/src/views/subjectMajor/discipline/index.vue b/frontend/src/views/subjectMajor/discipline/index.vue index a77d6a0a..4a8b328a 100644 --- a/frontend/src/views/subjectMajor/discipline/index.vue +++ b/frontend/src/views/subjectMajor/discipline/index.vue @@ -25,8 +25,11 @@ - - 停用 + + + + + @@ -322,10 +325,7 @@ export default { pageNum: this.pageNum, pageSize: this.pageSize } - // 状态:勾选「停用」时仅查已停用(ty=1),未勾选则查询全部 - if (this.searchForm.ty) { - params.ty = 1 - } + params.ty = this.searchForm.ty ? 1 : 0 // 其余文本条件非空时才传 ;['zymc', 'zydm', 'zyfx', 'xnz', 'pxlx2'].forEach(key => { const value = this.searchForm[key] diff --git a/frontend/src/views/subjectMajor/major/index.vue b/frontend/src/views/subjectMajor/major/index.vue index 1a6571f7..598e346b 100644 --- a/frontend/src/views/subjectMajor/major/index.vue +++ b/frontend/src/views/subjectMajor/major/index.vue @@ -45,11 +45,11 @@ - - - - - + + + + + @@ -367,7 +367,7 @@ export default { pxlx2: '', pxcc: '', xkzyxxbsh: '', - ty: '' + ty: 0 }, // ==================== 列表数据 ==================== @@ -460,10 +460,7 @@ export default { pageNum: this.pageNum, pageSize: this.pageSize } - // 状态:0 启用 / 1 停用(选中时才传) - if (this.searchForm.ty !== '' && this.searchForm.ty !== null && this.searchForm.ty !== undefined) { - params.ty = this.searchForm.ty - } + params.ty = this.searchForm.ty // 其余文本条件非空时才传 ;['zymc', 'zyfx', 'zydm', 'xnz', 'pxlx', 'pxlx2', 'pxcc', 'xkzyxxbsh'].forEach(key => { if (this.searchForm[key] !== '' && this.searchForm[key] !== null && this.searchForm[key] !== undefined) { @@ -497,7 +494,7 @@ export default { pxlx2: '', pxcc: '', xkzyxxbsh: '', - ty: '' + ty: 0 } this.pageNum = 1 this.fetchList() diff --git a/frontend/src/views/system/dept/index.vue b/frontend/src/views/system/dept/index.vue index 601e226b..cb6231d6 100644 --- a/frontend/src/views/system/dept/index.vue +++ b/frontend/src/views/system/dept/index.vue @@ -9,15 +9,11 @@ @keyup.enter.native="handleQuery" /> - - - - + + + + + 搜索 @@ -206,7 +202,7 @@ export default { // 查询参数 queryParams: { deptName: undefined, - status: undefined + status: '0' }, // 表单参数 form: {}, diff --git a/frontend/src/views/system/dict/data.vue b/frontend/src/views/system/dict/data.vue index 4ad1f322..0acb25fe 100644 --- a/frontend/src/views/system/dict/data.vue +++ b/frontend/src/views/system/dict/data.vue @@ -19,15 +19,11 @@ @keyup.enter.native="handleQuery" /> - - - - + + + + + 搜索 @@ -253,7 +249,7 @@ export default { pageSize: 10, dictType: undefined, dictLabel: undefined, - status: undefined + status: '0' }, // 表单参数 form: {}, diff --git a/frontend/src/views/system/dict/index.vue b/frontend/src/views/system/dict/index.vue index bab1b55d..7079dbb3 100644 --- a/frontend/src/views/system/dict/index.vue +++ b/frontend/src/views/system/dict/index.vue @@ -19,20 +19,11 @@ @keyup.enter.native="handleQuery" /> - - - - + + + + + \ No newline at end of file + diff --git a/frontend/src/views/system/menu/index.vue b/frontend/src/views/system/menu/index.vue index 49fac46c..d5c0144e 100644 --- a/frontend/src/views/system/menu/index.vue +++ b/frontend/src/views/system/menu/index.vue @@ -9,15 +9,11 @@ @keyup.enter.native="handleQuery" /> - - - - + + + + + 搜索 @@ -352,7 +348,8 @@ export default { // 查询参数 queryParams: { menuName: undefined, - visible: undefined + visible: undefined, + status: '0' }, // 表单参数 form: {}, diff --git a/frontend/src/views/system/post/index.vue b/frontend/src/views/system/post/index.vue index 6bdc3a3b..c8a6fd23 100644 --- a/frontend/src/views/system/post/index.vue +++ b/frontend/src/views/system/post/index.vue @@ -17,15 +17,11 @@ @keyup.enter.native="handleQuery" /> - - - - + + + + + 搜索 @@ -190,7 +186,7 @@ export default { pageSize: 10, postCode: undefined, postName: undefined, - status: undefined + status: '0' }, // 表单参数 form: {}, diff --git a/frontend/src/views/system/role/index.vue b/frontend/src/views/system/role/index.vue index 17468da6..0cda7bb0 100644 --- a/frontend/src/views/system/role/index.vue +++ b/frontend/src/views/system/role/index.vue @@ -19,20 +19,11 @@ @keyup.enter.native="handleQuery" /> - - - - + + + + + \ No newline at end of file + diff --git a/frontend/src/views/system/user/index.vue b/frontend/src/views/system/user/index.vue index 30bc674c..97f6389a 100644 --- a/frontend/src/views/system/user/index.vue +++ b/frontend/src/views/system/user/index.vue @@ -10,10 +10,11 @@ - - - - + + + + + @@ -230,7 +231,7 @@ export default { pageSize: 10, userName: undefined, phonenumber: undefined, - status: undefined, + status: '0', deptId: undefined }, // 列信息 diff --git a/frontend/src/views/teachBusiness/syllabus/index.vue b/frontend/src/views/teachBusiness/syllabus/index.vue index cda41159..43c212f0 100644 --- a/frontend/src/views/teachBusiness/syllabus/index.vue +++ b/frontend/src/views/teachBusiness/syllabus/index.vue @@ -10,11 +10,11 @@ - - - - - + + + + + @@ -296,7 +296,7 @@ export default { loading: false, searchForm: { zydh: '', - ty: '' + ty: 0 }, tableData: [], total: 0, @@ -381,8 +381,8 @@ export default { fetchList() { this.loading = true const { zydh, ty } = this.searchForm - // 专业代号与停用标识同时给出时走后端 /listByZydhAndTy;否则查全部后本地过滤 - const useApiQuery = zydh && ty !== '' && ty !== null && ty !== undefined + // 专业代号存在时走后端组合查询;否则查全部后按停用标识过滤 + const useApiQuery = Boolean(zydh) const req = useApiQuery ? listSyllabusByZydhAndTy(zydh, ty) : listSyllabus() @@ -390,9 +390,7 @@ export default { let list = response.data || [] if (!useApiQuery) { if (zydh) list = list.filter(i => i.zydh && i.zydh.indexOf(zydh) !== -1) - if (ty !== '' && ty !== null && ty !== undefined) { - list = list.filter(i => Number(i.ty) === Number(ty)) - } + list = list.filter(i => Number(i.ty) === Number(ty)) } this.tableData = list this.total = list.length @@ -408,7 +406,7 @@ export default { this.fetchList() }, handleReset() { - this.searchForm = { zydh: '', ty: '' } + this.searchForm = { zydh: '', ty: 0 } this.fetchList() }, handleSelectionChange(val) { diff --git a/frontend/src/views/teachBusiness/timetableAdjust/index.vue b/frontend/src/views/teachBusiness/timetableAdjust/index.vue index 71e96de4..154e3705 100644 --- a/frontend/src/views/teachBusiness/timetableAdjust/index.vue +++ b/frontend/src/views/teachBusiness/timetableAdjust/index.vue @@ -99,16 +99,23 @@ - + - + 选择可供调课课次 - + @@ -118,20 +125,34 @@ - - + + - + - + - + + + - +
- + - + @@ -45,7 +45,7 @@
- + @@ -132,10 +132,6 @@ import { listToday, listWeek, listClass, exportClassPlan, exportClassGrades, exportClassCourses } from '@/api/teachBusiness/timetable' import { listTeam } from '@/api/studentRecords/team' -const JC_SECTION = { - 1: '1-2节', 2: '3-4节', 3: '5-6节', 4: '7-8节', 5: '9-10节', 6: '11-12节' -} - const WEEK_DAY_NAMES = ['日', '一', '二', '三', '四', '五', '六'] function pad2(n) { @@ -161,9 +157,11 @@ export default { loading: false, // 今日 todayDate: new Date(), + dayOffset: 0, todayData: [], // 本周 weekStart: getMonday(new Date()), + weekOffset: 0, weekData: [], // 班次 searchForm: { teamClass: '' }, @@ -173,13 +171,23 @@ export default { } }, computed: { + selectedTodayDate() { + const date = new Date(this.todayDate) + date.setDate(date.getDate() + this.dayOffset) + return date + }, + selectedWeekStart() { + const date = new Date(this.weekStart) + date.setDate(date.getDate() + this.weekOffset * 7) + return date + }, dateTitle() { - return formatDate(this.todayDate) + ' 今日教学实施计划' + return formatDate(this.selectedTodayDate) + ' 今日教学实施计划' }, weekRangeText() { - const end = new Date(this.weekStart) + const end = new Date(this.selectedWeekStart) end.setDate(end.getDate() + 6) - return formatDate(this.weekStart) + '(' + this.weekDayName(this.weekStart) + ') 至 ' + + return formatDate(this.selectedWeekStart) + '(' + this.weekDayName(this.selectedWeekStart) + ') 至 ' + formatDate(end) + '(' + this.weekDayName(end) + ') 本周教学实施计划' }, pageTitle() { @@ -196,34 +204,22 @@ export default { weekDayName(d) { return WEEK_DAY_NAMES[d.getDay()] }, - formatJc(jc) { - if (jc === null || jc === undefined || jc === '') return '第?节' - return JC_SECTION[jc] || ('第' + jc + '节') - }, /* ---------- 今日:日期导航 ---------- */ handlePrevDay() { - const d = new Date(this.todayDate) - d.setDate(d.getDate() - 1) - this.todayDate = d + this.dayOffset -= 1 this.getTodayList() }, handleNextDay() { - const d = new Date(this.todayDate) - d.setDate(d.getDate() + 1) - this.todayDate = d + this.dayOffset += 1 this.getTodayList() }, /* ---------- 本周:周次导航 ---------- */ handlePrevWeek() { - const d = new Date(this.weekStart) - d.setDate(d.getDate() - 7) - this.weekStart = d + this.weekOffset -= 1 this.getWeekList() }, handleNextWeek() { - const d = new Date(this.weekStart) - d.setDate(d.getDate() + 7) - this.weekStart = d + this.weekOffset += 1 this.getWeekList() }, /* ---------- 队别班次下拉(真实接口) ---------- */ @@ -243,10 +239,6 @@ export default { }) }, /* ---------- 数据字段映射(接口字段 -> 页面字段) ---------- */ - parseSection(sksj) { - const m = String(sksj || '').match(/第(\d+)节/) - return m ? Number(m[1]) : undefined - }, mapLessonRow(apiRow) { // 接口今日/本周实体:bh sksj kc zrdw bc jy cd jxnrxff bz const row = Object.assign({}, apiRow) @@ -256,9 +248,28 @@ export default { row.jxnrff = apiRow.jxnrxff row.jybz = apiRow.bz row.sjsj = apiRow.sksj - row.jc = this.parseSection(apiRow.sksj) return row }, + extractLessonRows(response) { + const data = response && response.data + if (Array.isArray(data)) { + return data + } + if (!data) { + return [] + } + + // 新接口返回 DailyWeeklyTimetableRangeVO,列表位于 data.list; + // records 分支用于兼容旧分页结构,避免后端版本切换时页面再次无数据。 + if (Array.isArray(data.list)) { + return data.list + } + if (Array.isArray(data.records)) { + return data.records + } + + return [] + }, mapClassRow(apiRow) { // 接口班次实体:sskcbh kcmcksxs zrjykc jhxs yxxs khlxfs ssjy rscd ssjhbg const row = Object.assign({}, apiRow) @@ -271,12 +282,13 @@ export default { }, /* ---------- 今日:拉取数据 ---------- */ getTodayList() { + const params = { + offset: this.dayOffset, + rq: formatDate(this.todayDate) + } this.loading = true - listToday({}).then(response => { - const data = response.data - this.todayData = Array.isArray(data) - ? (data || []).map(item => this.mapLessonRow(item)) - : ((data && data.records) || []).map(item => this.mapLessonRow(item)) + listToday(params).then(response => { + this.todayData = this.extractLessonRows(response).map(item => this.mapLessonRow(item)) this.loading = false }).catch(() => { this.todayData = [] @@ -285,12 +297,13 @@ export default { }, /* ---------- 本周:拉取数据 ---------- */ getWeekList() { + const params = { + offset: this.weekOffset, + rq: formatDate(this.weekStart) + } this.loading = true - listWeek({}).then(response => { - const data = response.data - this.weekData = Array.isArray(data) - ? (data || []).map(item => this.mapLessonRow(item)) - : ((data && data.records) || []).map(item => this.mapLessonRow(item)) + listWeek(params).then(response => { + this.weekData = this.extractLessonRows(response).map(item => this.mapLessonRow(item)) this.loading = false }).catch(() => { this.weekData = [] diff --git a/frontend/src/views/teachBusiness/timetableAdjust/index.vue b/frontend/src/views/teachBusiness/timetableAdjust/index.vue index 154e3705..3e1f2409 100644 --- a/frontend/src/views/teachBusiness/timetableAdjust/index.vue +++ b/frontend/src/views/teachBusiness/timetableAdjust/index.vue @@ -339,9 +339,7 @@ const RECEIVE_STATUS = { export default { name: 'TimetableAdjust', data() { - const curUserName = (this.$store.state.user && this.$store.state.user.name) || '' return { - curUserName: curUserName, loading: false, tableData: [], total: 0, @@ -497,11 +495,24 @@ export default { sy: '', rq: '', jc: 1, - sqjybh: this.curUserName, + sqjybh: '', + xydrwbh: '', + kbh: '', + kcbbh: '', xydmc: '', yjsbh: '', xjsbh: '', - ydsjap: '' + ydsjap: '', + jxnr: '', + jxyd: '', + jxff: '', + jxbzbz: '', + ycxx: '', + bz: '', + roomList: [], + teacherList: [], + teamList: [], + supportList: [] } this.lessonOptions = [] this.loadClassroomOptions() @@ -509,11 +520,29 @@ export default { this.addVisible = true }, handleAddYearChange() { - this.addForm.sskcbbh = '' - this.addForm.xydmc = '' - this.addForm.yjsbh = '' - this.addForm.xjsbh = '' - this.addForm.ydsjap = '' + Object.assign(this.addForm, { + sskcbbh: '', + rq: '', + jc: 1, + sqjybh: '', + xydrwbh: '', + kbh: '', + kcbbh: '', + xydmc: '', + yjsbh: '', + xjsbh: '', + ydsjap: '', + jxnr: '', + jxyd: '', + jxff: '', + jxbzbz: '', + ycxx: '', + bz: '', + roomList: [], + teacherList: [], + teamList: [], + supportList: [] + }) this.lessonOptions = [] }, loadClassroomOptions() { @@ -558,12 +587,34 @@ export default { this.$message.warning('当前课次缺少课次编号,无法选择') return } - this.addForm.sskcbbh = lessonNumber - this.addForm.xydmc = row.xydmc || '' - this.addForm.yjsbh = row.jsbh || row.yjsbh || '' - this.addForm.xjsbh = '' - this.addForm.ydsjap = row.rq ? this.fmtRqJc(row.rq, row.jc) : (row.ydsjap || '') - ;['kbh', 'kcbbh', 'xydrwbh', 'jysdh', 'kcmc', 'sqjyxm'].forEach(key => { + const currentRoomNumber = row.jsbh || row.yjsbh || row.xjsbh || '' + const roomList = this.normalizeRoomList(row.roomList, currentRoomNumber) + const teamList = this.normalizeTeamList(row.teamList, row.xydbh) + Object.assign(this.addForm, { + sskcbbh: lessonNumber, + rq: row.rq ? String(row.rq).substring(0, 10) : '', + jc: row.jc === null || row.jc === undefined ? 1 : Number(row.jc), + nd: row.nd || this.addForm.nd, + sqjybh: row.sqjybh || '', + xydrwbh: row.xydrwbh || '', + kbh: row.kbh || '', + kcbbh: row.kcbbh || '', + xydmc: row.xydmc || '', + yjsbh: row.yjsbh || currentRoomNumber, + xjsbh: row.xjsbh || currentRoomNumber, + ydsjap: row.rq ? this.fmtRqJc(row.rq, row.jc) : (row.ydsjap || ''), + jxnr: row.jxnr || '', + jxyd: row.jxyd || '', + jxff: row.jxff || '', + jxbzbz: row.jxbzbz || '', + ycxx: row.ycxx || '', + bz: row.bz || '', + roomList: roomList, + teacherList: this.normalizeTeacherList(row.teacherList), + teamList: teamList, + supportList: this.normalizeSupportList(row.supportList) + }) + ;['jysdh', 'kcmc', 'sqjyxm'].forEach(key => { if (row[key] !== undefined && row[key] !== null) this.addForm[key] = row[key] }) this.lessonDialogVisible = false @@ -578,14 +629,19 @@ export default { sy: this.addForm.sy, rq: this.addForm.rq + 'T00:00:00', jc: this.addForm.jc, - nd: this.addForm.nd + nd: this.addForm.nd, + roomList: this.buildSubmitRoomList(), + teacherList: this.normalizeTeacherList(this.addForm.teacherList), + teamList: this.normalizeTeamList(this.addForm.teamList), + supportList: this.normalizeSupportList(this.addForm.supportList) } - ;['xydrwbh', 'kbh', 'kcbbh', 'xjsbh'].forEach(key => { + const optionalFields = [ + 'sqjybh', 'xydrwbh', 'kbh', 'kcbbh', 'xjsbh', 'jxnr', 'jxyd', + 'jxff', 'jxbzbz', 'ycxx', 'bz' + ] + optionalFields.forEach(key => { if (this.addForm[key]) payload[key] = this.addForm[key] }) - if (this.addForm.xjsbh) { - payload.roomList = [{ jsbh: this.addForm.xjsbh }] - } this.addLoading = true submitScheduleAdjust(payload).then(() => { this.addLoading = false @@ -597,6 +653,52 @@ export default { }) }) }, + normalizeRoomList(roomList, fallbackRoomNumber) { + const normalizedList = (Array.isArray(roomList) ? roomList : []) + .filter(item => item && item.jsbh) + .map(item => ({ + jsbh: item.jsbh, + bz: item.bz || '' + })) + if (normalizedList.length === 0 && fallbackRoomNumber) { + normalizedList.push({ jsbh: fallbackRoomNumber, bz: '' }) + } + return normalizedList + }, + normalizeTeacherList(teacherList) { + return (Array.isArray(teacherList) ? teacherList : []) + .filter(item => item && item.fzjybh) + .map(item => ({ fzjybh: item.fzjybh })) + }, + normalizeTeamList(teamList, fallbackTeamNumber) { + const normalizedList = (Array.isArray(teamList) ? teamList : []) + .filter(item => item && item.xydbh) + .map(item => ({ xydbh: item.xydbh })) + if (normalizedList.length === 0 && fallbackTeamNumber) { + normalizedList.push({ xydbh: fallbackTeamNumber }) + } + return normalizedList + }, + normalizeSupportList(supportList) { + return (Array.isArray(supportList) ? supportList : []) + .filter(item => item && item.bztgmxbh) + .map(item => ({ + bztgmxbh: item.bztgmxbh, + sl: item.sl === null || item.sl === undefined ? undefined : Number(item.sl) + })) + }, + buildSubmitRoomList() { + if (!this.addForm.xjsbh) return [] + const currentRoomList = this.normalizeRoomList(this.addForm.roomList) + if (this.addForm.xjsbh === this.addForm.yjsbh && currentRoomList.length > 0) { + return currentRoomList + } + const currentRoom = currentRoomList.find(item => item.jsbh === this.addForm.xjsbh) + return [{ + jsbh: this.addForm.xjsbh, + bz: currentRoom ? currentRoom.bz : '' + }] + }, /* ---------- 审批 ---------- */ showAuditMenu(row) { return row.sczt === 0 && (row.jyspzzt === 0 || row.jyspzzt === 2 || row.jyspzzt === 3)