修改bug

This commit is contained in:
‘937886381’ 2024-06-27 09:28:04 +08:00
parent 354031f119
commit 51938926d3
8 changed files with 209 additions and 33 deletions

View File

@ -289,7 +289,7 @@ function splitCurrentAndPreviousB(factoryListResponse) {
}
function splitCurrentAndPreviousA(factoryListResponse, targetListResponse, prodOutputFtoListRes,preData,preFtoData) {
console.log('工厂',targetListResponse);
console.log('工厂',preData);
// 初始数据
const { chipOeeRate, transformRate, chipRate, stdRate } = initA();
@ -343,17 +343,24 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse, prodO
// componentYieldRate: 0.73,
// },
// ];
if (preData && preData[0] != null) {
if (preData) {
for (const factory of preData) {
const fId = getPreFactoryId(factory);
const fId = getPreFactoryId(factory)
console.log('factory',factory.previousYearOee);
// chipInvest.previous[fId] = factory.previousYearInputNumber;
// chipOeeRate.current[fId] = factory.oee;
if (factory.previousGlassType === 0) {
chipOeeRate.previous[fId] = factory.previousYearOee;
}
// chipOeeRate.previous[fId] = factory.previousYearOee;
// 转化效率
if (factory.previousGlassType === 1) {
transformRate.previous[fId] = factory.previousYearComponentConversionEfficiency;
}
// transformRate.previous[fId] =factory.previousYearComponentConversionEfficiency ;
// 芯片良率 与 标准组件良率
if (![0, 1].includes(factory.glassType)) continue;
const _t = [chipRate, stdRate][factory.glassType]
if (![0, 1].includes(factory.previousGlassType)) continue;
const _t = [chipRate, stdRate][factory.previousGlassType]
// _t.current[fId] = factory.yieldRate ;
_t.previous[fId] = factory.previousYearYieldRate ;
// }
@ -393,6 +400,7 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse, prodO
_t.current[fId] = factory.yieldRate ;
// _t.previous[fId] = factory.previousYearYieldRate ;
}
console.log('chipOeeRate',stdRate);
// console.log('chipOeeRate',chipOeeRate);
return {
chipOeeRate,

View File

@ -65,21 +65,26 @@ export default {
items = [
{ label: `${year - 1}${yesterday}`, color: "#12f7f1" },
{ label: `${yesterday}`, color: "#58adfa" },
{ label: `${yesterday}日目标`, color: "#58adfa" },
];
} else if (this.period === '日' && this.than === '环比') {
items = [
{ label: `${dayBeYes}`, color: "#12f7f1" },
{ label: `${yesterday}`, color: "#58adfa" },
{ label: `${yesterday}日目标`, color: "#58adfa" },
];
} else if (this.period === '周' && this.than === '同比') {
items = [
{ label: `${year-1}年本周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
{ label: `本周目标`, color: "#58adfa" },
];
} else if (this.period === '周' && this.than === '环比') {
items = [
{ label: `上周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
{ label: `本周目标`, color: "#58adfa" },
];
} else if (this.period === '月' && this.than === '同比') {
items = [
@ -141,14 +146,6 @@ export default {
// console.log('chipOee', chipOeeRate)
let dataList = null
switch (this.period) {
case "日":
dataList = [];
dataList[0] = chipOeeRate?.previous;
dataList[1] = chipOeeRate?.current;
case "周":
dataList = [];
dataList[0] = chipOeeRate?.previous;
dataList[1] = chipOeeRate?.current;
default:
dataList = [];
dataList[0] = chipOeeRate?.previous;
@ -191,6 +188,11 @@ function getTemplate(period, dataList, than) {
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `${yesterday}日目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '日' && than === '环比') {
items = [
@ -203,6 +205,11 @@ function getTemplate(period, dataList, than) {
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `${yesterday}日目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '周' && than === '同比') {
items = [
@ -215,6 +222,11 @@ function getTemplate(period, dataList, than) {
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `本周目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '周' && than === '环比') {
items = [
@ -227,6 +239,11 @@ function getTemplate(period, dataList, than) {
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `本周目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '月' && than === '同比') {
items = [

View File

@ -65,21 +65,26 @@ export default {
items = [
{ label: `${year - 1}${yesterday}`, color: "#12f7f1" },
{ label: `${yesterday}`, color: "#58adfa" },
{ label: `${yesterday}日目标`, color: "#58adfa" },
];
} else if (this.period === '日' && this.than === '环比') {
items = [
{ label: `${dayBeYes}`, color: "#12f7f1" },
{ label: `${yesterday}`, color: "#58adfa" },
{ label: `${yesterday}日目标`, color: "#58adfa" },
];
} else if (this.period === '周' && this.than === '同比') {
items = [
{ label: `${year-1}年本周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
{ label: `本周目标`, color: "#58adfa" },
];
} else if (this.period === '周' && this.than === '环比') {
items = [
{ label: `上周`, color: "#12f7f1" },
{ label: `本周`, color: "#58adfa" },
{ label: `本周目标`, color: "#58adfa" },
];
} else if (this.period === '月' && this.than === '同比') {
items = [
@ -112,17 +117,9 @@ export default {
series() {
// console.log('aaaaaaaa', this.$store.getters.copilot.efficiency.chipOee);
const transformRate = this.transformRate
// console.log('chipOee', chipOeeRate)
console.log('chipOee', transformRate)
let dataList = null;
switch (this.period) {
case "日":
dataList = [];
dataList[0] = transformRate.previous;
dataList[1] = transformRate.current;
case "周":
dataList = [];
dataList[0] = transformRate.previous;
dataList[1] = transformRate.current;
default:
dataList = [];
dataList[0] = transformRate.previous;
@ -182,6 +179,11 @@ function getTemplate(period, dataList,than) {
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `${yesterday}日目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '日' && than === '环比') {
items = [
@ -194,6 +196,11 @@ function getTemplate(period, dataList,than) {
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `${yesterday}日目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '周' && than === '同比') {
items = [
@ -206,6 +213,11 @@ function getTemplate(period, dataList,than) {
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `本周目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '周' && than === '环比') {
items = [
@ -218,6 +230,11 @@ function getTemplate(period, dataList,than) {
data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
{
name: `本周目标`,
data: dataList ? dataList[2] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
},
];
} else if (period === '月' && than === '同比') {
items = [

View File

@ -157,6 +157,7 @@ export default {
color: this.color == 1 ? "#4CF0E8" : "#1065ff",
titleValue,
subtitle,
yesterday,
currentName: items[0].label,
preName: items[1].label,
previousSum: vt[0],

View File

@ -47,12 +47,12 @@ export default {
computed: {
dataRate() {
// if (this.current != 0 && this.target != 0) {
console.log( '1111111111', this.current, this.target);
console.log( '1111111111', this.current, this.target,this.previous);
return this.current == 0 && this.target == 0
? 0
: this.current != 0 && this.target != 0
? `${((this.current / this.target) * 100).toFixed(2)}%`
: this.current != 0 && this.target == 0 && this.current >= 100 ? 100 + '%' : this.current != 0 && this.target == 0 && this.current < 100 ? this.current + '%' : this.previous >=100 ? 100 + '%' : this.previous + '%';
: this.current != 0 && this.target == 0 && this.current >= 100 ? 100 + '%' : this.current != 0 && this.target == 0 && this.current < 100 ? this.current + '%' : 0 + '%'
// } else if(this.previous != 0) {
// return this.previous + '%'
// }

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-05-07 10:25:10
* @LastEditTime: 2024-06-14 09:58:01
* @LastEditTime: 2024-06-27 09:13:38
* @LastEditors: zhp
* @Description:
-->
@ -11,21 +11,21 @@
<CityName :value="city.name" />
<div class="std-rate-item__value">
<ProgressBar :period="period" :title="title" :target="city.target" :current="city.current" />
<ProgressBar :period="period" :title="titlePre" :previous="city.previous" />
<preProgressBar :period="period" :title="titlePre" :previous="city.previous" />
</div>
</div>
<div v-else-if="period == ''" class="std-rate-item">
<CityName :value="city.name" />
<div class="std-rate-item__value">
<ProgressBar :period="period" :title="title" :target="city.target" :current="city.current" />
<ProgressBar :period="period" :title="titlePre" :previous="city.previous" />
<preProgressBar :period="period" :title="titlePre" :previous="city.previous" />
</div>
</div>
<div v-else-if="period == ''" class="std-rate-item">
<CityName :value="city.name" />
<div class="std-rate-item__value">
<ProgressBar :period="period" :title="titleTarget" :target="city.target" :current="city.current" />
<ProgressBar :period="period" :title="titlePre" :previous="city.previous" />
<preProgressBar :period="period" :title="titlePre" :previous="city.previous" />
<!-- <ProgressBar :period="period" :title="title" :value="city.current" /> -->
</div>
</div>
@ -33,7 +33,7 @@
<CityName :value="city.name" />
<div class="std-rate-item__value">
<ProgressBar :period="period" :title="titleTarget" :target="city.target" :current="city.current" />
<ProgressBar :period="period" :title="titlePre" :previous="city.previous" />
<preProgressBar :period="period" :title="titlePre" :previous="city.previous" />
<!-- <ProgressBar :period="period" :title="title" :value="city.current" /> -->
</div>
</div>
@ -42,10 +42,12 @@
<script>
import CityName from "./CityName.vue";
import ProgressBar from "./ProgressBar.vue";
import preProgressBar from "./preProgressBar.vue";
export default {
name: "StdRateItem",
components: { CityName, ProgressBar },
components: { CityName, ProgressBar, preProgressBar },
props: {
city: {
type: Object,

View File

@ -0,0 +1,130 @@
<!--
* @Author: zhp
* @Date: 2024-06-27 09:12:54
* @LastEditTime: 2024-06-27 09:14:21
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="progress-bar" :data-title="title" :data-rate="previous + '%'">
<div class="progress-bar__rate" :style="{ width: dataRate == '-' ? 0 : dataRate }"></div>
</div>
</template>
<script>
export default {
name: "ProgressBar",
components: {},
props: {
value: {
type: Number,
default: 0,
},
target: {
type: Number,
default: 0,
},
previous: {
type: Number,
default: 0,
},
current: {
type: Number,
default: 0,
},
// total: {
// type: Number,
// default: 0,
// },
title: {
type: String,
default: "",
},
},
data() {
return {};
},
computed: {
dataRate() {
// if (this.current != 0 && this.target != 0) {
// console.log( '1111111111', this.current, this.target,this.previous);
return this.previous >=100 ? 100 + '%' : this.previous + '%';
// } else if(this.previous != 0) {
// return this.previous + '%'
// }
},
},
methods: {},
};
</script>
<style scoped lang="scss">
.progress-bar {
height: 10px;
background-color: #002f6b;
border-radius: 4px;
margin-bottom: 12px;
position: relative;
&:before {
content: attr(data-title);
display: inline-block;
color: #fff;
position: absolute;
bottom: -200%;
font-size: 12px;
}
&:after {
content: attr(data-rate);
display: inline-block;
color: #fff;
position: absolute;
bottom: -200%;
right: 0;
font-size: 12px;
}
&:first-child {
&:after {
color: #11eae3;
}
}
&:nth-child(2) {
&:after {
color: #0e65fd;
}
}
.progress-bar__rate {
position: absolute;
display: inline-block;
height: 100%;
width: 0;
border-radius: 4px;
background: linear-gradient(to right,
#004c5e11 10%,
#004c5e,
#0ac0c0,
#11eae3);
}
&:first-child {
.progress-bar__rate {
background: linear-gradient(to right,
#004c5e11 10%,
#004c5e,
#0ac0c0,
#11eae3);
}
}
&:nth-child(2) {
.progress-bar__rate {
background: linear-gradient(to right, #0048a811, #0048a8, #0e65fd);
}
}
}
</style>

View File

@ -6,6 +6,7 @@ export default ({
targetSum,
currentName,
preName,
yesterday,
}) => ({
grid: {
left: 300,
@ -25,7 +26,7 @@ export default ({
fontSize: 26,
color: "#fffd",
},
subtext: `\u2002${subtitle}\u2002`,
subtext: `\u2002${yesterday + '日良率'}\u2002`,
subtextStyle: {
fontSize: 14,
fontWeight: 100,