Browse Source

fix: alert with window?.fmode?.alert

Future 9 hours ago
parent
commit
bca222a608
59 changed files with 349 additions and 349 deletions
  1. 54 54
      copy/project-detail.ts
  2. 2 2
      copy/requirements-confirm-card.ts
  3. 3 3
      docs/prd/wxwork-project-management.md
  4. 3 3
      docs/prd/组件-项目问卷.md
  5. 2 2
      docs/prd/项目-订单分配.md
  6. 2 2
      docs/requirements-optimization.md
  7. 3 3
      docs/service-integration-complete.md
  8. 3 3
      docs/task/2025102218-team-leader-project-detail-navigation.md
  9. 2 2
      docs/task/2025102221-migration-guide.md
  10. 5 5
      rules/wxwork/group-chat-contact.md
  11. 2 2
      src/app/app.ts
  12. 2 2
      src/app/pages/admin/api-integrations/api-integrations.ts
  13. 7 7
      src/app/pages/admin/departments/departments.ts
  14. 1 1
      src/app/pages/admin/designers/designers.ts
  15. 2 2
      src/app/pages/admin/employees/employees.ts
  16. 7 7
      src/app/pages/admin/groupchats/groupchats.ts
  17. 1 1
      src/app/pages/admin/logs/logs.ts
  18. 1 1
      src/app/pages/admin/project-management/project-management.ts
  19. 10 10
      src/app/pages/admin/system-settings/setting-dialog/setting-dialog.ts
  20. 3 3
      src/app/pages/admin/system-settings/system-settings.ts
  21. 3 3
      src/app/pages/admin/user-management/role-dialog/role-dialog.ts
  22. 1 1
      src/app/pages/admin/user-management/user-management.ts
  23. 2 2
      src/app/pages/customer-service/dashboard/dashboard.ts
  24. 2 2
      src/app/pages/customer-service/dashboard/pages/after-sales/after-sales.component.ts
  25. 2 2
      src/app/pages/designer/dashboard/dashboard.ts
  26. 3 3
      src/app/pages/designer/material-share/material-share.ts
  27. 1 1
      src/app/pages/designer/personal-board/personal-board.ts
  28. 1 1
      src/app/pages/designer/project-detail/LATEST-FIXES-SUMMARY.md
  29. 3 3
      src/app/pages/designer/project-detail/components/order-creation/order-creation.component.ts
  30. 3 3
      src/app/pages/designer/project-detail/components/reference-image-manager/reference-image-manager.component.ts
  31. 59 59
      src/app/pages/designer/project-detail/project-detail.ts
  32. 18 18
      src/app/pages/finance/dashboard/dashboard.ts
  33. 1 1
      src/app/pages/finance/reports/reports.ts
  34. 7 7
      src/app/pages/hr/attendance/attendance.ts
  35. 1 1
      src/app/pages/hr/dashboard/dashboard.ts
  36. 3 3
      src/app/pages/hr/recruitment-performance/recruitment-performance.ts
  37. 5 5
      src/app/pages/team-leader/dashboard/dashboard.ts
  38. 2 2
      src/app/pages/team-leader/performance/performance.ts
  39. 2 2
      src/app/pages/team-leader/project-review/project-review.ts
  40. 9 9
      src/app/pages/team-leader/quality-management/quality-management.ts
  41. 5 5
      src/app/pages/team-leader/team-management/team-management.ts
  42. 3 3
      src/app/shared/components/complaint-card/complaint-card.ts
  43. 3 3
      src/app/shared/components/customer-review-card/customer-review-card.ts
  44. 1 1
      src/app/shared/components/customer-review-form/customer-review-form.ts
  45. 2 2
      src/app/shared/components/requirements-confirm-card/requirements-confirm-card.ts
  46. 8 8
      src/app/shared/components/settlement-card/settlement-card.ts
  47. 3 3
      src/app/shared/components/upload-example/upload-example.component.ts
  48. 1 1
      src/fmode-ng-augmentation.d.ts
  49. 8 8
      src/modules/project/components/project-members-modal/project-members-modal.component.ts
  50. 11 11
      src/modules/project/components/quotation-editor.component.ts
  51. 7 7
      src/modules/project/components/team-assign/team-assign.component.ts
  52. 3 3
      src/modules/project/pages/contact/contact.component.ts
  53. 7 7
      src/modules/project/pages/project-detail/project-detail.component.ts
  54. 13 13
      src/modules/project/pages/project-detail/stages/stage-aftercare.component.ts
  55. 2 2
      src/modules/project/pages/project-detail/stages/stage-delivery.component.ts
  56. 19 19
      src/modules/project/pages/project-detail/stages/stage-order.component.ts
  57. 4 4
      src/modules/project/pages/project-detail/stages/stage-requirements.component.ts
  58. 4 4
      src/modules/project/pages/project-loader/project-loader.component.ts
  59. 2 2
      src/modules/project/pages/project-survey/project-survey.component.ts

+ 54 - 54
copy/project-detail.ts

@@ -886,7 +886,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     if (phase === 'soft') markSynced(this.softDecorImages);
     if (phase === 'render') markSynced(this.renderLargeImages);
     if (phase === 'postProcess') markSynced(this.postProcessImages);
-    alert('已同步该阶段的图片信息(模拟)');
+   window?.fmode?.alert('已同步该阶段的图片信息(模拟)');
   }
 
   reviewImage(imageId: string, phase: 'white' | 'soft' | 'render' | 'postProcess', status: 'approved' | 'rejected'): void {
@@ -1169,7 +1169,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
   // 整理项目详情
   organizeProject(): void {
     // 模拟整理项目逻辑
-    alert('项目详情已整理');
+   window?.fmode?.alert('项目详情已整理');
   }
   
   // 检查当前阶段是否显示特定卡片
@@ -1408,7 +1408,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       if (/\.(jpg|jpeg|png)$/i.test(file.name)) {
         const ok = await this.validateImage4K(file).catch(() => false);
         if (!ok) {
-          alert(`图片不符合4K标准(最大边需≥4000像素):${file.name}`);
+         window?.fmode?.alert(`图片不符合4K标准(最大边需≥4000像素):${file.name}`);
           continue;
         }
       }
@@ -1487,12 +1487,12 @@ export class ProjectDetail implements OnInit, OnDestroy {
     
     if (hoursRemaining <= 3 && hoursRemaining > 0) {
       // 弹窗预警
-      alert('渲染进度预警:交付前3小时,请关注渲染进度');
+     window?.fmode?.alert('渲染进度预警:交付前3小时,请关注渲染进度');
     }
     
     if (hoursRemaining <= 1 && hoursRemaining > 0) {
       // 更严重的预警
-      alert('渲染进度严重预警:交付前1小时,渲染可能无法按时完成!');
+     window?.fmode?.alert('渲染进度严重预警:交付前1小时,渲染可能无法按时完成!');
     }
   }
 
@@ -1535,7 +1535,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       } else {
         clearInterval(this.countdownInterval);
         // 超时提醒
-        alert('客户反馈已超过1小时未响应,请立即处理!');
+       window?.fmode?.alert('客户反馈已超过1小时未响应,请立即处理!');
         this.notifyTeamLeader('feedback-overdue');
       }
     }, 1000);
@@ -1562,14 +1562,14 @@ export class ProjectDetail implements OnInit, OnDestroy {
   initiateDesignerChange(reason: string): void {
     // 实际应用中应调用API发起变更
     console.log(`发起设计师变更,原因:${reason}`);
-    alert('已发起设计师变更申请,请等待新设计师承接');
+   window?.fmode?.alert('已发起设计师变更申请,请等待新设计师承接');
   }
 
   // 确认承接变更项目
   acceptDesignerChange(changeId: string): void {
     // 实际应用中应调用API确认承接
     console.log(`确认承接设计师变更:${changeId}`);
-    alert('已确认承接项目,系统已记录时间戳和责任人');
+   window?.fmode?.alert('已确认承接项目,系统已记录时间戳和责任人');
   }
 
   // 格式化倒计时显示
@@ -1585,7 +1585,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
   // 提交异常反馈
   submitExceptionFeedback(): void {
     if (!this.exceptionDescription.trim() || this.isSubmittingFeedback) {
-      alert('请填写异常类型和描述');
+     window?.fmode?.alert('请填写异常类型和描述');
       return;
     }
 
@@ -1613,7 +1613,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       this.showExceptionForm = false;
       
       // 显示成功消息
-      alert('异常反馈已提交,技术支持将尽快处理');
+     window?.fmode?.alert('异常反馈已提交,技术支持将尽快处理');
       
       this.isSubmittingFeedback = false;
     }, 1000);
@@ -1645,12 +1645,12 @@ export class ProjectDetail implements OnInit, OnDestroy {
 
   // 联系组长
   contactTeamLeader() {
-    alert(`已联系${this.project?.assigneeName || '项目组长'}`);
+   window?.fmode?.alert(`已联系${this.project?.assigneeName || '项目组长'}`);
   }
 
   // 处理渲染超时预警
   handleRenderTimeout() {
-    alert('已发送渲染超时预警通知');
+   window?.fmode?.alert('已发送渲染超时预警通知');
   }
 
   // 通知技术支持
@@ -1761,7 +1761,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
   previewImage(img: any): void {
     const isRenderLarge = !!this.renderLargeImages.find(i => i.id === img?.id);
     if (isRenderLarge && img?.locked) {
-      alert('该渲染大图已加锁,需完成尾款结算并上传/识别支付凭证后方可预览。');
+     window?.fmode?.alert('该渲染大图已加锁,需完成尾款结算并上传/识别支付凭证后方可预览。');
       return;
     }
     this.previewImageData = img;
@@ -1776,7 +1776,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
   downloadImage(img: any): void {
     const isRenderLarge = !!this.renderLargeImages.find(i => i.id === img?.id);
     if (isRenderLarge && img?.locked) {
-      alert('该渲染大图已加锁,需完成尾款结算并上传/识别支付凭证后方可下载。');
+     window?.fmode?.alert('该渲染大图已加锁,需完成尾款结算并上传/识别支付凭证后方可下载。');
       return;
     }
     if (img) {
@@ -1949,7 +1949,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       this.isConfirmingSettlement = false;
       
       // 显示成功提示
-      alert('尾款结算已确认完成!');
+     window?.fmode?.alert('尾款结算已确认完成!');
       
       // 进入下一阶段
       this.advanceToNextStage('尾款结算');
@@ -2018,7 +2018,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     for (const f of files) {
       const ok = await this.validateImage4K(f).catch(() => false);
       if (!ok) {
-        alert(`图片不符合4K标准(最大边需≥4000像素):${f.name}`);
+       window?.fmode?.alert(`图片不符合4K标准(最大边需≥4000像素):${f.name}`);
         continue;
       }
       const item = this.makeImageItem(f);
@@ -2893,7 +2893,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       this.expandedStages['订单分配'] = false;
       
       // 显示成功消息
-      alert('团队分配成功!已进入需求沟通阶段');
+     window?.fmode?.alert('团队分配成功!已进入需求沟通阶段');
       
       console.log('团队分配完成,已跳转到需求沟通阶段');
     }
@@ -3432,7 +3432,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
             置信度:${(recognition.confidence * 100).toFixed(1)}%
           `;
           
-          alert(successMessage);
+         window?.fmode?.alert(successMessage);
           console.log('支付凭证识别完成', recognition);
           
           // 自动标记验证通过并解锁渲染大图
@@ -3444,13 +3444,13 @@ export class ProjectDetail implements OnInit, OnDestroy {
           
         } else {
           const errorMessage = `支付凭证识别失败:${result.error || '未知错误'}`;
-          alert(errorMessage);
+         window?.fmode?.alert(errorMessage);
           console.error('支付凭证识别失败', result.error);
         }
       },
       error: (error) => {
         const errorMessage = `支付凭证处理出错:${error.message || '网络错误'}`;
-        alert(errorMessage);
+       window?.fmode?.alert(errorMessage);
         console.error('支付凭证处理出错', error);
       }
     });
@@ -3484,7 +3484,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
         您现在可以下载4K高清渲染图了!
       `;
       
-      alert(notificationMessage);
+     window?.fmode?.alert(notificationMessage);
       console.log('自动通知发送完成');
     }, 1000);
   }
@@ -3741,7 +3741,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     
     // 权限检查
     if (!this.isTechnicalView()) {
-      alert('⚠️ 仅技术人员可以启动自动化结算流程');
+     window?.fmode?.alert('⚠️ 仅技术人员可以启动自动化结算流程');
       return;
     }
     
@@ -3777,7 +3777,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       this.isAutoSettling = false;
       
       // 显示启动成功消息
-      alert(`🚀 自动化结算已成功启动!
+     window?.fmode?.alert(`🚀 自动化结算已成功启动!
 
 ✅ 已启动功能:
 • 小程序支付自动监听
@@ -3976,7 +3976,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       if (!file) return;
       
       console.log('📄 上传的凭证文件:', file.name);
-      alert(`📎 支付凭证已上传:${file.name}\n\n系统将自动识别支付金额和支付方式。`);
+     window?.fmode?.alert(`📎 支付凭证已上传:${file.name}\n\n系统将自动识别支付金额和支付方式。`);
       
       // 模拟凭证识别和处理
       setTimeout(() => {
@@ -4148,7 +4148,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     console.log('打开全景图画廊');
     
     if (this.panoramicSyntheses.length === 0) {
-      alert('暂无全景图记录');
+     window?.fmode?.alert('暂无全景图记录');
       return;
     }
     
@@ -4157,20 +4157,20 @@ export class ProjectDetail implements OnInit, OnDestroy {
       `${i + 1}. ${s.projectName} - ${s.status === 'completed' ? '已完成' : '处理中'} (${s.spaces.length}个空间)`
     ).join('\n');
     
-    alert(`全景图画廊\n\n${galleryInfo}\n\n点击查看详情功能开发中...`);
+   window?.fmode?.alert(`全景图画廊\n\n${galleryInfo}\n\n点击查看详情功能开发中...`);
   }
   
   // 复制全景图链接
   copyPanoramicLink(synthesis: PanoramicSynthesis): void {
     if (!synthesis.shareLink) {
-      alert('全景图链接尚未生成');
+     window?.fmode?.alert('全景图链接尚未生成');
       return;
     }
     
     navigator.clipboard.writeText(synthesis.shareLink).then(() => {
-      alert(`✅ 全景图链接已复制!\n\n${synthesis.shareLink}`);
+     window?.fmode?.alert(`✅ 全景图链接已复制!\n\n${synthesis.shareLink}`);
     }).catch(() => {
-      alert(`全景图链接:\n${synthesis.shareLink}`);
+     window?.fmode?.alert(`全景图链接:\n${synthesis.shareLink}`);
     });
   }
 
@@ -4216,9 +4216,9 @@ export class ProjectDetail implements OnInit, OnDestroy {
     
     // 复制到剪贴板
     navigator.clipboard.writeText(reviewLink).then(() => {
-      alert(`✅ 评价链接已复制到剪贴板!\n\n链接:${reviewLink}\n\n有效期:30天\n\n请通过企业微信发送给客户`);
+     window?.fmode?.alert(`✅ 评价链接已复制到剪贴板!\n\n链接:${reviewLink}\n\n有效期:30天\n\n请通过企业微信发送给客户`);
     }).catch(() => {
-      alert(`评价链接:\n\n${reviewLink}\n\n有效期:30天\n\n请通过企业微信发送给客户`);
+     window?.fmode?.alert(`评价链接:\n\n${reviewLink}\n\n有效期:30天\n\n请通过企业微信发送给客户`);
     });
     
     // 通知客服发送评价链接
@@ -4257,7 +4257,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       this.project.customerReviewCompletedAt = new Date();
     }
     
-    alert('✅ 客户评价已确认完成!');
+   window?.fmode?.alert('✅ 客户评价已确认完成!');
     
     // 可选:自动进入下一阶段
     // this.advanceToNextStage('客户评价');
@@ -4274,10 +4274,10 @@ export class ProjectDetail implements OnInit, OnDestroy {
     console.log('📝 手动创建投诉');
     
     // 弹出创建投诉表单
-    const complaintReason = prompt('请输入投诉原因:');
+    const complaintReason =await window?.fmode?.input('请输入投诉原因:');
     if (!complaintReason || complaintReason.trim() === '') return;
     
-    const complaintStage = prompt('请输入投诉环节(如:需求沟通、建模、渲染等):') || '未指定';
+    const complaintStage =await window?.fmode?.input('请输入投诉环节(如:需求沟通、建模、渲染等):') || '未指定';
     
     // 创建投诉记录
     const complaint: any = {
@@ -4305,7 +4305,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     
     console.log('✅ 投诉记录已创建:', complaint);
     
-    alert(`✅ 投诉记录已创建!\n\n投诉环节:${complaintStage}\n核心问题:${complaint.tags.join('、')}\n\n系统将自动跟踪处理进度。`);
+   window?.fmode?.alert(`✅ 投诉记录已创建!\n\n投诉环节:${complaintStage}\n核心问题:${complaint.tags.join('、')}\n\n系统将自动跟踪处理进度。`);
     
     // 通知相关人员
     this.notifyComplaintHandlers(complaint);
@@ -4360,14 +4360,14 @@ export class ProjectDetail implements OnInit, OnDestroy {
       const confirmStop = confirm('关键词监控已激活,是否停止监控?');
       if (confirmStop) {
         this.isKeywordMonitoringActive = false;
-        alert('✅ 关键词监控已停止');
+       window?.fmode?.alert('✅ 关键词监控已停止');
       }
       return;
     }
     
     // 显示当前监控关键词
     const currentKeywords = this.complaintKeywords.join('、');
-    const newKeywords = prompt(`当前监控关键词:\n\n${currentKeywords}\n\n请输入要添加的关键词(多个关键词用逗号分隔):`);
+    const newKeywords =await window?.fmode?.input(`当前监控关键词:\n\n${currentKeywords}\n\n请输入要添加的关键词(多个关键词用逗号分隔):`);
     
     if (newKeywords && newKeywords.trim()) {
       const keywords = newKeywords.split(/[,,、]/).map(k => k.trim()).filter(k => k);
@@ -4378,7 +4378,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     this.isKeywordMonitoringActive = true;
     this.startKeywordMonitoring();
     
-    alert(`✅ 关键词监控已激活!\n\n监控关键词:${this.complaintKeywords.join('、')}\n\n系统将自动检测企业微信群消息中的关键词并创建投诉记录。`);
+   window?.fmode?.alert(`✅ 关键词监控已激活!\n\n监控关键词:${this.complaintKeywords.join('、')}\n\n系统将自动检测企业微信群消息中的关键词并创建投诉记录。`);
   }
   
   // 开始关键词监控
@@ -4471,7 +4471,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       if (!confirmAnyway) return;
     }
     
-    alert('✅ 所有投诉已确认处理完成!');
+   window?.fmode?.alert('✅ 所有投诉已确认处理完成!');
   }
 
   // 处理评价表单提交
@@ -4481,7 +4481,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     // 这里应该调用API将评价数据保存到服务器
     // 模拟API调用
     setTimeout(() => {
-      alert('客户评价提交成功!评价数据已保存。');
+     window?.fmode?.alert('客户评价提交成功!评价数据已保存。');
       
       // 更新本地反馈数据
       const newFeedback: CustomerFeedback = {
@@ -4509,7 +4509,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     // 这里应该调用API将草稿数据保存到服务器
     // 模拟API调用
     setTimeout(() => {
-      alert('评价草稿保存成功!您可以稍后继续完善。');
+     window?.fmode?.alert('评价草稿保存成功!您可以稍后继续完善。');
     }, 500);
   }
 
@@ -4639,7 +4639,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     // 这里应该调用API创建订单
     // 模拟API调用
     setTimeout(() => {
-      alert('订单分配成功!');
+     window?.fmode?.alert('订单分配成功!');
       // 订单分配成功后自动切换到下一环节
       this.advanceToNextStage('订单分配');
     }, 500);
@@ -4777,7 +4777,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       };
       
       this.isGeneratingReview = false;
-      alert('复盘报告生成完成!基于真实SOP执行数据和智能分析生成。');
+     window?.fmode?.alert('复盘报告生成完成!基于真实SOP执行数据和智能分析生成。');
     }, 3000);
   }
 
@@ -4809,14 +4809,14 @@ export class ProjectDetail implements OnInit, OnDestroy {
           link.click();
           document.body.removeChild(link);
           
-          alert('复盘报告导出成功!');
+         window?.fmode?.alert('复盘报告导出成功!');
         } else {
-          alert('导出失败:' + (response.message || '未知错误'));
+         window?.fmode?.alert('导出失败:' + (response.message || '未知错误'));
         }
       },
       error: (error) => {
         console.error('导出复盘报告失败:', error);
-        alert('导出失败,请稍后重试');
+       window?.fmode?.alert('导出失败,请稍后重试');
       }
     });
   }
