|
|
|
|
@ -627,15 +627,23 @@ function validateBookingFormInternal(): boolean {
|
|
|
|
|
}
|
|
|
|
|
const yStart = sessionDatetimeYmdPart(startN)
|
|
|
|
|
const yEnd = sessionDatetimeYmdPart(endN)
|
|
|
|
|
if (!yStart || !yEnd || yStart !== yEnd) {
|
|
|
|
|
if (!yStart || !yEnd) {
|
|
|
|
|
Message.warning(`第 ${i + 1} 行请填写场次开始与场次结束时间`)
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
if (rt === 'online' && yStart !== yEnd) {
|
|
|
|
|
Message.warning(`第 ${i + 1} 行场次开始与场次结束须为同一天内`)
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
const actStart = String(form.start_at || '').trim().slice(0, 10)
|
|
|
|
|
const actEnd = String(form.end_at || '').trim().slice(0, 10)
|
|
|
|
|
if (/^\d{4}-\d{2}-\d{2}$/.test(actStart) && /^\d{4}-\d{2}-\d{2}$/.test(actEnd)) {
|
|
|
|
|
if (yStart < actStart || yStart > actEnd) {
|
|
|
|
|
Message.warning(`第 ${i + 1} 行场次日期须落在活动日期 ${actStart}~${actEnd} 范围内`)
|
|
|
|
|
const startOut = yStart < actStart || yStart > actEnd
|
|
|
|
|
const endOut = yEnd < actStart || yEnd > actEnd
|
|
|
|
|
if (startOut || endOut) {
|
|
|
|
|
Message.warning(
|
|
|
|
|
`第 ${i + 1} 行场次开始与结束的日期须落在活动日期 ${actStart}~${actEnd} 范围内`,
|
|
|
|
|
)
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|