This commit is contained in:
shijing 2024-12-11 10:09:38 +08:00
commit e03198aa43
11 changed files with 429 additions and 38 deletions

View File

@ -1025,6 +1025,16 @@ const routes = [
},
component: "enm_energy/hour_base",
},
{
name: "hourBase",
path: "/enm_energy/electric_total",
meta: {
title: "电量报表",
// icon: "el-icon-grid",
perms: ["hour_base"],
},
component: "enm_energy/electric_total",
},
{
name: "water",
path: "/enm_energy/water",

View File

@ -443,7 +443,7 @@ export default {
rateData: [
{ name: "原料磨", value: 0 },
{ name: "煤磨", value: 0 },
{ name: "烧成", value: 0 },
{ name: "回转窑", value: 0 },
{ name: "水泥磨", value: 0 },
],
elecData: [
@ -1602,7 +1602,7 @@ export default {
var checkbox1 = new BABYLON_GUI.Checkbox();
checkbox1.width = "20px";
checkbox1.height = "20px";
checkbox1.isChecked = true;
// checkbox1.isChecked = true;
checkbox1.marginLeft = "16px";
checkbox1.color = "green";
checkbox1.onIsCheckedChangedObservable.add(function (value) {
@ -1928,7 +1928,7 @@ export default {
row.addControl(valx);
data_view.addControl(row);
});
data_view.isVisible = true;
data_view.isVisible = false;
// StackPanelGUI
that.myui.addControl(data_view);
data_view.linkWithMesh(mesh);
@ -2372,6 +2372,18 @@ export default {
color: #ffffff;
font-weight: 500;
}
.elecItem span {
font-size: 14px; /* 修改文字大小 */
}
.elec_number {
font-size: 14px;
}
.elec_unit {
font-size: 14px; /* 修改单位的文字大小 */
}
.successState {
width: 10px;
height: 10px;

View File

@ -99,6 +99,7 @@
clearable
filterable
style="width: 100%"
@clear="() => { form.ep_belong=null } "
>
<el-option
v-for="item in epOptions"
@ -371,6 +372,7 @@ export default {
type: 10,
belong_dept: null,
mgroup: null,
ep_belong: null,
interval: 10,
func_on_change: "",
is_rep_ep_running_state: false,

View File

@ -0,0 +1,355 @@
<!-- 全厂电量统计 -->
<template>
<div class="app-container" id="app-container" style="height: 100%">
<el-header id="app-header">
<div class="left-panel">
<el-date-picker
v-model="query.day"
type="date"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
placeholder="日"
style="margin-right: 6px"
@change="dateChange"
/>
<!-- <el-button
type="primary"
icon="el-icon-search"
@click="dateChange"
></el-button> -->
<el-button
type="primary"
@click="exportExcel()"
:loading="exportLoading"
v-auth="'export_excel'"
>导出xlsx
</el-button>
<el-button type="primary" @click="handlePrint">打印 </el-button>
</div>
</el-header>
<el-main>
<el-card>
<div>
<div ref="print" id="myReport" class="printContainer">
<el-table
id="hourBaseTable"
:data="tableDatas2"
style="width: 100%"
border
:height="tableHeight"
>
<el-table-column
label="设备名称"
prop="name"
fixed
>
</el-table-column>
<el-table-column
label="对应点位"
prop="code"
fixed
>
</el-table-column>
<el-table-column label="日累计" prop="day" align="center" fixed>
</el-table-column>
<el-table-column label="月累计" prop="month" align="center" fixed>
</el-table-column>
<el-table-column label="年累计" prop="year" align="center" fixed>
</el-table-column>
</el-table>
</div>
</div>
</el-card>
</el-main>
<el-dialog v-model="itemVisible" :title="itemChartTitle" width="1100px">
<scEcharts
height="400px"
width="1033px"
:option="option"
></scEcharts>
<template #footer>
<slot name="footer"></slot>
</template>
</el-dialog>
</div>
</template>
<script>
import scEcharts from "@/components/scEcharts";
export default {
components: {
scEcharts,
},
data() {
return {
days: 30,
day: "",
year: "",
month: "",
search_date: "",
query:{
type:0,
day:'',
year:'',
month:'',
yearStart:'',
},
mgroupObj: {},
indexList: [],
mpointList: [],
tableDatas: [],
tableDatas2: [],
tableHeight: 600,
itemChartTitle: "",
itemChartData: [],
itemChartXData: [],
itemChartYData: [],
itemChartLegend: [],
itemChartSeries: [],
timeStamp: null,
itemVisible: false,
exportLoading: false,
tableName: "全厂电量统计",
sourceData: {},
option: {
title: {
// text: "",
x: "center",
},
grid: {
top: "20%",
left: "3%",
right: "10%",
bottom: "5%",
containLabel: true,
},
legend: {
orient: "horizontal",
x: "right",
y: "10",
data: [],
},
xAxis: {
type: "category",
data: [],
name: "时间",
nameTextStyle: {
fontWeight: 600,
fontSize: 14,
},
axisLine: {
lineStyle: {
color: "#3366CC",
},
},
axisLabel: {
rotate: 45,
interval: 0,
},
boundaryGap: false,
},
yAxis: {
type: "value",
name: "对象值",
nameTextStyle: {
fontWeight: 500,
fontSize: 14,
},
axisLine: {
lineStyle: {
color: "#3366CC",
},
},
},
tooltip: {
show: true,
trigger: "axis",
axisPointer: {
type: "cross",
axis: "auto",
snap: true,
},
showContent: true,
},
series: [
{
name: "",
data: [],
type: "line",
symbolSize: 8,
symbol: "circle",
smooth: 0.5,
itemStyle: {
normal: {
label: {
show: true,
},
lineStyle: {
width: 1,
type: "dotted",
color: "#3366CC",
},
},
},
},
],
},
xAxisData: [],
xAxisData_day: [],
xAxisData_month: [],
};
},
mounted() {
let that = this;
var nowDate = new Date();
let year = nowDate.getFullYear();
let month = nowDate.getMonth() + 1;
that.timeStamp = nowDate.getTime();
that.days = new Date(year, month, 0).getDate();
that.headerLength = that.days + 4;
that.tableWidth = that.headerLength * 100 + "";
this.getMPoints();
let heightContainer =
document.getElementById("app-container").clientHeight;
let heightHeader = document.getElementById("app-header").clientHeight;
let heightTable = heightContainer - heightHeader - 35;
that.tableHeight = heightTable;
},
methods: {
// objectSpanMethod({ row, column, rowIndex, columnIndex }) {
// let that = this;
// if (columnIndex == 0) {
// if (that.indexList.indexOf(rowIndex) > -1) {
// let rowspans = that.mgroupObj[row.mgroupName];
// return {
// rowspan: rowspans,
// colspan: 1,
// };
// } else {
// return {
// rowspan: 1,
// colspan: 0,
// };
// }
// }
// },
dateChange(e) {
let that = this;
that.tableDatas = [];
let arr = [];
if(e){//
arr = e.split('-');
that.year = Number(arr[0]);
that.month = Number(arr[1]);
that.day = Number(arr[2]);
that.dataLoop();
}
let nowDate = new Date();
that.timeStamp = nowDate.getTime();
},
getMPoints() {
let that = this;
that.$API.enm.mpoint.list
.req({
page: 0,
enabled: 1,
need_display: 1,
ordering: "report_sortstr",
material__code__in: "elec",
query: "{ id, name, nickname, mgroup_name, unit, report_sortstr, code}",
})
.then((res) => {
that.mpointList = res.filter((item) => {
return item.report_sortstr !== "";
});
that.dataLoop();
});
},
dataLoop() {
let that = this;
that.tableDatas2 = [];
that.mpointList.forEach((item, index) => {
let obj = {};
console.log('item', item.name)
obj.name = item.name;
obj.code =
item.code != null && item.code != ""
? item.code
: None;
that.tableDatas2.push(obj);
that.getData(item.id, index);
});
},
getData(id, index) {
let that = this;
let obj = {};
obj.type = "day";
obj.year = that.year;
obj.month = that.month;
obj.day = that.day;
obj.mpoint = id;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((res) => {
res.forEach((item) => {
that.tableDatas2[index]['day'] = item.val;
});
});
//
let obj_month = {};
obj_month.type = "month";
obj_month.year = that.year;
obj_month.month = that.month;
obj_month.mpoint = id;
obj_month.page = 0;
this.$API.enm.mpoint.stat.req(obj_month).then((res) => {
res.forEach((item) => {
that.tableDatas2[index]['month'] = item.val;
});
});
//
let obj_year = {};
obj_year.type = "year";
obj_year.year = that.year;
obj_year.mpoint = id;
obj_year.page = 0;
this.$API.enm.mpoint.stat.req(obj_year).then((res) => {
res.forEach((item) => {
that.tableDatas2[index]['year'] = item.val;
});
});
console.log('that.tableDatas2', that.tableDatas2)
},
// handleCellClick(row, column, cell, event) {
// let that = this;
// console.log("row", row);
// console.log("column", column);
// console.log("cell", cell);
// let index = that.tableDatas2.indexOf(row);
// console.log(index, "index");
// let lineData = that.tableDatas[index].slice(2, 5);
// that.option.xAxis.data = that.xAxisData;
// that.option.series[0].data = lineData;
// this.itemVisible = true;
// },
exportExcel() {
this.exportLoading = true;
this.$XLSX("#hourBaseTable", this.tableName);
this.exportLoading = false;
},
handlePrint() {
this.$PRINT("#myReport");
},
},
};
</script>
<style scoped>
.printWrap {
width: 100%;
overflow-x: scroll;
}
.printContainer {
width: 100%;
}
</style>

View File

@ -108,7 +108,7 @@
{index:2,name:'熟料单位产品综合能耗(kgce/t)',value:0,note:''},
{index:3,name:'熟料单位产品综合电耗(kw.h/t)',value:0,note:''},
{index:4,name:'熟料单位产品综合煤耗(kgce/t)',value:0,note:''},
{index:5,name:'水泥单位产品综合电耗(kw.h/t)',value:0,note:''},
{index:5,name:'水泥单位产品综合能耗(kgce/t)',value:0,note:''},
],
};
@ -157,7 +157,7 @@
that.$API.enm.enstat.req(params1).then((res) => {
console.log(res[0]);
that.tableDatas[0].value = res[0].cen_consume_unit;
that.tableDatas[4].value = res[0].celec_consume_unit;
that.tableDatas[4].value = res[0].cen_consume_unit;
});
let params2 = {
page:0,

View File

@ -20,6 +20,7 @@
:key="timeStamp"
id="myTable"
class="myTable"
width="1033px"
>
<thead class="myTableHead">
<tr>
@ -52,8 +53,7 @@
</tr>
</table>
</div>
</el-card>
<div class="chartWrap">
<div class="chartWrap">
<div class="chartTitle">本年工业总产值</div>
<scEcharts
height="400px"
@ -61,11 +61,11 @@
:option="optionMonth"
></scEcharts>
</div>
</el-card>
</div>
</template>
<script>
import scEcharts from "@/components/scEcharts";
import { defineAsyncComponent } from "vue";
const colors = ["#647bfe", "#cbd3fe", "#91CC75", "#EE6666", "#CC00CC", "#551e13"];
let tooltip = {
show: true,
@ -110,6 +110,8 @@ let yAxis = [
},
}
];
import scEcharts from "@/components/scEcharts";
import { defineAsyncComponent } from "vue";
export default {
components: {
scEcharts,
@ -144,6 +146,7 @@ export default {
type: "bar",
yAxisIndex: 0,
data: [],
barWidth: "40",
}
],
},

View File

@ -258,19 +258,7 @@ export default {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24,
],
mgroupList: [
"石灰石破碎",
"原料磨",
"回转窑",
"煤磨",
"余热发电",
"空压机",
"富氧燃烧系统",
"生产总耗电量",
"全厂进线",
],
tableHeight: 600,
mgroup: "石灰石破碎",
itemChartTitle: "",
itemChartData: [],
itemChartXData: [],

View File

@ -263,7 +263,10 @@
{{ reportItem.production_cost_unit }}
</td>
</tr>
<tr>
<td class="numCell">氨水消耗量t</td>
<td class="numCell">{{ reportItem.ammonia_consume }}</td>
</tr>
<tr v-if="sflogexpList.length > 0">
<td
class="numCell"

View File

@ -61,6 +61,9 @@
<td class="numCell" v-else-if="index == 9">
{{ item[0] }}
</td>
<td class="numCell" v-else-if="index == 10">
{{ item[0] }}
</td>
<td class="numCell">{{ item[1] }}</td>
<td
class="numCell hoursItem"
@ -440,6 +443,7 @@ export default {
["能耗", "单位产品综合能耗kgce/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0, 0, 0, 0, 0, 0],
["成本", "单位产品成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0],
["氨水", "氨水消耗量(t)", 0, 0, 0, 0, 0, 0, 0, 0],
],
tableName: "生产报告",
modelValue: true,
@ -691,6 +695,7 @@ export default {
that.tableDatas[7][3] = data3.cen_consume_unit;
that.tableDatas[8][3] = data3.elec_consume;
that.tableDatas[9][3] = data3.production_cost_unit;
that.tableDatas[10][3] = data3.ammonia_consume;
}
});
//
@ -712,6 +717,7 @@ export default {
that.tableDatas[7][2] = data4.cen_consume_unit;
that.tableDatas[8][2] = data4.elec_consume;
that.tableDatas[9][2] = data4.production_cost_unit;
that.tableDatas[10][2] = data4.ammonia_consume;
}
});
let params5 = {};
@ -834,6 +840,7 @@ export default {
(that.tableDatas[9][5]-that.tableDatas[9][8]),
that.tableDatas[9][9]
);
that.tableDatas[10][5] = data1.ammonia_consume;
} else {
}
});
@ -895,6 +902,7 @@ export default {
that.tableDatas[9][4]-that.tableDatas[9][6],
that.tableDatas[9][6]
);
that.tableDatas[10][4] = data2.ammonia_consume;
}
});
});

