|
@@ -36,6 +36,8 @@ export default { |
|
|
isFullscreen: false, |
|
|
isFullscreen: false, |
|
|
actualOptions: null, |
|
|
actualOptions: null, |
|
|
chart: "", |
|
|
chart: "", |
|
|
|
|
|
data: [], |
|
|
|
|
|
orderXAxis:[], |
|
|
// obj:{ |
|
|
// obj:{ |
|
|
// seriesArr: [], |
|
|
// seriesArr: [], |
|
|
// targetProduceArr: [], |
|
|
// targetProduceArr: [], |
|
@@ -50,7 +52,7 @@ export default { |
|
|
grid: { |
|
|
grid: { |
|
|
left: "7%", |
|
|
left: "7%", |
|
|
right: "7%", |
|
|
right: "7%", |
|
|
bottom: "8%", |
|
|
|
|
|
|
|
|
bottom: "15%", |
|
|
top: "15%", |
|
|
top: "15%", |
|
|
}, |
|
|
}, |
|
|
tooltip: { |
|
|
tooltip: { |
|
@@ -66,6 +68,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
axisLabel: { |
|
|
axisLabel: { |
|
|
|
|
|
rotate:45, |
|
|
color: "rgba(255, 255, 255, 0.7)", |
|
|
color: "rgba(255, 255, 255, 0.7)", |
|
|
fontSize: 12, |
|
|
fontSize: 12, |
|
|
}, |
|
|
}, |
|
@@ -191,7 +194,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
|
type(val) { |
|
|
type(val) { |
|
|
|
|
|
|
|
|
|
|
|
this.initChart() |
|
|
}, |
|
|
}, |
|
|
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */ |
|
|
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */ |
|
|
// isFullscreen(val) { |
|
|
// isFullscreen(val) { |
|
@@ -249,79 +252,62 @@ export default { |
|
|
}, 500)(); |
|
|
}, 500)(); |
|
|
}, |
|
|
}, |
|
|
initChart() { |
|
|
initChart() { |
|
|
if (this.chart) { |
|
|
|
|
|
this.chart.dispose(); |
|
|
|
|
|
} |
|
|
|
|
|
this.chart = echarts.init(document.getElementById("factoryEnergyChart")); |
|
|
|
|
|
const actualOptions = JSON.parse(JSON.stringify(this.options)); |
|
|
|
|
|
if (this.type === '目标产量') { |
|
|
if (this.type === '目标产量') { |
|
|
let orderXAxis = [] |
|
|
|
|
|
let targetProduceArr = [] |
|
|
|
|
|
|
|
|
this.orderXAxis = [] |
|
|
|
|
|
this.data = [] |
|
|
if (this.energyCockpits) { |
|
|
if (this.energyCockpits) { |
|
|
this.energyCockpits.forEach(ele => { |
|
|
this.energyCockpits.forEach(ele => { |
|
|
targetProduceArr.push(ele.targetProduction) |
|
|
|
|
|
orderXAxis.push(ele.workOrderNumber) |
|
|
|
|
|
|
|
|
this.data.push(ele.targetProduction) |
|
|
|
|
|
this.orderXAxis.push(ele.workOrderNumber) |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
actualOptions.xAxis.data = orderXAxis; |
|
|
|
|
|
actualOptions.series[0].data = targetProduceArr; |
|
|
|
|
|
// this.initChart(targetProduceArr, orderXAxis) |
|
|
// this.initChart(targetProduceArr, orderXAxis) |
|
|
} else if (this.type === '计划投入') { |
|
|
} else if (this.type === '计划投入') { |
|
|
let orderXAxis = [] |
|
|
|
|
|
let planIn = [] |
|
|
|
|
|
|
|
|
this.orderXAxis = [] |
|
|
|
|
|
this.data = [] |
|
|
if (this.energyCockpits) { |
|
|
if (this.energyCockpits) { |
|
|
this.energyCockpits.forEach(ele => { |
|
|
this.energyCockpits.forEach(ele => { |
|
|
planIn.push(ele.plannedInvestment) |
|
|
|
|
|
orderXAxis.push(ele.workOrderNumber) |
|
|
|
|
|
|
|
|
this.data.push(ele.plannedInvestment) |
|
|
|
|
|
this.orderXAxis.push(ele.workOrderNumber) |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
actualOptions.xAxis.data = orderXAxis; |
|
|
|
|
|
actualOptions.series[0].data = planIn; |
|
|
|
|
|
} else if (this.type === '实际投入') { |
|
|
} else if (this.type === '实际投入') { |
|
|
let orderXAxis = [] |
|
|
|
|
|
let acIn = [] |
|
|
|
|
|
|
|
|
this.orderXAxis = [] |
|
|
|
|
|
this.data = [] |
|
|
if (this.energyCockpits) { |
|
|
if (this.energyCockpits) { |
|
|
this.energyCockpits.forEach(ele => { |
|
|
this.energyCockpits.forEach(ele => { |
|
|
acIn.push(ele.actualInvestment) |
|
|
|
|
|
orderXAxis.push(ele.workOrderNumber) |
|
|
|
|
|
|
|
|
this.data.push(ele.actualInvestment) |
|
|
|
|
|
this.orderXAxis.push(ele.workOrderNumber) |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
actualOptions.xAxis.data = orderXAxis; |
|
|
|
|
|
actualOptions.series[0].data = acIn; |
|
|
|
|
|
} else if (this.type === '实际产出') { |
|
|
} else if (this.type === '实际产出') { |
|
|
let orderXAxis = [] |
|
|
|
|
|
let acProduceArr = [] |
|
|
|
|
|
|
|
|
this.orderXAxis = [] |
|
|
|
|
|
this.data = [] |
|
|
if (this.energyCockpits) { |
|
|
if (this.energyCockpits) { |
|
|
this.energyCockpits.forEach(ele => { |
|
|
this.energyCockpits.forEach(ele => { |
|
|
acProduceArr.push(ele.actualProduction) |
|
|
|
|
|
orderXAxis.push(ele.workOrderNumber) |
|
|
|
|
|
|
|
|
this.data.push(ele.actualProduction) |
|
|
|
|
|
this.orderXAxis.push(ele.workOrderNumber) |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
actualOptions.xAxis.data = orderXAxis; |
|
|
|
|
|
actualOptions.series[0].data = acProduceArr; |
|
|
|
|
|
} else if (this.type === '废品数量') { |
|
|
} else if (this.type === '废品数量') { |
|
|
let orderXAxis = [] |
|
|
|
|
|
let scrapNum = [] |
|
|
|
|
|
|
|
|
this.orderXAxis = [] |
|
|
|
|
|
this.data = [] |
|
|
if (this.energyCockpits) { |
|
|
if (this.energyCockpits) { |
|
|
this.energyCockpits.forEach(ele => { |
|
|
this.energyCockpits.forEach(ele => { |
|
|
scrapNum.push(ele.wasteNum) |
|
|
|
|
|
orderXAxis.push(ele.workOrderNumber) |
|
|
|
|
|
|
|
|
this.data.push(ele.wasteNum) |
|
|
|
|
|
this.orderXAxis.push(ele.workOrderNumber) |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
actualOptions.xAxis.data = orderXAxis; |
|
|
|
|
|
actualOptions.series[0].data = scrapNum; |
|
|
|
|
|
} else if (this.type === '待再加工') { |
|
|
} else if (this.type === '待再加工') { |
|
|
let orderXAxis = [] |
|
|
|
|
|
let processNum = [] |
|
|
|
|
|
|
|
|
this.orderXAxis = [] |
|
|
|
|
|
this.data = [] |
|
|
if (this.energyCockpits) { |
|
|
if (this.energyCockpits) { |
|
|
this.energyCockpits.forEach(ele => { |
|
|
this.energyCockpits.forEach(ele => { |
|
|
console.log(ele.reworkNum); |
|
|
console.log(ele.reworkNum); |
|
|
processNum.push(ele.reworkNum) |
|
|
|
|
|
orderXAxis.push(ele.workOrderNumber) |
|
|
|
|
|
|
|
|
this.data.push(ele.reworkNum) |
|
|
|
|
|
this.orderXAxis.push(ele.workOrderNumber) |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
actualOptions.xAxis.data = orderXAxis; |
|
|
|
|
|
actualOptions.series[0].data = processNum; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// let seriesArr = [ |
|
|
// let seriesArr = [ |
|
@@ -370,6 +356,13 @@ export default { |
|
|
// actualOptions.series[1].name = seriesArr[1].name; |
|
|
// actualOptions.series[1].name = seriesArr[1].name; |
|
|
// actualOptions.series[2].data = seriesArr[2].data; |
|
|
// actualOptions.series[2].data = seriesArr[2].data; |
|
|
// actualOptions.series[2].name = seriesArr[2].name; |
|
|
// actualOptions.series[2].name = seriesArr[2].name; |
|
|
|
|
|
if (this.chart) { |
|
|
|
|
|
this.chart.dispose(); |
|
|
|
|
|
} |
|
|
|
|
|
this.chart = echarts.init(document.getElementById("factoryEnergyChart")); |
|
|
|
|
|
const actualOptions = JSON.parse(JSON.stringify(this.options)); |
|
|
|
|
|
actualOptions.xAxis.data = this.orderXAxis; |
|
|
|
|
|
actualOptions.series[0].data = this.data; |
|
|
this.actualOptions = actualOptions; |
|
|
this.actualOptions = actualOptions; |
|
|
this.chart.setOption(actualOptions); |
|
|
this.chart.setOption(actualOptions); |
|
|
}, |
|
|
}, |
|
|