Ver Fonte

feat:customer16

徐福静0235668 há 19 horas atrás
pai
commit
04197eaac9

+ 2 - 1
src/app/models/project.model.ts

@@ -160,11 +160,12 @@ export interface Settlement {
   stage: ProjectStage;
   amount: number;
   percentage: number;
-  status: '待结算' | '已结算';
+  status: '待结算' | '已结算' | '逾期';
   createdAt: Date;
   settledAt?: Date;
   completionTime?: Date;
   projectName?: string;
+  dueDate?: Date;
 }
 
 // 技能标签

+ 48 - 11
src/app/pages/customer-service/consultation-order/consultation-order.ts

@@ -456,17 +456,50 @@ export class ConsultationOrder {
 
     this.isSubmitting.set(true);
 
-    const payload = {
-      customerId: 'temp-' + Date.now(),
-      customerName: nameCtrl.value,
-      requirement: {
+    // 构建完整的表单数据用于同步
+    const formData = {
+      customerInfo: {
+        id: this.selectedCustomer()?.id || 'temp-' + Date.now(),
+        name: nameCtrl.value,
+        phone: phoneCtrl.value,
+        wechat: this.customerForm.get('wechat')?.value || '',
+        customerType: this.customerForm.get('customerType')?.value || '新客户',
+        source: this.customerForm.get('source')?.value || '小程序',
+        remark: this.customerForm.get('remark')?.value || '',
+        demandType: this.customerForm.get('demandType')?.value || '',
+        followUpStatus: this.customerForm.get('followUpStatus')?.value || '待分配'
+      },
+      requirementInfo: {
         style: styleCtrl.value,
         projectGroup: groupCtrl.value,
         downPayment: Number(downPaymentCtrl?.value ?? 0),
-        firstDraftDate: firstDraftDateCtrl?.value
+        firstDraftDate: firstDraftDateCtrl?.value,
+        budget: this.requirementForm.get('budget')?.value || '',
+        area: this.requirementForm.get('area')?.value || 0,
+        houseType: this.requirementForm.get('houseType')?.value || '',
+        smallImageTime: this.requirementForm.get('smallImageTime')?.value || '',
+        largeImageTime: this.requirementForm.get('largeImageTime')?.value || '',
+        spaceRequirements: this.requirementForm.get('spaceRequirements')?.value || '',
+        designAngles: this.requirementForm.get('designAngles')?.value || '',
+        specialAreaHandling: this.requirementForm.get('specialAreaHandling')?.value || '',
+        materialRequirements: this.requirementForm.get('materialRequirements')?.value || '',
+        lightingRequirements: this.requirementForm.get('lightingRequirements')?.value || ''
       },
+      preferenceTags: this.preferenceTags,
+      roleContext: 'customer-service'
+    };
+
+    const payload = {
+      customerId: formData.customerInfo.id,
+      customerName: formData.customerInfo.name,
+      requirement: formData.requirementInfo,
       referenceCases: [],
-      tags: { followUpStatus: '待分配' }
+      tags: { 
+        demandType: formData.customerInfo.demandType,
+        preferenceTags: formData.preferenceTags,
+        followUpStatus: formData.customerInfo.followUpStatus
+      },
+      formData: formData // 传递完整表单数据用于同步
     };
 
     this.projectService.createProject(payload).subscribe(
@@ -480,17 +513,21 @@ export class ConsultationOrder {
           setTimeout(() => {
             this.showSuccessMessage.set(false);
             
-            // 发出订单创建成功事件,用于关闭弹窗
+            // 发出订单创建成功事件,包含完整表单数据用于同步
             const orderData = {
-              orderId: 'mock-9',
+              orderId: res.projectId || 'mock-9',
               customerName: nameCtrl.value,
-              projectId: 'mock-9'
+              projectId: res.projectId || 'mock-9',
+              formData: formData // 传递表单数据用于同步
             };
             this.orderCreated.emit(orderData);
             
             // 跳转到设计师项目详情页面,传递客服角色标识
-            this.router.navigate(['/designer/project-detail/mock-9'], { 
-              queryParams: { role: 'customer-service' } 
+            this.router.navigate(['/designer/project-detail/' + (res.projectId || 'mock-9')], { 
+              queryParams: { 
+                role: 'customer-service',
+                syncData: JSON.stringify(formData) // 通过URL参数传递同步数据
+              } 
             });
           }, 1000);
         } else {

+ 10 - 10
src/app/pages/customer-service/dashboard/pages/after-sales/after-sales.component.html

@@ -13,8 +13,8 @@
           <mat-icon>assignment</mat-icon>
         </div>
         <div class="stat-content">
-          <div class="stat-value">{{ stats().total }}</div>
-          <div class="stat-label">总项目数</div>
+          <div class="stat-value">{{ formatCurrency(stats().totalAmount) }}</div>
+          <div class="stat-label">总金额 ({{ stats().totalCount }}项)</div>
         </div>
       </div>
 
@@ -23,8 +23,8 @@
           <mat-icon>payment</mat-icon>
         </div>
         <div class="stat-content">
-          <div class="stat-value">{{ stats().pendingPayment }}</div>
-          <div class="stat-label">待收款</div>
+          <div class="stat-value">{{ formatCurrency(stats().pendingAmount) }}</div>
+          <div class="stat-label">待收款 ({{ stats().pendingCount }}项)</div>
         </div>
       </div>
 
@@ -33,18 +33,18 @@
           <mat-icon>schedule</mat-icon>
         </div>
         <div class="stat-content">
-          <div class="stat-value">{{ stats().overduePayment }}</div>
-          <div class="stat-label">逾期尾款</div>
+          <div class="stat-value">{{ formatCurrency(stats().overdueAmount) }}</div>
+          <div class="stat-label">逾期尾款 ({{ stats().overdueCount }}项)</div>
         </div>
       </div>
 
       <div class="stat-card">
-        <div class="stat-icon review">
-          <mat-icon>rate_review</mat-icon>
+        <div class="stat-icon completed">
+          <mat-icon>check_circle</mat-icon>
         </div>
         <div class="stat-content">
-          <div class="stat-value">{{ stats().pendingReview }}</div>
-          <div class="stat-label">待处理评价</div>
+          <div class="stat-value">{{ formatCurrency(stats().completedAmount) }}</div>
+          <div class="stat-label">已收款 ({{ stats().completedCount }}项)</div>
         </div>
       </div>
 

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

@@ -184,12 +184,32 @@ export class AfterSalesComponent implements OnInit {
   // 统计数据
   stats = computed(() => {
     const projects = this.afterSalesProjects();
+    
+    // 计算总金额统计
+    const totalAmount = projects.reduce((sum, p) => sum + p.finalPaymentAmount, 0);
+    const paidAmount = projects.reduce((sum, p) => sum + p.paidAmount, 0);
+    const pendingAmount = projects.filter(p => p.finalPaymentStatus === 'pending' || p.finalPaymentStatus === 'partial')
+                                 .reduce((sum, p) => sum + (p.finalPaymentAmount - p.paidAmount), 0);
+    const overdueAmount = projects.filter(p => p.finalPaymentStatus === 'overdue')
+                                 .reduce((sum, p) => sum + (p.finalPaymentAmount - p.paidAmount), 0);
+    
     return {
       total: projects.length,
-      pendingPayment: projects.filter(p => p.finalPaymentStatus === 'pending').length,
+      pendingPayment: projects.filter(p => p.finalPaymentStatus === 'pending' || p.finalPaymentStatus === 'partial').length,
       overduePayment: projects.filter(p => p.finalPaymentStatus === 'overdue').length,
       pendingReview: projects.filter(p => p.reviewStatus === 'pending').length,
-      highPriority: projects.filter(p => p.priority === 'high').length
+      highPriority: projects.filter(p => p.priority === 'high').length,
+      // 新增金额统计
+      totalAmount,
+      paidAmount,
+      pendingAmount,
+      overdueAmount,
+      completedAmount: projects.filter(p => p.finalPaymentStatus === 'completed').reduce((sum, p) => sum + p.finalPaymentAmount, 0),
+      // 项目数量统计
+      totalCount: projects.length,
+      pendingCount: projects.filter(p => p.finalPaymentStatus === 'pending' || p.finalPaymentStatus === 'partial').length,
+      overdueCount: projects.filter(p => p.finalPaymentStatus === 'overdue').length,
+      completedCount: projects.filter(p => p.finalPaymentStatus === 'completed').length
     };
   });
 
@@ -247,6 +267,117 @@ export class AfterSalesComponent implements OnInit {
         suggestionCount: 3,
         lastContactDate: new Date('2024-01-22'),
         priority: 'medium'
+      },
+      // 添加更多项目以丰富尾款结算数据
+      {
+        id: '4',
+        projectCode: 'PRJ-2024-004',
+        projectName: '品牌VI设计',
+        customerName: '赵六广告公司',
+        completedDate: new Date('2024-12-01'),
+        finalPaymentStatus: 'pending',
+        finalPaymentAmount: 35000,
+        paidAmount: 28000,
+        reviewStatus: 'positive',
+        reviewScore: 4,
+        reviewContent: '设计风格很符合我们的要求',
+        suggestionCount: 1,
+        lastContactDate: new Date('2024-12-05'),
+        priority: 'medium'
+      },
+      {
+        id: '5',
+        projectCode: 'PRJ-2024-005',
+        projectName: '小程序开发',
+        customerName: '孙七餐饮集团',
+        completedDate: new Date('2024-11-15'),
+        finalPaymentStatus: 'overdue',
+        finalPaymentAmount: 45000,
+        paidAmount: 30000,
+        reviewStatus: 'negative',
+        reviewScore: 2,
+        reviewContent: '功能有些问题,需要修复',
+        suggestionCount: 4,
+        lastContactDate: new Date('2024-11-20'),
+        priority: 'high'
+      },
+      {
+        id: '6',
+        projectCode: 'PRJ-2024-006',
+        projectName: '网站重构项目',
+        customerName: '周八科技',
+        completedDate: new Date('2024-12-10'),
+        finalPaymentStatus: 'completed',
+        finalPaymentAmount: 28000,
+        paidAmount: 28000,
+        reviewStatus: 'positive',
+        reviewScore: 5,
+        reviewContent: '非常专业,交付及时',
+        suggestionCount: 0,
+        lastContactDate: new Date('2024-12-15'),
+        priority: 'low'
+      },
+      {
+        id: '7',
+        projectCode: 'PRJ-2024-007',
+        projectName: '数据可视化系统',
+        customerName: '吴九数据公司',
+        completedDate: new Date('2024-11-28'),
+        finalPaymentStatus: 'partial',
+        finalPaymentAmount: 95000,
+        paidAmount: 70000,
+        reviewStatus: 'pending',
+        suggestionCount: 2,
+        lastContactDate: new Date('2024-12-02'),
+        priority: 'high'
+      },
+      {
+        id: '8',
+        projectCode: 'PRJ-2024-008',
+        projectName: '企业管理系统',
+        customerName: '郑十管理咨询',
+        completedDate: new Date('2024-10-20'),
+        finalPaymentStatus: 'overdue',
+        finalPaymentAmount: 150000,
+        paidAmount: 100000,
+        reviewStatus: 'positive',
+        reviewScore: 4,
+        reviewContent: '系统功能强大,但界面需要优化',
+        suggestionCount: 3,
+        lastContactDate: new Date('2024-10-25'),
+        priority: 'high'
+      },
+      {
+        id: '9',
+        projectCode: 'PRJ-2024-009',
+        projectName: '在线教育平台',
+        customerName: '刘十一教育科技',
+        completedDate: new Date('2024-12-05'),
+        finalPaymentStatus: 'pending',
+        finalPaymentAmount: 75000,
+        paidAmount: 60000,
+        reviewStatus: 'positive',
+        reviewScore: 5,
+        reviewContent: '平台功能完善,用户体验很好',
+        suggestionCount: 1,
+        lastContactDate: new Date('2024-12-08'),
+        priority: 'medium'
+      },
+      {
+        id: '10',
+        projectCode: 'PRJ-2024-010',
+        projectName: '智能客服系统',
+        customerName: '陈十二服务公司',
+        completedDate: new Date('2024-11-30'),
+        finalPaymentStatus: 'completed',
+        finalPaymentAmount: 65000,
+        paidAmount: 65000,
+        reviewStatus: 'positive',
+        reviewScore: 4,
+        reviewContent: '智能化程度高,节省了人力成本',
+        suggestionCount: 2,
+        lastContactDate: new Date('2024-12-03'),
+        priority: 'low'
       }
     ];
     

+ 11 - 2
src/app/pages/customer-service/project-list/project-list.ts

@@ -480,14 +480,23 @@ export class ProjectList implements OnInit, OnDestroy {
       // 关闭弹窗
       dialogRef.close();
       
-      // 跳转到新创建的项目详情页面
+      // 准备同步数据
+      const syncData = {
+        customerInfo: orderData.customerInfo,
+        requirementInfo: orderData.requirementInfo,
+        preferenceTags: orderData.preferenceTags,
+        assignedDesigner: orderData.assignedDesigner
+      };
+      
+      // 跳转到新创建的项目详情页面,传递同步数据
       this.router.navigate([
         '/designer/project-detail', 
         orderData.orderId
       ], {
         queryParams: { 
           role: 'customer-service', 
-          activeTab: 'overview'
+          activeTab: 'overview',
+          syncData: JSON.stringify(syncData)
         }
       });
     });

+ 10 - 0
src/app/pages/designer/project-detail/project-detail.html

@@ -178,10 +178,19 @@
                 <div class="info-grid">
                   <!-- 显示订单创建时填写的客户信息,如果有的话 -->
                   @if (orderCreationData?.customerInfo) {
+                    <!-- 基本客户信息 -->
+                    <div class="info-item key-info"><label>客户姓名</label><span>{{ orderCreationData.customerInfo.name }}</span></div>
+                    <div class="info-item key-info"><label>联系电话</label><span>{{ orderCreationData.customerInfo.phone }}</span></div>
                     @if (orderCreationData.customerInfo.wechat) {
                       <div class="info-item"><label>微信号</label><span>{{ orderCreationData.customerInfo.wechat }}</span></div>
                     }
                     <div class="info-item"><label>客户类型</label><span>{{ orderCreationData.customerInfo.customerType }}</span></div>
+                    @if (orderCreationData.customerInfo.source) {
+                      <div class="info-item"><label>客户来源</label><span>{{ orderCreationData.customerInfo.source }}</span></div>
+                    }
+                    @if (orderCreationData.customerInfo.remark) {
+                      <div class="info-item"><label>备注信息</label><span>{{ orderCreationData.customerInfo.remark }}</span></div>
+                    }
                   } @else {
                     <!-- 默认显示项目信息 -->
                     <div class="info-item key-info"><label>项目负责人</label><span>{{ project.assigneeName }}</span></div>
@@ -380,6 +389,7 @@
                     <div class="vertical-stage-body">
                       @if (stage === '订单创建') {
                         <app-consultation-order-panel
+                          [syncData]="projectData"
                           (orderCreated)="onConsultationOrderSubmit($event)"
                           (projectCreated)="onProjectCreated($event)"
                         ></app-consultation-order-panel>

+ 94 - 1
src/app/pages/designer/project-detail/project-detail.ts

@@ -332,6 +332,84 @@ export class ProjectDetail implements OnInit, OnDestroy {
           this.scrollToStage(currentStageParam as ProjectStage);
         }, 500);
       }
+
+      // 处理从客服项目列表传递的同步数据
+      const syncDataParam = qp.get('syncData');
+      if (syncDataParam) {
+        try {
+          const syncData = JSON.parse(syncDataParam);
+          console.log('接收到客服同步数据:', syncData);
+          
+          // 设置同步状态
+          this.isSyncingCustomerInfo = true;
+          
+          // 存储订单创建数据用于显示
+          this.orderCreationData = syncData;
+          
+          // 更新projectData以传递给子组件
+          this.projectData = {
+            customerInfo: syncData.customerInfo,
+            requirementInfo: syncData.requirementInfo,
+            preferenceTags: syncData.preferenceTags
+          };
+          
+          // 同步客户信息到表单
+          if (syncData.customerInfo) {
+            this.customerForm.patchValue({
+              name: syncData.customerInfo.name || '',
+              phone: syncData.customerInfo.phone || '',
+              wechat: syncData.customerInfo.wechat || '',
+              customerType: syncData.customerInfo.customerType || '新客户',
+              source: syncData.customerInfo.source || '小程序',
+              remark: syncData.customerInfo.remark || '',
+              demandType: syncData.customerInfo.demandType || '',
+              followUpStatus: syncData.customerInfo.followUpStatus || '待分配'
+            });
+
+            // 设置选中的客户
+            this.selectedOrderCustomer = {
+              id: syncData.customerInfo.id || 'temp-' + Date.now(),
+              name: syncData.customerInfo.name,
+              phone: syncData.customerInfo.phone,
+              wechat: syncData.customerInfo.wechat,
+              customerType: syncData.customerInfo.customerType,
+              source: syncData.customerInfo.source,
+              remark: syncData.customerInfo.remark
+            };
+          }
+
+          // 同步需求信息
+          if (syncData.requirementInfo) {
+            this.syncRequirementKeyInfo(syncData.requirementInfo);
+          }
+
+          // 同步偏好标签到项目数据
+          if (syncData.preferenceTags && this.project) {
+            this.project.customerTags = syncData.preferenceTags.map((tag: string) => ({
+              source: '客服填写',
+              needType: tag,
+              preference: tag,
+              colorAtmosphere: tag
+            }));
+          }
+
+          // 模拟同步完成
+          setTimeout(() => {
+            this.isSyncingCustomerInfo = false;
+            this.lastSyncTime = new Date();
+            this.cdr.detectChanges();
+            console.log('客户信息同步完成');
+          }, 1500);
+
+          // 触发界面更新
+          this.cdr.detectChanges();
+          
+          console.log('客服数据同步完成,orderCreationData:', this.orderCreationData);
+        } catch (error) {
+          console.error('解析同步数据失败:', error);
+          this.isSyncingCustomerInfo = false;
+        }
+      }
     });
     
     // 添加点击事件监听器,当点击页面其他位置时关闭下拉菜单
@@ -806,6 +884,7 @@ export class ProjectDetail implements OnInit, OnDestroy {
     if (this.project) {
       this.projectService.updateProjectStage(this.projectId, stage).subscribe(() => {
         this.currentStage = stage; // 同步更新本地状态
+        this.project!.currentStage = stage; // 同步更新project对象的currentStage
         this.loadProjectDetails(); // 重新加载项目详情
         this.cdr.detectChanges(); // 触发变更检测以更新导航栏颜色
       });
@@ -821,6 +900,9 @@ export class ProjectDetail implements OnInit, OnDestroy {
       // 更新展开状态,折叠当前、展开下一阶段,提升体验
       if (this.expandedStages[afterStage] !== undefined) this.expandedStages[afterStage] = false as any;
       if (this.expandedStages[next] !== undefined) this.expandedStages[next] = true as any;
+      // 更新板块展开状态
+      const nextSection = this.getSectionKeyForStage(next);
+      this.expandedSection = nextSection;
       // 触发变更检测以更新导航栏颜色
       this.cdr.detectChanges();
     }
@@ -1524,7 +1606,8 @@ export class ProjectDetail implements OnInit, OnDestroy {
 
   // 获取板块状态:completed | 'active' | 'pending'
   getSectionStatus(key: SectionKey): 'completed' | 'active' | 'pending' {
-    const current = this.project?.currentStage as ProjectStage | undefined;
+    // 优先使用本地的currentStage,如果没有则使用project.currentStage
+    const current = (this.currentStage || this.project?.currentStage) as ProjectStage | undefined;
     
     // 如果没有当前阶段(新创建的项目),默认订单创建板块为active(红色)
     if (!current || current === '订单创建') {
@@ -1715,6 +1798,9 @@ export class ProjectDetail implements OnInit, OnDestroy {
       this.lastSyncTime = new Date();
       this.isSyncingCustomerInfo = false;
       
+      // 触发界面更新
+      this.cdr.detectChanges();
+      
       console.log('客户信息显示已同步:', this.lastSyncTime);
     }, 800);
   }
@@ -1982,6 +2068,13 @@ export class ProjectDetail implements OnInit, OnDestroy {
     // 保存订单创建数据
     this.orderCreationData = formData;
     
+    // 更新projectData以便传递给子组件
+    this.projectData = {
+      customerInfo: formData.customerInfo,
+      requirementInfo: formData.requirementInfo,
+      preferenceTags: formData.preferenceTags
+    };
+    
     // 实时更新左侧客户信息显示
     this.updateCustomerInfoDisplay(formData);
     

+ 104 - 0
src/app/services/project.service.ts

@@ -304,6 +304,110 @@ export class ProjectService {
       percentage: 25,
       status: '待结算',
       createdAt: new Date('2025-09-08')
+    },
+    // 客服项目的尾款结算记录
+    {
+      id: 's12',
+      projectId: '1', // 对应客服项目PRJ-2024-001
+      projectName: '企业官网设计开发',
+      stage: '尾款结算',
+      amount: 50000,
+      percentage: 100,
+      status: '待结算',
+      createdAt: new Date('2024-01-15'),
+      dueDate: new Date('2024-02-15')
+    },
+    {
+      id: 's13',
+      projectId: '2', // 对应客服项目PRJ-2024-002
+      projectName: '移动端APP开发',
+      stage: '尾款结算',
+      amount: 80000,
+      percentage: 100,
+      status: '逾期',
+      createdAt: new Date('2024-01-10'),
+      dueDate: new Date('2024-02-10')
+    },
+    {
+      id: 's14',
+      projectId: '3', // 对应客服项目PRJ-2024-003
+      projectName: '电商平台升级',
+      stage: '尾款结算',
+      amount: 120000,
+      percentage: 100,
+      status: '已结算',
+      createdAt: new Date('2024-01-08'),
+      settledAt: new Date('2024-01-22'),
+      dueDate: new Date('2024-02-08')
+    },
+    // 添加更多不同项目的尾款结算记录
+    {
+      id: 's15',
+      projectId: '4',
+      projectName: '品牌VI设计',
+      stage: '尾款结算',
+      amount: 35000,
+      percentage: 100,
+      status: '待结算',
+      createdAt: new Date('2024-12-01'),
+      dueDate: new Date('2024-12-31')
+    },
+    {
+      id: 's16',
+      projectId: '5',
+      projectName: '小程序开发',
+      stage: '尾款结算',
+      amount: 45000,
+      percentage: 100,
+      status: '逾期',
+      createdAt: new Date('2024-11-15'),
+      dueDate: new Date('2024-12-15')
+    },
+    {
+      id: 's17',
+      projectId: '6',
+      projectName: '网站重构项目',
+      stage: '尾款结算',
+      amount: 28000,
+      percentage: 100,
+      status: '已结算',
+      createdAt: new Date('2024-12-10'),
+      settledAt: new Date('2024-12-20'),
+      dueDate: new Date('2025-01-10')
+    },
+    {
+      id: 's18',
+      projectId: '7',
+      projectName: '数据可视化系统',
+      stage: '尾款结算',
+      amount: 95000,
+      percentage: 100,
+      status: '待结算',
+      createdAt: new Date('2024-12-20'),
+      dueDate: new Date('2025-01-20')
+    },
+    {
+      id: 's19',
+      projectId: '8',
+      projectName: '智能家居控制系统',
+      stage: '尾款结算',
+      amount: 68000,
+      percentage: 100,
+      status: '逾期',
+      createdAt: new Date('2024-10-30'),
+      dueDate: new Date('2024-11-30')
+    },
+    {
+      id: 's20',
+      projectId: '9',
+      projectName: '在线教育平台',
+      stage: '尾款结算',
+      amount: 150000,
+      percentage: 100,
+      status: '已结算',
+      createdAt: new Date('2024-11-25'),
+      settledAt: new Date('2024-12-15'),
+      dueDate: new Date('2024-12-25')
     }
   ];
 

+ 9 - 4
src/app/shared/components/complaint-card/complaint-card.html

@@ -33,11 +33,16 @@
   <!-- 优先级统计 -->
   <div class="priority-stats">
     <h5>优先级分布</h5>
-    <div class="priority-grid">
+    <div class="priority-cards-grid">
       @for (priority of priorities; track priority.value) {
-        <div class="priority-item" [style.border-left-color]="priority.color">
-          <span class="priority-label">{{ priority.label }}</span>
-          <span class="priority-count">{{ stats().priorityStats[priority.value] || 0 }}</span>
+        <div class="priority-card" [style.border-color]="priority.color">
+          <div class="priority-card-header" [style.background-color]="priority.color">
+            <span class="priority-card-label">{{ priority.label }}</span>
+          </div>
+          <div class="priority-card-body">
+            <div class="priority-card-count">{{ stats().priorityStats[priority.value] || 0 }}</div>
+            <div class="priority-card-suffix">个</div>
+          </div>
         </div>
       }
     </div>

+ 44 - 20
src/app/shared/components/complaint-card/complaint-card.scss

@@ -58,8 +58,8 @@
     }
   }
 
-  // 优先级统计
-  .priority-stats.complaint-trends {
+  // 优先级统计 - 小卡片样式
+  .priority-stats {
     margin-bottom: ios.$ios-spacing-lg;
     padding: ios.$ios-spacing-md;
     background: ios.$ios-background-secondary;
@@ -73,30 +73,54 @@
       color: ios.$ios-text-primary;
     }
 
-    .priority-grid {
+    .priority-cards-grid {
       display: grid;
-      grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
-      gap: ios.$ios-spacing-sm;
+      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
+      gap: ios.$ios-spacing-md;
 
-      .priority-item {
-        display: flex;
-        justify-content: space-between;
-        align-items: center;
-        padding: ios.$ios-spacing-sm;
+      .priority-card {
         background: ios.$ios-background;
-        border-radius: ios.$ios-radius-sm;
-        border: 1px solid ios.$ios-border;
-        border-left-width: 4px;
+        border-radius: ios.$ios-radius-md;
+        border: 2px solid;
+        overflow: hidden;
+        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+        transition: all 0.3s ease;
 
-        .priority-label {
-          font-size: ios.$ios-font-size-sm;
-          color: ios.$ios-text-secondary;
+        &:hover {
+          transform: translateY(-2px);
+          box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
         }
 
-        .priority-count {
-          font-size: ios.$ios-font-size-md;
-          font-weight: ios.$ios-font-weight-semibold;
-          color: ios.$ios-text-primary;
+        .priority-card-header {
+          padding: ios.$ios-spacing-sm ios.$ios-spacing-md;
+          color: white;
+          text-align: center;
+
+          .priority-card-label {
+            font-size: ios.$ios-font-size-sm;
+            font-weight: ios.$ios-font-weight-semibold;
+            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
+          }
+        }
+
+        .priority-card-body {
+          padding: ios.$ios-spacing-md;
+          text-align: center;
+          background: ios.$ios-background;
+
+          .priority-card-count {
+            font-size: 28px;
+            font-weight: ios.$ios-font-weight-bold;
+            color: ios.$ios-text-primary;
+            line-height: 1;
+            margin-bottom: 4px;
+          }
+
+          .priority-card-suffix {
+            font-size: ios.$ios-font-size-xs;
+            color: ios.$ios-text-secondary;
+            font-weight: ios.$ios-font-weight-medium;
+          }
         }
       }
     }

+ 116 - 42
src/app/shared/components/consultation-order-panel/consultation-order-panel.component.html

@@ -42,49 +42,47 @@
 
   <!-- 可滚动内容区域 -->
   <div class="panel-content">
-    <!-- 客户信息栏 -->
-    <section class="customer-info-section">
-      <h2 class="section-title">客户信息</h2>
-      
-      @if (!selectedCustomer) {
-        <!-- 客户搜索 -->
-        <div class="search-container">
-          <input 
-            type="text" 
-            [(ngModel)]="searchKeyword" 
-            (ngModelChange)="searchCustomer()"
-            placeholder="输入客户姓名或手机号搜索..."
-            class="search-input"
-            autocomplete="off"
-          />
-          <button class="search-btn" (click)="searchCustomer()">搜索</button>
-        </div>
-        
-        <!-- 搜索结果 -->
-        @if (searchResults.length > 0) {
-          <div class="search-results">
-            @for (customer of searchResults; track customer.id) {
-              <div class="result-item" (click)="selectCustomer(customer)">
-                <div class="customer-name">{{ customer.name }}</div>
-                <div class="customer-info">{{ customer.phone }}</div>
-              </div>
-            }
+
+
+    <!-- 客户信息显示 -->
+    @if (syncData?.customerInfo) {
+      <section class="synced-customer-info">
+        <h3 class="form-title">客户信息(已同步)</h3>
+        <div class="customer-info-display">
+          <div class="info-row">
+            <div class="info-item">
+              <label>客户姓名:</label>
+              <span>{{ syncData.customerInfo.name || '未填写' }}</span>
+            </div>
+            <div class="info-item">
+              <label>联系电话:</label>
+              <span>{{ syncData.customerInfo.phone || '未填写' }}</span>
+            </div>
           </div>
-        }
-      } @else {
-        <!-- 已选择客户 -->
-        <div class="selected-customer">
-          <div class="customer-details">
-            <div class="customer-name">{{ selectedCustomer.name }}</div>
-            <div class="customer-phone">{{ selectedCustomer.phone }}</div>
+          <div class="info-row">
+            <div class="info-item">
+              <label>微信号:</label>
+              <span>{{ syncData.customerInfo.wechat || '未填写' }}</span>
+            </div>
+            <div class="info-item">
+              <label>客户类型:</label>
+              <span>{{ syncData.customerInfo.customerType || '未填写' }}</span>
+            </div>
+          </div>
+          <div class="info-row">
+            <div class="info-item">
+              <label>客户来源:</label>
+              <span>{{ syncData.customerInfo.source || '未填写' }}</span>
+            </div>
+            <div class="info-item">
+              <label>备注:</label>
+              <span>{{ syncData.customerInfo.remark || '无' }}</span>
+            </div>
           </div>
-          <button class="clear-btn" (click)="clearSelectedCustomer()">重新选择</button>
         </div>
-      }
-    </section>
-
-    <!-- 新客户表单 -->
-    @if (!selectedCustomer) {
+      </section>
+    } @else {
+      <!-- 新客户表单 -->
       <section class="new-customer-form">
         <h3 class="form-title">新客户信息</h3>
         <form [formGroup]="customerForm">
@@ -116,7 +114,82 @@
       
       @if (isRequirementCardExpanded) {
         <div class="card-content">
-          <form [formGroup]="requirementForm">
+          <!-- 显示同步的需求信息 -->
+          @if (syncData?.requirementInfo) {
+            <div class="synced-requirements-display">
+              <h4 class="sync-title">已同步的需求信息</h4>
+              <div class="requirements-grid">
+                <div class="requirement-item">
+                  <label>定金金额:</label>
+                  <span>{{ syncData.requirementInfo.downPayment || '未填写' }}</span>
+                </div>
+                <div class="requirement-item">
+                  <label>预算范围:</label>
+                  <span>{{ syncData.requirementInfo.budget || '未填写' }}</span>
+                </div>
+                <div class="requirement-item">
+                  <label>房屋面积:</label>
+                  <span>{{ syncData.requirementInfo.area || '未填写' }}平方米</span>
+                </div>
+                <div class="requirement-item">
+                  <label>房屋类型:</label>
+                  <span>{{ syncData.requirementInfo.houseType || '未填写' }}</span>
+                </div>
+                <div class="requirement-item">
+                  <label>小图时间:</label>
+                  <span>{{ syncData.requirementInfo.smallImageTime || '未设置' }}</span>
+                </div>
+                <div class="requirement-item">
+                  <label>大图时间:</label>
+                  <span>{{ syncData.requirementInfo.largeImageTime || '未设置' }}</span>
+                </div>
+                @if (syncData.requirementInfo.spaceRequirements) {
+                  <div class="requirement-item full-width">
+                    <label>涉及空间:</label>
+                    <span>{{ syncData.requirementInfo.spaceRequirements }}</span>
+                  </div>
+                }
+                @if (syncData.requirementInfo.designAngles) {
+                  <div class="requirement-item full-width">
+                    <label>设计角度:</label>
+                    <span>{{ syncData.requirementInfo.designAngles }}</span>
+                  </div>
+                }
+                @if (syncData.requirementInfo.specialAreaHandling) {
+                  <div class="requirement-item full-width">
+                    <label>特殊区域处理:</label>
+                    <span>{{ syncData.requirementInfo.specialAreaHandling }}</span>
+                  </div>
+                }
+                @if (syncData.requirementInfo.materialRequirements) {
+                  <div class="requirement-item full-width">
+                    <label>材质要求:</label>
+                    <span>{{ syncData.requirementInfo.materialRequirements }}</span>
+                  </div>
+                }
+                @if (syncData.requirementInfo.lightingRequirements) {
+                  <div class="requirement-item full-width">
+                    <label>灯光要求:</label>
+                    <span>{{ syncData.requirementInfo.lightingRequirements }}</span>
+                  </div>
+                }
+              </div>
+              
+              <!-- 偏好标签显示 -->
+              @if (syncData.preferenceTags && syncData.preferenceTags.length > 0) {
+                <div class="synced-tags-section">
+                  <h4 class="tags-title">偏好标签</h4>
+                  <div class="tags-container">
+                    @for (tag of syncData.preferenceTags; track tag) {
+                      <span class="tag synced-tag">{{ tag }}</span>
+                    }
+                  </div>
+                </div>
+              }
+            </div>
+          } @else {
+            <!-- 原有的表单输入 -->
+            <form [formGroup]="requirementForm">
             <!-- 基本信息 - 两列布局 -->
             <div class="form-row two-columns">
               <div class="form-group">
@@ -234,7 +307,8 @@
                 <button type="button" class="add-tag-btn" (click)="addPreferenceTag(newTag)">添加</button>
               </div>
             </div>
-          </form>
+            </form>
+          }
         </div>
       }
     </section>

+ 110 - 0
src/app/shared/components/consultation-order-panel/consultation-order-panel.component.scss

@@ -731,4 +731,114 @@ $ios-spacing-xl: 32px;
       padding: $ios-spacing-md;
     }
   }
+
+  // 同步客户信息显示样式
+  .synced-customer-info {
+    margin-bottom: $ios-spacing-lg;
+    padding: $ios-spacing-md;
+    background: rgba($ios-success, 0.05);
+    border: 1px solid rgba($ios-success, 0.2);
+    border-radius: $ios-radius;
+
+    .form-title {
+      font-size: 16px;
+      font-weight: 600;
+      color: $ios-success;
+      margin-bottom: $ios-spacing-md;
+    }
+
+    .customer-info-display {
+      .info-row {
+        display: flex;
+        gap: $ios-spacing-lg;
+        margin-bottom: $ios-spacing-sm;
+
+        .info-item {
+          flex: 1;
+          display: flex;
+          align-items: center;
+
+          label {
+            font-weight: 500;
+            color: $ios-text-secondary;
+            margin-right: $ios-spacing-sm;
+            min-width: 80px;
+          }
+
+          span {
+            color: $ios-text-primary;
+            font-weight: 500;
+          }
+        }
+      }
+    }
+  }
+
+  // 同步需求信息显示样式
+  .synced-requirements-display {
+    .sync-title {
+      font-size: 16px;
+      font-weight: 600;
+      color: $ios-success;
+      margin-bottom: $ios-spacing-md;
+    }
+
+    .requirements-grid {
+      display: grid;
+      grid-template-columns: 1fr 1fr;
+      gap: $ios-spacing-md;
+      margin-bottom: $ios-spacing-lg;
+
+      .requirement-item {
+        display: flex;
+        align-items: flex-start;
+        padding: $ios-spacing-sm;
+        background: rgba($ios-success, 0.03);
+        border-radius: $ios-radius;
+
+        &.full-width {
+          grid-column: 1 / -1;
+          flex-direction: column;
+
+          label {
+            margin-bottom: $ios-spacing-xs;
+          }
+        }
+
+        label {
+          font-weight: 500;
+          color: $ios-text-secondary;
+          margin-right: $ios-spacing-sm;
+          min-width: 80px;
+        }
+
+        span {
+          color: $ios-text-primary;
+          font-weight: 500;
+          flex: 1;
+        }
+      }
+    }
+
+    .synced-tags-section {
+      .tags-title {
+        font-size: 14px;
+        font-weight: 600;
+        color: $ios-text-secondary;
+        margin-bottom: $ios-spacing-sm;
+      }
+
+      .tags-container {
+        display: flex;
+        flex-wrap: wrap;
+        gap: $ios-spacing-sm;
+
+        .synced-tag {
+          background: rgba($ios-success, 0.1);
+          color: $ios-success;
+          border: 1px solid rgba($ios-success, 0.3);
+        }
+      }
+    }
+  }
 }

+ 34 - 2
src/app/shared/components/consultation-order-panel/consultation-order-panel.component.ts

@@ -1,4 +1,4 @@
-import { Component, EventEmitter, OnInit, Output } from '@angular/core';
+import { Component, EventEmitter, OnInit, Output, Input, OnChanges, SimpleChanges } from '@angular/core';
 import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
 import { CommonModule } from '@angular/common';
 import { TeamAssignmentModalComponent, Designer } from '../team-assignment-modal/team-assignment-modal.component';
@@ -35,9 +35,10 @@ interface Customer {
   templateUrl: './consultation-order-panel.component.html',
   styleUrls: ['./consultation-order-panel.component.scss']
 })
-export class ConsultationOrderPanelComponent implements OnInit {
+export class ConsultationOrderPanelComponent implements OnInit, OnChanges {
   @Output() orderCreated = new EventEmitter<any>();
   @Output() projectCreated = new EventEmitter<any>(); // 新增项目创建成功事件
+  @Input() syncData: any = null; // 接收同步的订单数据
 
   // 搜索客户关键词
   searchKeyword = '';
@@ -128,6 +129,37 @@ export class ConsultationOrderPanelComponent implements OnInit {
     
     // 初始检查阶段状态
     this.checkStageCompletion();
+    
+    // 如果有同步数据,立即填充表单
+    if (this.syncData) {
+      this.fillFormWithSyncData(this.syncData);
+    }
+  }
+
+  ngOnChanges(changes: SimpleChanges): void {
+    // 当syncData发生变化时,填充表单数据
+    if (changes['syncData'] && changes['syncData'].currentValue) {
+      this.fillFormWithSyncData(changes['syncData'].currentValue);
+    }
+  }
+
+  // 使用同步数据填充表单
+  private fillFormWithSyncData(data: any): void {
+    if (data.customerInfo) {
+      this.customerForm.patchValue(data.customerInfo);
+      this.selectedCustomer = data.customerInfo;
+    }
+    
+    if (data.requirementInfo) {
+      this.requirementForm.patchValue(data.requirementInfo);
+    }
+    
+    if (data.preferenceTags && Array.isArray(data.preferenceTags)) {
+      this.preferenceTags = [...data.preferenceTags];
+    }
+    
+    // 更新阶段完成状态
+    this.checkStageCompletion();
   }
 
   // 搜索客户