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/components/FactoryDataHeader.vue b/src/views/copilot/components/FactoryDataHeader.vue
index f6d1bfc..ea1ab77 100644
--- a/src/views/copilot/components/FactoryDataHeader.vue
+++ b/src/views/copilot/components/FactoryDataHeader.vue
@@ -63,14 +63,22 @@ export default {
computed: {},
methods: {
handleExport() {
- exportFactoryDataExcel({
- factoryId: this.companyId,
- timeSelection: this.period === 1 ? 0 : this.period === 2 ? 1 : this.period === 3 ? 2 : 3,
- compare: this.than === '同比' ? 1 : 2
- }).then(response => {
- this.$download.excel(response, `${this.companyName}生产数据.xls`);
- // this.exportLoading = false;
- }).catch(() => { });
+ if (this.period != 1) {
+ exportFactoryDataExcel({
+ factoryId: this.companyId,
+ timeSelection: this.period === 1 ? 0 : this.period === 2 ? 1 : this.period === 3 ? 2 : 3,
+ compare: this.than === '同比' ? 1 : 2
+ }).then(response => {
+ this.$download.excel(response, `${this.companyName}生产数据.xls`);
+ // this.exportLoading = false;
+ }).catch(() => { });
+ } else {
+ this.$message({
+ type: 'warning',
+ message: '为日的情况下没有导出功能',
+ })
+ }
+
},
toggleFullScreen() {
this.isFullscreen = !this.isFullscreen;
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 8d90011..cee0804 100644
--- a/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue
+++ b/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue
@@ -65,13 +65,13 @@ export default {
valueTuple() {
const getter = this.chipRate;
// console.log(getter)
- if (this.period === "日" || this.period === "周") {
- return [
- getter.previous[this.factoryId],
- getter.current[this.factoryId],
- 0,
- ];
- }
+ // if (this.period === "日" || this.period === "周") {
+ // return [
+ // getter.previous[this.factoryId],
+ // getter.current[this.factoryId],
+ // 0,
+ // ];
+ // }
// [100, 200, 200]
return [
getter.previous[this.factoryId],
@@ -105,21 +105,25 @@ export default {
items = [
{ label: `${yesterday}日良率`, },
{ label: `${year - 1}年${yesterday}日良率` },
+ { label: `${yesterday}日目标` },
];
} else if (this.period === '日' && this.than === '环比') {
items = [
{ label: `${yesterday}日良率` },
{ label: `${dayBeYes}日良率` },
+ { label: `${yesterday}日目标` },
];
} else if (this.period === '周' && this.than === '同比') {
items = [
{ label: `本周良率`, },
- { label: `${year-1}年本周良率` },
+ { label: `${year - 1}年本周良率` },
+ { label: `本周目标`, },
];
} else if (this.period === '周' && this.than === '环比') {
items = [
{ label: `本周良率`, },
{ label: `上周良率`, },
+ { label: `本周目标`, },
];
} else if (this.period === '月' && this.than === '同比') {
items = [
@@ -147,12 +151,13 @@ export default {
月: `${month}月良率`,
年: `${year}良率`,
}[this.period];
- console.log(vt[1]);
+ console.log(vt[0]);
const t = getOptions({
// single,
color: this.color == 1 ? "#4CF0E8" : "#1065ff",
titleValue,
subtitle,
+ yesterday,
currentName: items[0].label,
preName: items[1].label,
previousSum: vt[0],
@@ -182,22 +187,25 @@ export default {
items = [
{ label: `${year - 1}年${yesterday}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0]) ) + "%" },
{ label: `${yesterday}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
+ { label: `${yesterday}日目标`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" },
];
} else if (this.period === '日' && this.than === '环比') {
items = [
{ label: `${dayBeYes}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" },
{ label: `${yesterday}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
+ { label: `${yesterday}日目标`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" },
];
} else if (this.period === '周' && this.than === '同比') {
items = [
{ label: `${year-1}年本周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" },
{ label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
-
+ { label: `本周目标`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" },
];
} else if (this.period === '周' && this.than === '环比') {
items = [
{ label: `上周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" },
{ label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
+ { label: `本周目标`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" },
];
} else if (this.period === '月' && this.than === '同比') {
items = [
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 @@