|
|
|
|
@ -90,13 +90,26 @@ Component({
|
|
|
|
|
|
|
|
|
|
// 计算当前维修人员的接单统计
|
|
|
|
|
const myRepairs = all.filter(r => r.technicianId === techId)
|
|
|
|
|
|
|
|
|
|
// 修改统计逻辑,确保与界面显示一致
|
|
|
|
|
// 从实际数据来看,"已解决"的工单应该被统计为已完成
|
|
|
|
|
const completedCount = myRepairs.filter(r => r.status === 'resolved').length
|
|
|
|
|
const pendingCount = myRepairs.filter(r => r.status === 'in_progress').length
|
|
|
|
|
const totalCount = completedCount + pendingCount
|
|
|
|
|
|
|
|
|
|
const stats = {
|
|
|
|
|
total: myRepairs.length,
|
|
|
|
|
pending: myRepairs.filter(r => r.status === 'unassigned').length,
|
|
|
|
|
processing: myRepairs.filter(r => r.status === 'in_progress').length,
|
|
|
|
|
completed: myRepairs.filter(r => r.status === 'resolved').length
|
|
|
|
|
total: totalCount,
|
|
|
|
|
pending: pendingCount,
|
|
|
|
|
processing: 0, // 暂不区分待处理和处理中
|
|
|
|
|
completed: completedCount
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 调试信息,帮助确认统计是否正确
|
|
|
|
|
console.log('维修人员ID:', techId)
|
|
|
|
|
console.log('统计的工单总数:', totalCount)
|
|
|
|
|
console.log('待处理工单数:', pendingCount)
|
|
|
|
|
console.log('已完成工单数:', completedCount)
|
|
|
|
|
|
|
|
|
|
const { filter } = this.data
|
|
|
|
|
let repairs = all
|
|
|
|
|
if (filter === 'mine') {
|
|
|
|
|
|