From 51938926d3c42fa17232ca4ac464ae1efc2c46d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Thu, 27 Jun 2024 09:28:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/home.js | 22 ++- .../copilot/efficiency/components/ChipOee.vue | 33 +++-- .../efficiency/components/TransformRate.vue | 35 +++-- .../components/sub/chip/ChipRateItem.vue | 1 + .../components/sub/std/ProgressBar.vue | 4 +- .../components/sub/std/StdRateItem.vue | 14 +- .../components/sub/std/preProgressBar.vue | 130 ++++++++++++++++++ .../copilot/efficiency/options/chipOptions.js | 3 +- 8 files changed, 209 insertions(+), 33 deletions(-) create mode 100644 src/views/copilot/efficiency/components/sub/std/preProgressBar.vue diff --git a/src/store/modules/home.js b/src/store/modules/home.js index 0d1678d..e01a745 100644 --- a/src/store/modules/home.js +++ b/src/store/modules/home.js @@ -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; - chipOeeRate.previous[fId] = factory.previousYearOee; + if (factory.previousGlassType === 0) { + chipOeeRate.previous[fId] = factory.previousYearOee; + } + // chipOeeRate.previous[fId] = factory.previousYearOee; // 转化效率 - transformRate.previous[fId] =factory.previousYearComponentConversionEfficiency ; + 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, diff --git a/src/views/copilot/efficiency/components/ChipOee.vue b/src/views/copilot/efficiency/components/ChipOee.vue index 16c89be..3e3ac06 100644 --- a/src/views/copilot/efficiency/components/ChipOee.vue +++ b/src/views/copilot/efficiency/components/ChipOee.vue @@ -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 = [ diff --git a/src/views/copilot/efficiency/components/TransformRate.vue b/src/views/copilot/efficiency/components/TransformRate.vue index 04e07f5..0b835fd 100644 --- a/src/views/copilot/efficiency/components/TransformRate.vue +++ b/src/views/copilot/efficiency/components/TransformRate.vue @@ -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 = [ diff --git a/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue b/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue index 60f37e4..cee0804 100644 --- a/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue +++ b/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue @@ -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], diff --git a/src/views/copilot/efficiency/components/sub/std/ProgressBar.vue b/src/views/copilot/efficiency/components/sub/std/ProgressBar.vue index 4925e17..3e90f71 100644 --- a/src/views/copilot/efficiency/components/sub/std/ProgressBar.vue +++ b/src/views/copilot/efficiency/components/sub/std/ProgressBar.vue @@ -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 + '%' // } diff --git a/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue b/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue index a6d707e..fc5199b 100644 --- a/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue +++ b/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue @@ -1,7 +1,7 @@ @@ -11,21 +11,21 @@
- +
- +
- +
@@ -33,7 +33,7 @@
- +
@@ -42,10 +42,12 @@ + + diff --git a/src/views/copilot/efficiency/options/chipOptions.js b/src/views/copilot/efficiency/options/chipOptions.js index e9584b4..59af0e2 100644 --- a/src/views/copilot/efficiency/options/chipOptions.js +++ b/src/views/copilot/efficiency/options/chipOptions.js @@ -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, -- 2.45.2