fix(scheduling): use current year mileage for consistent data display

- Add currentYearMileage to SchedulingVehicleInfo (backend + frontend)
- Compute completionRate as currentYearMileage/yearTarget (year-based)
  instead of using overall completion_rate from DB
- Display "本年已跑" instead of "累计" in detail modal
- Fix reason text to show year completion rate

Before: 累计 4.6万, 考核 3.0万, 完成率 12.1% (mismatched periods)
After:  本年已跑 8.3万, 考核 3.0万, 完成率 275% (consistent year-based)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
kkfluous
2026-04-16 21:08:29 +08:00
parent 6ee811c937
commit bcbeb64e28
4 changed files with 11 additions and 5 deletions

View File

@@ -85,8 +85,8 @@ export default function SuggestionDetail({ suggestion: s, onClose, onNotifySucce
<div className="flex items-center gap-3 text-[10px] text-slate-500 flex-wrap">
<span>{v.targetName}</span>
<span className="text-slate-300">|</span>
<span> <span className="text-slate-700 font-bold">{fmtKm(v.totalMileage)}</span> km</span>
<span> <span className="text-slate-700 font-bold">{fmtKm(v.yearTarget)}</span> km</span>
<span> <span className="text-slate-700 font-bold">{fmtKm(v.currentYearMileage)}</span> km</span>
<span> <span className="text-slate-700 font-bold">{fmtKm(v.yearTarget)}</span> km</span>
<span><MapPin size={9} className="inline -mt-px" /> {v.region}</span>
</div>
<div className="flex items-center gap-3 text-[10px] text-slate-500 mt-1">