From e01dd950b84a7d928935b0ca0e53237de89838fa Mon Sep 17 00:00:00 2001 From: git_rabbit Date: Wed, 29 Oct 2025 00:10:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor(WorkorderOnlineCard):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BB=8A=E6=97=A5=E7=94=9F=E4=BA=A7=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91=E5=92=8C=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将"今日统计"改为"今日生产统计"以更准确描述内容 - 更新统计项标签文案使其更清晰 - 简化总工单数计算方式,直接使用数组长度 - 使用filter方法统计已完成/未完成工单数 - 保持总上件数计算逻辑不变 --- .../components/WorkorderOnlineCard.vue | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/views/kanbanManagement/CarouselBoard/components/WorkorderOnlineCard.vue b/src/views/kanbanManagement/CarouselBoard/components/WorkorderOnlineCard.vue index b60be74..13b5998 100644 --- a/src/views/kanbanManagement/CarouselBoard/components/WorkorderOnlineCard.vue +++ b/src/views/kanbanManagement/CarouselBoard/components/WorkorderOnlineCard.vue @@ -15,22 +15,22 @@
-
今日统计
+
今日生产统计
-
今日总计划数
+
今日工单总数
{{ todayStatistics.totalPlan }}
-
已完成计划数
+
已完成工单数
{{ todayStatistics.completedPlan }}
-
未完成计划数
+
未完成工单数
{{ todayStatistics.uncompletedPlan }}
-
今日总投入数
+
今日总上件数
{{ todayStatistics.totalInput }}
@@ -243,20 +243,15 @@ export default { totalInput: 0, }; - // 统计工单数据 + // 总计划数改为查询数据的条数 + this.todayStatistics.totalPlan = this.workorderOnlineTable.length; + + // 统计已完成和未完成计划数量 + this.todayStatistics.completedPlan = this.workorderOnlineTable.filter((item) => item.status === 2).length; + this.todayStatistics.uncompletedPlan = this.workorderOnlineTable.filter((item) => item.status !== 2).length; + + // 统计总上件数 this.workorderOnlineTable.forEach((item) => { - // 确保使用实际的计划数字段 - const planCount = Number(item.vehicleNumber) || 0; - this.todayStatistics.totalPlan += planCount; - - // 统计已完成和未完成计划 - if (item.status === 2) { - // 已完成 - this.todayStatistics.completedPlan += planCount; - } else { - this.todayStatistics.uncompletedPlan += planCount; - } - // 确保使用实际的投入数字段 this.todayStatistics.totalInput += Number(item.previousNumber) || 0; });