@@ -4839,20 +4839,20 @@ export class ProjectDetail implements OnInit, OnDestroy {
           // 复制到剪贴板
           if (navigator.clipboard) {
             navigator.clipboard.writeText(response.shareUrl).then(() => {
-              alert(`复盘报告分享链接已复制到剪贴板!\n链接有效期:${response.expirationDate ? new Date(response.expirationDate).toLocaleDateString() : '30天'}`);
+             window?.fmode?.alert(`复盘报告分享链接已复制到剪贴板!\n链接有效期:${response.expirationDate ? new Date(response.expirationDate).toLocaleDateString() : '30天'}`);
             }).catch(() => {
-              alert(`复盘报告分享链接:\n${response.shareUrl}\n\n链接有效期:${response.expirationDate ? new Date(response.expirationDate).toLocaleDateString() : '30天'}`);
+             window?.fmode?.alert(`复盘报告分享链接:\n${response.shareUrl}\n\n链接有效期:${response.expirationDate ? new Date(response.expirationDate).toLocaleDateString() : '30天'}`);
             });
           } else {
-            alert(`复盘报告分享链接:\n${response.shareUrl}\n\n链接有效期:${response.expirationDate ? new Date(response.expirationDate).toLocaleDateString() : '30天'}`);
+           window?.fmode?.alert(`复盘报告分享链接:\n${response.shareUrl}\n\n链接有效期:${response.expirationDate ? new Date(response.expirationDate).toLocaleDateString() : '30天'}`);
           }
         } else {
-          alert('分享失败:' + (response.message || '未知错误'));
+         window?.fmode?.alert('分享失败:' + (response.message || '未知错误'));
         }
       },
       error: (error) => {
         console.error('分享复盘报告失败:', error);
-        alert('分享失败,请稍后重试');
+       window?.fmode?.alert('分享失败,请稍后重试');
       }
     });
   }
@@ -5183,7 +5183,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     );
     
     if (!hasImages) {
-      alert('请先上传图片再确认');
+     window?.fmode?.alert('请先上传图片再确认');
       return;
     }
     
@@ -5210,7 +5210,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     } else {
       // 如果是最后一个阶段,标记为完成
       console.log(`交付执行阶段完成: ${currentStage}`);
-      alert('交付执行阶段已完成!');
+     window?.fmode?.alert('交付执行阶段已完成!');
     }
   }
   
@@ -5278,6 +5278,6 @@ export class ProjectDetail implements OnInit, OnDestroy {
     console.log(`📋 功能详情: ${title}`);
     console.log(`📝 ${description}`);
     
-    alert(`✨ ${title}\n\n${description}\n\n点击确定关闭`);
+   window?.fmode?.alert(`✨ ${title}\n\n${description}\n\n点击确定关闭`);
   }
 }

+ 2 - 2
copy/requirements-confirm-card.ts

