+ {isRescue
+ ? '以下车辆里程已充足,可调给当前客户,将此车换走给高里程客户冲刺'
+ : '以下车辆里程缺口大,换到该高里程客户处可加速达标'
+ }
+
{s.candidates.map(c => {
diff --git a/src/modules/scheduling/SuggestionList.tsx b/src/modules/scheduling/SuggestionList.tsx
index e3b1136..591c04d 100644
--- a/src/modules/scheduling/SuggestionList.tsx
+++ b/src/modules/scheduling/SuggestionList.tsx
@@ -38,7 +38,7 @@ export default function SuggestionList({ suggestions, onSelect }: Props) {
onClick={() => onSelect(s)}
>
{/* Color bar */}
-
+
{/* Info */}
@@ -47,9 +47,9 @@ export default function SuggestionList({ suggestions, onSelect }: Props) {
{v.plateNumber}
- {isRescue ? '无望' : '达标'}
+ {isRescue ? '里程低·换走' : '里程高·换下'}
{v.vehicleType}
·
diff --git a/src/server/routes/scheduling/algorithm.ts b/src/server/routes/scheduling/algorithm.ts
index b7d981f..b23c460 100644
--- a/src/server/routes/scheduling/algorithm.ts
+++ b/src/server/routes/scheduling/algorithm.ts
@@ -3,6 +3,11 @@ import type {
CandidateVehicle, VehicleClassification, SchedulingSummary,
} from './types.js';
+function fmtKmSimple(v: number): string {
+ if (v >= 10000) return (v / 10000).toFixed(1) + '万';
+ return Math.round(v).toLocaleString();
+}
+
// ---------------------------------------------------------------------------
// 1. Vehicle type compatibility
// ---------------------------------------------------------------------------
@@ -105,7 +110,10 @@ export function generateSuggestions(
})
.slice(0, 5);
- const reason = `${vehicle.customer}日均里程仅 ${Math.round(vehicle.customerAvgDaily)} KM,该车达标概率 ${Math.round((vehicle.predictedYearEnd / vehicle.yearTarget) * 100)}%,建议替换为已达标车辆,将此车调配给高里程客户。`;
+ const yearRate = vehicle.yearTarget > 0 ? Math.round((vehicle.currentYearMileage / vehicle.yearTarget) * 100) : 0;
+ const gap = Math.max(0, vehicle.yearTarget - vehicle.currentYearMileage);
+ const reason = `该车在客户「${vehicle.customer}」处日均仅 ${Math.round(vehicle.customerAvgDaily)} km,本年完成率 ${yearRate}%,还差 ${fmtKmSimple(gap)} km 达标,按当前速度年底无法完成。`
+ + `\n建议:将此车调配给高里程客户冲刺达标,同时从库存调一辆已达标的车给当前客户。`;
suggestions.push({
id: `hopeless-${vehicle.plateNumber}`,
@@ -156,7 +164,8 @@ export function generateSuggestions(
.slice(0, 5);
const yearRate = vehicle.yearTarget > 0 ? Math.round((vehicle.currentYearMileage / vehicle.yearTarget) * 100) : 0;
- const reason = `${vehicle.customer}日均里程 ${Math.round(vehicle.customerAvgDaily)} KM(高里程),该车本年完成率 ${yearRate}%,建议换上里程缺口大的车辆以加速达标。`;
+ const reason = `该车在客户「${vehicle.customer}」处已达标(完成率 ${yearRate}%),客户日均 ${Math.round(vehicle.customerAvgDaily)} km,属于高里程客户。`
+ + `\n建议:将此车换下,换上一辆里程少的车,利用该客户的高日均里程帮助新车快速达标。`;
suggestions.push({
id: `qualified-${vehicle.plateNumber}`,