From 14c782f112925bb9da49be2d9c0f19d40927f850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98937886381=E2=80=99?= <‘937886381@qq.com’> Date: Mon, 17 Jun 2024 16:59:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/home.js | 4 +-- .../factoryData/components/ChipOee.vue | 31 ++++++++++++++----- .../copilot/factoryData/components/Order.vue | 2 +- src/views/copilot/factoryData/index.vue | 2 +- .../components/sub/ring/DoubleRingChart.vue | 10 +++--- 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/store/modules/home.js b/src/store/modules/home.js index 8a2652a..cdd0e6f 100644 --- a/src/store/modules/home.js +++ b/src/store/modules/home.js @@ -437,7 +437,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu for (const factory of preData) { const fId = getPreFactoryId(factory); if (factory.previousGlassType === 0) { - chipInvest.previous[fId] = factory.inputNumber + chipInvest.previous[fId] = factory.previousYearInputNumber } // chipInvest.previous[fId] = factory.previousYearInputNumber; if (![0, 1, 2].includes(factory.previousGlassType)) continue; @@ -476,7 +476,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu const _t = [chipOutput, stdOutput, bipvOutput][factory.glassType]; _t.current[fId] = factory.outputNumber; } - console.log('chipInvest',chipInvest); + console.log('chipInvest',ftoInvest); return { chipInvest, // ftoInvest, diff --git a/src/views/copilot/factoryData/components/ChipOee.vue b/src/views/copilot/factoryData/components/ChipOee.vue index a89bef2..8ed936e 100644 --- a/src/views/copilot/factoryData/components/ChipOee.vue +++ b/src/views/copilot/factoryData/components/ChipOee.vue @@ -1,7 +1,7 @@ @@ -54,8 +54,20 @@ export default { legend() { let items = []; var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() + //今天的时间 + // var day2 = new Date(); + // day2.setTime(day2.getTime()); + // var s2 = (day2.getMonth() + 1) + "月" + day2.getDate() + '日'; + // const today = new Date().getDate(); + // let yesterday = new Date().getDate() -1; + // const month = new Date().getMonth() + 1; + // const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1; + // const year = new Date().getFullYear(); //今天的时间 // var day2 = new Date(); // day2.setTime(day2.getTime()); @@ -65,15 +77,18 @@ export default { const month = new Date().getMonth() + 1; const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1; const year = new Date().getFullYear(); - if (this.period === 1 && this.than === '同比') { + if (this.period === 1 && this.than === '同比') { items = [ - { label: `${year-1}年${month}月${today}日`, color: "#12f7f1" }, - { label: `${month}月${today}日`, color: "#58adfa" }, + { label: `${year - 1}年${yesterday}累计` }, + { label: `${yesterday}日累计`, }, + + // { label: `${month}月${today}日目标`, }, ]; - } else if (this.period ===1 && this.than === '环比') { + } else if (this.period === 1 && this.than === '环比') { items = [ - { label: `${yesterday}日`, color: "#12f7f1" }, - { label: `${month}月${today}日`, color: "#58adfa" }, + { label: `${dayBeYes}日累计` }, + { label: `${yesterday}日累计` }, + // { label: `${month}月${today}日目标`, }, ]; } else if (this.period === 2 && this.than === '同比') { items = [ diff --git a/src/views/copilot/factoryData/components/Order.vue b/src/views/copilot/factoryData/components/Order.vue index e9eb35a..0219590 100644 --- a/src/views/copilot/factoryData/components/Order.vue +++ b/src/views/copilot/factoryData/components/Order.vue @@ -105,7 +105,7 @@ export default { ); arr.push( `${ - this.prodOrder[i].orderStatus === 0 ? '未开始' : this.prodOrder[i].orderStatus === 1 ? '进行中' : '已完成' || "" + this.prodOrder[i].orderStatus === 1 ? '未开始' : this.prodOrder[i].orderStatus === 2 ? '进行中' : '已完成' || "" }` ); arr.push( diff --git a/src/views/copilot/factoryData/index.vue b/src/views/copilot/factoryData/index.vue index 39d0614..7a40566 100644 --- a/src/views/copilot/factoryData/index.vue +++ b/src/views/copilot/factoryData/index.vue @@ -89,7 +89,7 @@ export default { updateThan(val) { console.log(val); this.than = val; - // this.getMes(); + this.getMes() }, updatePeriod(val) { this.period = val; diff --git a/src/views/copilot/yield/components/sub/ring/DoubleRingChart.vue b/src/views/copilot/yield/components/sub/ring/DoubleRingChart.vue index a592e46..9b3ca7e 100644 --- a/src/views/copilot/yield/components/sub/ring/DoubleRingChart.vue +++ b/src/views/copilot/yield/components/sub/ring/DoubleRingChart.vue @@ -1,7 +1,7 @@ @@ -118,13 +118,13 @@ export default { items = [ { label: `${yesterday}日累计`,}, { label: `${year - 1}年${yesterday}累计` }, - { label: `${month}月${today}日目标`, }, + { label: `${yesterday}日目标`, }, ]; } else if (this.period === '日' && this.than === '环比') { items = [ { label: `${yesterday}日累计`}, { label: `${dayBeYes}日累计` }, - { label: `${month}月${today}日目标`, }, + { label: `${yesterday}日目标`, }, ]; } else if (this.period === '周' && this.than === '同比') { items = [ @@ -243,13 +243,13 @@ function calculateItems(period, valueTuple, than) { items = [ { label: `${year - 1}年${yesterday}累计`, value: valueTuple[0] }, { label: `${yesterday}累计`, value: valueTuple[1] }, - { label: `${month}月${today}日目标`, value: valueTuple[2] }, + { label: `${yesterday}日目标`, value: valueTuple[2] }, ]; } else if (period === '日' && than === '环比') { items = [ { label: `${dayBeYes}日累计`, value: valueTuple[0] }, { label: `${yesterday}日累计`, value: valueTuple[1] }, - { label: `${month}月${today}日目标`, value: valueTuple[2] }, + { label: `${yesterday}日目标`, value: valueTuple[2] }, ]; } else if (period === '周' && than === '同比') { items = [