@@ -739,7 +739,7 @@ export class RequirementsConfirmCardComponent implements OnInit, OnDestroy {
   confirmRequirement(requirementId: string) {
     // 检查是否可以进行需求确认操作
     if (!this.canProceedToNextStage('materialAnalysis')) {
-      alert('请先完成素材分析阶段的所有必要操作');
+     window?.fmode?.alert('请先完成素材分析阶段的所有必要操作');
       return;
     }
     
@@ -759,7 +759,7 @@ export class RequirementsConfirmCardComponent implements OnInit, OnDestroy {
   rejectRequirement(requirementId: string, reason?: string) {
     // 检查是否可以进行需求拒绝操作
     if (!this.canProceedToNextStage('materialAnalysis')) {
-      alert('请先完成素材分析阶段的所有必要操作');
+     window?.fmode?.alert('请先完成素材分析阶段的所有必要操作');
       return;
     }
     

+ 3 - 3
docs/prd/wxwork-project-management.md

@@ -672,7 +672,7 @@ async initiateDelivery() {
   // 1. 检查完成度
   const deliveryRate = await this.checkDeliveryCompleteness();
   if (deliveryRate < 100) {
-    alert('还有交付物未完成,请检查');
+   window?.fmode?.alert('还有交付物未完成,请检查');
     return;
   }
 
@@ -783,7 +783,7 @@ feedback.set('status', '已完成');
 async archiveProject() {
   // 1. 检查是否可归档
   if (!this.checkCanArchive()) {
-    alert('请先完成尾款结算和客户评价');
+   window?.fmode?.alert('请先完成尾款结算和客户评价');
     return;
   }
 
@@ -1123,7 +1123,7 @@ function hasPermission(role: string, action: string): boolean {
 
 // 使用示例
 if (!hasPermission(currentUser.get('roleName'), 'createProject')) {
-  alert('您没有权限创建项目');
+ window?.fmode?.alert('您没有权限创建项目');
   return;
 }
 ```

+ 3 - 3
docs/prd/组件-项目问卷.md

@@ -451,10 +451,10 @@ async sendSurvey() {
       }
     });
 
-    alert('问卷已发送到群聊!');
+   window?.fmode?.alert('问卷已发送到群聊!');
   } catch (err) {
     console.error('发送问卷失败:', err);
-    alert('发送失败,请重试');
+   window?.fmode?.alert('发送失败,请重试');
   }
 }
 ```
@@ -506,7 +506,7 @@ async ngOnInit() {
     console.log('当前联系人:', this.currentContact);
   } catch (error) {
     console.error('获取联系人失败:', error);
-    alert('无法识别您的身份,请通过企微群聊进入');
+   window?.fmode?.alert('无法识别您的身份,请通过企微群聊进入');
     return;
   }
 

+ 2 - 2
docs/prd/项目-订单分配.md

@@ -1606,14 +1606,14 @@ createProductOrder(): void {
   this.projectService.createProject(orderData).subscribe({
     next: (result) => {
       if (result.success) {
-        alert('订单分配成功!');
+       window?.fmode?.alert('订单分配成功!');
         // 订单分配成功后自动切换到下一环节
         this.advanceToNextStage('订单分配');
       }
     },
     error: (error) => {
       console.error('订单分配失败:', error);
-      alert('订单分配失败,请重试');
+     window?.fmode?.alert('订单分配失败,请重试');
     }
   });
 }

+ 2 - 2
docs/requirements-optimization.md

@@ -1276,7 +1276,7 @@ export class AnnotationToolComponent {
     
     // 如果是文字工具,弹出输入框
     if (this.activeTool === 'text') {
-      const text = prompt('请输入标注内容:');
+      const text =await window?.fmode?.input('请输入标注内容:');
       if (text) {
         this.currentAnnotation.content = text;
         this.annotations.push(this.currentAnnotation as Annotation);
@@ -1832,7 +1832,7 @@ approveStep(stepId: string): void {
 rejectStep(stepId: string): void {
   const step = this.approvalSteps.find(s => s.id === stepId);
   if (step) {
-    const reason = prompt('请输入驳回原因:');
+    const reason =await window?.fmode?.input('请输入驳回原因:');
     if (reason) {
       step.status = 'completed';
       step.result = 'rejected';

+ 3 - 3
docs/service-integration-complete.md

@@ -309,7 +309,7 @@ const allowedTypes = [
 
 // 添加文件大小验证 (50MB)
 if (!this.uploadService.validateFileSize(file, 50)) {
-  alert('文件大小不能超过50MB');
+ window?.fmode?.alert('文件大小不能超过50MB');
   return;
 }
 ```
@@ -353,14 +353,14 @@ try {
   const ocrResult = await this.aiService.recognizePaymentVoucher(url);
 
   // 显示识别结果
-  alert(`OCR识别成功!
+ window?.fmode?.alert(`OCR识别成功!
 金额: ¥${ocrResult.amount}
 方式: ${ocrResult.paymentMethod}
 置信度: ${ocrResult.confidence}`);
 
 } catch (ocrError) {
   // OCR失败,仍保存图片但需手动输入
-  alert('凭证已上传,但OCR识别失败,请手动核对金额');
+ window?.fmode?.alert('凭证已上传,但OCR识别失败,请手动核对金额');
 }
 ```
 

+ 3 - 3
docs/task/2025102218-team-leader-project-detail-navigation.md

@@ -125,7 +125,7 @@ viewProjectDetails(projectId: string): void {
 quickAssignProject(projectId: string): void {
   console.log('快速分配项目:', projectId);
   // TODO: 实现快速分配逻辑
-  alert('快速分配功能待实现');
+ window?.fmode?.alert('快速分配功能待实现');
 }
 ```
 
@@ -142,7 +142,7 @@ quickAssignProject(projectId: string): void {
 openSmartMatch(project: any): void {
   console.log('打开智能推荐:', project);
   // TODO: 实现智能推荐逻辑
-  alert('智能推荐功能待实现');
+ window?.fmode?.alert('智能推荐功能待实现');
 }
 ```
 
@@ -160,7 +160,7 @@ reviewProjectQuality(projectId: string, quality: 'excellent' | 'qualified' | 'un
   console.log('质量评审:', projectId, quality);
   // TODO: 实现质量评审逻辑
   const qualityText = quality === 'excellent' ? '优秀' : quality === 'qualified' ? '合格' : '不合格';
-  alert(`已将项目评为${qualityText}`);
+ window?.fmode?.alert(`已将项目评为${qualityText}`);
 }
 ```
 

+ 2 - 2
docs/task/2025102221-migration-guide.md

@@ -67,12 +67,12 @@ export class ProjectManagement {
     
     try {
       const result = await this.migrationService.migrateProjectAssignees();
-      alert(`迁移完成!\n总计: ${result.total}\n成功: ${result.success}\n失败: ${result.failed}`);
+     window?.fmode?.alert(`迁移完成!\n总计: ${result.total}\n成功: ${result.success}\n失败: ${result.failed}`);
       
       // 刷新项目列表
       await this.loadProjects();
     } catch (error) {
-      alert('迁移失败: ' + error);
+     window?.fmode?.alert('迁移失败: ' + error);
     }
   }
 }

+ 5 - 5
rules/wxwork/group-chat-contact.md

@@ -323,7 +323,7 @@ export class PageGroupMessageComponent implements OnInit {
    */
   async sendTextMessage() {
     if (!this.chatId) {
-      alert('请先加载群聊信息');
+     window?.fmode?.alert('请先加载群聊信息');
       return;
     }
 
@@ -577,7 +577,7 @@ export class PageChatContextComponent implements OnInit {
       this.appId = params.get('appId') || 'crm';
 
       if (!this.cid) {
-        alert('缺少企业ID参数');
+       window?.fmode?.alert('缺少企业ID参数');
         return;
       }
 
@@ -610,7 +610,7 @@ export class PageChatContextComponent implements OnInit {
 
     } catch (error) {
       console.error('加载数据失败:', error);
-      alert('加载失败: ' + error);
+     window?.fmode?.alert('加载失败: ' + error);
     } finally {
       this.loading = false;
     }
@@ -956,9 +956,9 @@ async loadContact() {
 
     // 友好提示
     if (error.code === 84061) {
-      alert("无权限访问该联系人信息");
+     window?.fmode?.alert("无权限访问该联系人信息");
     } else {
-      alert("加载失败,请重试");
+     window?.fmode?.alert("加载失败,请重试");
     }
 
     return null;

+ 2 - 2
src/app/app.ts

@@ -68,7 +68,7 @@ export class App {
       fmode.alert = (detail: any) => this.handleGlobalAlert(detail);
       // 支持两种用法:
       // 1) 对象用法:window.fmode.input({ header, message, inputs, buttons, callback }) 保留原功能
-      // 2) 字符串简化用法:window.fmode.input('描述', '默认值'),行为与 prompt() 一致,返回输入值或 null
+      // 2) 字符串简化用法:window.fmode.input('描述', '默认值'),行为与await window?.fmode?.input() 一致,返回输入值或 null
       fmode.input = (detailOrMessage: any, defaultValue?: string) => {
         if (typeof detailOrMessage === 'string') {
           return this.presentPromptSimple(detailOrMessage, defaultValue);
@@ -131,7 +131,7 @@ export class App {
     return result;
   }
 
-  // 字符串简化用法:行为与原生 prompt() 相同,返回输入字符串或 null
+  // 字符串简化用法:行为与原生await window?.fmode?.input() 相同,返回输入字符串或 null
   private async presentPromptSimple(message: string, defaultValue?: string): Promise<string | null> {
     const alert = await this.alertController.create({
       header: '请输入',

+ 2 - 2
src/app/pages/admin/api-integrations/api-integrations.ts

@@ -583,7 +583,7 @@ export class ApiIntegrations implements OnInit {
 
   testIntegration(id: string): void {
     // 模拟测试操作
-    alert(`正在测试API集成...\n测试完成!`);
+   window?.fmode?.alert(`正在测试API集成...\n测试完成!`);
     this.apiIntegrations.set(this.apiIntegrations().map(integration => 
       integration.id === id ? { ...integration, lastTested: new Date().toLocaleString('zh-CN') } : integration
     ));
@@ -643,7 +643,7 @@ export class ApiIntegrations implements OnInit {
   // 导出日志
   exportLogs(): void {
     // 模拟导出功能
-    alert(`已导出 ${this.filteredLogs().length} 条API日志记录`);
+   window?.fmode?.alert(`已导出 ${this.filteredLogs().length} 条API日志记录`);
   }
 
   // 清除筛选条件

+ 7 - 7
src/app/pages/admin/departments/departments.ts

@@ -166,12 +166,12 @@ export class Departments implements OnInit {
   async saveDepartment() {
     const name = (this.formModel.name || '').trim();
     if (!name) {
-      alert('请输入项目组名称');
+     window?.fmode?.alert('请输入项目组名称');
       return;
     }
 
     if (!this.formModel.leaderId) {
-      alert('请选择组长');
+     window?.fmode?.alert('请选择组长');
       return;
     }
 
@@ -186,7 +186,7 @@ export class Departments implements OnInit {
       this.closePanel();
     } catch (error) {
       console.error('创建项目组失败:', error);
-      alert('创建项目组失败,请重试');
+     window?.fmode?.alert('创建项目组失败,请重试');
     }
   }
 
@@ -196,12 +196,12 @@ export class Departments implements OnInit {
 
     const name = (this.formModel.name || '').trim();
     if (!name) {
-      alert('请输入项目组名称');
+     window?.fmode?.alert('请输入项目组名称');
       return;
     }
 
     if (!this.formModel.leaderId) {
-      alert('请选择组长');
+     window?.fmode?.alert('请选择组长');
       return;
     }
 
@@ -215,7 +215,7 @@ export class Departments implements OnInit {
       this.closePanel();
     } catch (error) {
       console.error('更新项目组失败:', error);
-      alert('更新项目组失败,请重试');
+     window?.fmode?.alert('更新项目组失败,请重试');
     }
   }
 
@@ -230,7 +230,7 @@ export class Departments implements OnInit {
       await this.loadDepartments();
     } catch (error) {
       console.error('删除项目组失败:', error);
-      alert('删除项目组失败,请重试');
+     window?.fmode?.alert('删除项目组失败,请重试');
     }
   }
 

+ 1 - 1
src/app/pages/admin/designers/designers.ts

@@ -177,7 +177,7 @@ export class Designers implements OnInit {
   saveDesigner(): void {
     const name = (this.formModel.name || '').trim();
     if (!name) {
-      alert('请输入姓名');
+     window?.fmode?.alert('请输入姓名');
       return;
     }
     const newDesigner: Designer = {

+ 2 - 2
src/app/pages/admin/employees/employees.ts

@@ -215,7 +215,7 @@ export class Employees implements OnInit {
       this.closePanel();
     } catch (error) {
       console.error('更新员工失败:', error);
-      alert('更新员工失败,请重试');
+     window?.fmode?.alert('更新员工失败,请重试');
     }
   }
 
@@ -231,7 +231,7 @@ export class Employees implements OnInit {
       await this.loadEmployees();
     } catch (error) {
       console.error(`${action}员工失败:`, error);
-      alert(`${action}员工失败,请重试`);
+     window?.fmode?.alert(`${action}员工失败,请重试`);
     }
   }
 

+ 7 - 7
src/app/pages/admin/groupchats/groupchats.ts

@@ -172,7 +172,7 @@ export class GroupChats implements OnInit {
       }
     } catch (error) {
       console.error('加载群组详情失败:', error);
-      alert('加载群组详情失败,可能是企微API调用失败');
+     window?.fmode?.alert('加载群组详情失败,可能是企微API调用失败');
     } finally {
       this.loadingDetail.set(false);
     }
@@ -207,7 +207,7 @@ export class GroupChats implements OnInit {
       this.closePanel();
     } catch (error) {
       console.error('更新群组失败:', error);
-      alert('更新群组失败,请重试');
+     window?.fmode?.alert('更新群组失败,请重试');
     }
   }
 
@@ -222,7 +222,7 @@ export class GroupChats implements OnInit {
       await this.loadGroupChats();
     } catch (error) {
       console.error(`${action}群组失败:`, error);
-      alert(`${action}群组失败,请重试`);
+     window?.fmode?.alert(`${action}群组失败,请重试`);
     }
   }
 
@@ -282,7 +282,7 @@ export class GroupChats implements OnInit {
    */
   async createProject() {
     if (!this.newProjectName.trim()) {
-      alert('请输入项目名称');
+     window?.fmode?.alert('请输入项目名称');
       return;
     }
 
@@ -336,7 +336,7 @@ export class GroupChats implements OnInit {
       await pg.save();
       console.log('ProjectGroup关联创建成功');
 
-      alert('项目创建成功!');
+     window?.fmode?.alert('项目创建成功!');
 
       // 4. 刷新群组列表
       await this.loadGroupChats();
@@ -346,7 +346,7 @@ export class GroupChats implements OnInit {
 
     } catch (err: any) {
       console.error('创建项目失败:', err);
-      alert('创建失败: ' + (err.message || '未知错误'));
+     window?.fmode?.alert('创建失败: ' + (err.message || '未知错误'));
     } finally {
       this.creating.set(false);
     }
@@ -357,7 +357,7 @@ export class GroupChats implements OnInit {
    */
   async navigateToProjectDetail(group: GroupChat) {
     if (!group.project) {
-      alert('该群组未关联项目');
+     window?.fmode?.alert('该群组未关联项目');
       return;
     }
 

+ 1 - 1
src/app/pages/admin/logs/logs.ts

@@ -444,7 +444,7 @@ export class Logs implements OnInit {
   // 导出日志
   exportLogs(): void {
     // 模拟导出功能
-    alert(`已导出 ${this.filteredLogs().length} 条日志记录`);
+   window?.fmode?.alert(`已导出 ${this.filteredLogs().length} 条日志记录`);
   }
   
   // 清除筛选条件

+ 1 - 1
src/app/pages/admin/project-management/project-management.ts

@@ -277,7 +277,7 @@ export class ProjectManagement implements OnInit {
   openEditDialog(project: Project): void {
     // TODO: 实现简单的编辑对话框,使用设计师分配组件
     // 暂时使用alert提示
-    alert('编辑功能将在设计师分配组件对接完成后实现');
+   window?.fmode?.alert('编辑功能将在设计师分配组件对接完成后实现');
   }
 
   // 打开团队分配弹窗

+ 10 - 10
src/app/pages/admin/system-settings/setting-dialog/setting-dialog.ts

@@ -128,12 +128,12 @@ export class SettingDialogComponent implements OnInit {
   isFormValid(): boolean {
     // 通用验证 - 名称和描述
     if (!this.item.name || !this.item.name.trim()) {
-      alert('请输入名称');
+     window?.fmode?.alert('请输入名称');
       return false;
     }
 
     if (!this.item.description || !this.item.description.trim()) {
-      alert('请输入描述');
+     window?.fmode?.alert('请输入描述');
       return false;
     }
 
@@ -142,44 +142,44 @@ export class SettingDialogComponent implements OnInit {
       case 'workflow':
         const workflowItem = this.item as WorkflowStage;
         if (!workflowItem.order || workflowItem.order <= 0) {
-          alert('请输入有效的阶段顺序');
+         window?.fmode?.alert('请输入有效的阶段顺序');
           return false;
         }
         break;
       case 'sop':
         const sopItem = this.item as SOPTemplate;
         if (!sopItem.category) {
-          alert('请选择模板分类');
+         window?.fmode?.alert('请选择模板分类');
           return false;
         }
         if (!sopItem.steps || sopItem.steps.length === 0) {
-          alert('请至少添加一个流程步骤');
+         window?.fmode?.alert('请至少添加一个流程步骤');
           return false;
         }
         break;
       case 'pricing':
         const pricingItem = this.item as PricingRule;
         if (!pricingItem.category) {
-          alert('请选择报价分类');
+         window?.fmode?.alert('请选择报价分类');
           return false;
         }
         if (!pricingItem.formula || !pricingItem.formula.trim()) {
-          alert('请输入计算公式');
+         window?.fmode?.alert('请输入计算公式');
           return false;
         }
         break;
       case 'performance':
         const performanceItem = this.item as PerformanceRule;
         if (!performanceItem.metric) {
-          alert('请选择绩效指标');
+         window?.fmode?.alert('请选择绩效指标');
           return false;
         }
         if (performanceItem.threshold === undefined || performanceItem.threshold < 0 || performanceItem.threshold > 100) {
-          alert('请输入有效的阈值(0-100)');
+         window?.fmode?.alert('请输入有效的阈值(0-100)');
           return false;
         }
         if (!performanceItem.reward || !performanceItem.reward.trim()) {
-          alert('请输入奖励方式');
+         window?.fmode?.alert('请输入奖励方式');
           return false;
         }
         break;

+ 3 - 3
src/app/pages/admin/system-settings/system-settings.ts

@@ -552,11 +552,11 @@ export class SystemSettings implements OnInit {
   }
 
   // 批量排序:输入起始序号,按当前显示顺序依次编号
-  bulkSortWorkflow(): void {
+  async bulkSortWorkflow(): Promise<void> {
     if (this.bulkSelectedIds.size === 0) return;
     const selected = this.workflowStages.filter(s => this.bulkSelectedIds.has(s.id)).sort((a,b)=>a.order-b.order);
     const minOrder = selected.reduce((m,s)=>Math.min(m,s.order), selected[0].order);
-    const input = prompt(`请输入起始序号(默认 ${minOrder})`, String(minOrder));
+    const input = await window?.fmode?.input(`请输入起始序号(默认 ${minOrder})`, String(minOrder));
     const start = input ? parseInt(input, 10) : minOrder;
     if (!Number.isFinite(start)) return;
     let current = start;
@@ -786,7 +786,7 @@ export class SystemSettings implements OnInit {
   saveSystemOptions(): void {
     console.log('保存系统配置:', this.systemOptions);
     // 这里可以添加保存到后端的逻辑
-    alert('系统配置保存成功!');
+   window?.fmode?.alert('系统配置保存成功!');
   }
   
   // 初始化数据使用情况图表

+ 3 - 3
src/app/pages/admin/user-management/role-dialog/role-dialog.ts

@@ -132,19 +132,19 @@ export class RoleDialogComponent {
   isFormValid(): boolean {
     // 验证角色名称
     if (!this.role.name.trim()) {
-      alert('请输入角色名称');
+     window?.fmode?.alert('请输入角色名称');
       return false;
     }
 
     // 验证角色描述
     if (!this.role.description.trim()) {
-      alert('请输入角色描述');
+     window?.fmode?.alert('请输入角色描述');
       return false;
     }
 
     // 验证权限选择
     if (this.role.permissions.length === 0 && this.role.name !== '超级管理员') {
-      alert('请至少选择一项权限');
+     window?.fmode?.alert('请至少选择一项权限');
       return false;
     }
 

+ 1 - 1
src/app/pages/admin/user-management/user-management.ts

@@ -490,7 +490,7 @@ export class UserManagement implements OnInit {
     // 检查是否有用户正在使用该角色
     const role = this.roles().find(r => r.id === id);
     if (role && role.usersCount > 0) {
-      alert('该角色下有用户正在使用,无法删除!');
+     window?.fmode?.alert('该角色下有用户正在使用,无法删除!');
       return;
     }
     

+ 2 - 2
src/app/pages/customer-service/dashboard/dashboard.ts

@@ -756,7 +756,7 @@ export class Dashboard implements OnInit, OnDestroy {
     // 验证表单数据
     if (!this.newTask.title.trim() || !this.newTask.projectName.trim() || !this.deadlineInput || this.isSubmitDisabled) {
       // 在实际应用中,这里应该显示错误提示
-      alert('请填写必填字段(任务标题、项目名称、截止时间)');
+     window?.fmode?.alert('请填写必填字段(任务标题、项目名称、截止时间)');
       return;
     }
     
@@ -1065,7 +1065,7 @@ onSearchInput(event: Event): void {
       console.log(`✅ 项目 ${projectId} 大图已成功发送到企业微信服务群`);
       console.log(`📱 已同步发送支付成功与大图交付通知`);
       
-      alert(`🎉 大图发送成功!
+     window?.fmode?.alert(`🎉 大图发送成功!
 
 ✅ 已完成操作:
 • 大图已发送至企业微信服务群

+ 2 - 2
src/app/pages/customer-service/dashboard/pages/after-sales/after-sales.component.ts

@@ -623,13 +623,13 @@ export class AfterSalesComponent implements OnInit {
   // 显示成功消息
   private showSuccessMessage(message: string): void {
     // 这里可以集成实际的消息提示组件
-    alert(message);
+   window?.fmode?.alert(message);
   }
 
   // 显示错误消息
   private showErrorMessage(message: string): void {
     // 这里可以集成实际的消息提示组件
-    alert(message);
+   window?.fmode?.alert(message);
   }
   
   // 获取支付记录状态文本

+ 2 - 2
src/app/pages/designer/dashboard/dashboard.ts

@@ -462,7 +462,7 @@ export class Dashboard implements OnInit {
     if (shift) {
       // 实际应用中,这里应该打开详情页面或模态框
       console.log('查看代班任务详情:', shift);
-      alert(`代班任务详情:\n项目:${shift.projectName}\n任务:${shift.taskDescription}\n优先级:${shift.priority}\n代班日期:${shift.shiftDate}`);
+     window?.fmode?.alert(`代班任务详情:\n项目:${shift.projectName}\n任务:${shift.taskDescription}\n优先级:${shift.priority}\n代班日期:${shift.shiftDate}`);
     }
   }
 
@@ -472,7 +472,7 @@ export class Dashboard implements OnInit {
     if (shiftIndex !== -1) {
       // 在实际应用中,这里应该调用API更新状态
       this.shiftTasks[shiftIndex].status = '已完成';
-      alert('代班任务已标记为完成');
+     window?.fmode?.alert('代班任务已标记为完成');
     }
   }
 

+ 3 - 3
src/app/pages/designer/material-share/material-share.ts

@@ -139,7 +139,7 @@ export class MaterialShare implements OnInit {
       setTimeout(() => {
         // 实际应用中应调用上传API
         console.log('上传素材:', file.name);
-        alert('素材上传成功!等待审核后即可在共享盘中看到');
+       window?.fmode?.alert('素材上传成功!等待审核后即可在共享盘中看到');
         this.isLoading = false;
         // 重置输入,允许重新选择同一文件
         input.value = '';
@@ -154,7 +154,7 @@ export class MaterialShare implements OnInit {
       // 实际应用中应调用下载API
       this.projectService.recordMaterialDownload(materialId).subscribe(() => {
         console.log('下载素材:', materialId);
-        alert('素材下载成功!');
+       window?.fmode?.alert('素材下载成功!');
         this.isLoading = false;
         // 刷新统计数据
         this.loadMaterialStatistics();
@@ -165,7 +165,7 @@ export class MaterialShare implements OnInit {
   viewMaterialDetail(materialId: string): void {
     // 在实际应用中,这里应该导航到素材详情页
     console.log('查看素材详情:', materialId);
-    alert('素材ID: ' + materialId);
+   window?.fmode?.alert('素材ID: ' + materialId);
   }
 
   addToFavorites(materialId: string): void {

+ 1 - 1
src/app/pages/designer/personal-board/personal-board.ts

@@ -305,7 +305,7 @@ export class PersonalBoard implements OnInit, AfterViewInit {
   acceptOrder(orderId: string): void {
     // 接受订单功能
     console.log('接受订单:', orderId);
-    alert('订单接受成功!');
+   window?.fmode?.alert('订单接受成功!');
     // 实际应用中应调用API接受订单
   }
 

+ 1 - 1
src/app/pages/designer/project-detail/LATEST-FIXES-SUMMARY.md

@@ -143,7 +143,7 @@ showFeatureDetail(title: string, description: string): void {
   console.log(`📋 功能详情: ${title}`);
   console.log(`📝 ${description}`);
   
-  alert(`✨ ${title}\n\n${description}\n\n点击确定关闭`);
+ window?.fmode?.alert(`✨ ${title}\n\n${description}\n\n点击确定关闭`);
 }
 ```
 

+ 3 - 3
src/app/pages/designer/project-detail/components/order-creation/order-creation.component.ts

@@ -157,7 +157,7 @@ export class OrderCreationComponent implements OnInit {
   // 生成自动报价
   generateAutoQuotation(): void {
     if (!this.selectedSpaceType() || !this.selectedStyleLevel()) {
-      alert('请先选择空间类型和风格等级');
+     window?.fmode?.alert('请先选择空间类型和风格等级');
       return;
     }
 
@@ -165,7 +165,7 @@ export class OrderCreationComponent implements OnInit {
     const styleConfig = this.styleLevelConfig().find(s => s.level === this.selectedStyleLevel());
 
     if (!spaceConfig || !styleConfig) {
-      alert('配置信息不完整');
+     window?.fmode?.alert('配置信息不完整');
       return;
     }
 
@@ -210,7 +210,7 @@ export class OrderCreationComponent implements OnInit {
   // 调整报价
   adjustQuotation(newPrice: number, reason: string): void {
     if (this.generatedQuotation().length === 0) {
-      alert('请先生成报价');
+     window?.fmode?.alert('请先生成报价');
       return;
     }
 

+ 3 - 3
src/app/pages/designer/project-detail/components/reference-image-manager/reference-image-manager.component.ts

@@ -436,19 +436,19 @@ export class ReferenceImageManagerComponent implements OnInit {
       }
     }
 
-    alert(`已将追问发送给客户:\n\n${question.example}`);
+   window?.fmode?.alert(`已将追问发送给客户:\n\n${question.example}`);
   }
 
   // 发送自定义问题
   sendCustomQuestion() {
     if (!this.customQuestion.trim()) {
-      alert('请输入追问内容');
+     window?.fmode?.alert('请输入追问内容');
       return;
     }
 
     // 这里实现发送自定义问题的逻辑
     console.log('发送自定义问题:', this.customQuestion);
-    alert(`已将追问发送给客户:\n\n${this.customQuestion}`);
+   window?.fmode?.alert(`已将追问发送给客户:\n\n${this.customQuestion}`);
     this.customQuestion = '';
   }
 

+ 59 - 59
src/app/pages/designer/project-detail/project-detail.ts

@@ -996,7 +996,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     if (phase === 'soft') markSynced(this.softDecorImages);
     if (phase === 'render') markSynced(this.renderLargeImages);
     if (phase === 'postProcess') markSynced(this.postProcessImages);
-    alert('已同步该阶段的图片信息(模拟)');
+   window?.fmode?.alert('已同步该阶段的图片信息(模拟)');
   }
 
   reviewImage(imageId: string, phase: 'white' | 'soft' | 'render' | 'postProcess', status: 'approved' | 'rejected'): void {
@@ -1294,7 +1294,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
   // 整理项目详情
   organizeProject(): void {
     // 模拟整理项目逻辑
-    alert('项目详情已整理');
+   window?.fmode?.alert('项目详情已整理');
   }
   
   // 检查当前阶段是否显示特定卡片
@@ -1570,7 +1570,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       if (/\.(jpg|jpeg|png)$/i.test(file.name)) {
         const ok = await this.validateImage4K(file).catch(() => false);
         if (!ok) {
-          alert(`图片不符合4K标准(最大边需≥4000像素):${file.name}`);
+         window?.fmode?.alert(`图片不符合4K标准(最大边需≥4000像素):${file.name}`);
           continue;
         }
       }
@@ -1649,12 +1649,12 @@ export class ProjectDetail implements OnInit, OnDestroy {
     
     if (hoursRemaining <= 3 && hoursRemaining > 0) {
       // 弹窗预警
-      alert('渲染进度预警:交付前3小时,请关注渲染进度');
+     window?.fmode?.alert('渲染进度预警:交付前3小时,请关注渲染进度');
     }
     
     if (hoursRemaining <= 1 && hoursRemaining > 0) {
       // 更严重的预警
-      alert('渲染进度严重预警:交付前1小时,渲染可能无法按时完成!');
+     window?.fmode?.alert('渲染进度严重预警:交付前1小时,渲染可能无法按时完成!');
     }
   }
 
@@ -1697,7 +1697,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       } else {
         clearInterval(this.countdownInterval);
         // 超时提醒
-        alert('客户反馈已超过1小时未响应,请立即处理!');
+       window?.fmode?.alert('客户反馈已超过1小时未响应,请立即处理!');
         this.notifyTeamLeader('feedback-overdue');
       }
     }, 1000);
@@ -1724,14 +1724,14 @@ export class ProjectDetail implements OnInit, OnDestroy {
   initiateDesignerChange(reason: string): void {
     // 实际应用中应调用API发起变更
     console.log(`发起设计师变更,原因:${reason}`);
-    alert('已发起设计师变更申请,请等待新设计师承接');
+   window?.fmode?.alert('已发起设计师变更申请,请等待新设计师承接');
   }
 
   // 确认承接变更项目
   acceptDesignerChange(changeId: string): void {
     // 实际应用中应调用API确认承接
     console.log(`确认承接设计师变更:${changeId}`);
-    alert('已确认承接项目,系统已记录时间戳和责任人');
+   window?.fmode?.alert('已确认承接项目,系统已记录时间戳和责任人');
   }
 
   // 格式化倒计时显示
@@ -1747,7 +1747,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
   // 提交异常反馈
   submitExceptionFeedback(): void {
     if (!this.exceptionDescription.trim() || this.isSubmittingFeedback) {
-      alert('请填写异常类型和描述');
+     window?.fmode?.alert('请填写异常类型和描述');
       return;
     }
 
@@ -1775,7 +1775,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       this.showExceptionForm = false;
       
       // 显示成功消息
-      alert('异常反馈已提交,技术支持将尽快处理');
+     window?.fmode?.alert('异常反馈已提交,技术支持将尽快处理');
       
       this.isSubmittingFeedback = false;
     }, 1000);
@@ -1807,7 +1807,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
 
   // 联系组长
   contactTeamLeader() {
-    alert(`已联系${this.project?.assigneeName || '项目组长'}`);
+   window?.fmode?.alert(`已联系${this.project?.assigneeName || '项目组长'}`);
   }
 
   // 处理渲染超时预警
@@ -1927,7 +1927,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
   previewImage(img: any): void {
     const isRenderLarge = !!this.renderLargeImages.find(i => i.id === img?.id);
     if (isRenderLarge && img?.locked) {
-      alert('该渲染大图已加锁,需完成尾款结算并上传/识别支付凭证后方可预览。');
+     window?.fmode?.alert('该渲染大图已加锁,需完成尾款结算并上传/识别支付凭证后方可预览。');
       return;
     }
     this.previewImageData = img;
@@ -1942,7 +1942,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
   downloadImage(img: any): void {
     const isRenderLarge = !!this.renderLargeImages.find(i => i.id === img?.id);
     if (isRenderLarge && img?.locked) {
-      alert('该渲染大图已加锁,需完成尾款结算并上传/识别支付凭证后方可下载。');
+     window?.fmode?.alert('该渲染大图已加锁,需完成尾款结算并上传/识别支付凭证后方可下载。');
       return;
     }
     if (img) {
@@ -2115,7 +2115,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       this.isConfirmingSettlement = false;
       
       // 显示成功提示
-      alert('尾款结算已确认完成!');
+     window?.fmode?.alert('尾款结算已确认完成!');
       
       // 进入下一阶段
       this.advanceToNextStage('尾款结算');
@@ -2184,7 +2184,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     for (const f of files) {
       const ok = await this.validateImage4K(f).catch(() => false);
       if (!ok) {
-        alert(`图片不符合4K标准(最大边需≥4000像素):${f.name}`);
+       window?.fmode?.alert(`图片不符合4K标准(最大边需≥4000像素):${f.name}`);
         continue;
       }
       const item = this.makeImageItem(f);
@@ -3066,7 +3066,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       this.expandedStages['订单分配'] = false;
       
       // 显示成功消息
-      alert('团队分配成功!已进入需求沟通阶段');
+     window?.fmode?.alert('团队分配成功!已进入需求沟通阶段');
       
       console.log('团队分配完成,已跳转到需求沟通阶段');
     }
@@ -3622,7 +3622,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
             置信度:${(recognition.confidence * 100).toFixed(1)}%
           `;
           
-          alert(successMessage);
+         window?.fmode?.alert(successMessage);
           console.log('支付凭证识别完成', recognition);
           
           // 自动标记验证通过并解锁渲染大图
@@ -3634,13 +3634,13 @@ export class ProjectDetail implements OnInit, OnDestroy {
           
         } else {
           const errorMessage = `支付凭证识别失败:${result.error || '未知错误'}`;
-          alert(errorMessage);
+         window?.fmode?.alert(errorMessage);
           console.error('支付凭证识别失败', result.error);
         }
       },
       error: (error) => {
         const errorMessage = `支付凭证处理出错:${error.message || '网络错误'}`;
-        alert(errorMessage);
+       window?.fmode?.alert(errorMessage);
         console.error('支付凭证处理出错', error);
       }
     });
@@ -3674,7 +3674,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
         您现在可以下载4K高清渲染图了!
       `;
       
-      alert(notificationMessage);
+     window?.fmode?.alert(notificationMessage);
       console.log('自动通知发送完成');
     }, 1000);
   }
@@ -3931,7 +3931,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     
     // 权限检查
     if (!this.isTechnicalView()) {
-      alert('⚠️ 仅技术人员可以启动自动化结算流程');
+     window?.fmode?.alert('⚠️ 仅技术人员可以启动自动化结算流程');
       return;
     }
     
@@ -3967,7 +3967,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       this.isAutoSettling = false;
       
       // 显示启动成功消息
-      alert(`🚀 自动化结算已成功启动!
+     window?.fmode?.alert(`🚀 自动化结算已成功启动!
 
 ✅ 已启动功能:
 • 小程序支付自动监听
@@ -4166,7 +4166,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       if (!file) return;
       
       console.log('📄 上传的凭证文件:', file.name);
-      alert(`📎 支付凭证已上传:${file.name}\n\n系统将自动识别支付金额和支付方式。`);
+     window?.fmode?.alert(`📎 支付凭证已上传:${file.name}\n\n系统将自动识别支付金额和支付方式。`);
       
       // 模拟凭证识别和处理
       setTimeout(() => {
@@ -4188,7 +4188,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     console.log('🎨 启动全景图合成...');
     
     // 显示提示信息
-    alert('📸 请选择需要合成全景图的图片\n\n提示:\n1. 建议选择同一空间的多个角度照片\n2. 图片文件名可以包含空间名称(如:客厅-角度1.jpg)\n3. 系统会自动识别并分类');
+   window?.fmode?.alert('📸 请选择需要合成全景图的图片\n\n提示:\n1. 建议选择同一空间的多个角度照片\n2. 图片文件名可以包含空间名称(如:客厅-角度1.jpg)\n3. 系统会自动识别并分类');
     
     // 打开文件选择对话框,支持多文件选择
     const fileInput = document.createElement('input');
@@ -4341,7 +4341,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     console.log('📁 打开全景图画廊');
     
     if (this.panoramicSyntheses.length === 0) {
-      alert('📁 全景图画廊\n\n暂无全景图记录,请先进行全景图合成。');
+     window?.fmode?.alert('📁 全景图画廊\n\n暂无全景图记录,请先进行全景图合成。');
       return;
     }
     
@@ -4350,20 +4350,20 @@ export class ProjectDetail implements OnInit, OnDestroy {
       `${index + 1}. ${item.projectName} - ${item.status === 'completed' ? '✅ 已完成' : '⏳ 处理中'} (${item.spaces?.length || 0}个空间)`
     ).join('\n');
     
-    alert(`📁 全景图画廊(共${this.panoramicSyntheses.length}个)\n\n${galleryInfo}\n\n提示:点击列表中的全景图可查看详情或下载`);
+   window?.fmode?.alert(`📁 全景图画廊(共${this.panoramicSyntheses.length}个)\n\n${galleryInfo}\n\n提示:点击列表中的全景图可查看详情或下载`);
   }
   
   // 复制全景图链接
   copyPanoramicLink(synthesis: PanoramicSynthesis): void {
     if (!synthesis.shareLink) {
-      alert('全景图链接尚未生成');
+     window?.fmode?.alert('全景图链接尚未生成');
       return;
     }
     
     navigator.clipboard.writeText(synthesis.shareLink).then(() => {
-      alert(`✅ 全景图链接已复制!\n\n${synthesis.shareLink}`);
+     window?.fmode?.alert(`✅ 全景图链接已复制!\n\n${synthesis.shareLink}`);
     }).catch(() => {
-      alert(`全景图链接:\n${synthesis.shareLink}`);
+     window?.fmode?.alert(`全景图链接:\n${synthesis.shareLink}`);
     });
   }
 
@@ -4409,9 +4409,9 @@ export class ProjectDetail implements OnInit, OnDestroy {
     
     // 复制到剪贴板
     navigator.clipboard.writeText(reviewLink).then(() => {
-      alert(`✅ 评价链接已复制到剪贴板!\n\n链接:${reviewLink}\n\n有效期:30天\n\n请通过企业微信发送给客户`);
+     window?.fmode?.alert(`✅ 评价链接已复制到剪贴板!\n\n链接:${reviewLink}\n\n有效期:30天\n\n请通过企业微信发送给客户`);
     }).catch(() => {
-      alert(`评价链接:\n\n${reviewLink}\n\n有效期:30天\n\n请通过企业微信发送给客户`);
+     window?.fmode?.alert(`评价链接:\n\n${reviewLink}\n\n有效期:30天\n\n请通过企业微信发送给客户`);
     });
     
     // 通知客服发送评价链接
@@ -4450,7 +4450,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       this.project.customerReviewCompletedAt = new Date();
     }
     
-    alert('✅ 客户评价已确认完成!');
+   window?.fmode?.alert('✅ 客户评价已确认完成!');
     
     // 可选:自动进入下一阶段
     // this.advanceToNextStage('客户评价');
@@ -4463,17 +4463,17 @@ export class ProjectDetail implements OnInit, OnDestroy {
   isKeywordMonitoringActive: boolean = false;
   
   // 手动创建投诉
-  createComplaintManually(): void {
+  async createComplaintManually(): Promise<void> {
     console.log('📝 手动创建投诉');
     
     // 显示创建投诉表单提示
-    alert('📝 创建投诉记录\n\n即将打开投诉创建表单,请填写以下信息:\n• 投诉环节\n• 核心问题\n• 客户反馈\n• 严重程度');
+   await window?.fmode?.alert('📝 创建投诉记录\n\n即将打开投诉创建表单,请填写以下信息:\n• 投诉环节\n• 核心问题\n• 客户反馈\n• 严重程度');
     
     // 弹出创建投诉表单
-    const complaintReason = prompt('请输入投诉原因:');
+    const complaintReason = await window?.fmode?.input('请输入投诉原因:');
     if (!complaintReason || complaintReason.trim() === '') return;
     
-    const complaintStage = prompt('请输入投诉环节(如:需求沟通、建模、渲染等):') || '未指定';
+    const complaintStage = await window?.fmode?.input('请输入投诉环节(如:需求沟通、建模、渲染等):') || '未指定';
     
     // 创建投诉记录
     const complaint: any = {
@@ -4501,7 +4501,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     
     console.log('✅ 投诉记录已创建:', complaint);
     
-    alert(`✅ 投诉记录已创建!\n\n投诉环节:${complaintStage}\n核心问题:${complaint.tags.join('、')}\n\n系统将自动跟踪处理进度。`);
+   await window?.fmode?.alert(`✅ 投诉记录已创建!\n\n投诉环节:${complaintStage}\n核心问题:${complaint.tags.join('、')}\n\n系统将自动跟踪处理进度。`);
     
     // 通知相关人员
     this.notifyComplaintHandlers(complaint);
@@ -4549,35 +4549,35 @@ export class ProjectDetail implements OnInit, OnDestroy {
   }
 
   // 设置关键词监控
-  setupKeywordMonitoring(): void {
+  async setupKeywordMonitoring(): Promise<void> {
     console.log('⚙️ 设置关键词监控');
     
     if (this.isKeywordMonitoringActive) {
       const confirmStop = confirm('⚙️ 关键词监控管理\n\n状态:✅ 已激活\n监控关键词:' + this.complaintKeywords.join('、') + '\n\n是否停止监控?');
       if (confirmStop) {
         this.isKeywordMonitoringActive = false;
-        alert('⏸️ 关键词监控已停止\n\n系统将不再自动抓取企业微信群中的投诉关键词');
+       await window?.fmode?.alert('⏸️ 关键词监控已停止\n\n系统将不再自动抓取企业微信群中的投诉关键词');
       }
       return;
     }
     
     // 显示设置说明和当前关键词
-    alert('⚙️ 关键词监控功能\n\n功能说明:\n• 自动监测企业微信群消息\n• 识别投诉相关关键词\n• 自动创建投诉记录并标注\n• 实时通知相关处理人员\n\n当前监控关键词:\n' + this.complaintKeywords.join('、'));
+   await window?.fmode?.alert('⚙️ 关键词监控功能\n\n功能说明:\n• 自动监测企业微信群消息\n• 识别投诉相关关键词\n• 自动创建投诉记录并标注\n• 实时通知相关处理人员\n\n当前监控关键词:\n' + this.complaintKeywords.join('、'));
     
     const currentKeywords = this.complaintKeywords.join('、');
-    const newKeywords = prompt(`当前监控关键词:\n${currentKeywords}\n\n请输入要添加的关键词(多个关键词用逗号分隔):`);
+    const newKeywords = await window?.fmode?.input(`当前监控关键词:\n${currentKeywords}\n\n请输入要添加的关键词(多个关键词用逗号分隔):`);
     
     if (newKeywords && newKeywords.trim()) {
       const keywords = newKeywords.split(/[,,、]/).map(k => k.trim()).filter(k => k);
       this.complaintKeywords = [...new Set([...this.complaintKeywords, ...keywords])];
-      alert(`✅ 关键词已更新\n\n新增关键词:${keywords.join('、')}\n\n全部监控关键词:\n${this.complaintKeywords.join('、')}`);
+     await window?.fmode?.alert(`✅ 关键词已更新\n\n新增关键词:${keywords.join('、')}\n\n全部监控关键词:\n${this.complaintKeywords.join('、')}`);
     }
     
     // 激活监控
     this.isKeywordMonitoringActive = true;
     this.startKeywordMonitoring();
     
-    alert(`✅ 关键词监控已激活!\n\n监控关键词:${this.complaintKeywords.join('、')}\n\n系统将自动检测企业微信群消息中的关键词并创建投诉记录。`);
+   await window?.fmode?.alert(`✅ 关键词监控已激活!\n\n监控关键词:${this.complaintKeywords.join('、')}\n\n系统将自动检测企业微信群消息中的关键词并创建投诉记录。`);
   }
   
   // 开始关键词监控
@@ -4670,7 +4670,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       if (!confirmAnyway) return;
     }
     
-    alert('✅ 所有投诉已确认处理完成!');
+   window?.fmode?.alert('✅ 所有投诉已确认处理完成!');
   }
 
   // 处理评价表单提交
@@ -4680,7 +4680,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     // 这里应该调用API将评价数据保存到服务器
     // 模拟API调用
     setTimeout(() => {
-      alert('客户评价提交成功!评价数据已保存。');
+     window?.fmode?.alert('客户评价提交成功!评价数据已保存。');
       
       // 更新本地反馈数据
       const newFeedback: CustomerFeedback = {
@@ -4708,7 +4708,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     // 这里应该调用API将草稿数据保存到服务器
     // 模拟API调用
     setTimeout(() => {
-      alert('评价草稿保存成功!您可以稍后继续完善。');
+     window?.fmode?.alert('评价草稿保存成功!您可以稍后继续完善。');
     }, 500);
   }
 
@@ -4838,7 +4838,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     // 这里应该调用API分配订单
     // 模拟API调用
     setTimeout(() => {
-      alert('订单分配成功!');
+     window?.fmode?.alert('订单分配成功!');
       // 订单分配成功后自动切换到下一环节
       this.advanceToNextStage('订单分配');
     }, 500);
@@ -4976,7 +4976,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       };
       
       this.isGeneratingReview = false;
-      alert('复盘报告生成完成!基于真实SOP执行数据和智能分析生成。');
+     window?.fmode?.alert('复盘报告生成完成!基于真实SOP执行数据和智能分析生成。');
     }, 3000);
   }
 
@@ -5013,20 +5013,20 @@ export class ProjectDetail implements OnInit, OnDestroy {
           // 复制到剪贴板
           if (navigator.clipboard) {
             navigator.clipboard.writeText(response.shareUrl).then(() => {
-              alert(`复盘报告分享链接已复制到剪贴板!\n链接有效期:${response.expirationDate ? new Date(response.expirationDate).toLocaleDateString() : '30天'}`);
+             window?.fmode?.alert(`复盘报告分享链接已复制到剪贴板!\n链接有效期:${response.expirationDate ? new Date(response.expirationDate).toLocaleDateString() : '30天'}`);
             }).catch(() => {
-              alert(`复盘报告分享链接:\n${response.shareUrl}\n\n链接有效期:${response.expirationDate ? new Date(response.expirationDate).toLocaleDateString() : '30天'}`);
+             window?.fmode?.alert(`复盘报告分享链接:\n${response.shareUrl}\n\n链接有效期:${response.expirationDate ? new Date(response.expirationDate).toLocaleDateString() : '30天'}`);
             });
           } else {
-            alert(`复盘报告分享链接:\n${response.shareUrl}\n\n链接有效期:${response.expirationDate ? new Date(response.expirationDate).toLocaleDateString() : '30天'}`);
+           window?.fmode?.alert(`复盘报告分享链接:\n${response.shareUrl}\n\n链接有效期:${response.expirationDate ? new Date(response.expirationDate).toLocaleDateString() : '30天'}`);
           }
         } else {
-          alert('分享失败:' + (response.message || '未知错误'));
+         window?.fmode?.alert('分享失败:' + (response.message || '未知错误'));
         }
       },
       error: (error) => {
         console.error('分享复盘报告失败:', error);
-        alert('分享失败,请稍后重试');
+       window?.fmode?.alert('分享失败,请稍后重试');
       }
     });
   }
@@ -5349,7 +5349,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     );
     
     if (!hasImages) {
-      alert('请先上传图片再确认');
+     window?.fmode?.alert('请先上传图片再确认');
       return;
     }
     
@@ -5376,7 +5376,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     } else {
       // 如果是最后一个阶段,标记为完成
       console.log(`交付执行阶段完成: ${currentStage}`);
-      alert('交付执行阶段已完成!');
+     window?.fmode?.alert('交付执行阶段已完成!');
     }
   }
   
@@ -5444,7 +5444,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     console.log(`📋 功能详情: ${title}`);
     console.log(`📝 ${description}`);
     
-    alert(`✨ ${title}\n\n${description}\n\n点击确定关闭`);
+   window?.fmode?.alert(`✨ ${title}\n\n${description}\n\n点击确定关闭`);
   }
 
   // ==================== 需求映射辅助方法 ====================
@@ -5534,7 +5534,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
       suggestion.acceptedAt = new Date();
       
       // 显示成功消息
-      alert(`✅ 已采纳优化建议!\n\n类别:${suggestion.category}\n建议已加入您的改进计划中。`);
+     window?.fmode?.alert(`✅ 已采纳优化建议!\n\n类别:${suggestion.category}\n建议已加入您的改进计划中。`);
       
       console.log('已采纳建议:', suggestion);
     }
@@ -5573,11 +5573,11 @@ export class ProjectDetail implements OnInit, OnDestroy {
       // 转换为CSV格式并下载(简化版本)
       this.downloadAsCSV(data);
       
-      alert('✅ 报告导出成功!\n\n报告已下载到您的下载文件夹。');
+     window?.fmode?.alert('✅ 报告导出成功!\n\n报告已下载到您的下载文件夹。');
       
     } catch (error) {
       console.error('导出报告失败:', error);
-      alert('❌ 导出报告失败,请稍后重试。');
+     window?.fmode?.alert('❌ 导出报告失败,请稍后重试。');
     }
   }
 

+ 18 - 18
src/app/pages/finance/dashboard/dashboard.ts

@@ -208,7 +208,7 @@ export class Dashboard implements OnInit {
   handleTaskClick(task: any) {
     // 检查财务相关任务的权限
     if ((task.title === '临时收款待核定' || task.title === '报价待审核') && !this.checkUserRole('teamLead')) {
-      alert('⚠️ 权限不足\n\n只有组长及以上权限可以处理此任务\n\n请联系管理员申请权限');
+     window?.fmode?.alert('⚠️ 权限不足\n\n只有组长及以上权限可以处理此任务\n\n请联系管理员申请权限');
       return;
     }
     
@@ -219,15 +219,15 @@ export class Dashboard implements OnInit {
       // 根据任务来源跳转到对应页面
       switch(task.source) {
         case 'reconciliation':
-          alert('🔄 正在跳转到对账管理页面...');
+         window?.fmode?.alert('🔄 正在跳转到对账管理页面...');
           // window.location.href = '/finance/reconciliation';
           break;
         case 'project-records':
-          alert('🔄 正在跳转到项目记录页面...');
+         window?.fmode?.alert('🔄 正在跳转到项目记录页面...');
           // window.location.href = '/finance/project-records';
           break;
         default:
-          alert(`📌 任务已标记\n\n任务"${task.title}"已加入处理队列`);
+         window?.fmode?.alert(`📌 任务已标记\n\n任务"${task.title}"已加入处理队列`);
       }
     }
   }
@@ -236,7 +236,7 @@ export class Dashboard implements OnInit {
   handleQuickAction(action: string) {
     // 检查权限
     if ((action === 'recordPayment' || action === 'generateReport') && !this.checkUserRole('teamLead')) {
-      alert('⚠️ 权限不足\n\n只有组长及以上权限可以执行此操作\n\n请联系管理员申请权限');
+     window?.fmode?.alert('⚠️ 权限不足\n\n只有组长及以上权限可以执行此操作\n\n请联系管理员申请权限');
       return;
     }
     
@@ -263,13 +263,13 @@ export class Dashboard implements OnInit {
   }
 
   // 显示新建报价对话框
-  private showNewQuoteDialog(): void {
-    const projectName = prompt('📝 新建报价\n\n请输入项目名称:', '示例项目');
+  private async showNewQuoteDialog(): Promise<void> {
+    const projectName = await window?.fmode?.input('📝 新建报价\n\n请输入项目名称:', '示例项目');
     if (projectName) {
-      const projectType = prompt('请选择项目类型:\n\n1. 家装-小户型\n2. 家装-大户型\n3. 工装-商铺\n4. 工装-写字楼\n\n请输入数字 1-4:', '1');
+      const projectType = await window?.fmode?.input('请选择项目类型:\n\n1. 家装-小户型\n2. 家装-大户型\n3. 工装-商铺\n4. 工装-写字楼\n\n请输入数字 1-4:', '1');
       
       if (projectType) {
-        alert(`✅ 报价创建成功!\n\n项目名称:${projectName}\n项目类型:${this.getProjectTypeText(projectType)}\n\n系统正在为您准备报价模板...`);
+       window?.fmode?.alert(`✅ 报价创建成功!\n\n项目名称:${projectName}\n项目类型:${this.getProjectTypeText(projectType)}\n\n系统正在为您准备报价模板...`);
         console.log('创建报价:', { projectName, projectType });
         // window.location.href = '/finance/project-records';
       }
@@ -277,13 +277,13 @@ export class Dashboard implements OnInit {
   }
 
   // 显示记录回款对话框
-  private showRecordPaymentDialog(): void {
-    const amount = prompt('💰 记录回款\n\n请输入回款金额(元):', '');
+  private async showRecordPaymentDialog(): Promise<void> {
+    const amount = await window?.fmode?.input('💰 记录回款\n\n请输入回款金额(元):', '');
     if (amount && !isNaN(Number(amount))) {
-      const paymentMethod = prompt('请选择支付方式:\n\n1. 微信支付\n2. 支付宝\n3. 银行转账\n4. 现金\n\n请输入数字 1-4:', '1');
+      const paymentMethod = await window?.fmode?.input('请选择支付方式:\n\n1. 微信支付\n2. 支付宝\n3. 银行转账\n4. 现金\n\n请输入数字 1-4:', '1');
       
       if (paymentMethod) {
-        alert(`✅ 回款记录成功!\n\n回款金额:¥${Number(amount).toLocaleString()}\n支付方式:${this.getPaymentMethodText(paymentMethod)}\n记录时间:${new Date().toLocaleString()}\n\n财务数据已更新`);
+       window?.fmode?.alert(`✅ 回款记录成功!\n\n回款金额:¥${Number(amount).toLocaleString()}\n支付方式:${this.getPaymentMethodText(paymentMethod)}\n记录时间:${new Date().toLocaleString()}\n\n财务数据已更新`);
         console.log('记录回款:', { amount, paymentMethod });
         // window.location.href = '/finance/reconciliation';
       }
@@ -291,14 +291,14 @@ export class Dashboard implements OnInit {
   }
 
   // 显示生成报表对话框
-  private showGenerateReportDialog(): void {
-    const reportType = prompt('📊 生成财务报表\n\n请选择报表类型:\n\n1. 月度收入报表\n2. 项目利润分析\n3. 回款统计报表\n4. 成本费用报表\n\n请输入数字 1-4:', '1');
+  private async showGenerateReportDialog(): Promise<void> {
+    const reportType = await window?.fmode?.input('📊 生成财务报表\n\n请选择报表类型:\n\n1. 月度收入报表\n2. 项目利润分析\n3. 回款统计报表\n4. 成本费用报表\n\n请输入数字 1-4:', '1');
     
     if (reportType) {
-      const period = prompt('请选择时间周期:\n\n1. 本月\n2. 上月\n3. 本季度\n4. 本年度\n\n请输入数字 1-4:', '1');
+      const period = await window?.fmode?.input('请选择时间周期:\n\n1. 本月\n2. 上月\n3. 本季度\n4. 本年度\n\n请输入数字 1-4:', '1');
       
       if (period) {
-        alert(`✅ 报表生成成功!\n\n报表类型:${this.getReportTypeText(reportType)}\n时间周期:${this.getPeriodText(period)}\n生成时间:${new Date().toLocaleString()}\n\n报表正在下载,请稍候...`);
+       window?.fmode?.alert(`✅ 报表生成成功!\n\n报表类型:${this.getReportTypeText(reportType)}\n时间周期:${this.getPeriodText(period)}\n生成时间:${new Date().toLocaleString()}\n\n报表正在下载,请稍候...`);
         console.log('生成报表:', { reportType, period });
         // window.location.href = '/finance/reports';
       }
@@ -591,7 +591,7 @@ export class Dashboard implements OnInit {
                            avgUtilization >= 75 ? '良好' : 
                            avgUtilization >= 60 ? '中等' : '待提升';
     
-    alert(`👨‍💼 设计师效率详情
+   window?.fmode?.alert(`👨‍💼 设计师效率详情
 
 姓名:${designer.name}
 效率等级:${efficiencyLevel} (平均利用率: ${avgUtilization.toFixed(1)}%)

+ 1 - 1
src/app/pages/finance/reports/reports.ts

@@ -632,7 +632,7 @@ export class Reports implements OnInit, AfterViewInit {
     const report = this.reportData();
     if (report) {
       console.log('导出报表:', report.title);
-      alert(`报表"${report.title}"已导出`);
+     window?.fmode?.alert(`报表"${report.title}"已导出`);
     }
   }
 

+ 7 - 7
src/app/pages/hr/attendance/attendance.ts

@@ -128,7 +128,7 @@ import * as echarts from 'echarts';
   
   submit() {
     if (!this.reason.trim()) {
-      alert('请输入补卡原因');
+     window?.fmode?.alert('请输入补卡原因');
       return;
     }
     this.dialogRef.close({ reason: this.reason });
@@ -268,7 +268,7 @@ const generateMockEmployees = (): Employee[] => {
       const end = new Date(v[2]);
       const employee = v[3];
       const progress = v[4];
-      alert(`任务:${params.name}\n负责人:${employee}\n进度:${progress}%\n起止:${start.toLocaleDateString()} ~ ${end.toLocaleDateString()}`);
+     window?.fmode?.alert(`任务:${params.name}\n负责人:${employee}\n进度:${progress}%\n起止:${start.toLocaleDateString()} ~ ${end.toLocaleDateString()}`);
     });
   };
   showGanttView = signal(false);
@@ -670,7 +670,7 @@ const generateMockEmployees = (): Employee[] => {
           this.isDialogOpening = false;
           if (result) {
             // 在实际应用中,这里会提交补卡申请到服务器
-            alert('补卡申请已提交,等待审核');
+           window?.fmode?.alert('补卡申请已提交,等待审核');
           }
         },
         error: (error) => {
@@ -681,7 +681,7 @@ const generateMockEmployees = (): Employee[] => {
     } catch (error) {
       this.isDialogOpening = false;
       console.error('打开补卡对话框失败:', error);
-      alert('打开对话框失败,请重试');
+     window?.fmode?.alert('打开对话框失败,请重试');
     }
   }
   
@@ -690,7 +690,7 @@ const generateMockEmployees = (): Employee[] => {
     try {
       const data = this.filteredAttendance();
       if (data.length === 0) {
-        alert('暂无数据可导出');
+       window?.fmode?.alert('暂无数据可导出');
         return;
       }
       
@@ -699,11 +699,11 @@ const generateMockEmployees = (): Employee[] => {
       
       // 显示成功提示
       setTimeout(() => {
-        alert(`成功导出 ${data.length} 条考勤记录`);
+       window?.fmode?.alert(`成功导出 ${data.length} 条考勤记录`);
       }, 100);
     } catch (error) {
       console.error('导出数据失败:', error);
-      alert('导出失败,请重试');
+     window?.fmode?.alert('导出失败,请重试');
     }
   }
 

+ 1 - 1
src/app/pages/hr/dashboard/dashboard.ts

@@ -858,7 +858,7 @@ export class Dashboard implements OnInit, AfterViewInit {
     // 这里可以打开一个对话框显示晋升规则
     console.log('打开晋升规则弹窗');
     // 临时实现:显示alert
-    alert('晋升规则:\n\n初级→中级:连续3个月优秀作品率超过80%,逾期率低于5%,客户满意度4.5以上\n\n中级→高级:连续6个月优秀作品率超过85%,逾期率低于3%,客户满意度4.8以上,有mentorship经验');
+   window?.fmode?.alert('晋升规则:\n\n初级→中级:连续3个月优秀作品率超过80%,逾期率低于5%,客户满意度4.5以上\n\n中级→高级:连续6个月优秀作品率超过85%,逾期率低于3%,客户满意度4.8以上,有mentorship经验');
   }
 
   // 招聘相关方法

+ 3 - 3
src/app/pages/hr/recruitment-performance/recruitment-performance.ts

@@ -512,13 +512,13 @@ export class RecruitmentPerformanceComponent implements AfterViewInit, OnDestroy
       // 验证文件类型
       const allowedTypes = ['application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'];
       if (!allowedTypes.includes(file.type)) {
-        alert('不支持的文件格式,请上传PDF、DOC或DOCX文件');
+       window?.fmode?.alert('不支持的文件格式,请上传PDF、DOC或DOCX文件');
         return;
       }
 
       // 验证文件大小 (10MB)
       if (file.size > 10 * 1024 * 1024) {
-        alert('文件大小超过10MB限制');
+       window?.fmode?.alert('文件大小超过10MB限制');
         return;
       }
 
@@ -1321,7 +1321,7 @@ export class RecruitmentPerformanceComponent implements AfterViewInit, OnDestroy
     
     // 这里可以调用后端API保存数据
     // 模拟保存成功
-    alert(`${stageType}数据已保存!`);
+   window?.fmode?.alert(`${stageType}数据已保存!`);
     this.closeStagePanel();
   }
 

+ 5 - 5
src/app/pages/team-leader/dashboard/dashboard.ts

@@ -1106,7 +1106,7 @@ export class Dashboard implements OnInit, OnDestroy {
       }
     } catch (error) {
       console.error('❌ 分配项目失败:', error);
-      alert('分配失败,请重试');
+     window?.fmode?.alert('分配失败,请重试');
     }
   }
 
@@ -2431,7 +2431,7 @@ export class Dashboard implements OnInit, OnDestroy {
       project.currentStage = 'revision';
     }
     this.applyFilters();
-    alert('质量评审已提交');
+   window?.fmode?.alert('质量评审已提交');
   }
 
   // 查看绩效预警(占位:跳转到团队管理)
@@ -2461,7 +2461,7 @@ export class Dashboard implements OnInit, OnDestroy {
   quickAssignProject(projectId: string): void {
     const project = this.projects.find(p => p.id === projectId);
     if (!project) {
-      alert('未找到对应项目');
+     window?.fmode?.alert('未找到对应项目');
       return;
     }
 
@@ -2480,7 +2480,7 @@ export class Dashboard implements OnInit, OnDestroy {
         // 更新设计师筛选列表
         this.designers = Array.from(new Set(this.projects.map(p => p.designerName).filter(n => !!n)));
         this.applyFilters();
-        alert(`项目已${reassigning ? '重新' : ''}分配给 ${recommended.name}`);
+       window?.fmode?.alert(`项目已${reassigning ? '重新' : ''}分配给 ${recommended.name}`);
         return;
       }
     }
@@ -2538,7 +2538,7 @@ export class Dashboard implements OnInit, OnDestroy {
     } else {
       this.router.navigate(['/team-leader/dashboard']);
     }
-    alert('工作量预估工具已迁移至项目详情页,您可以在建模阶段之前使用该工具进行工作量计算。');
+   window?.fmode?.alert('工作量预估工具已迁移至项目详情页,您可以在建模阶段之前使用该工具进行工作量计算。');
   }
 
   // 查看所有超期项目

+ 2 - 2
src/app/pages/team-leader/performance/performance.ts

@@ -80,12 +80,12 @@ export class PerformanceComponent implements OnInit {
   exportReport(): void {
     console.log('Exporting performance report...');
     // 实际的导出逻辑
-    alert('报告已开始导出!');
+   window?.fmode?.alert('报告已开始导出!');
   }
 
   viewDetailReport(designerId: string): void {
     console.log(`Viewing detail report for designer: ${designerId}`);
     // 导航到详细报告页面的逻辑
-    alert(`正在查看 ${this.allDesigners.find(d => d.id === designerId)?.name} 的详细报告`);
+   window?.fmode?.alert(`正在查看 ${this.allDesigners.find(d => d.id === designerId)?.name} 的详细报告`);
   }
 }

+ 2 - 2
src/app/pages/team-leader/project-review/project-review.ts

@@ -228,7 +228,7 @@ export class ProjectReviewComponent implements OnInit {
   // 提交至质量管理
   submitToQualityManagement(): void {
     // 在实际应用中,这里应该调用API将测试结果提交到质量管理模块
-    alert('测试结果已提交至质量管理模块!');
+   window?.fmode?.alert('测试结果已提交至质量管理模块!');
     // 跳转到质量管理页面
     this.router.navigate(['team-leader/quality-management']);
   }
@@ -411,7 +411,7 @@ export class ProjectReviewComponent implements OnInit {
     
     // 验证表单数据
     if (!this.workloadEstimationForm.area || this.workloadEstimationForm.area <= 0) {
-      alert('请输入有效的面积');
+     window?.fmode?.alert('请输入有效的面积');
       return;
     }
     

+ 9 - 9
src/app/pages/team-leader/quality-management/quality-management.ts

@@ -266,7 +266,7 @@ export class QualityManagementComponent implements OnInit {
   // 导出SOP为PDF
   exportSOP(): void {
     // 模拟导出PDF功能
-    alert(`已导出${this.getPhaseName(this.activeTab)}的SOP标准为PDF文件`);
+   window?.fmode?.alert(`已导出${this.getPhaseName(this.activeTab)}的SOP标准为PDF文件`);
     // 实际项目中,这里应该调用PDF生成库或API
   }
   
@@ -294,21 +294,21 @@ export class QualityManagementComponent implements OnInit {
       task.status = 'completed';
       // 自动同步至项目评审板块
       this.syncToProjectReview(taskId);
-      alert(`已批准任务: ${task.projectName}`);
+     window?.fmode?.alert(`已批准任务: ${task.projectName}`);
     }
   }
   
   // 拒绝任务
-  rejectTask(taskId: string): void {
+  async rejectTask(taskId: string): Promise<void> {
     const task = this.rectificationTasks.find(t => t.id === taskId);
     if (task) {
       task.status = 'pending';
       // 可以添加拒绝原因输入框
-      const reason = prompt('请输入拒绝原因:');
+      const reason = await window?.fmode?.input('请输入拒绝原因:');
       if (reason) {
         task.managerComment = reason;
       }
-      alert(`已拒绝任务: ${task.projectName}`);
+     window?.fmode?.alert(`已拒绝任务: ${task.projectName}`);
     }
   }
   
@@ -325,23 +325,23 @@ export class QualityManagementComponent implements OnInit {
   // 播放视频
   playVideo(video: VideoTutorial): void {
     // 模拟播放视频
-    alert(`正在播放视频: ${video.title}`);
+   window?.fmode?.alert(`正在播放视频: ${video.title}`);
     // 实际项目中,这里应该打开视频播放器或跳转到视频播放页面
   }
   
   // 评审作业
-  reviewAssignment(assignmentId: string): void {
+  async reviewAssignment(assignmentId: string): Promise<void> {
     const assignment = this.practiceAssignments.find(a => a.id === assignmentId);
     if (assignment) {
       // 模拟评审作业
       if (assignment.status === 'submitted') {
-        const score = prompt('请输入评分 (0-100):');
+        const score = await window?.fmode?.input('请输入评分 (0-100):');
         if (score && !isNaN(Number(score)) && Number(score) >= 0 && Number(score) <= 100) {
           assignment.score = Number(score);
           assignment.status = 'reviewed';
           // 同步成绩到team-management板块的能力看板
           this.syncScoreToTeamManagement(assignmentId, Number(score));
-          alert(`已完成作业评审,评分: ${score}`);
+         window?.fmode?.alert(`已完成作业评审,评分: ${score}`);
         }
       }
     }

+ 5 - 5
src/app/pages/team-leader/team-management/team-management.ts

@@ -401,7 +401,7 @@ export class TeamManagementComponent implements OnInit {
       // 在实际项目中,这里应该弹出一个对话框让用户选择新的优先级
       // 这里简单地循环切换优先级
       task.priority = task.priority % 3 + 1;
-      alert(`任务优先级已调整为: ${task.priority}`);
+     window?.fmode?.alert(`任务优先级已调整为: ${task.priority}`);
     }
   }
 
@@ -414,7 +414,7 @@ export class TeamManagementComponent implements OnInit {
       const newDeadline = new Date(task.deadline);
       newDeadline.setDate(newDeadline.getDate() + 3);
       task.deadline = newDeadline;
-      alert(`任务截止日期已调整为: ${newDeadline.toLocaleDateString()}`);
+     window?.fmode?.alert(`任务截止日期已调整为: ${newDeadline.toLocaleDateString()}`);
     }
   }
 
@@ -474,16 +474,16 @@ export class TeamManagementComponent implements OnInit {
 
   // 查看晋级条件
   showPromotionCriteria(): void {
-    alert('头部20%员工可获得晋级机会,具体条件:\n1. 绩效分数≥90分\n2. 无重大客户投诉\n3. 连续2个季度保持头部20%');
+   window?.fmode?.alert('头部20%员工可获得晋级机会,具体条件:\n1. 绩效分数≥90分\n2. 无重大客户投诉\n3. 连续2个季度保持头部20%');
   }
 
   // 查看提升建议
   showImprovementSuggestions(): void {
-    alert('中部70%员工提升建议:\n1. 参加技能培训课程\n2. 多与优秀员工交流学习\n3. 针对薄弱环节进行专项练习');
+   window?.fmode?.alert('中部70%员工提升建议:\n1. 参加技能培训课程\n2. 多与优秀员工交流学习\n3. 针对薄弱环节进行专项练习');
   }
 
   // 查看整改计划
   showRectificationPlan(): void {
-    alert('尾部10%员工整改计划:\n1. 制定个性化提升计划\n2. 每周提交学习进度\n3. 1个月后进行重新评估,仍未达标者将进行转岗或其他处理');
+   window?.fmode?.alert('尾部10%员工整改计划:\n1. 制定个性化提升计划\n2. 每周提交学习进度\n3. 1个月后进行重新评估,仍未达标者将进行转岗或其他处理');
   }
 }

+ 3 - 3
src/app/shared/components/complaint-card/complaint-card.ts

@@ -471,15 +471,15 @@ export class ComplaintCardComponent {
     // 添加到投诉列表
     this.complaints.push(autoComplaint);
     
-    alert('检测到新的微信投诉,已自动创建投诉记录');
+   window?.fmode?.alert('检测到新的微信投诉,已自动创建投诉记录');
   }
 
   // 设置关键词监控
-  setupKeywordMonitoring(): void {
+  async setupKeywordMonitoring(): Promise<void> {
     console.log('设置关键词监控:', this.monitorKeywords);
     
     // 这里可以打开关键词设置弹窗
-    const newKeywords = prompt('请输入监控关键词(用逗号分隔):', this.monitorKeywords.join(','));
+    const newKeywords = await window?.fmode?.input('请输入监控关键词(用逗号分隔):', this.monitorKeywords.join(','));
     
     if (newKeywords) {
       this.monitorKeywords = newKeywords.split(',').map(k => k.trim()).filter(k => k);

+ 3 - 3
src/app/shared/components/customer-review-card/customer-review-card.ts

@@ -284,10 +284,10 @@ export class CustomerReviewCardComponent {
     }
   }
 
-  openReplyModal(feedback: CustomerFeedback): void {
+  async openReplyModal(feedback: CustomerFeedback): Promise<void> {
     console.log('打开回复模态框:', feedback);
     // 这里可以打开一个模态框让用户输入回复内容
-    const reply = prompt('请输入回复内容:');
+    const reply = await window?.fmode?.input('请输入回复内容:');
     if (reply && reply.trim()) {
       feedback.response = reply.trim();
       feedback.updatedAt = new Date();
@@ -300,7 +300,7 @@ export class CustomerReviewCardComponent {
   viewDetails(feedback: CustomerFeedback): void {
     console.log('查看客户评价详情:', feedback);
     // 这里可以打开详情页面或模态框
-    alert(`客户评价详情:\n\n客户: ${feedback.customerName}\n评分: ${feedback.rating}/5\n内容: ${feedback.content}\n回复: ${feedback.response || '暂无回复'}`);
+   window?.fmode?.alert(`客户评价详情:\n\n客户: ${feedback.customerName}\n评分: ${feedback.rating}/5\n内容: ${feedback.content}\n回复: ${feedback.response || '暂无回复'}`);
   }
 
   // 新增方法:获取维度评分的星级显示

+ 1 - 1
src/app/shared/components/customer-review-form/customer-review-form.ts

@@ -127,7 +127,7 @@ export class CustomerReviewFormComponent {
       this.reviewSubmitted.emit(this.reviewData);
       this.resetForm();
     } else {
-      alert('请完成所有必填的评价项目');
+     window?.fmode?.alert('请完成所有必填的评价项目');
     }
   }
 

+ 2 - 2
src/app/shared/components/requirements-confirm-card/requirements-confirm-card.ts

@@ -1003,7 +1003,7 @@ export class RequirementsConfirmCardComponent implements OnInit, OnDestroy {
   confirmRequirement(requirementId: string) {
     // 检查是否可以进行需求确认操作
     if (!this.canProceedToNextStage('materialAnalysis')) {
-      alert('请先完成素材分析阶段的所有必要操作');
+     window?.fmode?.alert('请先完成素材分析阶段的所有必要操作');
       return;
     }
     
@@ -1023,7 +1023,7 @@ export class RequirementsConfirmCardComponent implements OnInit, OnDestroy {
   rejectRequirement(requirementId: string, reason?: string) {
     // 检查是否可以进行需求拒绝操作
     if (!this.canProceedToNextStage('materialAnalysis')) {
-      alert('请先完成素材分析阶段的所有必要操作');
+     window?.fmode?.alert('请先完成素材分析阶段的所有必要操作');
       return;
     }
     

+ 8 - 8
src/app/shared/components/settlement-card/settlement-card.ts

@@ -260,7 +260,7 @@ export class SettlementCardComponent implements OnInit {
   }
   
   // 处理逾期结算
-  handleOverdueSettlement(settlement: Settlement): void {
+  async handleOverdueSettlement(settlement: Settlement): Promise<void> {
     const daysOverdue = this.getDaysOverdue(settlement);
     const overdueMessage = `
 项目:${settlement.projectName}
@@ -279,7 +279,7 @@ export class SettlementCardComponent implements OnInit {
       this.sendOverdueReminder(settlement);
     } else {
       // 显示更多处理选项
-      this.showOverdueOptions(settlement);
+      await this.showOverdueOptions(settlement);
     }
   }
   
@@ -322,8 +322,8 @@ export class SettlementCardComponent implements OnInit {
   }
   
   // 显示逾期处理选项
-  private showOverdueOptions(settlement: Settlement): void {
-    const option = prompt(`
+  private async showOverdueOptions(settlement: Settlement): Promise<void> {
+    const option = await window?.fmode?.input(`
 逾期处理选项:
 1 - 延期7天
 2 - 延期15天
@@ -389,8 +389,8 @@ export class SettlementCardComponent implements OnInit {
   }
   
   // 标记为已结算
-  private markSettlementAsCompleted(settlement: Settlement): void {
-    const reason = prompt('请输入标记为已结算的原因:');
+  private async markSettlementAsCompleted(settlement: Settlement): Promise<void> {
+    const reason = await window?.fmode?.input('请输入标记为已结算的原因:');
     if (reason && reason.trim()) {
       settlement.status = '已结算';
       settlement.paidDate = new Date();
@@ -415,8 +415,8 @@ export class SettlementCardComponent implements OnInit {
   }
   
   // 取消结算
-  private cancelSettlement(settlement: Settlement): void {
-    const reason = prompt('请输入取消结算的原因:');
+  private async cancelSettlement(settlement: Settlement): Promise<void> {
+    const reason = await window?.fmode?.input('请输入取消结算的原因:');
     if (reason && reason.trim()) {
       if (confirm(`确定要取消此结算吗?\n项目:${settlement.projectName}\n金额:¥${settlement.amount}`)) {
         settlement.status = '已取消';

+ 3 - 3
src/app/shared/components/upload-example/upload-example.component.ts

@@ -89,7 +89,7 @@ export class UploadExampleComponent {
   onUploadError(error: string): void {
     this.isUploading = false;
     console.error('上传错误:', error);
-    alert(`上传失败: ${error}`);
+   window?.fmode?.alert(`上传失败: ${error}`);
   }
 
   /**
@@ -162,7 +162,7 @@ export class UploadExampleComponent {
   async copyUrl(url: string): Promise<void> {
     try {
       await navigator.clipboard.writeText(url);
-      alert('URL已复制到剪贴板');
+     window?.fmode?.alert('URL已复制到剪贴板');
     } catch (error) {
       console.error('复制失败:', error);
       // 降级方案
@@ -172,7 +172,7 @@ export class UploadExampleComponent {
       textArea.select();
       document.execCommand('copy');
       document.body.removeChild(textArea);
-      alert('URL已复制到剪贴板');
+     window?.fmode?.alert('URL已复制到剪贴板');
     }
   }
 }

+ 1 - 1
src/fmode-ng-augmentation.d.ts

@@ -62,7 +62,7 @@ declare global {
       alert?: (detail: any) => Promise<any> | any;
       // 保留对象用法:传入配置对象,返回 Alert 的 onDidDismiss 结果
       input?: ((detail: any) => Promise<any>)
-        // 新增字符串简化用法:与 prompt(message, defaultValue) 一致,返回 string 或 null
+        // 新增字符串简化用法:与await window?.fmode?.input(message, defaultValue) 一致,返回 string 或 null
         & ((message: string, defaultValue?: string) => Promise<string | null>);
       [key: string]: any;
     };

+ 8 - 8
src/modules/project/components/project-members-modal/project-members-modal.component.ts

@@ -260,14 +260,14 @@ export class ProjectMembersModalComponent implements OnInit {
   async addMemberToGroupChat(member: ProjectMember): Promise<void> {
    
     if (!member.userid) {
-      alert('该成员没有用户ID,无法添加到群聊');
+     window?.fmode?.alert('该成员没有用户ID,无法添加到群聊');
       return;
     }
 
     try {
       const chatId = this.groupChat?.get('chat_id');
       if (!chatId) {
-        alert('群聊ID不存在');
+       window?.fmode?.alert('群聊ID不存在');
         return;
       }
 
@@ -306,23 +306,23 @@ export class ProjectMembersModalComponent implements OnInit {
         this.calculateStats();
       }
 
-      alert(`✅ 已将 ${member.name} 添加到群聊`);
+     window?.fmode?.alert(`✅ 已将 ${member.name} 添加到群聊`);
       console.log(`✅ 成功添加成员 ${member.name} 到群聊`);
 
     } catch (error) {
       console.error('❌ 添加成员到群聊失败:', error);
-      alert(`添加失败: ${error instanceof Error ? error.message : '未知错误'}`);
+     window?.fmode?.alert(`添加失败: ${error instanceof Error ? error.message : '未知错误'}`);
     }
   }
 
   // 新增:移出项目(软删除 ProjectTeam)
   async removeMemberFromProject(member: ProjectMember): Promise<void> {
     if (!member.isInProjectTeam || !member.projectTeamId) {
-      alert('该成员未在项目团队中,无法移出项目');
+     window?.fmode?.alert('该成员未在项目团队中,无法移出项目');
       return;
     }
     if (!this.project) {
-      alert('项目不存在,无法执行移出操作');
+     window?.fmode?.alert('项目不存在,无法执行移出操作');
       return;
     }
 
@@ -338,10 +338,10 @@ export class ProjectMembersModalComponent implements OnInit {
 
       // 重新加载成员数据,保持列表与统计一致
       await this.loadMembers();
-      alert(`✅ 已将 ${member.name} 移出项目`);
+     window?.fmode?.alert(`✅ 已将 ${member.name} 移出项目`);
     } catch (error) {
       console.error('❌ 移出项目失败:', error);
-      alert(`移出失败: ${error instanceof Error ? error.message : '未知错误'}`);
+     window?.fmode?.alert(`移出失败: ${error instanceof Error ? error.message : '未知错误'}`);
     } finally {
       this.loading = false;
     }

+ 11 - 11
src/modules/project/components/quotation-editor.component.ts

@@ -713,7 +713,7 @@ export class QuotationEditorComponent implements OnInit, OnChanges, OnDestroy {
   async addProduct(productName?: string): Promise<void> {
     if (!this.project) return;
 
-    const name = productName || prompt('请输入产品名称:');
+    const name = productName ||await window?.fmode?.input('请输入产品名称:');
     if (!name) return;
 
     try {
@@ -723,7 +723,7 @@ export class QuotationEditorComponent implements OnInit, OnChanges, OnDestroy {
 
     } catch (error) {
       console.error('添加产品失败:', error);
-      alert('添加失败,请重试');
+     window?.fmode?.alert('添加失败,请重试');
     }
   }
 
@@ -734,7 +734,7 @@ export class QuotationEditorComponent implements OnInit, OnChanges, OnDestroy {
     const product = this.products.find(p => p.id === productId);
     if (!product) return;
 
-    const newName = prompt('修改产品名称:', product.get('productName'));
+    const newName =await window?.fmode?.input('修改产品名称:', product.get('productName'));
     if (!newName || newName === product.get('productName')) return;
 
     try {
@@ -752,7 +752,7 @@ export class QuotationEditorComponent implements OnInit, OnChanges, OnDestroy {
 
     } catch (error) {
       console.error('更新产品失败:', error);
-      alert('更新失败,请重试');
+     window?.fmode?.alert('更新失败,请重试');
     }
   }
 
@@ -784,7 +784,7 @@ export class QuotationEditorComponent implements OnInit, OnChanges, OnDestroy {
 
     } catch (error) {
       console.error('删除产品失败:', error);
-      alert('删除失败,请重试');
+     window?.fmode?.alert('删除失败,请重试');
     }
   }
 
@@ -796,10 +796,10 @@ export class QuotationEditorComponent implements OnInit, OnChanges, OnDestroy {
 
     try {
       await this.saveQuotationToProject();
-      alert('保存成功');
+     window?.fmode?.alert('保存成功');
     } catch (error) {
       console.error('保存失败:', error);
-      alert('保存失败');
+     window?.fmode?.alert('保存失败');
     }
   }
 
@@ -1143,7 +1143,7 @@ export class QuotationEditorComponent implements OnInit, OnChanges, OnDestroy {
    */
   async confirmAddProduct(): Promise<void> {
     if (!this.isNewProductValid()) {
-      alert('请完整填写产品信息');
+     window?.fmode?.alert('请完整填写产品信息');
       return;
     }
 
@@ -1155,7 +1155,7 @@ export class QuotationEditorComponent implements OnInit, OnChanges, OnDestroy {
       }
     } catch (error) {
       console.error(this.isEditMode ? '编辑产品失败:' : '添加产品失败:', error);
-      alert(this.isEditMode ? '编辑产品失败,请重试' : '添加产品失败,请重试');
+     window?.fmode?.alert(this.isEditMode ? '编辑产品失败,请重试' : '添加产品失败,请重试');
     }
   }
 
@@ -1192,7 +1192,7 @@ export class QuotationEditorComponent implements OnInit, OnChanges, OnDestroy {
       // 关闭模态框
       this.closeAddProductModal();
 
-      alert(`成功添加产品: ${productName}`);
+     window?.fmode?.alert(`成功添加产品: ${productName}`);
     } else {
       throw new Error('创建产品失败');
     }
@@ -1304,7 +1304,7 @@ export class QuotationEditorComponent implements OnInit, OnChanges, OnDestroy {
     // 关闭模态框
     this.closeAddProductModal();
 
-    alert(`成功更新产品: ${productName}`);
+   window?.fmode?.alert(`成功更新产品: ${productName}`);
   }
 
   /**

+ 7 - 7
src/modules/project/components/team-assign/team-assign.component.ts

@@ -183,7 +183,7 @@ export class TeamAssignComponent implements OnInit {
     // 检查是否已分配
     const isAssigned = this.projectTeams.some(team => team.get('profile')?.id === designer.id);
     if (isAssigned) {
-      alert('该设计师已分配到此项目');
+     window?.fmode?.alert('该设计师已分配到此项目');
       return;
     }
 
@@ -225,7 +225,7 @@ export class TeamAssignComponent implements OnInit {
     if (!this.assigningDesigner || !this.project) return;
 
     if (this.selectedSpaces.length === 0) {
-      alert('请至少选择一个空间场景');
+     window?.fmode?.alert('请至少选择一个空间场景');
       return;
     }
 
@@ -242,7 +242,7 @@ export class TeamAssignComponent implements OnInit {
 
         await this.editingTeam.save();
 
-        alert('更新成功');
+       window?.fmode?.alert('更新成功');
       } else {
         // 创建新的 ProjectTeam
         const ProjectTeam = Parse.Object.extend('ProjectTeam');
@@ -262,7 +262,7 @@ export class TeamAssignComponent implements OnInit {
         // 加入群聊(静默执行)
         await this.addMemberToGroupChat(this.assigningDesigner.get('userId'));
 
-        alert('分配成功');
+       window?.fmode?.alert('分配成功');
       }
 
       await this.loadProjectTeams();
@@ -273,7 +273,7 @@ export class TeamAssignComponent implements OnInit {
       this.editingTeam = null;
     } catch (err) {
       console.error(this.editingTeam ? '更新失败:' : '分配设计师失败:', err);
-      alert(this.editingTeam ? '更新失败' : '分配失败');
+     window?.fmode?.alert(this.editingTeam ? '更新失败' : '分配失败');
     } finally {
       this.saving = false;
     }
@@ -331,7 +331,7 @@ export class TeamAssignComponent implements OnInit {
         await this.removeMemberFromGroupChat(userId);
       }
 
-      alert('成员已删除');
+     window?.fmode?.alert('成员已删除');
 
       // 刷新列表并收起弹窗
       await this.loadProjectTeams();
@@ -341,7 +341,7 @@ export class TeamAssignComponent implements OnInit {
       this.editingTeam = null;
     } catch (err) {
       console.error('删除成员失败:', err);
-      alert('删除失败');
+     window?.fmode?.alert('删除失败');
     } finally {
       this.saving = false;
       this.cdr.markForCheck();

+ 3 - 3
src/modules/project/pages/contact/contact.component.ts

@@ -366,7 +366,7 @@ export class CustomerProfileComponent implements OnInit {
       await this.wxworkService.openChat(chatId);
     } catch (error: any) {
       console.error('跳转群聊失败:', error);
-      alert('跳转失败,请在企业微信中操作');
+     window?.fmode?.alert('跳转失败,请在企业微信中操作');
     }
   }
 
@@ -471,7 +471,7 @@ export class CustomerProfileComponent implements OnInit {
       const externalUserId = this.contactInfo.get('external_userid');
       const companyId = this.currentUser?.get('company')?.id || this.contactInfo.get('company')?.id || localStorage.getItem('company');
       if (!externalUserId || !companyId) {
-        alert('无法刷新:缺少企业或external_userid');
+       window?.fmode?.alert('无法刷新:缺少企业或external_userid');
         return;
       }
       this.refreshing = true;
@@ -497,7 +497,7 @@ export class CustomerProfileComponent implements OnInit {
       await this.buildCustomerProfile();
     } catch (e) {
       console.warn('刷新客户数据失败:', e);
-      alert('刷新失败,请稍后重试');
+     window?.fmode?.alert('刷新失败,请稍后重试');
     } finally {
       this.refreshing = false;
     }

+ 7 - 7
src/modules/project/pages/project-detail/project-detail.component.ts

@@ -365,7 +365,7 @@ export class ProjectDetailComponent implements OnInit {
       await this.project.save();
     } catch (err) {
       console.error('更新阶段失败:', err);
-      alert('更新失败');
+     window?.fmode?.alert('更新失败');
     }
   }
 
@@ -395,7 +395,7 @@ export class ProjectDetailComponent implements OnInit {
       const externalMembers = memberList.filter((m: any) => m.type === 2);
 
       if (externalMembers.length === 0) {
-        alert('当前群聊中没有外部联系人');
+       window?.fmode?.alert('当前群聊中没有外部联系人');
         return;
       }
 
@@ -407,7 +407,7 @@ export class ProjectDetailComponent implements OnInit {
       await this.setCustomerFromMember(selectedMember);
     } catch (err) {
       console.error('选择客户失败:', err);
-      alert('选择客户失败');
+     window?.fmode?.alert('选择客户失败');
     }
   }
 
@@ -450,7 +450,7 @@ export class ProjectDetailComponent implements OnInit {
         this.project.set('contact', contactInfo.toPointer());
         await this.project.save();
         this.contact = contactInfo;
-        alert('客户设置成功');
+       window?.fmode?.alert('客户设置成功');
       }
     } catch (err) {
       console.error('设置客户失败:', err);
@@ -560,7 +560,7 @@ export class ProjectDetailComponent implements OnInit {
    */
   async sendSurvey() {
     if (!this.groupChat || !this.wxwork) {
-      alert('无法发送问卷:未找到群聊或企微SDK未初始化');
+     window?.fmode?.alert('无法发送问卷:未找到群聊或企微SDK未初始化');
       return;
     }
 
@@ -581,10 +581,10 @@ export class ProjectDetailComponent implements OnInit {
         }
       });
 
-      alert('问卷已发送到群聊!');
+     window?.fmode?.alert('问卷已发送到群聊!');
     } catch (err) {
       console.error('❌ 发送问卷失败:', err);
-      alert('发送失败,请重试');
+     window?.fmode?.alert('发送失败,请重试');
     }
   }
 

+ 13 - 13
src/modules/project/pages/project-detail/stages/stage-aftercare.component.ts

@@ -564,10 +564,10 @@ export class StageAftercareComponent implements OnInit {
 
       await this.saveDraft();
       this.cdr.markForCheck();
-      alert('上传成功');
+     window?.fmode?.alert('上传成功');
     } catch (error: any) {
       console.error('上传失败:', error);
-      alert('上传失败: ' + (error?.message || '未知错误'));
+     window?.fmode?.alert('上传失败: ' + (error?.message || '未知错误'));
     } finally {
       this.uploading = false;
       this.cdr.markForCheck();
@@ -603,10 +603,10 @@ export class StageAftercareComponent implements OnInit {
       this.calculatePaidAmount();
       await this.saveDraft();
       this.cdr.markForCheck();
-      alert('删除成功');
+     window?.fmode?.alert('删除成功');
     } catch (error: any) {
       console.error('删除失败:', error);
-      alert('删除失败: ' + (error?.message || '未知错误'));
+     window?.fmode?.alert('删除失败: ' + (error?.message || '未知错误'));
     }
   }
 
@@ -636,7 +636,7 @@ export class StageAftercareComponent implements OnInit {
    */
   async submitFeedback() {
     if (this.customerFeedback.overallRating === 0) {
-      alert('请选择综合评分');
+     window?.fmode?.alert('请选择综合评分');
       return;
     }
 
@@ -650,10 +650,10 @@ export class StageAftercareComponent implements OnInit {
       await this.saveDraft();
       this.calculateStats();
       this.cdr.markForCheck();
-      alert('评价提交成功');
+     window?.fmode?.alert('评价提交成功');
     } catch (error: any) {
       console.error('提交失败:', error);
-      alert('提交失败: ' + (error?.message || '未知错误'));
+     window?.fmode?.alert('提交失败: ' + (error?.message || '未知错误'));
     } finally {
       this.saving = false;
       this.cdr.markForCheck();
@@ -697,10 +697,10 @@ export class StageAftercareComponent implements OnInit {
       await this.saveDraft();
       this.calculateStats();
       this.cdr.markForCheck();
-      alert('项目复盘生成成功');
+     window?.fmode?.alert('项目复盘生成成功');
     } catch (error: any) {
       console.error('生成失败:', error);
-      alert('生成失败: ' + (error?.message || '未知错误'));
+     window?.fmode?.alert('生成失败: ' + (error?.message || '未知错误'));
     } finally {
       this.generating = false;
       this.cdr.markForCheck();
@@ -1055,12 +1055,12 @@ export class StageAftercareComponent implements OnInit {
     if (!this.canEdit || !this.project) return;
 
     if (!this.projectRetrospective) {
-      alert('请先生成项目复盘');
+     window?.fmode?.alert('请先生成项目复盘');
       return;
     }
 
     if (!this.customerFeedback.submitted) {
-      alert('请先提交客户评价');
+     window?.fmode?.alert('请先提交客户评价');
       return;
     }
 
@@ -1084,10 +1084,10 @@ export class StageAftercareComponent implements OnInit {
       await this.saveDraft();
       this.calculateStats();
       this.cdr.markForCheck();
-      alert('项目归档成功');
+     window?.fmode?.alert('项目归档成功');
     } catch (error: any) {
       console.error('归档失败:', error);
-      alert('归档失败: ' + (error?.message || '未知错误'));
+     window?.fmode?.alert('归档失败: ' + (error?.message || '未知错误'));
     } finally {
       this.saving = false;
       this.cdr.markForCheck();

+ 2 - 2
src/modules/project/pages/project-detail/stages/stage-delivery.component.ts

@@ -347,7 +347,7 @@ export class StageDeliveryComponent implements OnInit {
 
     } catch (error) {
       console.error('上传交付文件失败:', error);
-      alert('文件上传失败,请重试');
+     window?.fmode?.alert('文件上传失败,请重试');
     } finally {
       this.uploadingDeliveryFiles = false;
       this.uploadProgress = 0;
@@ -381,7 +381,7 @@ export class StageDeliveryComponent implements OnInit {
 
     } catch (error) {
       console.error('删除交付文件失败:', error);
-      alert('删除文件失败,请重试');
+     window?.fmode?.alert('删除文件失败,请重试');
     }
   }
 

+ 19 - 19
src/modules/project/pages/project-detail/stages/stage-order.component.ts

@@ -489,7 +489,7 @@ export class StageOrderComponent implements OnInit {
    * 添加新空间
    */
   async addSpace() {
-    const spaceName = prompt('请输入空间名称:');
+    const spaceName =await window?.fmode?.input('请输入空间名称:');
     if (!spaceName) return;
 
     try {
@@ -513,10 +513,10 @@ export class StageOrderComponent implements OnInit {
       // 重新生成报价
       await this.regenerateQuotationFromSpaces();
 
-      alert('空间添加成功');
+     window?.fmode?.alert('空间添加成功');
     } catch (error) {
       console.error('添加空间失败:', error);
-      alert('添加失败,请重试');
+     window?.fmode?.alert('添加失败,请重试');
     }
   }
 
@@ -527,7 +527,7 @@ export class StageOrderComponent implements OnInit {
     const space = this.projectSpaces.find(s => s.id === spaceId);
     if (!space) return;
 
-    const newName = prompt('修改空间名称:', space.name);
+    const newName =await window?.fmode?.input('修改空间名称:', space.name);
     if (!newName || newName === space.name) return;
 
     try {
@@ -543,10 +543,10 @@ export class StageOrderComponent implements OnInit {
       // 保存到项目数据
       await this.saveDraft();
 
-      alert('空间更新成功');
+     window?.fmode?.alert('空间更新成功');
     } catch (error) {
       console.error('更新空间失败:', error);
-      alert('更新失败,请重试');
+     window?.fmode?.alert('更新失败,请重试');
     }
   }
 
@@ -570,10 +570,10 @@ export class StageOrderComponent implements OnInit {
       // 重新生成报价
       await this.regenerateQuotationFromSpaces();
 
-      alert('空间删除成功');
+     window?.fmode?.alert('空间删除成功');
     } catch (error) {
       console.error('删除空间失败:', error);
-      alert('删除失败,请重试');
+     window?.fmode?.alert('删除失败,请重试');
     }
   }
 
@@ -770,10 +770,10 @@ export class StageOrderComponent implements OnInit {
 
       await this.project.save();
 
-      alert('保存成功');
+     window?.fmode?.alert('保存成功');
     } catch (err) {
       console.error('保存失败:', err);
-      alert('保存失败');
+     window?.fmode?.alert('保存失败');
     } finally {
       this.saving = false;
     }
@@ -787,23 +787,23 @@ export class StageOrderComponent implements OnInit {
 
     // 基础验证
     if (!this.projectInfo.title.trim()) {
-      alert('请填写项目名称');
+     window?.fmode?.alert('请填写项目名称');
       return;
     }
     if (!this.projectInfo.projectType) {
-      alert('请选择项目类型');
+     window?.fmode?.alert('请选择项目类型');
       return;
     }
     if (!this.projectInfo.demoday) {
-      alert('请选择小图日期');
+     window?.fmode?.alert('请选择小图日期');
       return;
     }
     // if (!this.projectInfo.deadline) {
-    //   alert('请选择交付期限');
+    //  window?.fmode?.alert('请选择交付期限');
     //   return;
     // }
     if (this.quotation.total === 0) {
-      alert('请配置报价明细');
+     window?.fmode?.alert('请配置报价明细');
       return;
     }
 
@@ -817,7 +817,7 @@ export class StageOrderComponent implements OnInit {
       query.notEqualTo('isDeleted', true);
       const assignedTeams = await query.find();
       if (assignedTeams.length === 0) {
-        alert('请在“设计师分配”中分配至少一位组员');
+       window?.fmode?.alert('请在“设计师分配”中分配至少一位组员');
         this.saving = false;
         return;
       }
@@ -859,11 +859,11 @@ export class StageOrderComponent implements OnInit {
 
       await this.project.save();
 
-      alert('提交成功,等待组长审批');
+     window?.fmode?.alert('提交成功,等待组长审批');
 
     } catch (err) {
       console.error('提交失败:', err);
-      alert('提交失败');
+     window?.fmode?.alert('提交失败');
     } finally {
       this.saving = false;
     }
@@ -1096,7 +1096,7 @@ export class StageOrderComponent implements OnInit {
       console.log('✅ 文件删除成功:', fileId);
     } catch (error) {
       console.error('❌ 文件删除失败:', error);
-      alert('删除失败,请稍后重试');
+     window?.fmode?.alert('删除失败,请稍后重试');
     }
   }
 

+ 4 - 4
src/modules/project/pages/project-detail/stages/stage-requirements.component.ts

@@ -374,7 +374,7 @@ export class StageRequirementsComponent implements OnInit {
 
     } catch (error) {
       console.error('上传失败:', error);
-      alert('文件上传失败,请重试');
+     window?.fmode?.alert('文件上传失败,请重试');
     } finally {
       this.uploading = false;
     }
@@ -402,7 +402,7 @@ export class StageRequirementsComponent implements OnInit {
 
     } catch (error) {
       console.error('删除参考图片失败:', error);
-      alert('删除文件失败,请重试');
+     window?.fmode?.alert('删除文件失败,请重试');
     }
   }
 
@@ -515,7 +515,7 @@ export class StageRequirementsComponent implements OnInit {
 
     } catch (error) {
       console.error('上传失败:', error);
-      alert('文件上传失败,请重试');
+     window?.fmode?.alert('文件上传失败,请重试');
     } finally {
       this.uploading = false;
     }
@@ -542,7 +542,7 @@ export class StageRequirementsComponent implements OnInit {
 
     } catch (error) {
       console.error('删除CAD文件失败:', error);
-      alert('删除文件失败,请重试');
+     window?.fmode?.alert('删除文件失败,请重试');
     }
   }
 

+ 4 - 4
src/modules/project/pages/project-loader/project-loader.component.ts

@@ -287,14 +287,14 @@ export class ProjectLoaderComponent implements OnInit {
    */
   async createProject() {
     if (!this.projectName.trim()) {
-      alert('请输入项目名称');
+     window?.fmode?.alert('请输入项目名称');
       return;
     }
 
     // 权限检查
     const role = this.currentUser!.get('roleName');
     if (!['客服', '组长', '管理员'].includes(role)) {
-      alert('您没有权限创建项目');
+     window?.fmode?.alert('您没有权限创建项目');
       return;
     }
 
@@ -345,7 +345,7 @@ export class ProjectLoaderComponent implements OnInit {
     } catch (err: any) {
       console.error('创建项目失败:', err);
       wxdebug('创建项目失败', err);
-      alert('创建失败: ' + (err.message || '未知错误'));
+     window?.fmode?.alert('创建失败: ' + (err.message || '未知错误'));
     } finally {
       this.creating = false;
     }
@@ -370,7 +370,7 @@ export class ProjectLoaderComponent implements OnInit {
       await this.navigateToProjectDetail();
     } catch (err: any) {
       console.error('关联项目失败:', err);
-      alert('关联失败: ' + (err.message || '未知错误'));
+     window?.fmode?.alert('关联失败: ' + (err.message || '未知错误'));
     }
   }
 

+ 2 - 2
src/modules/project/pages/project-survey/project-survey.component.ts

@@ -328,7 +328,7 @@ export class ProjectSurveyComponent implements OnInit {
 
     // 验证必填
     if (question.required && !this.answers[question.id]) {
-      alert('请完成当前题目');
+     window?.fmode?.alert('请完成当前题目');
       return;
     }
 
@@ -471,7 +471,7 @@ export class ProjectSurveyComponent implements OnInit {
       console.log('✅ 问卷提交成功');
     } catch (err) {
       console.error('❌ 提交问卷失败:', err);
-      alert('提交失败,请重试');
+     window?.fmode?.alert('提交失败,请重试');
     }
   }