From b3a2fad886e46ac806cb6cbd440c11c6102b7db5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?=
<7507756+jiang_yuqi@user.noreply.gitee.com>
Date: Sun, 5 May 2024 21:43:56 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/components/MonitAndWarning.vue | 130 +++++++++++++----------
1 file changed, 75 insertions(+), 55 deletions(-)
diff --git a/src/pages/components/MonitAndWarning.vue b/src/pages/components/MonitAndWarning.vue
index 0c566f3..2608c5b 100644
--- a/src/pages/components/MonitAndWarning.vue
+++ b/src/pages/components/MonitAndWarning.vue
@@ -39,6 +39,7 @@
@@ -46,14 +47,14 @@

{{ item.name }}
-
- {{ item.total }}
+
+ {{ item.total }}
- {{ item.data }}/
- {{item.total }}
+ {{ item.data }}/
+ {{ item.total }}
-
@@ -94,6 +95,11 @@ export default {
data: 0,
total: 0,
},
+ {
+ name: "劳资预警",
+ data: 0,
+ total: 0,
+ },
],
};
},
@@ -128,57 +134,71 @@ export default {
if (this.type == "detail") {
prjId = this.prjInfo.id;
}
- this.$api.problemmodify.getMonitAndWarning(this.deptInfo.id||0, prjId).then((d) => {
- let tmps = d.data?.today || [];
- let sum = 0;
- tmps.forEach((it) => {
- sum += it.total;
+ this.$api.problemmodify
+ .getMonitAndWarning(this.deptInfo.id || 0, prjId)
+ .then((d) => {
+ let tmps = d.data?.today || [];
+ let sum = 0;
+ tmps.forEach((it) => {
+ sum += it.total;
+ });
+ this.todayCnt = sum;
+ sum = 0;
+ tmps = d.data?.week || [];
+ tmps.forEach((it) => {
+ sum += it.total;
+ });
+ this.weekCnt = sum;
+ let data = 0;
+ sum = 0;
+ tmps = d.data?.group || [];
+ let objs = tmps.filter((it) => it.infotype == "0");
+ objs.forEach((it) => {
+ sum += it.total;
+ if (it.checkState != "4") {
+ data += it.total;
+ }
+ });
+ this.warningType[1].data = data;
+ this.warningType[1].total = sum;
+ data = 0;
+ sum = 0;
+ tmps = d.data?.group || [];
+ objs = tmps.filter((it) => it.infotype == "1");
+ objs.forEach((it) => {
+ sum += it.total;
+ if (it.checkState != "4") {
+ data += it.total;
+ }
+ });
+ this.warningType[2].data = data;
+ this.warningType[2].total = sum;
+ data = 0;
+ sum = 0;
+ tmps = d.data?.group || [];
+ objs = tmps.filter((it) => it.infotype == "96");
+ objs.forEach((it) => {
+ sum += it.total;
+ if (it.checkState != "4") {
+ data += it.total;
+ }
+ });
+ this.warningType[0].data = data;
+ this.warningType[0].total = sum;
+ data = 0;
+ sum = 0;
+ tmps = d.data?.group || [];
+ objs = tmps.filter((it) => it.infotype == "97");
+ objs.forEach((it) => {
+ sum += it.total;
+ if (it.checkState != "100") {
+ data += it.total;
+ }
+ });
+ this.warningType[3].data = data;
+ this.warningType[3].total = sum;
+ this.elKey++;
});
- this.todayCnt = sum;
- sum = 0;
- tmps = d.data?.week || [];
- tmps.forEach((it) => {
- sum += it.total;
- });
- this.weekCnt = sum;
- let data = 0;
- sum = 0;
- tmps = d.data?.group || [];
- let objs = tmps.filter((it) => it.infotype == "0");
- objs.forEach((it) => {
- sum += it.total;
- if (it.checkState != "4") {
- data += it.total;
- }
- });
- this.warningType[1].data = data;
- this.warningType[1].total = sum;
- data = 0;
- sum = 0;
- tmps = d.data?.group || [];
- objs = tmps.filter((it) => it.infotype == "1");
- objs.forEach((it) => {
- sum += it.total;
- if (it.checkState != "4") {
- data += it.total;
- }
- });
- this.warningType[2].data = data;
- this.warningType[2].total = sum;
- data = 0;
- sum = 0;
- tmps = d.data?.group || [];
- objs = tmps.filter((it) => it.infotype == "96");
- objs.forEach((it) => {
- sum += it.total;
- if (it.checkState != "4") {
- data += it.total;
- }
- });
- this.warningType[0].data = data;
- this.warningType[0].total = sum;
- this.elKey++;
- });
},
},
};