|
@@ -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'
|
|
|
}
|
|
|
];
|
|
|
|