prv
姜玉琦 2024-05-05 21:43:56 +08:00
parent 7d231e5500
commit b3a2fad886
1 changed files with 75 additions and 55 deletions

View File

@ -39,6 +39,7 @@
<div
class="glr-login-number-max analyse-num-max"
v-for="(item, idx) in warningType"
v-if="type != 'detail' || (type == 'detail' && item.name != '劳资预警')"
style="height: unset"
:key="idx"
>
@ -46,14 +47,14 @@
<div class="glr-login-number analyse-login-numbe">
<div><img src="images/text_red_spot.png" />{{ item.name }}</div>
<div class="glr-rate-value glr-rate-red-value">
<template v-if="idx==0">
<span style="color: #c0dafb">{{ item.total }}</span>
<template v-if="idx == 0">
<span style="color: #c0dafb">{{ item.total }}</span>
</template>
<template v-else>
<span>{{ item.data }}</span>/
<span style="color: #c0dafb">{{item.total }}</span>
<span>{{ item.data }}</span
>/
<span style="color: #c0dafb">{{ item.total }}</span>
</template>
</div>
</div>
</div>
@ -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++;
});
},
},
};