From 635038b25c2458be5143fdeef2236d4d62bcebae Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 7 Jul 2026 10:24:37 +0800 Subject: [PATCH] commit --- .../service/impl/SiteCugApplyServiceImpl.java | 24 +++ .../zhgh/dayofficework/siteCug/apply/apply.js | 29 ++- .../siteCug/schoolUnionAudit/index.html | 4 +- .../dayofficework/siteCug/apply/form/apply.js | 27 ++- .../siteCug/apply/form/index.html | 40 +++- .../dayofficework/siteCug/mine/index.html | 172 +++++++++++++++++- .../siteCug/schoolUnionAudit/index.html | 146 ++++++++++++++- 7 files changed, 416 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/budwk/app/zhgh/dayofficework/siteCug/service/impl/SiteCugApplyServiceImpl.java b/src/main/java/com/budwk/app/zhgh/dayofficework/siteCug/service/impl/SiteCugApplyServiceImpl.java index bb248871..4d1c9103 100644 --- a/src/main/java/com/budwk/app/zhgh/dayofficework/siteCug/service/impl/SiteCugApplyServiceImpl.java +++ b/src/main/java/com/budwk/app/zhgh/dayofficework/siteCug/service/impl/SiteCugApplyServiceImpl.java @@ -80,6 +80,10 @@ public class SiteCugApplyServiceImpl extends BaseServiceImpl imple if (!Boolean.TRUE.equals(siteInfo.getState())) { return Map.of(false, "该场地未开启预约"); } + Map termDateRangeValidate = validateTermDateRange(apply, siteInfo); + if (termDateRangeValidate.containsKey(false)) { + return termDateRangeValidate; + } if (apply.getJoinCount() == null || apply.getJoinCount() <= 0) { return Map.of(false, "预约人数必须大于0"); } @@ -135,6 +139,26 @@ public class SiteCugApplyServiceImpl extends BaseServiceImpl imple return Map.of(true, ""); } + // 分工会预约必须落在后台配置的本学期时间内,批量预约逐条复用该校验防止接口越权提交学期外日期 + private Map validateTermDateRange(SiteCugApply apply, SiteCugInfo siteInfo) { + if (!StrUtil.equals(apply.getReserveType(), "union") + || StrUtil.hasBlank(siteInfo.getTermStartDate(), siteInfo.getTermEndDate())) { + return Map.of(true, ""); + } + try { + DateTime reserveStart = DateUtil.parseDateTime(apply.getReserveStartTime()); + DateTime reserveEnd = DateUtil.parseDateTime(apply.getReserveEndTime()); + Date termStart = DateUtil.beginOfDay(DateUtil.parseDate(siteInfo.getTermStartDate())); + Date termEnd = DateUtil.endOfDay(DateUtil.parseDate(siteInfo.getTermEndDate())); + if (reserveStart.isBefore(termStart) || reserveEnd.isAfter(termEnd)) { + return Map.of(false, "预约时间必须在本学期时间范围内"); + } + return Map.of(true, ""); + } catch (Exception e) { + return Map.of(false, "本学期时间配置有误,请联系管理员处理"); + } + } + @Override public Map occupyRecord(String id, String message, boolean sendMsg) { if (StrUtil.isBlank(message)) { diff --git a/src/main/resources/views/platform/zhgh/dayofficework/siteCug/apply/apply.js b/src/main/resources/views/platform/zhgh/dayofficework/siteCug/apply/apply.js index 3b5d3f33..f72933b3 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/siteCug/apply/apply.js +++ b/src/main/resources/views/platform/zhgh/dayofficework/siteCug/apply/apply.js @@ -175,9 +175,9 @@ const apply = {
- 预约本年后续每周同一时段 + 预约本月后续每周同一时段 - 例如先选某个周一 09:00-11:00,勾选后会自动预约本年剩余所有周一的这个时段。 + 例如先选某个周一 09:00-11:00,勾选后会自动预约本月剩余所有周一的这个时段。
@@ -344,7 +344,10 @@ const apply = { if (!this.formData.reserveStartTime) { return false } - return this.$moment(time).format('YYYY-MM-DD') < this.formData.reserveStartTime.slice(0, 10) + const targetDay = this.$moment(time).format('YYYY-MM-DD') + const startDay = this.formData.reserveStartTime.slice(0, 10) + const monthEndDay = this.$moment(this.formData.reserveStartTime).endOf('month').format('YYYY-MM-DD') + return targetDay < startDay || targetDay > monthEndDay }, } }, @@ -397,10 +400,10 @@ const apply = { return '' } if (!this.formData.reserveStartTime || !this.formData.reserveEndTime) { - return '请先选择开始和结束时间后,再批量预约本年同星期时段' + return '请先选择开始和结束时间后,再批量预约本月同星期时段' } if (!this.yearlyReserveDates.length) { - return '当前时间段无法生成本年批量预约日期' + return '当前时间段无法生成本月批量预约日期' } return '将从 ' + this.yearlyReserveDates[0] + ' 开始,自动预约到 ' + this.yearlyReserveDates[this.yearlyReserveDates.length - 1] + ',共 ' + this.yearlyReserveDates.length + ' 个时段' }, @@ -498,6 +501,10 @@ const apply = { } if (this.formData.reserveStartTime && this.formData.yearlyReserveEndDate < this.formData.reserveStartTime.slice(0, 10)) { this.$set(this.formData, 'yearlyReserveEndDate', defaultDate) + return + } + if (this.formData.reserveStartTime && this.formData.yearlyReserveEndDate > defaultDate) { + this.$set(this.formData, 'yearlyReserveEndDate', defaultDate) } }, getInitialScheduleDate() { @@ -1020,12 +1027,16 @@ const apply = { this.$message.warning('批量预约截止日期不能早于开始日期') return false } + if (this.formData.reserveStartTime && this.formData.yearlyReserveEndDate > this.$moment(this.formData.reserveStartTime).endOf('month').format('YYYY-MM-DD')) { + this.$message.warning('批量预约截止日期不能超过预约开始时间所在月份') + return false + } if (!this.yearlyReserveDates.length) { this.$message.warning('当前选择的时间段在截止日期内无法生成可批量预约的日期') return false } if (!this.yearlyReserveDates.length) { - this.$message.warning('当前选择的时间段无法生成本年批量预约日期') + this.$message.warning('当前选择的时间段无法生成本月批量预约日期') return false } return true @@ -1038,7 +1049,7 @@ const apply = { if (!this.yearlyReserve) { return baseText + ',是否确定提交预约?' } - return baseText + '。系统将继续预约本年后续 ' + this.yearlyReserveDates.length + ' 个同星期时段,是否确定提交?' + return baseText + '。系统将继续预约本月后续 ' + this.yearlyReserveDates.length + ' 个同星期时段,是否确定提交?' }, validateYearlyReserve() { if (!this.yearlyReserve) { @@ -1052,6 +1063,10 @@ const apply = { this.$message.warning('批量预约截止日期不能早于开始日期') return false } + if (this.formData.reserveStartTime && this.formData.yearlyReserveEndDate > this.$moment(this.formData.reserveStartTime).endOf('month').format('YYYY-MM-DD')) { + this.$message.warning('批量预约截止日期不能超过预约开始时间所在月份') + return false + } if (!this.yearlyReserveDates.length) { this.$message.warning('当前选择的时间段在截止日期内无法生成可批量预约的日期') return false diff --git a/src/main/resources/views/platform/zhgh/dayofficework/siteCug/schoolUnionAudit/index.html b/src/main/resources/views/platform/zhgh/dayofficework/siteCug/schoolUnionAudit/index.html index 0e3bfa88..55d3ba7d 100644 --- a/src/main/resources/views/platform/zhgh/dayofficework/siteCug/schoolUnionAudit/index.html +++ b/src/main/resources/views/platform/zhgh/dayofficework/siteCug/schoolUnionAudit/index.html @@ -288,7 +288,7 @@ layout("/layouts/platform.html"){ return } const message = this.formData.yearlyBatch - ? ('该记录属于“预约本年”批量预约,提交后将一并审核同批次的 ' + (this.formData.batchAuditCount || 0) + ' 条预约记录,是否继续?') + ? ('该记录属于“预约本月”批量预约,提交后将一并审核同批次的 ' + (this.formData.batchAuditCount || 0) + ' 条预约记录,是否继续?') : '您确定要提交吗?' this.$confirm(message, '提示', { confirmButtonText: '确定', @@ -317,7 +317,7 @@ layout("/layouts/platform.html"){ return } const message = this.normalizeBatchFlag(row) - ? ('该记录属于“预约本年”批量预约,撤回后将一并撤回同批次的 ' + (row.batchAuditCount || row._batchCount || 0) + ' 条审核任务,是否继续?') + ? ('该记录属于“预约本月”批量预约,撤回后将一并撤回同批次的 ' + (row.batchAuditCount || row._batchCount || 0) + ' 条审核任务,是否继续?') : '您确定要撤回吗?' this.$confirm(message, '提示', { confirmButtonText: '确定', diff --git a/src/main/resources/views/platform/zhghh5/dayofficework/siteCug/apply/form/apply.js b/src/main/resources/views/platform/zhghh5/dayofficework/siteCug/apply/form/apply.js index 7d9d033b..d2f218f6 100644 --- a/src/main/resources/views/platform/zhghh5/dayofficework/siteCug/apply/form/apply.js +++ b/src/main/resources/views/platform/zhghh5/dayofficework/siteCug/apply/form/apply.js @@ -142,7 +142,10 @@ new Vue({ return base.startOf('day').toDate() }, yearlyReserveMaxDate() { - return this.$moment().add(2, 'year').endOf('year').toDate() + const base = this.formData.reserveStartTime + ? this.$moment(this.formData.reserveStartTime) + : (this.scheduleDate ? this.$moment(this.scheduleDate, 'YYYY-MM-DD') : this.$moment()) + return base.endOf('month').toDate() }, yearlyReserveDates() { if (!this.yearlyReserve || !this.formData.reserveStartTime || !this.formData.reserveEndTime || !this.formData.yearlyReserveEndDate) { @@ -255,6 +258,10 @@ new Vue({ } if (this.formData.reserveStartTime && this.formData.yearlyReserveEndDate < this.formData.reserveStartTime.slice(0, 10)) { this.$set(this.formData, 'yearlyReserveEndDate', defaultDate) + return + } + if (this.formData.reserveStartTime && this.formData.yearlyReserveEndDate > defaultDate) { + this.$set(this.formData, 'yearlyReserveEndDate', defaultDate) } }, openReserveTypePicker() { @@ -488,6 +495,20 @@ new Vue({ result.push('slot-block--closed') return result }, + formatSlotLabel(block) { + const label = block && block.label ? block.label : '' + const match = label.match(/^(.+?)\s+(\d{2}:\d{2}(?::\d{2})?\s*-\s*\d{2}:\d{2}(?::\d{2})?)$/) + if (match) { + return { + name: match[1], + time: match[2], + } + } + return { + name: label, + time: '', + } + }, onAvailabilityBlockClick(block) { if (!block || !block.key) { return @@ -847,6 +868,10 @@ new Vue({ this.$toast('批量预约截止日期不能早于开始日期') return false } + if (this.formData.reserveStartTime && this.formData.yearlyReserveEndDate > this.$moment(this.formData.reserveStartTime).endOf('month').format('YYYY-MM-DD')) { + this.$toast('批量预约截止日期不能超过预约开始时间所在月份') + return false + } if (!this.yearlyReserveDates.length) { this.$toast('当前截止日期内没有可批量预约的同星期时段') return false diff --git a/src/main/resources/views/platform/zhghh5/dayofficework/siteCug/apply/form/index.html b/src/main/resources/views/platform/zhghh5/dayofficework/siteCug/apply/form/index.html index aed48e96..e3f0afb9 100644 --- a/src/main/resources/views/platform/zhghh5/dayofficework/siteCug/apply/form/index.html +++ b/src/main/resources/views/platform/zhghh5/dayofficework/siteCug/apply/form/index.html @@ -165,21 +165,30 @@ layout("/layouts/platform_h5.html"){ .availability-popup__tabs { display: flex; gap: 8px; - padding: 12px 16px 0; + padding: 12px 16px 8px; overflow-x: auto; background: #f8fafc; + scrollbar-width: none; + -ms-overflow-style: none; + } + + .availability-popup__tabs::-webkit-scrollbar { + display: none; } .availability-tab { + flex: 0 0 auto; min-width: 72px; - height: 34px; - padding: 0 14px; + min-height: 34px; + padding: 6px 14px; border: 1px solid #cbd5e1; border-radius: 999px; background: #ffffff; color: #475569; font-size: 13px; font-weight: 500; + line-height: 1.2; + white-space: nowrap; box-sizing: border-box; } @@ -244,12 +253,13 @@ layout("/layouts/platform_h5.html"){ .slot-block { min-height: 48px; - padding: 0 12px; + padding: 8px 10px; border: 1px solid #dbe4ee; border-radius: 14px; background: #ffffff; color: #475569; - display: inline-flex; + display: flex; + flex-direction: column; align-items: center; justify-content: center; text-align: center; @@ -259,6 +269,21 @@ layout("/layouts/platform_h5.html"){ box-sizing: border-box; } + .slot-block__name, + .slot-block__time { + display: block; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .slot-block__time { + margin-top: 2px; + font-size: 12px; + line-height: 1.2; + } + .slot-block--available { border-color: #86efac; background: rgba(34, 197, 94, 0.1); @@ -464,7 +489,7 @@ layout("/layouts/platform_h5.html"){
-
将自动预约截止日期内每周同一时段,默认到本月底。
+
预约本月后续每周同一时段,默认到本月底。
- {{ block.label }} + {{ formatSlotLabel(block).name }} + {{ formatSlotLabel(block).time }}
diff --git a/src/main/resources/views/platform/zhghh5/dayofficework/siteCug/mine/index.html b/src/main/resources/views/platform/zhghh5/dayofficework/siteCug/mine/index.html index 3b8e7ec4..7638bdbd 100644 --- a/src/main/resources/views/platform/zhghh5/dayofficework/siteCug/mine/index.html +++ b/src/main/resources/views/platform/zhghh5/dayofficework/siteCug/mine/index.html @@ -3,7 +3,54 @@ layout("/layouts/platform_h5.html"){ #-->
@@ -18,18 +65,35 @@ layout("/layouts/platform_h5.html"){