Release: 添加行程验证
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user