diff --git a/src/modules/scheduling/SuggestionDetail.tsx b/src/modules/scheduling/SuggestionDetail.tsx index eb2785c..dc8e78d 100644 --- a/src/modules/scheduling/SuggestionDetail.tsx +++ b/src/modules/scheduling/SuggestionDetail.tsx @@ -116,11 +116,11 @@ export default function SuggestionDetail({ suggestion: s, onClose, onNotifySucce {/* Candidates */}
-
- - {isRescue ? '建议替换车辆' : '建议替换车辆'} - - {s.candidates.length} 辆可选 +
+
+ 当前区域所有可替换在库车辆 + {s.candidates.length} 辆 +
diff --git a/src/server/routes/scheduling/algorithm.ts b/src/server/routes/scheduling/algorithm.ts index d82b3e7..4caa611 100644 --- a/src/server/routes/scheduling/algorithm.ts +++ b/src/server/routes/scheduling/algorithm.ts @@ -129,7 +129,7 @@ export function generateSuggestions( // Among non-qualifiable: smallest gap first (closest to target) return a.mileageGap - b.mileageGap; }) - .slice(0, 5); +; const gap = Math.max(0, vehicle.yearTarget - vehicle.currentYearMileage); const dailyReq = vehicle.daysLeft > 0 ? Math.round(gap / vehicle.daysLeft) : 0; @@ -192,7 +192,7 @@ export function generateSuggestions( }) // Only keep candidates that can actually qualify at this customer .filter(c => c.canQualifyAfterSwap) - .slice(0, 5); +; // Skip if no candidate can reach target — swap would be pointless if (candidates.length === 0) continue;