From 8e9bc97e709f7e49586dffb9cc3d2dac4cfef4ca Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 26 三月 2026 10:13:02 +0800
Subject: [PATCH] 进销存升级 1.语法修改
---
src/views/customerService/feedbackRegistration/index.vue | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/views/customerService/feedbackRegistration/index.vue b/src/views/customerService/feedbackRegistration/index.vue
index 3a2d362..e307dda 100644
--- a/src/views/customerService/feedbackRegistration/index.vue
+++ b/src/views/customerService/feedbackRegistration/index.vue
@@ -404,15 +404,19 @@
});
};
+const getStatsCountByStatus = (list, status) => {
+ if (!Array.isArray(list)) return 0;
+ return list.find((item) => item?.status === status)?.count || 0;
+};
+
// 鑾峰彇缁熻鏁版嵁骞跺埛鏂伴《閮ㄥ崱鐗�
const getSalesLedgerDetails = () => {
getSalesLedgerDetail({}).then((res) => {
if (res.code === 200) {
- statsList.value[0].count = res.data.filter((item) => item.status === 3)[0].count;
- statsList.value[1].count = res.data.filter((item) => item.status === 2)[0].count;
- statsList.value[2].count = res.data.filter((item) => item.status === 1)[0].count;
-
- // });
+ const statsData = Array.isArray(res.data) ? res.data : [];
+ statsList.value[0].count = getStatsCountByStatus(statsData, 3);
+ statsList.value[1].count = getStatsCountByStatus(statsData, 2);
+ statsList.value[2].count = getStatsCountByStatus(statsData, 1);
}
});
}
--
Gitblit v1.9.3