refactor(scheduling): condense reason text to data-only one-liner
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -129,9 +129,7 @@ export function generateSuggestions(
|
|||||||
|
|
||||||
const yearRate = vehicle.yearTarget > 0 ? Math.round((vehicle.currentYearMileage / vehicle.yearTarget) * 100) : 0;
|
const yearRate = vehicle.yearTarget > 0 ? Math.round((vehicle.currentYearMileage / vehicle.yearTarget) * 100) : 0;
|
||||||
const gap = Math.max(0, vehicle.yearTarget - vehicle.currentYearMileage);
|
const gap = Math.max(0, vehicle.yearTarget - vehicle.currentYearMileage);
|
||||||
const canAddKm = Math.round(customerCanAdd);
|
const reason = `客户日均 ${Math.round(vehicle.customerAvgDaily)} km · 完成率 ${yearRate}% · 缺口 ${fmtKmSimple(gap)} km · 剩余 ${vehicle.daysLeft} 天(约 ${fmtKmSimple(Math.round(customerCanAdd))} km)`;
|
||||||
const reason = `该车在客户「${vehicle.customer}」处日均仅 ${Math.round(vehicle.customerAvgDaily)} km,完成率 ${yearRate}%,还差 ${fmtKmSimple(gap)} km,年底无法达标。`
|
|
||||||
+ `\n建议:将此车换走给高里程客户冲刺,换上一辆快达标的车——该客户剩余 ${vehicle.daysLeft} 天还能跑约 ${fmtKmSimple(canAddKm)} km,足以帮缺口小的车冲线。`;
|
|
||||||
|
|
||||||
suggestions.push({
|
suggestions.push({
|
||||||
id: `hopeless-${vehicle.plateNumber}`,
|
id: `hopeless-${vehicle.plateNumber}`,
|
||||||
@@ -196,8 +194,7 @@ export function generateSuggestions(
|
|||||||
|
|
||||||
const yearRate = vehicle.yearTarget > 0 ? Math.round((vehicle.currentYearMileage / vehicle.yearTarget) * 100) : 0;
|
const yearRate = vehicle.yearTarget > 0 ? Math.round((vehicle.currentYearMileage / vehicle.yearTarget) * 100) : 0;
|
||||||
const canAddKm = vehicle.customerAvgDaily * vehicle.daysLeft;
|
const canAddKm = vehicle.customerAvgDaily * vehicle.daysLeft;
|
||||||
const reason = `该车在客户「${vehicle.customer}」处已达标(完成率 ${yearRate}%),客户日均 ${Math.round(vehicle.customerAvgDaily)} km × ${vehicle.daysLeft} 天 ≈ ${fmtKmSimple(canAddKm)} km。`
|
const reason = `客户日均 ${Math.round(vehicle.customerAvgDaily)} km · 完成率 ${yearRate}% · 剩余 ${vehicle.daysLeft} 天(约 ${fmtKmSimple(Math.round(canAddKm))} km)`;
|
||||||
+ `\n建议:换上里程未达标的车,利用该客户的高日均帮新车快速冲线。`;
|
|
||||||
|
|
||||||
suggestions.push({
|
suggestions.push({
|
||||||
id: `qualified-${vehicle.plateNumber}`,
|
id: `qualified-${vehicle.plateNumber}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user