所在位置

master
lion 3 weeks ago
parent e9670d3e21
commit 3f716ee181

@ -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
}
}

Loading…
Cancel
Save