From cd1825d634421509865eefccb294cabd629aaa92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Thu, 11 Jan 2024 18:29:06 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/board/foaming/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/board/foaming/index.vue b/src/views/board/foaming/index.vue index 6f94f05..76898e8 100644 --- a/src/views/board/foaming/index.vue +++ b/src/views/board/foaming/index.vue @@ -577,7 +577,7 @@ export default { value1: ((totalArr.filter(val => val.value3 === '生产中').length / 6) * 100).toFixed(2), value2: totalArr.map(val => val.value5).reduce((acc, curr) => acc + curr, 0), value3: totalArr.map(val => val.value6).reduce((acc, curr) => acc + curr, 0), - value4: ((totalArr.map(val => val.value6).reduce((acc, curr) => acc + curr, 0) / totalArr.map(val => val.value4).reduce((acc, curr) => acc + curr, 0)) * 100).toFixed(2), + value4: totalArr.map(val => val.value4).reduce((acc, curr) => acc + curr, 0) === 0 ? 0 : ((totalArr.map(val => val.value6).reduce((acc, curr) => acc + curr, 0) / totalArr.map(val => val.value4).reduce((acc, curr) => acc + curr, 0)) * 100).toFixed(2), value5: totalArr.map(val => val.value8).reduce((acc, curr) => acc + curr, 0), value6: totalArr.map(val => val.value9).reduce((acc, curr) => acc + curr, 0), value7: totalArr.map(val => val.value10).reduce((acc, curr) => acc + curr, 0), @@ -1178,7 +1178,7 @@ export default { value4: val.TARGET, value5: val.PLAN_SUM, value6: val.PRO_SUM, - value7: ((val.PRO_SUM / val.TARGET) * 100).toFixed(2) + '%', + value7: (val.PLAN_SUM === 0 ? 0 :((val.PRO_SUM / val.PLAN_SUM) * 100).toFixed(2) )+ '%', value8: val.ANHOUR, value9: val.TWOHOUR, value10: val.THREEHOUR, From cf4bf9208ce8fbdd68a2f8cab64b6edaec6e3b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Thu, 11 Jan 2024 18:29:39 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/board/foaming/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/board/foaming/index.vue b/src/views/board/foaming/index.vue index 76898e8..5eb0817 100644 --- a/src/views/board/foaming/index.vue +++ b/src/views/board/foaming/index.vue @@ -1200,7 +1200,7 @@ export default { value1: ((totalArr.filter(val => val.value3 === '生产中').length / 6) * 100).toFixed(2), value2: totalArr.map(val => val.value5).reduce((acc, curr) => acc + curr, 0), value3: totalArr.map(val => val.value6).reduce((acc, curr) => acc + curr, 0), - value4: ((totalArr.map(val => val.value6).reduce((acc, curr) => acc + curr, 0) / totalArr.map(val => val.value4).reduce((acc, curr) => acc + curr, 0)) * 100).toFixed(2), + value4: totalArr.map(val => val.value4).reduce((acc, curr) => acc + curr, 0) === 0 ? 0 : ((totalArr.map(val => val.value6).reduce((acc, curr) => acc + curr, 0) / totalArr.map(val => val.value4).reduce((acc, curr) => acc + curr, 0)) * 100).toFixed(2), value5: totalArr.map(val => val.value8).reduce((acc, curr) => acc + curr, 0), value6: totalArr.map(val => val.value9).reduce((acc, curr) => acc + curr, 0), value7: totalArr.map(val => val.value10).reduce((acc, curr) => acc + curr, 0), From 7bee754b40be81f9e90824a23b324c80a8487556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Thu, 11 Jan 2024 18:38:31 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/board/foaming/index2.vue | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/views/board/foaming/index2.vue b/src/views/board/foaming/index2.vue index 8ae93b4..25a42b9 100644 --- a/src/views/board/foaming/index2.vue +++ b/src/views/board/foaming/index2.vue @@ -18,11 +18,13 @@ {{ i }}