From 675c559d477e2fa2be254104dc3aa643a9b4a9f8 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 28 Feb 2026 14:46:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E8=A1=8C=E7=A8=8B?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E6=97=A5=E6=9C=9F=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 往返行程必须填写结束日期 - 避免提交时 end_date 为空导致数据库错误 --- frontend/src/pages/business-trip/apply.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/business-trip/apply.tsx b/frontend/src/pages/business-trip/apply.tsx index dedb630..bcec4d5 100644 --- a/frontend/src/pages/business-trip/apply.tsx +++ b/frontend/src/pages/business-trip/apply.tsx @@ -287,9 +287,18 @@ export default function BusinessTripApply() { return } - const hasValidItinerary = itineraries.some(item => item.startTime && item.destination.trim()) + const hasValidItinerary = itineraries.some(item => { + if (!item.startTime || !item.destination.trim()) { + return false + } + // 如果是往返行程,必须有结束时间 + if (item.tripType === 'roundtrip' && !item.endTime) { + return false + } + return true + }) if (!hasValidItinerary) { - Toast.show('请至少填写一条完整行程') + Toast.show('请至少填写一条完整行程(往返行程需填写结束日期)') return }