Parcourir la source

Merge branch 'master' of http://git.fmode.cn:3000/nkkj/yss-project

徐福静0235668 il y a 3 jours
Parent
commit
0a227c54a3

+ 13 - 8
src/app/pages/team-leader/dashboard/dashboard.ts

@@ -701,14 +701,19 @@ export class Dashboard implements OnInit, OnDestroy {
         // ✅ 关键修复:从交付日期往前推算各阶段截止时间
         const deliveryTime = adjustedEndDate.getTime();
         
-        // 后期截止 = 交付日期
-        const postProcessingDeadline = new Date(deliveryTime);
-        // 渲染截止 = 交付日期 - 1天
-        const renderingDeadline = new Date(deliveryTime - 1 * 24 * 60 * 60 * 1000);
-        // 软装截止 = 交付日期 - 2天
-        const softDecorDeadline = new Date(deliveryTime - 2 * 24 * 60 * 60 * 1000);
-        // 建模截止 = 交付日期 - 3天
-        const modelingDeadline = new Date(deliveryTime - 3 * 24 * 60 * 60 * 1000);
+        // 后期截止 = 交付日期 - 1天(确保后期事件在交付前显示)
+        const postProcessingDeadline = new Date(deliveryTime - 1 * 24 * 60 * 60 * 1000);
+        // 渲染截止 = 交付日期 - 2天
+        const renderingDeadline = new Date(deliveryTime - 2 * 24 * 60 * 60 * 1000);
+        // 软装截止 = 交付日期 - 3天
+        const softDecorDeadline = new Date(deliveryTime - 3 * 24 * 60 * 60 * 1000);
+        // 建模截止 = 交付日期 - 4天
+        const modelingDeadline = new Date(deliveryTime - 4 * 24 * 60 * 60 * 1000);
+        
+        // 🔥 小图对图时间 = 交付日期 - 2.5天(软装和渲染之间)
+        const reviewTime = deliveryTime - 2.5 * 24 * 60 * 60 * 1000;
+        adjustedReviewDate = new Date(reviewTime); // ⚠️ 不要使用 const,直接赋值给外层变量
+        adjustedReviewDate.setHours(14, 0, 0, 0); // 设置时间为下午2点
         
         phaseDeadlines = {
           modeling: {

+ 42 - 21
src/app/pages/team-leader/project-timeline/project-timeline.ts

@@ -394,30 +394,51 @@ export class ProjectTimelineComponent implements OnInit, OnDestroy {
     
     // 继续添加剩余阶段:渲染 -> 后期
     if (project.phaseDeadlines) {
-      const remainingPhases: PhaseName[] = ['rendering', 'postProcessing'];
+      // 渲染阶段
+      const renderingInfo = project.phaseDeadlines['rendering'];
+      if (renderingInfo && renderingInfo.deadline) {
+        const renderingDeadline = new Date(renderingInfo.deadline);
+        if (this.isEventInFuture(renderingDeadline)) {
+          const renderingConfig = PHASE_INFO['rendering'];
+          const isDelayed = isPhaseDelayed(renderingInfo);
+          events.push({
+            date: renderingDeadline,
+            label: `${renderingConfig.label}截止`,
+            type: 'phase_deadline',
+            phase: 'rendering',
+            projectId: project.projectId,
+            color: isDelayed ? '#dc2626' : renderingConfig.color,
+            icon: renderingConfig.label.charAt(0)
+          });
+        }
+      }
       
-      remainingPhases.forEach(phaseName => {
-        const phaseInfo = project.phaseDeadlines?.[phaseName];
-        if (phaseInfo && phaseInfo.deadline) {
-          const deadline = new Date(phaseInfo.deadline);
+      // 🔥 后期阶段(始终显示在时间范围内的后期截止,并确保不与交付重合)
+      const postProcessingInfo = project.phaseDeadlines['postProcessing'];
+      if (postProcessingInfo && postProcessingInfo.deadline) {
+        const postDeadline = new Date(postProcessingInfo.deadline);
+        
+        // 检查是否与交付日期重合(误差在12小时以内视为重合)
+        const isNearDelivery = project.deliveryDate && 
+          Math.abs(postDeadline.getTime() - project.deliveryDate.getTime()) < 12 * 60 * 60 * 1000;
+        
+        // 只要在时间范围内就显示,除非与交付日期太接近
+        if (this.isEventInRange(postDeadline) && !isNearDelivery) {
+          const postConfig = PHASE_INFO['postProcessing'];
+          const isDelayed = isPhaseDelayed(postProcessingInfo);
+          const isPast = postDeadline.getTime() < this.currentTime.getTime();
           
-          // 只显示未来的阶段截止事件
-          if (this.isEventInFuture(deadline)) {
-            const phaseConfig = PHASE_INFO[phaseName];
-            const isDelayed = isPhaseDelayed(phaseInfo);
-            
-            events.push({
-              date: deadline,
-              label: `${phaseConfig.label}截止`,
-              type: 'phase_deadline',
-              phase: phaseName,
-              projectId: project.projectId,
-              color: isDelayed ? '#dc2626' : phaseConfig.color,
-              icon: phaseConfig.label.charAt(0)
-            });
-          }
+          events.push({
+            date: postDeadline,
+            label: `${postConfig.label}截止`,
+            type: 'phase_deadline',
+            phase: 'postProcessing',
+            projectId: project.projectId,
+            color: isPast ? '#94a3b8' : (isDelayed ? '#dc2626' : postConfig.color),
+            icon: postConfig.label.charAt(0)
+          });
         }
-      });
+      }
     }
     
     // 交付事件