工厂驾驶舱
This commit is contained in:
@@ -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; **/
|
||||
|
||||
Reference in New Issue
Block a user