工厂驾驶舱
This commit is contained in:
@@ -1,10 +1,3 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-21 10:13:48
|
||||
* @LastEditTime: 2024-05-24 15:03:11
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="factory-layout">
|
||||
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
|
||||
@@ -12,15 +5,21 @@
|
||||
<div class="factory-section">
|
||||
<section class="top flex">
|
||||
<db-container title="生产监控" icon="prod">
|
||||
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
|
||||
<prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
|
||||
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
|
||||
</db-container>
|
||||
<db-container title="订单监控" icon="order">
|
||||
<db-container title="工单监控" icon="order">
|
||||
<order :prodOrder="prodOrder" />
|
||||
</db-container>
|
||||
<!-- <db-container title="" icon="store"> -->
|
||||
<!-- <store :stock="stock" /> -->
|
||||
<!-- </db-container> -->
|
||||
</section>
|
||||
<!-- <section class="bottom flex"> -->
|
||||
<!-- <db-container title="" icon="energy"> -->
|
||||
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
|
||||
<!-- </db-container> -->
|
||||
<!-- </section> -->
|
||||
</div>
|
||||
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
|
||||
</div>
|
||||
@@ -29,8 +28,9 @@
|
||||
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
|
||||
import Container from "./components/Container.vue";
|
||||
import ProdMonitor from "./components/ProdMonitor.vue";
|
||||
import Store from "./components/Store.vue";
|
||||
import Energy from "./components/Energy.vue";
|
||||
import { deepClone } from "@/utils";
|
||||
// import Store from "./components/Store.vue";
|
||||
// import Energy from "./components/Energy.vue";
|
||||
import Order from "./components/Order.vue";
|
||||
import { cockpitDataMonitor } from "@/api/produceData";
|
||||
export default {
|
||||
@@ -39,21 +39,27 @@ export default {
|
||||
FactoryDataHeader,
|
||||
DbContainer: Container,
|
||||
ProdMonitor,
|
||||
Store,
|
||||
Energy,
|
||||
// Store,
|
||||
// Energy,
|
||||
Order,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
companyId: 6,
|
||||
than: '同比',
|
||||
companyName: "蚌埠中建材光电材料有限公司",
|
||||
period: 1,
|
||||
show:true,
|
||||
show: false,
|
||||
than: '同比',
|
||||
data: {},
|
||||
// 接口获取的数据
|
||||
prodOutPut: [], //生产
|
||||
prodFto: [], //生产
|
||||
stock: {}, //仓库
|
||||
factoryData: {
|
||||
preDataDetail: [],
|
||||
currentDataDetail: {},
|
||||
targetDataDetail: [],
|
||||
},
|
||||
energyCockpits: [], //能源
|
||||
prodOrder: [], //订单
|
||||
energyLegend: [
|
||||
@@ -67,16 +73,16 @@ export default {
|
||||
this.getMes();
|
||||
},
|
||||
methods: {
|
||||
updateThan(val) {
|
||||
console.log(val);
|
||||
this.than = val;
|
||||
// this.getMes();
|
||||
},
|
||||
updateCompany(obj) {
|
||||
this.companyId = obj.companyId;
|
||||
this.companyName = obj.companyName;
|
||||
this.getMes();
|
||||
},
|
||||
updateThan(val) {
|
||||
console.log(val);
|
||||
this.than = val;
|
||||
// this.getMes();
|
||||
},
|
||||
updatePeriod(val) {
|
||||
this.period = val;
|
||||
this.getMes();
|
||||
@@ -85,13 +91,77 @@ export default {
|
||||
cockpitDataMonitor({
|
||||
factorys: [this.companyId],
|
||||
date: this.period,
|
||||
mode: this.than === '同比' ? 0 : 1
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
|
||||
this.prodFto = res.data.prodOutputFtoDO || [];
|
||||
this.stock = res.data.stockDO || {};
|
||||
this.energyCockpits = res.data.energyCockpitsDO || [];
|
||||
this.prodOrder = res.data.prodOrderMonitorDO || [];
|
||||
this.prodOrder = res.data.prodWorkOrderDO || [];
|
||||
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
|
||||
let preFtoData = res.data.previousProdOutputFtoDO || [];
|
||||
let preData = res.data.previousProdOutputMonitorShDO || [];
|
||||
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
|
||||
let targetListResponse = res.data.prodTargetMonitorDO || [];
|
||||
let preDataDetail = []
|
||||
let currentDataDetail = []
|
||||
let targetDataDetail = []
|
||||
if (prodOutputFtoListRes) {
|
||||
for (const factory of prodOutputFtoListRes) {
|
||||
console.log(factory);
|
||||
currentDataDetail[0] = factory.chipInput
|
||||
}
|
||||
}
|
||||
if (preFtoData) {
|
||||
for (const factory of preFtoData) {
|
||||
console.log(factory);
|
||||
// const fId = this.getPreFactoryId(factory);
|
||||
// const preFId = getPreFactoryId(factory);
|
||||
// if (fId) {
|
||||
preDataDetail[0] = factory.previousYearChipInput
|
||||
// }
|
||||
// if (preFId) {
|
||||
// ftoInvest.previous[fId] = factory.previousYearChipInput;
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (preData && preData[0] != null) {
|
||||
for (const factory of preData) {
|
||||
if (factory.previousGlassType === 0) {
|
||||
preDataDetail[1] = factory.previousYearOutputNumber
|
||||
} else if (factory.previousGlassType === 1) {
|
||||
preDataDetail[2] = factory.previousYearOutputNumber
|
||||
} else if (factory.previousYearOutputNumber === 2) {
|
||||
currentDataDetail[3] = factory.outputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
if (targetListResponse && targetListResponse[0] != null) {
|
||||
for (const factory of targetListResponse) {
|
||||
targetDataDetail[0] = factory.ftoInput
|
||||
// if (factory.previousGlassType === 0) {
|
||||
targetDataDetail[1] = factory.chipYield
|
||||
// } else if (factory.previousGlassType === 1) {
|
||||
targetDataDetail[2] = factory.componentYield
|
||||
targetDataDetail[3] = factory.bipvProductoutput
|
||||
// }
|
||||
}
|
||||
}
|
||||
// console.log('ftoInvest',ftoInvest)
|
||||
if (factoryListResponse && factoryListResponse[0] != null) {
|
||||
for (const factory of factoryListResponse) {
|
||||
// targetDataDetail[0] = factory.ftoInput
|
||||
if (factory.glassType === 0) {
|
||||
currentDataDetail[1] = factory.outputNumber
|
||||
} else if (factory.glassType === 1) {
|
||||
currentDataDetail[2] = factory.outputNumber
|
||||
}else if (factory.glassType === 2) {
|
||||
currentDataDetail[3] = factory.outputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
this.factoryData.preDataDetail = preDataDetail
|
||||
this.factoryData.currentDataDetail = currentDataDetail
|
||||
this.factoryData.targetDataDetail = targetDataDetail
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -100,8 +170,7 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.factory-layout {
|
||||
padding: 16px;
|
||||
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100%
|
||||
no-repeat;
|
||||
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
|
||||
position: absolute;
|
||||
height: calc(100% + 38px);
|
||||
left: -16px;
|
||||
@@ -112,21 +181,25 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
|
||||
.factory-section {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
flex: 1;
|
||||
}
|
||||
.top > div,
|
||||
.bottom > div {
|
||||
|
||||
.top>div,
|
||||
.bottom>div {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.factory-footer {
|
||||
/** position: absolute;
|
||||
bottom: 10px; **/
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-21 10:13:36
|
||||
* @LastEditTime: 2024-05-24 15:03:16
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="factory-layout">
|
||||
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
|
||||
@@ -12,15 +5,21 @@
|
||||
<div class="factory-section">
|
||||
<section class="top flex">
|
||||
<db-container title="生产监控" icon="prod">
|
||||
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
|
||||
<prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
|
||||
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
|
||||
</db-container>
|
||||
<db-container title="订单监控" icon="order">
|
||||
<db-container title="工单监控" icon="order">
|
||||
<order :prodOrder="prodOrder" />
|
||||
</db-container>
|
||||
<!-- <db-container title="" icon="store"> -->
|
||||
<!-- <store :stock="stock" /> -->
|
||||
<!-- </db-container> -->
|
||||
</section>
|
||||
<!-- <section class="bottom flex"> -->
|
||||
<!-- <db-container title="" icon="energy"> -->
|
||||
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
|
||||
<!-- </db-container> -->
|
||||
<!-- </section> -->
|
||||
</div>
|
||||
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
|
||||
</div>
|
||||
@@ -29,8 +28,9 @@
|
||||
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
|
||||
import Container from "./components/Container.vue";
|
||||
import ProdMonitor from "./components/ProdMonitor.vue";
|
||||
import Store from "./components/Store.vue";
|
||||
import Energy from "./components/Energy.vue";
|
||||
import { deepClone } from "@/utils";
|
||||
// import Store from "./components/Store.vue";
|
||||
// import Energy from "./components/Energy.vue";
|
||||
import Order from "./components/Order.vue";
|
||||
import { cockpitDataMonitor } from "@/api/produceData";
|
||||
export default {
|
||||
@@ -39,8 +39,8 @@ export default {
|
||||
FactoryDataHeader,
|
||||
DbContainer: Container,
|
||||
ProdMonitor,
|
||||
Store,
|
||||
Energy,
|
||||
// Store,
|
||||
// Energy,
|
||||
Order,
|
||||
},
|
||||
data() {
|
||||
@@ -48,12 +48,18 @@ export default {
|
||||
companyId: 4,
|
||||
companyName: "成都中建材光电材料有限公司",
|
||||
period: 1,
|
||||
show: false,
|
||||
than: '同比',
|
||||
show: true,
|
||||
data: {},
|
||||
// 接口获取的数据
|
||||
prodOutPut: [], //生产
|
||||
prodFto: [], //生产
|
||||
stock: {}, //仓库
|
||||
factoryData: {
|
||||
preDataDetail: [],
|
||||
currentDataDetail: {},
|
||||
targetDataDetail: [],
|
||||
},
|
||||
energyCockpits: [], //能源
|
||||
prodOrder: [], //订单
|
||||
energyLegend: [
|
||||
@@ -67,16 +73,16 @@ export default {
|
||||
this.getMes();
|
||||
},
|
||||
methods: {
|
||||
updateThan(val) {
|
||||
console.log(val);
|
||||
this.than = val;
|
||||
// this.getMes();
|
||||
},
|
||||
updateCompany(obj) {
|
||||
this.companyId = obj.companyId;
|
||||
this.companyName = obj.companyName;
|
||||
this.getMes();
|
||||
},
|
||||
updateThan(val) {
|
||||
console.log(val);
|
||||
this.than = val;
|
||||
// this.getMes();
|
||||
},
|
||||
updatePeriod(val) {
|
||||
this.period = val;
|
||||
this.getMes();
|
||||
@@ -85,13 +91,77 @@ export default {
|
||||
cockpitDataMonitor({
|
||||
factorys: [this.companyId],
|
||||
date: this.period,
|
||||
mode: this.than === '同比' ? 0 : 1
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
|
||||
this.prodFto = res.data.prodOutputFtoDO || [];
|
||||
this.stock = res.data.stockDO || {};
|
||||
this.energyCockpits = res.data.energyCockpitsDO || [];
|
||||
this.prodOrder = res.data.prodOrderMonitorDO || [];
|
||||
this.prodOrder = res.data.prodWorkOrderDO || [];
|
||||
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
|
||||
let preFtoData = res.data.previousProdOutputFtoDO || [];
|
||||
let preData = res.data.previousProdOutputMonitorShDO || [];
|
||||
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
|
||||
let targetListResponse = res.data.prodTargetMonitorDO || [];
|
||||
let preDataDetail = []
|
||||
let currentDataDetail = []
|
||||
let targetDataDetail = []
|
||||
if (prodOutputFtoListRes) {
|
||||
for (const factory of prodOutputFtoListRes) {
|
||||
console.log(factory);
|
||||
currentDataDetail[0] = factory.chipInput
|
||||
}
|
||||
}
|
||||
if (preFtoData) {
|
||||
for (const factory of preFtoData) {
|
||||
console.log(factory);
|
||||
// const fId = this.getPreFactoryId(factory);
|
||||
// const preFId = getPreFactoryId(factory);
|
||||
// if (fId) {
|
||||
preDataDetail[0] = factory.previousYearChipInput
|
||||
// }
|
||||
// if (preFId) {
|
||||
// ftoInvest.previous[fId] = factory.previousYearChipInput;
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (preData && preData[0] != null) {
|
||||
for (const factory of preData) {
|
||||
if (factory.previousGlassType === 0) {
|
||||
preDataDetail[1] = factory.previousYearOutputNumber
|
||||
} else if (factory.previousGlassType === 1) {
|
||||
preDataDetail[2] = factory.previousYearOutputNumber
|
||||
} else if (factory.previousYearOutputNumber === 2) {
|
||||
currentDataDetail[3] = factory.outputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
if (targetListResponse && targetListResponse[0] != null) {
|
||||
for (const factory of targetListResponse) {
|
||||
targetDataDetail[0] = factory.ftoInput
|
||||
// if (factory.previousGlassType === 0) {
|
||||
targetDataDetail[1] = factory.chipYield
|
||||
// } else if (factory.previousGlassType === 1) {
|
||||
targetDataDetail[2] = factory.componentYield
|
||||
targetDataDetail[3] = factory.bipvProductoutput
|
||||
// }
|
||||
}
|
||||
}
|
||||
// console.log('ftoInvest',ftoInvest)
|
||||
if (factoryListResponse && factoryListResponse[0] != null) {
|
||||
for (const factory of factoryListResponse) {
|
||||
// targetDataDetail[0] = factory.ftoInput
|
||||
if (factory.glassType === 0) {
|
||||
currentDataDetail[1] = factory.outputNumber
|
||||
} else if (factory.glassType === 1) {
|
||||
currentDataDetail[2] = factory.outputNumber
|
||||
} else if (factory.glassType === 2) {
|
||||
currentDataDetail[3] = factory.outputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
this.factoryData.preDataDetail = preDataDetail
|
||||
this.factoryData.currentDataDetail = currentDataDetail
|
||||
this.factoryData.targetDataDetail = targetDataDetail
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -100,8 +170,7 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.factory-layout {
|
||||
padding: 16px;
|
||||
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100%
|
||||
no-repeat;
|
||||
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
|
||||
position: absolute;
|
||||
height: calc(100% + 38px);
|
||||
left: -16px;
|
||||
@@ -112,21 +181,25 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
|
||||
.factory-section {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
flex: 1;
|
||||
}
|
||||
.top > div,
|
||||
.bottom > div {
|
||||
|
||||
.top>div,
|
||||
.bottom>div {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.factory-footer {
|
||||
/** position: absolute;
|
||||
bottom: 10px; **/
|
||||
|
||||
@@ -134,10 +134,27 @@ export default {
|
||||
// { offset: 1, color: "#12FFF5" + "00" },
|
||||
// ]),
|
||||
// },
|
||||
barWidth: '18',
|
||||
barWidth: 12,
|
||||
itemStyle: {
|
||||
// barWidth: 2,
|
||||
color: '#12FFF5'
|
||||
borderRadius: [10, 10, 0, 0],
|
||||
color: {
|
||||
type: "linear",
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 1,
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: "#57abf8", // 0% 处的颜色
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: "#364BFE66", // 100% 处的颜色
|
||||
},
|
||||
],
|
||||
global: false, // 缺省为 false
|
||||
},
|
||||
},
|
||||
symbol: "circle",
|
||||
symbolSize: 8,
|
||||
@@ -211,15 +228,16 @@ export default {
|
||||
}, 500)();
|
||||
},
|
||||
initChart() {
|
||||
console.log("this.energyCockpits", this.energyCockpits);
|
||||
let orderXAxis = ['目标产量', '计划投入量', '实际投入量', '实际产出量', '废品数量', '待再加工数量'];
|
||||
// let n = 0;
|
||||
let seriesArr =[]
|
||||
seriesArr[0] = this.energyCockpits[0].targetProduction ? this.energyCockpits[0].targetProduction :0
|
||||
seriesArr[1] = this.energyCockpits[0].plannedInvestment ? this.energyCockpits[0].plannedInvestment : 0
|
||||
seriesArr[2] = this.energyCockpits[0].actualInvestment ? this.energyCockpits[0].actualInvestment : 0
|
||||
seriesArr[3] = this.energyCockpits[0].actualProduction ? this.energyCockpits[0].actualProduction : 0
|
||||
seriesArr[4] = this.energyCockpits[0].wasteNum ? this.energyCockpits[0].wasteNum : 0
|
||||
seriesArr[5] = this.energyCockpits[0].reworkNum ? this.energyCockpits[0].reworkNum : 0
|
||||
seriesArr[0] = this.energyCockpits.length != 0 && this.energyCockpits[0].targetProduction ? this.energyCockpits[0].targetProduction :0
|
||||
seriesArr[1] = this.energyCockpits.length != 0 && this.energyCockpits[0].plannedInvestment ? this.energyCockpits[0].plannedInvestment : 0
|
||||
seriesArr[2] = this.energyCockpits.length != 0 && this.energyCockpits[0].actualInvestment ? this.energyCockpits[0].actualInvestment : 0
|
||||
seriesArr[3] = this.energyCockpits.length != 0 && this.energyCockpits[0].actualProduction ? this.energyCockpits[0].actualProduction : 0
|
||||
seriesArr[4] = this.energyCockpits.length != 0 && this.energyCockpits[0].wasteNum ? this.energyCockpits[0].wasteNum : 0
|
||||
seriesArr[5] = this.energyCockpits.length != 0 && this.energyCockpits[0].reworkNum ? this.energyCockpits[0].reworkNum : 0
|
||||
console.log(seriesArr);
|
||||
|
||||
// let seriesArr = [
|
||||
|
||||
343
src/views/copilot/factoryData/components/BarChartChipOEE.vue
Normal file
343
src/views/copilot/factoryData/components/BarChartChipOEE.vue
Normal file
@@ -0,0 +1,343 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-30 08:58:39
|
||||
* @LastEditTime: 2024-05-30 10:38:32
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<chart-container class="bar-chart-base">
|
||||
<div class="legend">
|
||||
<span v-for="(item,index) in legend" :key="index" class="legend-item"
|
||||
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span>
|
||||
</div>
|
||||
<div ref="oeeChart" style="height:96%;width:100%"></div>
|
||||
</chart-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import screenfull from "screenfull";
|
||||
import ChartContainer from "./ChartContainer.vue";
|
||||
// import chartMixin from "@/mixins/chart.js";
|
||||
import { debounce } from "@/utils/debounce";
|
||||
import * as echarts from "echarts";
|
||||
export default {
|
||||
name: "BarChartBase",
|
||||
components: {
|
||||
ChartContainer,
|
||||
},
|
||||
// mixins: [chartMixin],
|
||||
props: {
|
||||
vHeight: {
|
||||
type: Number,
|
||||
default: 36,
|
||||
},
|
||||
legend: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
xAxis: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
series: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
in: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
width: '100%',
|
||||
isFullscreen: false,
|
||||
actualOptions: null,
|
||||
options: {
|
||||
grid: {
|
||||
left: "5%",
|
||||
right: "0%",
|
||||
bottom: "3%",
|
||||
top: "15%",
|
||||
containLabel: true,
|
||||
},
|
||||
tooltip: {},
|
||||
xAxis: {
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#4561AE",
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
fontSize: 12,
|
||||
},
|
||||
data: this.xAxis,
|
||||
},
|
||||
yAxis: {
|
||||
name: "单位/%",
|
||||
nameTextStyle: {
|
||||
color: "#fff",
|
||||
fontSize: 12,
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
fontSize: 12,
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: "#4561AE",
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: "#4561AE",
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "fto", // this.series[0].name,
|
||||
type: "bar",
|
||||
barWidth: 12,
|
||||
itemStyle: {
|
||||
borderRadius: [10, 10, 0, 0],
|
||||
color: {
|
||||
type: "linear",
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 1,
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: "#12f7f1", // 0% 处的颜色
|
||||
},
|
||||
{
|
||||
offset: 0.35,
|
||||
color: "#12f7f177", // 100% 处的颜色
|
||||
},
|
||||
{
|
||||
offset: 0.75,
|
||||
color: "#12f7f133", // 100% 处的颜色
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: "transparent", // 100% 处的颜色
|
||||
},
|
||||
],
|
||||
global: false, // 缺省为 false
|
||||
},
|
||||
},
|
||||
data: [], // this.series[0].data,
|
||||
},
|
||||
{
|
||||
name: "", // this.series[1].name,
|
||||
type: "bar",
|
||||
barWidth: 12,
|
||||
// tooltip: {
|
||||
// valueFormatter: function (value) {
|
||||
// return value + " ml";
|
||||
// },
|
||||
// },
|
||||
itemStyle: {
|
||||
borderRadius: [10, 10, 0, 0],
|
||||
color: {
|
||||
type: "linear",
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 1,
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: "#57abf8", // 0% 处的颜色
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: "#364BFE66", // 100% 处的颜色
|
||||
},
|
||||
],
|
||||
global: false, // 缺省为 false
|
||||
},
|
||||
},
|
||||
data: [], // this.series[1].data,
|
||||
},
|
||||
{
|
||||
name: "", // "2024年目标值",
|
||||
type: "bar",
|
||||
barWidth: 12,
|
||||
itemStyle: {
|
||||
borderRadius: [10, 10, 0, 0],
|
||||
color: {
|
||||
type: "linear",
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 1,
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: "#f3c000", // 0% 处的颜色
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: "#f3c00033",
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: "transparent", // 100% 处的颜色
|
||||
},
|
||||
],
|
||||
global: false, // 缺省为 false
|
||||
},
|
||||
},
|
||||
data: [], // this.series[0].data,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isOpen() {
|
||||
return this.$store.getters.sidebar.opened
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
xAxis(val) {
|
||||
this.options.xAxis.data = val
|
||||
this.canvasReset()
|
||||
},
|
||||
isOpen(val) {
|
||||
this.canvasReset()
|
||||
},
|
||||
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */
|
||||
isFullscreen(val) {
|
||||
this.actualOptions.series.map((item) => {
|
||||
item.barWidth = val ? 18 : 12;
|
||||
});
|
||||
this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
|
||||
this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
|
||||
this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
|
||||
// if (val === false && this.isOpen === true) {
|
||||
// console.log(val)
|
||||
// this.width = 97 + '%'
|
||||
// this.canvasReset()
|
||||
// } else if (val === false && this.isOpen === false) {
|
||||
// this.width = 100 + '%'
|
||||
// this.canvasReset()
|
||||
// }
|
||||
// this.actualOptions.series.map((item) => {
|
||||
// item.barWidth = val ? 18 : 12;
|
||||
// });
|
||||
// this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
|
||||
// this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
|
||||
// this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
|
||||
this.initChart(this.actualOptions)
|
||||
this.canvasReset()
|
||||
},
|
||||
series(val) {
|
||||
if (!val) {
|
||||
this.initChart(this.options);
|
||||
return;
|
||||
}
|
||||
// console.log('val', val)
|
||||
const actualOptions = JSON.parse(JSON.stringify(this.options))
|
||||
// actualOptions.xAxis.data = val
|
||||
console.log(actualOptions)
|
||||
actualOptions.series[0].data = val[0].data;
|
||||
actualOptions.series[0].name = val[0].name;
|
||||
actualOptions.series[1].data = val?.[1]?.data;
|
||||
actualOptions.series[1].name = val?.[1]?.name;
|
||||
actualOptions.series[2].data = val?.[2]?.data || [];
|
||||
actualOptions.series[2].name = val?.[2]?.name || "";
|
||||
this.actualOptions = actualOptions;
|
||||
this.initChart(actualOptions);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// if (screenfull.isEnabled) {
|
||||
// screenfull.on("change", () => {
|
||||
// this.isFullscreen = screenfull.isFullscreen;
|
||||
// });
|
||||
// }
|
||||
// if (screenfull.isEnabled) {
|
||||
// screenfull.on("change", () => {
|
||||
// this.isFullscreen = screenfull.isFullscreen;
|
||||
// });
|
||||
// }
|
||||
this.actualOptions = this.options
|
||||
this.canvasReset();
|
||||
window.addEventListener("resize", this.canvasReset);
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.chart) {
|
||||
this.chart.dispose();
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener("resize", this.canvasReset);
|
||||
},
|
||||
methods: {
|
||||
canvasReset() {
|
||||
debounce(() => {
|
||||
this.initChart();
|
||||
}, 500)();
|
||||
},
|
||||
initChart() {
|
||||
if (this.chart) {
|
||||
this.chart.dispose();
|
||||
}
|
||||
this.chart = echarts.init(this.$refs.oeeChart);
|
||||
this.chart.setOption(this.actualOptions);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.bar-chart-base {
|
||||
// position: relative;
|
||||
|
||||
.legend {
|
||||
position: absolute;
|
||||
top: 5.2vh;
|
||||
right: 1vw;
|
||||
}
|
||||
|
||||
.legend-item {
|
||||
position: relative;
|
||||
// font-size: 12px;
|
||||
margin-right: 1.3vw;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
width: 0.531vw;
|
||||
height: 0.531vw;
|
||||
background-color: #ccc;
|
||||
border-radius: 2px;
|
||||
margin-right: 0.22vw;
|
||||
}
|
||||
}
|
||||
|
||||
.legend-item:nth-child(1):before {
|
||||
background-color: #12f7f1;
|
||||
}
|
||||
|
||||
.legend-item:nth-child(2):before {
|
||||
background-color: #58adfa;
|
||||
}
|
||||
.legend-item:nth-child(3):before {
|
||||
background-color: #f3c000;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
69
src/views/copilot/factoryData/components/ChartContainer.vue
Normal file
69
src/views/copilot/factoryData/components/ChartContainer.vue
Normal file
@@ -0,0 +1,69 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-30 09:00:01
|
||||
* @LastEditTime: 2024-05-30 09:50:02
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="chart-container" :class="{ 'no-scroll': noScroll }">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ChartContainer",
|
||||
components: {},
|
||||
props: {
|
||||
noScroll: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.chart-container {
|
||||
height: 0;
|
||||
flex: 1;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
|
||||
.no-scroll::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-button {
|
||||
width: 0;
|
||||
height: 0;
|
||||
// width: 10px;
|
||||
// height: 10px;
|
||||
// background: #14305f;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: #14305f;
|
||||
border: 0 none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #004798;
|
||||
border: 0 none;
|
||||
border-radius: 6px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-29 14:48:06
|
||||
* @LastEditTime: 2024-05-29 14:58:51
|
||||
* @LastEditTime: 2024-05-30 10:54:00
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BarChartBase from "@/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue";
|
||||
import BarChartBase from "./BarChartChipOEE.vue";
|
||||
export default {
|
||||
name: "ChipOEE",
|
||||
components: { BarChartBase },
|
||||
@@ -30,6 +30,10 @@ export default {
|
||||
type: String,
|
||||
default: "同比",
|
||||
},
|
||||
companyId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
default:{}
|
||||
@@ -37,12 +41,16 @@ export default {
|
||||
},
|
||||
data() {
|
||||
// 城市数组的顺序必须是固定的
|
||||
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"];
|
||||
const cities = ["fto投入", "芯片产量", "标准组件产量"];
|
||||
return {
|
||||
xAxis: cities,
|
||||
// xAxis: cities,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
xAxis() {
|
||||
console.log(' this.companyId', this.companyId);
|
||||
return this.companyId === 0 ? ["fto投入", "芯片产量", "标准组件产量"] : ["fto投入", "芯片产量", "标准组件产量", 'BIPV产量'];
|
||||
},
|
||||
legend() {
|
||||
let items = [];
|
||||
var day1 = new Date();
|
||||
@@ -95,7 +103,7 @@ export default {
|
||||
items = [
|
||||
{ label: `${year - 1}年`, color: "#12f7f1" },
|
||||
{ label: `${year}年`, color: "#58adfa" },
|
||||
{ label: `${year}年`, color: "#58adfa" },
|
||||
{ label: `${year}年目标`, color: "#58adfa" },
|
||||
|
||||
// { label: `${year}年目标`, value: valueTuple[2] },
|
||||
];
|
||||
@@ -133,24 +141,12 @@ export default {
|
||||
// },
|
||||
series() {
|
||||
// console.log('aaaaaaaa', this.$store.getters.copilot.efficiency.chipOee);
|
||||
const chipOeeRate = this.chipOeeRate
|
||||
// const chipOeeRate = this.data
|
||||
// console.log('chipOee', chipOeeRate)
|
||||
let dataList = null
|
||||
switch (this.period) {
|
||||
case 1:
|
||||
dataList = [];
|
||||
dataList[0] = chipOeeRate?.previous;
|
||||
dataList[1] = chipOeeRate?.current;
|
||||
case 2:
|
||||
dataList = [];
|
||||
dataList[0] = chipOeeRate?.previous;
|
||||
dataList[1] = chipOeeRate?.current;
|
||||
default:
|
||||
dataList = [];
|
||||
dataList[0] = chipOeeRate?.previous;
|
||||
dataList[1] = chipOeeRate?.current
|
||||
dataList[2] = chipOeeRate?.target
|
||||
}
|
||||
let dataList = []
|
||||
dataList[0] = this.data.preDataDetail
|
||||
dataList[1] = this.data.currentDataDetail
|
||||
dataList[2] = this.data.targetDataDetail
|
||||
console.log(dataList)
|
||||
return getTemplate(this.period, dataList,this.than);
|
||||
},
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bipv-box" v-if="showBipv">
|
||||
<div class="bipv-box" v-if="companyId != 0">
|
||||
<div class="icon">
|
||||
<img src="./../assets/images/bipv.png" alt="" style="width: 2.1875vw; height: 2.1875vw" />
|
||||
</div>
|
||||
@@ -120,11 +120,14 @@
|
||||
<span class="title">生产情况</span>
|
||||
<span class="line"></span>
|
||||
</div>
|
||||
<barChartBase :than="than" :period="period" :data="data" ref="barChart" style="height: 0;flex:1"></barChartBase>
|
||||
<barChartBase :companyId="companyId" :than="than" :period="period" :data="factoryData" ref="barChart"
|
||||
style="height: 0;flex:1">
|
||||
</barChartBase>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { number } from 'echarts';
|
||||
import barChartBase from './ChipOee'
|
||||
|
||||
export default {
|
||||
@@ -147,6 +150,10 @@ export default {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
companyId: {
|
||||
type: Number,
|
||||
default:0
|
||||
},
|
||||
than: {
|
||||
type: String,
|
||||
default: '同比',
|
||||
@@ -159,7 +166,7 @@ export default {
|
||||
type: Array,
|
||||
default: [],
|
||||
},
|
||||
data: {
|
||||
factoryData: {
|
||||
type: Object,
|
||||
default: {},
|
||||
},
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-21 09:25:42
|
||||
* @LastEditTime: 2024-05-24 15:03:21
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="factory-layout">
|
||||
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
|
||||
@@ -12,15 +5,21 @@
|
||||
<div class="factory-section">
|
||||
<section class="top flex">
|
||||
<db-container title="生产监控" icon="prod">
|
||||
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
|
||||
<prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
|
||||
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
|
||||
</db-container>
|
||||
<db-container title="订单监控" icon="order">
|
||||
<db-container title="工单监控" icon="order">
|
||||
<order :prodOrder="prodOrder" />
|
||||
</db-container>
|
||||
<!-- <db-container title="" icon="store"> -->
|
||||
<!-- <store :stock="stock" /> -->
|
||||
<!-- </db-container> -->
|
||||
</section>
|
||||
<!-- <section class="bottom flex"> -->
|
||||
<!-- <db-container title="" icon="energy"> -->
|
||||
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
|
||||
<!-- </db-container> -->
|
||||
<!-- </section> -->
|
||||
</div>
|
||||
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
|
||||
</div>
|
||||
@@ -29,8 +28,9 @@
|
||||
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
|
||||
import Container from "./components/Container.vue";
|
||||
import ProdMonitor from "./components/ProdMonitor.vue";
|
||||
import Store from "./components/Store.vue";
|
||||
import Energy from "./components/Energy.vue";
|
||||
import { deepClone } from "@/utils";
|
||||
// import Store from "./components/Store.vue";
|
||||
// import Energy from "./components/Energy.vue";
|
||||
import Order from "./components/Order.vue";
|
||||
import { cockpitDataMonitor } from "@/api/produceData";
|
||||
export default {
|
||||
@@ -39,8 +39,8 @@ export default {
|
||||
FactoryDataHeader,
|
||||
DbContainer: Container,
|
||||
ProdMonitor,
|
||||
Store,
|
||||
Energy,
|
||||
// Store,
|
||||
// Energy,
|
||||
Order,
|
||||
},
|
||||
data() {
|
||||
@@ -48,12 +48,18 @@ export default {
|
||||
companyId: 1,
|
||||
companyName: "邯郸中建材光电材料有限公司",
|
||||
period: 1,
|
||||
show: false,
|
||||
than: '同比',
|
||||
show: true,
|
||||
data: {},
|
||||
// 接口获取的数据
|
||||
prodOutPut: [], //生产
|
||||
prodFto: [], //生产
|
||||
stock: {}, //仓库
|
||||
factoryData: {
|
||||
preDataDetail: [],
|
||||
currentDataDetail: {},
|
||||
targetDataDetail: [],
|
||||
},
|
||||
energyCockpits: [], //能源
|
||||
prodOrder: [], //订单
|
||||
energyLegend: [
|
||||
@@ -67,16 +73,16 @@ export default {
|
||||
this.getMes();
|
||||
},
|
||||
methods: {
|
||||
updateThan(val) {
|
||||
console.log(val);
|
||||
this.than = val;
|
||||
// this.getMes();
|
||||
},
|
||||
updateCompany(obj) {
|
||||
this.companyId = obj.companyId;
|
||||
this.companyName = obj.companyName;
|
||||
this.getMes();
|
||||
},
|
||||
updateThan(val) {
|
||||
console.log(val);
|
||||
this.than = val;
|
||||
// this.getMes();
|
||||
},
|
||||
updatePeriod(val) {
|
||||
this.period = val;
|
||||
this.getMes();
|
||||
@@ -85,13 +91,77 @@ export default {
|
||||
cockpitDataMonitor({
|
||||
factorys: [this.companyId],
|
||||
date: this.period,
|
||||
mode: this.than === '同比' ? 0 : 1
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
|
||||
this.prodFto = res.data.prodOutputFtoDO || [];
|
||||
this.stock = res.data.stockDO || {};
|
||||
this.energyCockpits = res.data.energyCockpitsDO || [];
|
||||
this.prodOrder = res.data.prodOrderMonitorDO || [];
|
||||
this.prodOrder = res.data.prodWorkOrderDO || [];
|
||||
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
|
||||
let preFtoData = res.data.previousProdOutputFtoDO || [];
|
||||
let preData = res.data.previousProdOutputMonitorShDO || [];
|
||||
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
|
||||
let targetListResponse = res.data.prodTargetMonitorDO || [];
|
||||
let preDataDetail = []
|
||||
let currentDataDetail = []
|
||||
let targetDataDetail = []
|
||||
if (prodOutputFtoListRes) {
|
||||
for (const factory of prodOutputFtoListRes) {
|
||||
console.log(factory);
|
||||
currentDataDetail[0] = factory.chipInput
|
||||
}
|
||||
}
|
||||
if (preFtoData) {
|
||||
for (const factory of preFtoData) {
|
||||
console.log(factory);
|
||||
// const fId = this.getPreFactoryId(factory);
|
||||
// const preFId = getPreFactoryId(factory);
|
||||
// if (fId) {
|
||||
preDataDetail[0] = factory.previousYearChipInput
|
||||
// }
|
||||
// if (preFId) {
|
||||
// ftoInvest.previous[fId] = factory.previousYearChipInput;
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (preData && preData[0] != null) {
|
||||
for (const factory of preData) {
|
||||
if (factory.previousGlassType === 0) {
|
||||
preDataDetail[1] = factory.previousYearOutputNumber
|
||||
} else if (factory.previousGlassType === 1) {
|
||||
preDataDetail[2] = factory.previousYearOutputNumber
|
||||
} else if (factory.previousYearOutputNumber === 2) {
|
||||
currentDataDetail[3] = factory.outputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
if (targetListResponse && targetListResponse[0] != null) {
|
||||
for (const factory of targetListResponse) {
|
||||
targetDataDetail[0] = factory.ftoInput
|
||||
// if (factory.previousGlassType === 0) {
|
||||
targetDataDetail[1] = factory.chipYield
|
||||
// } else if (factory.previousGlassType === 1) {
|
||||
targetDataDetail[2] = factory.componentYield
|
||||
targetDataDetail[3] = factory.bipvProductoutput
|
||||
// }
|
||||
}
|
||||
}
|
||||
// console.log('ftoInvest',ftoInvest)
|
||||
if (factoryListResponse && factoryListResponse[0] != null) {
|
||||
for (const factory of factoryListResponse) {
|
||||
// targetDataDetail[0] = factory.ftoInput
|
||||
if (factory.glassType === 0) {
|
||||
currentDataDetail[1] = factory.outputNumber
|
||||
} else if (factory.glassType === 1) {
|
||||
currentDataDetail[2] = factory.outputNumber
|
||||
} else if (factory.glassType === 2) {
|
||||
currentDataDetail[3] = factory.outputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
this.factoryData.preDataDetail = preDataDetail
|
||||
this.factoryData.currentDataDetail = currentDataDetail
|
||||
this.factoryData.targetDataDetail = targetDataDetail
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -100,8 +170,7 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.factory-layout {
|
||||
padding: 16px;
|
||||
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100%
|
||||
no-repeat;
|
||||
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
|
||||
position: absolute;
|
||||
height: calc(100% + 38px);
|
||||
left: -16px;
|
||||
@@ -112,21 +181,25 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
|
||||
.factory-section {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
flex: 1;
|
||||
}
|
||||
.top > div,
|
||||
.bottom > div {
|
||||
|
||||
.top>div,
|
||||
.bottom>div {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.factory-footer {
|
||||
/** position: absolute;
|
||||
bottom: 10px; **/
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<div class="factory-section">
|
||||
<section class="top flex">
|
||||
<db-container title="生产监控" icon="prod">
|
||||
<prod-monitor :than="than" :period="period" :data="data" :prodOutPut="prodOutPut" :prodFto="prodFto"
|
||||
:showBipv="show" />
|
||||
<prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
|
||||
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
|
||||
</db-container>
|
||||
<db-container title="工单监控" icon="order">
|
||||
<order :prodOrder="prodOrder" />
|
||||
@@ -28,6 +28,7 @@
|
||||
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
|
||||
import Container from "./components/Container.vue";
|
||||
import ProdMonitor from "./components/ProdMonitor.vue";
|
||||
import { deepClone } from "@/utils";
|
||||
// import Store from "./components/Store.vue";
|
||||
// import Energy from "./components/Energy.vue";
|
||||
import Order from "./components/Order.vue";
|
||||
@@ -54,6 +55,11 @@ export default {
|
||||
prodOutPut: [], //生产
|
||||
prodFto: [], //生产
|
||||
stock: {}, //仓库
|
||||
factoryData: {
|
||||
preDataDetail: [],
|
||||
currentDataDetail: {},
|
||||
targetDataDetail: [],
|
||||
},
|
||||
energyCockpits: [], //能源
|
||||
prodOrder: [], //订单
|
||||
energyLegend: [
|
||||
@@ -90,9 +96,69 @@ export default {
|
||||
console.log(res);
|
||||
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
|
||||
this.prodFto = res.data.prodOutputFtoDO || [];
|
||||
this.stock = res.data.stockDO || {};
|
||||
this.energyCockpits = res.data.energyCockpitsDO || [];
|
||||
this.prodOrder = res.data.prodWorkOrderDO || [];
|
||||
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
|
||||
let preFtoData = res.data.previousProdOutputFtoDO || [];
|
||||
let preData = res.data.previousProdOutputMonitorShDO || [];
|
||||
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
|
||||
let targetListResponse = res.data.prodTargetMonitorDO || [];
|
||||
let preDataDetail = []
|
||||
let currentDataDetail = []
|
||||
let targetDataDetail = []
|
||||
if (prodOutputFtoListRes) {
|
||||
for (const factory of prodOutputFtoListRes) {
|
||||
console.log(factory);
|
||||
currentDataDetail[0] = factory.chipInput
|
||||
}
|
||||
}
|
||||
if (preFtoData) {
|
||||
for (const factory of preFtoData) {
|
||||
console.log(factory);
|
||||
// const fId = this.getPreFactoryId(factory);
|
||||
// const preFId = getPreFactoryId(factory);
|
||||
// if (fId) {
|
||||
preDataDetail[0] = factory.previousYearChipInput
|
||||
// }
|
||||
// if (preFId) {
|
||||
// ftoInvest.previous[fId] = factory.previousYearChipInput;
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (preData && preData[0] != null) {
|
||||
for (const factory of preData) {
|
||||
if (factory.previousGlassType === 0) {
|
||||
preDataDetail[1] = factory.previousYearOutputNumber
|
||||
} else if (factory.previousGlassType === 1) {
|
||||
preDataDetail[2] = factory.previousYearOutputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
if (targetListResponse && targetListResponse[0] != null) {
|
||||
for (const factory of targetListResponse) {
|
||||
targetDataDetail[0] = factory.ftoInput
|
||||
// if (factory.previousGlassType === 0) {
|
||||
targetDataDetail[1] = factory.chipYield
|
||||
// } else if (factory.previousGlassType === 1) {
|
||||
targetDataDetail[2] = factory.componentYield
|
||||
|
||||
// }
|
||||
}
|
||||
}
|
||||
// console.log('ftoInvest',ftoInvest)
|
||||
if (factoryListResponse && factoryListResponse[0] != null) {
|
||||
for (const factory of factoryListResponse) {
|
||||
// targetDataDetail[0] = factory.ftoInput
|
||||
if (factory.glassType === 0) {
|
||||
currentDataDetail[1] = factory.outputNumber
|
||||
} else if (factory.glassType === 1) {
|
||||
currentDataDetail[2] = factory.outputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
this.factoryData.preDataDetail = preDataDetail
|
||||
this.factoryData.currentDataDetail = currentDataDetail
|
||||
this.factoryData.targetDataDetail = targetDataDetail
|
||||
console.log(' this.factoryData', this.factoryData);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-21 10:13:30
|
||||
* @LastEditTime: 2024-05-24 15:03:26
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="factory-layout">
|
||||
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
|
||||
@@ -12,15 +5,21 @@
|
||||
<div class="factory-section">
|
||||
<section class="top flex">
|
||||
<db-container title="生产监控" icon="prod">
|
||||
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
|
||||
<prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
|
||||
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
|
||||
</db-container>
|
||||
<db-container title="订单监控" icon="order">
|
||||
<db-container title="工单监控" icon="order">
|
||||
<order :prodOrder="prodOrder" />
|
||||
</db-container>
|
||||
<!-- <db-container title="" icon="store"> -->
|
||||
<!-- <store :stock="stock" /> -->
|
||||
<!-- </db-container> -->
|
||||
</section>
|
||||
<!-- <section class="bottom flex"> -->
|
||||
<!-- <db-container title="" icon="energy"> -->
|
||||
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
|
||||
<!-- </db-container> -->
|
||||
<!-- </section> -->
|
||||
</div>
|
||||
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
|
||||
</div>
|
||||
@@ -29,8 +28,9 @@
|
||||
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
|
||||
import Container from "./components/Container.vue";
|
||||
import ProdMonitor from "./components/ProdMonitor.vue";
|
||||
import Store from "./components/Store.vue";
|
||||
import Energy from "./components/Energy.vue";
|
||||
import { deepClone } from "@/utils";
|
||||
// import Store from "./components/Store.vue";
|
||||
// import Energy from "./components/Energy.vue";
|
||||
import Order from "./components/Order.vue";
|
||||
import { cockpitDataMonitor } from "@/api/produceData";
|
||||
export default {
|
||||
@@ -39,8 +39,8 @@ export default {
|
||||
FactoryDataHeader,
|
||||
DbContainer: Container,
|
||||
ProdMonitor,
|
||||
Store,
|
||||
Energy,
|
||||
// Store,
|
||||
// Energy,
|
||||
Order,
|
||||
},
|
||||
data() {
|
||||
@@ -48,12 +48,18 @@ export default {
|
||||
companyId: 3,
|
||||
companyName: "佳木斯中建材光电材料有限公司",
|
||||
period: 1,
|
||||
show: false,
|
||||
than: '同比',
|
||||
show: true,
|
||||
data: {},
|
||||
// 接口获取的数据
|
||||
prodOutPut: [], //生产
|
||||
prodFto: [], //生产
|
||||
stock: {}, //仓库
|
||||
factoryData: {
|
||||
preDataDetail: [],
|
||||
currentDataDetail: {},
|
||||
targetDataDetail: [],
|
||||
},
|
||||
energyCockpits: [], //能源
|
||||
prodOrder: [], //订单
|
||||
energyLegend: [
|
||||
@@ -67,16 +73,16 @@ export default {
|
||||
this.getMes();
|
||||
},
|
||||
methods: {
|
||||
updateThan(val) {
|
||||
console.log(val);
|
||||
this.than = val;
|
||||
// this.getMes();
|
||||
},
|
||||
updateCompany(obj) {
|
||||
this.companyId = obj.companyId;
|
||||
this.companyName = obj.companyName;
|
||||
this.getMes();
|
||||
},
|
||||
updateThan(val) {
|
||||
console.log(val);
|
||||
this.than = val;
|
||||
// this.getMes();
|
||||
},
|
||||
updatePeriod(val) {
|
||||
this.period = val;
|
||||
this.getMes();
|
||||
@@ -85,13 +91,77 @@ export default {
|
||||
cockpitDataMonitor({
|
||||
factorys: [this.companyId],
|
||||
date: this.period,
|
||||
mode: this.than === '同比' ? 0 : 1
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
|
||||
this.prodFto = res.data.prodOutputFtoDO || [];
|
||||
this.stock = res.data.stockDO || {};
|
||||
this.energyCockpits = res.data.energyCockpitsDO || [];
|
||||
this.prodOrder = res.data.prodOrderMonitorDO || [];
|
||||
this.prodOrder = res.data.prodWorkOrderDO || [];
|
||||
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
|
||||
let preFtoData = res.data.previousProdOutputFtoDO || [];
|
||||
let preData = res.data.previousProdOutputMonitorShDO || [];
|
||||
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
|
||||
let targetListResponse = res.data.prodTargetMonitorDO || [];
|
||||
let preDataDetail = []
|
||||
let currentDataDetail = []
|
||||
let targetDataDetail = []
|
||||
if (prodOutputFtoListRes) {
|
||||
for (const factory of prodOutputFtoListRes) {
|
||||
console.log(factory);
|
||||
currentDataDetail[0] = factory.chipInput
|
||||
}
|
||||
}
|
||||
if (preFtoData) {
|
||||
for (const factory of preFtoData) {
|
||||
console.log(factory);
|
||||
// const fId = this.getPreFactoryId(factory);
|
||||
// const preFId = getPreFactoryId(factory);
|
||||
// if (fId) {
|
||||
preDataDetail[0] = factory.previousYearChipInput
|
||||
// }
|
||||
// if (preFId) {
|
||||
// ftoInvest.previous[fId] = factory.previousYearChipInput;
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (preData && preData[0] != null) {
|
||||
for (const factory of preData) {
|
||||
if (factory.previousGlassType === 0) {
|
||||
preDataDetail[1] = factory.previousYearOutputNumber
|
||||
} else if (factory.previousGlassType === 1) {
|
||||
preDataDetail[2] = factory.previousYearOutputNumber
|
||||
} else if (factory.previousYearOutputNumber === 2) {
|
||||
currentDataDetail[3] = factory.outputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
if (targetListResponse && targetListResponse[0] != null) {
|
||||
for (const factory of targetListResponse) {
|
||||
targetDataDetail[0] = factory.ftoInput
|
||||
// if (factory.previousGlassType === 0) {
|
||||
targetDataDetail[1] = factory.chipYield
|
||||
// } else if (factory.previousGlassType === 1) {
|
||||
targetDataDetail[2] = factory.componentYield
|
||||
targetDataDetail[3] = factory.bipvProductoutput
|
||||
// }
|
||||
}
|
||||
}
|
||||
// console.log('ftoInvest',ftoInvest)
|
||||
if (factoryListResponse && factoryListResponse[0] != null) {
|
||||
for (const factory of factoryListResponse) {
|
||||
// targetDataDetail[0] = factory.ftoInput
|
||||
if (factory.glassType === 0) {
|
||||
currentDataDetail[1] = factory.outputNumber
|
||||
} else if (factory.glassType === 1) {
|
||||
currentDataDetail[2] = factory.outputNumber
|
||||
} else if (factory.glassType === 2) {
|
||||
currentDataDetail[3] = factory.outputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
this.factoryData.preDataDetail = preDataDetail
|
||||
this.factoryData.currentDataDetail = currentDataDetail
|
||||
this.factoryData.targetDataDetail = targetDataDetail
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -100,8 +170,7 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.factory-layout {
|
||||
padding: 16px;
|
||||
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100%
|
||||
no-repeat;
|
||||
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
|
||||
position: absolute;
|
||||
height: calc(100% + 38px);
|
||||
left: -16px;
|
||||
@@ -112,21 +181,25 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
|
||||
.factory-section {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
flex: 1;
|
||||
}
|
||||
.top > div,
|
||||
.bottom > div {
|
||||
|
||||
.top>div,
|
||||
.bottom>div {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.factory-footer {
|
||||
/** position: absolute;
|
||||
bottom: 10px; **/
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-21 10:13:45
|
||||
* @LastEditTime: 2024-05-24 15:03:31
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="factory-layout">
|
||||
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
|
||||
@@ -12,15 +5,21 @@
|
||||
<div class="factory-section">
|
||||
<section class="top flex">
|
||||
<db-container title="生产监控" icon="prod">
|
||||
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
|
||||
<prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
|
||||
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
|
||||
</db-container>
|
||||
<db-container title="订单监控" icon="order">
|
||||
<db-container title="工单监控" icon="order">
|
||||
<order :prodOrder="prodOrder" />
|
||||
</db-container>
|
||||
<!-- <db-container title="" icon="store"> -->
|
||||
<!-- <store :stock="stock" /> -->
|
||||
<!-- </db-container> -->
|
||||
</section>
|
||||
<!-- <section class="bottom flex"> -->
|
||||
<!-- <db-container title="" icon="energy"> -->
|
||||
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
|
||||
<!-- </db-container> -->
|
||||
<!-- </section> -->
|
||||
</div>
|
||||
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
|
||||
</div>
|
||||
@@ -29,8 +28,9 @@
|
||||
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
|
||||
import Container from "./components/Container.vue";
|
||||
import ProdMonitor from "./components/ProdMonitor.vue";
|
||||
import Store from "./components/Store.vue";
|
||||
import Energy from "./components/Energy.vue";
|
||||
import { deepClone } from "@/utils";
|
||||
// import Store from "./components/Store.vue";
|
||||
// import Energy from "./components/Energy.vue";
|
||||
import Order from "./components/Order.vue";
|
||||
import { cockpitDataMonitor } from "@/api/produceData";
|
||||
export default {
|
||||
@@ -39,8 +39,8 @@ export default {
|
||||
FactoryDataHeader,
|
||||
DbContainer: Container,
|
||||
ProdMonitor,
|
||||
Store,
|
||||
Energy,
|
||||
// Store,
|
||||
// Energy,
|
||||
Order,
|
||||
},
|
||||
data() {
|
||||
@@ -48,12 +48,18 @@ export default {
|
||||
companyId: 5,
|
||||
companyName: "凯盛中建材光电材料有限公司",
|
||||
period: 1,
|
||||
show: false,
|
||||
than: '同比',
|
||||
show: true,
|
||||
data: {},
|
||||
// 接口获取的数据
|
||||
prodOutPut: [], //生产
|
||||
prodFto: [], //生产
|
||||
stock: {}, //仓库
|
||||
factoryData: {
|
||||
preDataDetail: [],
|
||||
currentDataDetail: {},
|
||||
targetDataDetail: [],
|
||||
},
|
||||
energyCockpits: [], //能源
|
||||
prodOrder: [], //订单
|
||||
energyLegend: [
|
||||
@@ -67,16 +73,16 @@ export default {
|
||||
this.getMes();
|
||||
},
|
||||
methods: {
|
||||
updateThan(val) {
|
||||
console.log(val);
|
||||
this.than = val;
|
||||
// this.getMes();
|
||||
},
|
||||
updateCompany(obj) {
|
||||
this.companyId = obj.companyId;
|
||||
this.companyName = obj.companyName;
|
||||
this.getMes();
|
||||
},
|
||||
updateThan(val) {
|
||||
console.log(val);
|
||||
this.than = val;
|
||||
// this.getMes();
|
||||
},
|
||||
updatePeriod(val) {
|
||||
this.period = val;
|
||||
this.getMes();
|
||||
@@ -85,13 +91,77 @@ export default {
|
||||
cockpitDataMonitor({
|
||||
factorys: [this.companyId],
|
||||
date: this.period,
|
||||
mode: this.than === '同比' ? 0 : 1
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
|
||||
this.prodFto = res.data.prodOutputFtoDO || [];
|
||||
this.stock = res.data.stockDO || {};
|
||||
this.energyCockpits = res.data.energyCockpitsDO || [];
|
||||
this.prodOrder = res.data.prodOrderMonitorDO || [];
|
||||
this.prodOrder = res.data.prodWorkOrderDO || [];
|
||||
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
|
||||
let preFtoData = res.data.previousProdOutputFtoDO || [];
|
||||
let preData = res.data.previousProdOutputMonitorShDO || [];
|
||||
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
|
||||
let targetListResponse = res.data.prodTargetMonitorDO || [];
|
||||
let preDataDetail = []
|
||||
let currentDataDetail = []
|
||||
let targetDataDetail = []
|
||||
if (prodOutputFtoListRes) {
|
||||
for (const factory of prodOutputFtoListRes) {
|
||||
console.log(factory);
|
||||
currentDataDetail[0] = factory.chipInput
|
||||
}
|
||||
}
|
||||
if (preFtoData) {
|
||||
for (const factory of preFtoData) {
|
||||
console.log(factory);
|
||||
// const fId = this.getPreFactoryId(factory);
|
||||
// const preFId = getPreFactoryId(factory);
|
||||
// if (fId) {
|
||||
preDataDetail[0] = factory.previousYearChipInput
|
||||
// }
|
||||
// if (preFId) {
|
||||
// ftoInvest.previous[fId] = factory.previousYearChipInput;
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (preData && preData[0] != null) {
|
||||
for (const factory of preData) {
|
||||
if (factory.previousGlassType === 0) {
|
||||
preDataDetail[1] = factory.previousYearOutputNumber
|
||||
} else if (factory.previousGlassType === 1) {
|
||||
preDataDetail[2] = factory.previousYearOutputNumber
|
||||
} else if (factory.previousYearOutputNumber === 2) {
|
||||
currentDataDetail[3] = factory.outputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
if (targetListResponse && targetListResponse[0] != null) {
|
||||
for (const factory of targetListResponse) {
|
||||
targetDataDetail[0] = factory.ftoInput
|
||||
// if (factory.previousGlassType === 0) {
|
||||
targetDataDetail[1] = factory.chipYield
|
||||
// } else if (factory.previousGlassType === 1) {
|
||||
targetDataDetail[2] = factory.componentYield
|
||||
targetDataDetail[3] = factory.bipvProductoutput
|
||||
// }
|
||||
}
|
||||
}
|
||||
// console.log('ftoInvest',ftoInvest)
|
||||
if (factoryListResponse && factoryListResponse[0] != null) {
|
||||
for (const factory of factoryListResponse) {
|
||||
// targetDataDetail[0] = factory.ftoInput
|
||||
if (factory.glassType === 0) {
|
||||
currentDataDetail[1] = factory.outputNumber
|
||||
} else if (factory.glassType === 1) {
|
||||
currentDataDetail[2] = factory.outputNumber
|
||||
} else if (factory.glassType === 2) {
|
||||
currentDataDetail[3] = factory.outputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
this.factoryData.preDataDetail = preDataDetail
|
||||
this.factoryData.currentDataDetail = currentDataDetail
|
||||
this.factoryData.targetDataDetail = targetDataDetail
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -100,8 +170,7 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.factory-layout {
|
||||
padding: 16px;
|
||||
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100%
|
||||
no-repeat;
|
||||
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
|
||||
position: absolute;
|
||||
height: calc(100% + 38px);
|
||||
left: -16px;
|
||||
@@ -112,21 +181,25 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
|
||||
.factory-section {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
flex: 1;
|
||||
}
|
||||
.top > div,
|
||||
.bottom > div {
|
||||
|
||||
.top>div,
|
||||
.bottom>div {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.factory-footer {
|
||||
/** position: absolute;
|
||||
bottom: 10px; **/
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-05-21 09:47:21
|
||||
* @LastEditTime: 2024-05-24 15:03:37
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="factory-layout">
|
||||
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
|
||||
@@ -12,15 +5,21 @@
|
||||
<div class="factory-section">
|
||||
<section class="top flex">
|
||||
<db-container title="生产监控" icon="prod">
|
||||
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
|
||||
<prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
|
||||
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
|
||||
</db-container>
|
||||
<db-container title="订单监控" icon="order">
|
||||
<db-container title="工单监控" icon="order">
|
||||
<order :prodOrder="prodOrder" />
|
||||
</db-container>
|
||||
<!-- <db-container title="" icon="store"> -->
|
||||
<!-- <store :stock="stock" /> -->
|
||||
<!-- </db-container> -->
|
||||
</section>
|
||||
<!-- <section class="bottom flex"> -->
|
||||
<!-- <db-container title="" icon="energy"> -->
|
||||
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
|
||||
<!-- </db-container> -->
|
||||
<!-- </section> -->
|
||||
</div>
|
||||
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
|
||||
</div>
|
||||
@@ -29,8 +28,9 @@
|
||||
import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
|
||||
import Container from "./components/Container.vue";
|
||||
import ProdMonitor from "./components/ProdMonitor.vue";
|
||||
import Store from "./components/Store.vue";
|
||||
import Energy from "./components/Energy.vue";
|
||||
import { deepClone } from "@/utils";
|
||||
// import Store from "./components/Store.vue";
|
||||
// import Energy from "./components/Energy.vue";
|
||||
import Order from "./components/Order.vue";
|
||||
import { cockpitDataMonitor } from "@/api/produceData";
|
||||
export default {
|
||||
@@ -39,8 +39,8 @@ export default {
|
||||
FactoryDataHeader,
|
||||
DbContainer: Container,
|
||||
ProdMonitor,
|
||||
Store,
|
||||
Energy,
|
||||
// Store,
|
||||
// Energy,
|
||||
Order,
|
||||
},
|
||||
data() {
|
||||
@@ -48,12 +48,18 @@ export default {
|
||||
companyId: 2,
|
||||
companyName: "株洲中建材光电材料有限公司",
|
||||
period: 1,
|
||||
show: false,
|
||||
than: '同比',
|
||||
show: true,
|
||||
data: {},
|
||||
// 接口获取的数据
|
||||
prodOutPut: [], //生产
|
||||
prodFto: [], //生产
|
||||
stock: {}, //仓库
|
||||
factoryData: {
|
||||
preDataDetail: [],
|
||||
currentDataDetail: {},
|
||||
targetDataDetail: [],
|
||||
},
|
||||
energyCockpits: [], //能源
|
||||
prodOrder: [], //订单
|
||||
energyLegend: [
|
||||
@@ -67,16 +73,16 @@ export default {
|
||||
this.getMes();
|
||||
},
|
||||
methods: {
|
||||
updateThan(val) {
|
||||
console.log(val);
|
||||
this.than = val;
|
||||
// this.getMes();
|
||||
},
|
||||
updateCompany(obj) {
|
||||
this.companyId = obj.companyId;
|
||||
this.companyName = obj.companyName;
|
||||
this.getMes();
|
||||
},
|
||||
updateThan(val) {
|
||||
console.log(val);
|
||||
this.than = val;
|
||||
// this.getMes();
|
||||
},
|
||||
updatePeriod(val) {
|
||||
this.period = val;
|
||||
this.getMes();
|
||||
@@ -85,13 +91,77 @@ export default {
|
||||
cockpitDataMonitor({
|
||||
factorys: [this.companyId],
|
||||
date: this.period,
|
||||
mode: this.than === '同比' ? 0 : 1
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
this.prodOutPut = res.data.prodOutputMonitorShDO || [];
|
||||
this.prodFto = res.data.prodOutputFtoDO || [];
|
||||
this.stock = res.data.stockDO || {};
|
||||
this.energyCockpits = res.data.energyCockpitsDO || [];
|
||||
this.prodOrder = res.data.prodOrderMonitorDO || [];
|
||||
this.prodOrder = res.data.prodWorkOrderDO || [];
|
||||
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
|
||||
let preFtoData = res.data.previousProdOutputFtoDO || [];
|
||||
let preData = res.data.previousProdOutputMonitorShDO || [];
|
||||
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
|
||||
let targetListResponse = res.data.prodTargetMonitorDO || [];
|
||||
let preDataDetail = []
|
||||
let currentDataDetail = []
|
||||
let targetDataDetail = []
|
||||
if (prodOutputFtoListRes) {
|
||||
for (const factory of prodOutputFtoListRes) {
|
||||
console.log(factory);
|
||||
currentDataDetail[0] = factory.chipInput
|
||||
}
|
||||
}
|
||||
if (preFtoData) {
|
||||
for (const factory of preFtoData) {
|
||||
console.log(factory);
|
||||
// const fId = this.getPreFactoryId(factory);
|
||||
// const preFId = getPreFactoryId(factory);
|
||||
// if (fId) {
|
||||
preDataDetail[0] = factory.previousYearChipInput
|
||||
// }
|
||||
// if (preFId) {
|
||||
// ftoInvest.previous[fId] = factory.previousYearChipInput;
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (preData && preData[0] != null) {
|
||||
for (const factory of preData) {
|
||||
if (factory.previousGlassType === 0) {
|
||||
preDataDetail[1] = factory.previousYearOutputNumber
|
||||
} else if (factory.previousGlassType === 1) {
|
||||
preDataDetail[2] = factory.previousYearOutputNumber
|
||||
} else if (factory.previousYearOutputNumber === 2) {
|
||||
currentDataDetail[3] = factory.outputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
if (targetListResponse && targetListResponse[0] != null) {
|
||||
for (const factory of targetListResponse) {
|
||||
targetDataDetail[0] = factory.ftoInput
|
||||
// if (factory.previousGlassType === 0) {
|
||||
targetDataDetail[1] = factory.chipYield
|
||||
// } else if (factory.previousGlassType === 1) {
|
||||
targetDataDetail[2] = factory.componentYield
|
||||
targetDataDetail[3] = factory.bipvProductoutput
|
||||
// }
|
||||
}
|
||||
}
|
||||
// console.log('ftoInvest',ftoInvest)
|
||||
if (factoryListResponse && factoryListResponse[0] != null) {
|
||||
for (const factory of factoryListResponse) {
|
||||
// targetDataDetail[0] = factory.ftoInput
|
||||
if (factory.glassType === 0) {
|
||||
currentDataDetail[1] = factory.outputNumber
|
||||
} else if (factory.glassType === 1) {
|
||||
currentDataDetail[2] = factory.outputNumber
|
||||
} else if (factory.glassType === 2) {
|
||||
currentDataDetail[3] = factory.outputNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
this.factoryData.preDataDetail = preDataDetail
|
||||
this.factoryData.currentDataDetail = currentDataDetail
|
||||
this.factoryData.targetDataDetail = targetDataDetail
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -100,8 +170,7 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.factory-layout {
|
||||
padding: 16px;
|
||||
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100%
|
||||
no-repeat;
|
||||
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
|
||||
position: absolute;
|
||||
height: calc(100% + 38px);
|
||||
left: -16px;
|
||||
@@ -112,21 +181,25 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
|
||||
.factory-section {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
flex: 1;
|
||||
}
|
||||
.top > div,
|
||||
.bottom > div {
|
||||
|
||||
.top>div,
|
||||
.bottom>div {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.factory-footer {
|
||||
/** position: absolute;
|
||||
bottom: 10px; **/
|
||||
|
||||
Reference in New Issue
Block a user