|
|
@@ -565,7 +565,7 @@ export class Dashboard implements OnInit, OnDestroy {
|
|
|
const daysSinceUpdate = Math.floor((now.getTime() - updatedAt.getTime()) / (1000 * 60 * 60 * 24));
|
|
|
// 如果超过7天未更新,认为停滞
|
|
|
isStalled = daysSinceUpdate > 7;
|
|
|
- stalledDays = isStalled ? daysSinceUpdate : 0;
|
|
|
+ stalledDays = daysSinceUpdate;
|
|
|
}
|
|
|
|
|
|
// 9. 催办次数(基于状态和历史记录)
|
|
|
@@ -1582,6 +1582,19 @@ export class Dashboard implements OnInit, OnDestroy {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ // 🆕 辅助方法:获取逾期原因
|
|
|
+ const getOverdueReason = (daysDiff: number, stalledDays: number = 0) => {
|
|
|
+ if (daysDiff >= 0) return ''; // 未逾期
|
|
|
+
|
|
|
+ // 如果项目超过3天未更新/无反馈,推测为客户原因
|
|
|
+ if (stalledDays >= 3) {
|
|
|
+ return '原因:客户未跟进反馈导致逾期';
|
|
|
+ }
|
|
|
+
|
|
|
+ // 否则推测为设计师进度原因
|
|
|
+ return '原因:设计师进度原因导致逾期';
|
|
|
+ };
|
|
|
+
|
|
|
const addEvent = (
|
|
|
partial: Omit<UrgentEvent, 'category' | 'statusType' | 'labels' | 'allowConfirmOnTime' | 'allowMarkHandled' | 'allowCreateTodo' | 'followUpNeeded'> &
|
|
|
Partial<UrgentEvent>
|
|
|
@@ -1626,10 +1639,13 @@ export class Dashboard implements OnInit, OnDestroy {
|
|
|
|
|
|
// 如果小图对图已经到期或即将到期(1天内),且不在已完成状态
|
|
|
if (daysDiff <= 1 && project.currentStage !== 'delivery') {
|
|
|
+ const reason = getOverdueReason(daysDiff, project.stalledDays);
|
|
|
+ const descSuffix = reason ? `,${reason}` : '';
|
|
|
+
|
|
|
addEvent({
|
|
|
id: `${project.projectId}-review`,
|
|
|
title: `小图对图截止`,
|
|
|
- description: `项目「${project.projectName}」的小图对图时间已${daysDiff < 0 ? '逾期' : '临近'}`,
|
|
|
+ description: `项目「${project.projectName}」的小图对图时间已${daysDiff < 0 ? '逾期' : '临近'}${descSuffix}`,
|
|
|
eventType: 'review',
|
|
|
deadline: project.reviewDate,
|
|
|
projectId: project.projectId,
|
|
|
@@ -1653,11 +1669,13 @@ export class Dashboard implements OnInit, OnDestroy {
|
|
|
if (daysDiff <= 1 && project.currentStage !== 'delivery') {
|
|
|
const summary = project.spaceDeliverableSummary;
|
|
|
const completionRate = summary?.overallCompletionRate || 0;
|
|
|
+ const reason = getOverdueReason(daysDiff, project.stalledDays);
|
|
|
+ const descSuffix = reason ? `,${reason}` : '';
|
|
|
|
|
|
addEvent({
|
|
|
id: `${project.projectId}-delivery`,
|
|
|
title: `项目交付截止`,
|
|
|
- description: `项目「${project.projectName}」需要在 ${project.deliveryDate.toLocaleDateString()} 交付(当前完成率 ${completionRate}%)`,
|
|
|
+ description: `项目「${project.projectName}」需要在 ${project.deliveryDate.toLocaleDateString()} 交付(当前完成率 ${completionRate}%)${descSuffix}`,
|
|
|
eventType: 'delivery',
|
|
|
deadline: project.deliveryDate,
|
|
|
projectId: project.projectId,
|
|
|
@@ -1699,10 +1717,13 @@ export class Dashboard implements OnInit, OnDestroy {
|
|
|
completionRate = phaseProgress?.completionRate || 0;
|
|
|
}
|
|
|
|
|
|
+ const reason = getOverdueReason(daysDiff, project.stalledDays);
|
|
|
+ const descSuffix = reason ? `,${reason}` : '';
|
|
|
+
|
|
|
addEvent({
|
|
|
id: `${project.projectId}-phase-${key}`,
|
|
|
title: `${phaseName}阶段截止`,
|
|
|
- description: `项目「${project.projectName}」的${phaseName}阶段截止时间已${daysDiff < 0 ? '逾期' : '临近'}(完成率 ${completionRate}%)`,
|
|
|
+ description: `项目「${project.projectName}」的${phaseName}阶段截止时间已${daysDiff < 0 ? '逾期' : '临近'}(完成率 ${completionRate}%)${descSuffix}`,
|
|
|
eventType: 'phase_deadline',
|
|
|
phaseName,
|
|
|
deadline,
|