View File

@ -77,13 +77,13 @@
<tr v-for="(item,index) in tableDatas" :key="index">
<td class="numCell">{{item[0]}}</td>
<td class="numCell">{{item[1]}}</td>
<td class="numCell" v-if="index==3||index==6||index==7||index==8" colspan="6">{{item[2]}}</td>
<td class="numCell" v-if="index==6||index==7||index==8" colspan="6">{{item[2]}}</td>
<td class="numCell" v-else>{{item[2]}}</td>
<td class="numCell" v-if="index!==3&&index!==6&&index!==7&&index!==8">{{item[3]}}</td>
<td class="numCell" v-if="index!==3&&index!==6&&index!==7&&index!==8">{{item[4]}}</td>
<td class="numCell" v-if="index!==3&&index!==6&&index!==7&&index!==8">{{item[5]}}</td>
<td class="numCell" v-if="index!==3&&index!==6&&index!==7&&index!==8">{{item[6]}}</td>
<td class="numCell" v-if="index!==3&&index!==6&&index!==7&&index!==8">{{item[7]}}</td>
<td class="numCell" v-if="index!==6&&index!==7&&index!==8">{{item[3]}}</td>
<td class="numCell" v-if="index!==6&&index!==7&&index!==8">{{item[4]}}</td>
<td class="numCell" v-if="index!==6&&index!==7&&index!==8">{{item[5]}}</td>
<td class="numCell" v-if="index!==6&&index!==7&&index!==8">{{item[6]}}</td>
<td class="numCell" v-if="index!==6&&index!==7&&index!==8">{{item[7]}}</td>
</tr>
</table>
</div>
@ -114,14 +114,14 @@
['台产(t/h)'],
['质量'],
['煤耗(t)'],
['电耗(kw.h/t)'],
['电耗(kw.h)'],
['柴油消耗(t)'],
['绿化水耗(m³)'],
['生活水耗(m³)'],
['工业水耗(m³)'],
['原料压缩空气流量(m³/h)'],
['烧成压缩空气流量(m³/h)'],
['水泥压缩空气流量(m³/h)'],
['原料压缩空气流量(m³)'],
['烧成压缩空气流量(m³)'],
['水泥压缩空气流量(m³)'],
['产生蒸汽量(t)'],
['成本(元/t)'],
],
@ -201,7 +201,12 @@
that.tableDatas[4][index] = item.elec_consume;//
that.tableDatas[5][index] = item.imaterial_data_dict?item.imaterial_data_dict.柴油?(item.imaterial_data_dict.柴油.cost).toFixed(2):'':'';//
that.tableDatas[12][index] = item.out_steam;//
that.tableDatas[13][index] = item.production_cost_unit;//
// 0
if(item.mgroup_name=='煤磨' || item.mgroup_name=='水泥包装'){
that.tableDatas[13][index] = 0;
}else{
that.tableDatas[13][index] = item.production_cost_unit;//
}
}
if(item.mgroup_name=='原料压缩空气'){
that.tableDatas[9][3] = item.cair_consume;
@ -231,11 +236,12 @@
that.tableDatas[7][2] = item.val;
}else if(item.mpoint_nickname=='工业水'){
that.tableDatas[8][2] = item.val;
}else if(item.mpoint_nickname=='头煤_煤'){
that.tableDatas[3][2] += Number(item.val);
}else if(item.mpoint_nickname=='尾煤_煤'){
that.tableDatas[3][2] += Number(item.val);
}
// else if(item.mpoint_nickname=='_'){
// that.tableDatas[3][2] += Number(item.val);
// }else if(item.mpoint_nickname=='_'){
// that.tableDatas[3][2] += Number(item.val);
// }
})
// that.tableDatas[3][2] = coalTotl;//
console.log('that.tableDatas[3][2]',that.tableDatas[3][2])

View File

@ -74,7 +74,11 @@
<el-table-column label="单位产品能耗" prop="en_consume_unit" width="110" show-overflow-tooltip></el-table-column>
<el-table-column label="单位产品综合能耗" prop="cen_consume_unit" width="130" show-overflow-tooltip></el-table-column>
<el-table-column label="台时产量" prop="production_hour" width="90" show-overflow-tooltip></el-table-column>
<el-table-column label="运转时长" prop="run_sec" width="90" show-overflow-tooltip></el-table-column>
<el-table-column label="运转时长(h)" prop="run_sec" width="100" show-overflow-tooltip>
<template #default="scope">
{{ (scope.row.run_sec /3600).toFixed(2) }}
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>