feat:水泥包装 增加昨日展示

This commit is contained in:
zty 2024-12-27 09:14:19 +08:00
parent a2320580c1
commit 3d2591e904
5 changed files with 467 additions and 91 deletions

View File

@ -1,6 +1,6 @@
<!-- 全厂水量统计 -->
<template>
<div class="app-container" id="app-container" style="height: 100%">
<div class="app-container" id="app-container" style="height: 50%">
<el-header id="app-header">
<div class="left-panel">
<el-select
@ -202,6 +202,30 @@
</el-table>
</div>
</div>
<div class="chartWrap" v-show="query.type==0">
<div class="chartTitle">本日生产参数统计图</div>
<scEcharts
height="400px"
width="1500px"
:option="optionHour"
></scEcharts>
</div>
<div class="chartWrap" v-show="query.type==1">
<div class="chartTitle">本月生产参数统计图</div>
<scEcharts
height="400px"
width="1500px"
:option="optionDay"
></scEcharts>
</div>
<div class="chartWrap" v-show="query.type==2">
<div class="chartTitle">本年生产参数统计图</div>
<scEcharts
height="400px"
width="1500px"
:option="optionMonth"
></scEcharts>
</div>
</el-card>
</el-main>
<el-dialog v-model="itemVisible" :title="itemChartTitle" width="1100px">
@ -265,9 +289,25 @@ export default {
itemChartYData: [],
itemChartLegend: [],
itemChartSeries: [],
gyhourlyData : [],
lvhourlyData : [],
shhourlyData : [], //
gyhourlyData_month : [],
lvhourlyData_month : [],
shhourlyData_month : [], //
gyhourlyData_year : [],
lvhourlyData_year : [],
shhourlyData_year : [], //
timeStamp: null,
itemVisible: false,
exportLoading: false,
xAxisData: [],
optionDay:[],
optionMonth:[],
optionHour:[],
xAxisData_day: [],
xAxisData_month: [],
xTtimeRange: [],
tableName: "全厂电量小时统计",
sourceData: {},
option: {
@ -354,11 +394,56 @@ export default {
},
],
},
xAxisData: [],
xAxisData_day: [],
xAxisData_month: [],
xTtimeRange: [],
};
bar_option: {
legend: {
top: "2%",
data: ["烧成车间压缩空气", "原料车间压缩空气", "水泥磨压缩空气"]
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
data: [],
},
yAxis: {
type: 'value',
name: '压缩空气'
},
series: [
{
name: '烧成车间压缩空气', //
type: 'bar',
data: [],
itemStyle: {
color: '#a9b6fe',
},
},
{
name: '原料车间压缩空气', //
type: 'bar',
data: [],
itemStyle: {
color: '#3398DB',
},
},
{
name: '水泥磨压缩空气', //
type: 'bar',
data: [],
itemStyle: {
color: '#EE6666',
},
},
],
},
}
},
mounted() {
let that = this;
@ -380,6 +465,9 @@ export default {
for (let n = 1; n < 13; n++) {
that.xAxisData_month.push(n + "月");
}
for (let n = 1; n <= that.days; n++) {
that.xAxisData_day.push(n + "日");
}
this.getMPoints();
let heightContainer =
document.getElementById("app-container").clientHeight;
@ -467,15 +555,6 @@ export default {
that.dataLoop();
});
},
getLengthData() {
let that = this;
let arrs = [];
that.mpointList.forEach((item, index) => {
if (arrs.indexOf(item.mgroup_name) == -1) {
arrs.push(item.mgroup_name);
}
});
},
dataLoop() {
let that = this;
that.tableDatas = [];
@ -517,6 +596,7 @@ export default {
that.tableDatas2.push(obj);
that.getData(item.id, index);
});
this.updateChart(that.gyhourlyData, that.shhourlyData, that.lvhourlyData)
that.mgroupObj = mgroupObj;
that.indexList = indexList;
},
@ -537,6 +617,13 @@ export default {
sum += Number(item.val);
let keyName = item.hour + "时";
that.tableDatas2[index][keyName] = item.val;
if (item.mpoint_name == "窑中压缩空气累计"){
that.gyhourlyData[item.hour] = item.val;
}else if(item.mpoint_name == "水泥磨压缩空气累积量"){
that.shhourlyData[item.hour] = item.val;
}else if(item.mpoint_name == "原料车间压缩空气"){
that.lvhourlyData[item.hour] = item.val;
}
});
sum = sum * 100;
sum = Math.round(sum);
@ -546,6 +633,15 @@ export default {
that.$forceUpdate();
});
},
updateChart (gyhourlyData, shhourlyData, lvhourlyData){
let that = this;
let options = { ...that.bar_option };
options.series[0].data = gyhourlyData;
options.series[1].data = lvhourlyData;
options.series[2].data = shhourlyData;
options.xAxis.data = that.xAxisData;
that.optionHour = options;
},
dataLoop1() {
let that = this;
that.tableDatas = [];
@ -592,9 +688,19 @@ export default {
that.tableDatas_day.push(obj);
that.getData1(item.id, index);
});
that.updateMonthChart(that.gyhourlyData_month, that.shhourlyData_month, that.lvhourlyData_month);
that.mgroupObj = mgroupObj;
that.indexList = indexList;
},
updateMonthChart(gyhourlyData, shhourlyData, lvhourlyData) {
let that = this;
let options = { ...that.bar_option };
options.series[0].data = gyhourlyData;
options.series[1].data = lvhourlyData;
options.series[2].data = shhourlyData;
options.xAxis.data = that.xAxisData_day;
that.optionDay = options;
},
getData1(id, index) {
let that = this;
let obj = {};
@ -606,11 +712,19 @@ export default {
this.$API.enm.mpoint.stat.req(obj).then((res) => {
let sum = 0;
res.forEach((item) => {
console.log(item, 'item');
let ind = item.day + 2;
that.tableDatas[index][ind] = item.val;
sum += Number(item.val);
let keyName = item.day + "日";
that.tableDatas_day[index][keyName] = item.val;
if (item.mpoint_name == "窑中压缩空气累计"){
that.gyhourlyData_month[item.day] = item.val;
}else if(item.mpoint_name == "水泥磨压缩空气累积量"){
that.shhourlyData_month[item.day] = item.val;
}else if(item.mpoint_name == "原料车间压缩空气"){
that.lvhourlyData_month[item.day] = item.val;
}
});
sum = sum * 100;
sum = Math.round(sum);
@ -663,9 +777,19 @@ export default {
that.tableDatas_month.push(obj);
that.getData_month(item.id, index);
});
that.updateMonthChart_month(that.gyhourlyData_year, that.shhourlyData_year, that.lvhourlyData_year);
that.mgroupObj = mgroupObj;
that.indexList = indexList;
},
updateMonthChart_month(gyhourlyData, shhourlyData, lvhourlyData){
let that = this;
let options = { ...that.bar_option };
options.series[0].data = gyhourlyData;
options.series[1].data = lvhourlyData;
options.series[2].data = shhourlyData;
options.xAxis.data = that.xAxisData_month;
that.optionMonth = options;
},
getData_month(id, index) {
let that = this;
let obj = {};
@ -682,6 +806,13 @@ export default {
sum += Number(item.val);
let keyName = item.month + "月";
that.tableDatas_month[index][keyName] = item.val;
if (item.mpoint_name == "窑中压缩空气累计"){
that.gyhourlyData_year[item.month] = item.val;
}else if(item.mpoint_name == "水泥磨压缩空气累积量"){
that.shhourlyData_year[item.month] = item.val;
}else if(item.mpoint_name == "原料车间压缩空气"){
that.lvhourlyData_year[item.month] = item.val;
}
});
sum = sum * 100;
sum = Math.round(sum);
@ -691,7 +822,6 @@ export default {
that.$forceUpdate();
});
},
handleCellClick(row, column, cell, event) {
let that = this;
console.log("row", row);
@ -737,7 +867,7 @@ export default {
handlePrint() {
this.$PRINT("#myReport");
},
},
}
};
</script>
<style scoped>

View File

@ -241,6 +241,10 @@
</div>
</template>
<script>
let legend = {
top: "2%",
data: ["工业水", "绿化水", "生活水"],
};
import scEcharts from "@/components/scEcharts";
export default {
components: {
@ -385,6 +389,15 @@ export default {
xAxisData_day: [],
xAxisData_month: [],
xTtimeRange: [],
gyhourlyData : [],
lvhourlyData : [],
shhourlyData : [], //
gyhourlyData_month : [],
lvhourlyData_month : [],
shhourlyData_month : [], //
gyhourlyData_year : [],
lvhourlyData_year : [],
shhourlyData_year : [], //
};
},
mounted() {
@ -407,6 +420,9 @@ export default {
for (let n = 1; n < 13; n++) {
that.xAxisData_month.push(n + "月");
}
for (let n = 1; n <= that.days; n++) {
that.xAxisData_day.push(n + "日");
}
this.getMPoints();
let heightContainer =
document.getElementById("app-container").clientHeight;
@ -535,6 +551,7 @@ export default {
that.tableDatas2.push(obj);
that.getData(item.id, index);
});
that.updateChart(that.gyhourlyData, that.shhourlyData, that.lvhourlyData);
that.mgroupObj = mgroupObj;
that.indexList = indexList;
},
@ -549,23 +566,79 @@ export default {
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((res) => {
let sum = 0;
let seriesData = [];
res.forEach((item) => {
let ind = item.hour + 3;
that.tableDatas[index][ind] = item.val;
sum += Number(item.val);
let keyName = item.hour + "时";
that.tableDatas2[index][keyName] = item.val;
seriesData.push({name: item.mpoint_nickname, value: item.val});
if (item.mpoint_nickname == "工业水"){
that.gyhourlyData[item.hour] = item.val;
}else if(item.mpoint_nickname == "生活水"){
that.shhourlyData[item.hour] = item.val;
}else if(item.mpoint_nickname == "绿化水"){
that.lvhourlyData[item.hour] = item.val;
}
});
sum = sum * 100;
sum = Math.round(sum);
sum = sum / 100;
that.tableDatas[index][27] = sum.toFixed(2);
that.tableDatas2[index].sum = sum.toFixed(2);
that.$forceUpdate();
});
},
updateChart(gyhourlyData, shhourlyData, lvhourlyData) {
let that = this;
// ECharts
let option = {
legend: legend,
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
data: ['0时', '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '21时', '22时', '23时'],
},
yAxis: {
type: 'value',
name: '用水量'
},
series: [{
name: '工业水', //
type: 'bar',
data: gyhourlyData, //
itemStyle: {
color: '#a9b6fe',
},
},
{
name: '绿化水', //
type: 'bar',
data: lvhourlyData, //
itemStyle: {
color: '#3398DB',
},
},
{
name: '生活水', //
type: 'bar',
data: shhourlyData, //
itemStyle: {
color: '#EE6666',
},
},
]
};
that.optionHour = option;
},
dataLoop1() {
let that = this;
that.tableDatas = [];
@ -612,9 +685,63 @@ export default {
that.tableDatas_day.push(obj);
that.getData1(item.id, index);
});
console.log(that.gyhourlyData_month, that.shhourlyData_month, that.lvhourlyData_month, '----------------')
that.updateMonthChart(that.gyhourlyData_month, that.shhourlyData_month, that.lvhourlyData_month);
that.mgroupObj = mgroupObj;
that.indexList = indexList;
},
updateMonthChart(gyhourlyData, shhourlyData, lvhourlyData) {
let that = this;
// ECharts
let option1 = {
legend: legend,
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
data: [],
},
yAxis: {
type: 'value',
name: '用水量'
},
series: [{
name: '工业水', //
type: 'bar',
data: gyhourlyData, //
itemStyle: {
color: '#a9b6fe',
},
},
{
name: '绿化水', //
type: 'bar',
data: lvhourlyData, //
itemStyle: {
color: '#3398DB',
},
},
{
name: '生活水', //
type: 'bar',
data: shhourlyData, //
itemStyle: {
color: '#EE6666',
},
},
]
};
console.log(that.xAxisData_day, 'that.xAxisData_day')
option1.xAxis.data = that.xAxisData_day;
that.optionDay = option1;
},
getData1(id, index) {
let that = this;
let obj = {};
@ -631,6 +758,13 @@ export default {
sum += Number(item.val);
let keyName = item.day + "日";
that.tableDatas_day[index][keyName] = item.val;
if (item.mpoint_nickname == "工业水"){
that.gyhourlyData_month[item.day] = item.val;
}else if(item.mpoint_nickname == "生活水"){
that.shhourlyData_month[item.day] = item.val;
}else if(item.mpoint_nickname == "绿化水"){
that.lvhourlyData_month[item.day] = item.val;
}
});
sum = sum * 100;
sum = Math.round(sum);
@ -683,9 +817,60 @@ export default {
that.tableDatas_month.push(obj);
that.getData_month(item.id, index);
});
that.updateMonthChart_month(that.gyhourlyData_year, that.shhourlyData_year, that.lvhourlyData_year);
that.mgroupObj = mgroupObj;
that.indexList = indexList;
},
updateMonthChart_month(gyhourlyData, shhourlyData, lvhourlyData) {
let that = this;
let option2 = {
legend: legend,
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
data: [],
},
yAxis: {
type: 'value',
name: '用水量'
},
series: [{
name: '工业水', //
type: 'bar',
data: gyhourlyData, //
itemStyle: {
color: '#a9b6fe',
},
},
{
name: '绿化水', //
type: 'bar',
data: lvhourlyData, //
itemStyle: {
color: '#3398DB',
},
},
{
name: '生活水', //
type: 'bar',
data: shhourlyData, //
itemStyle: {
color: '#EE6666',
},
},
]
};
option2.xAxis.data = that.xAxisData_month;
that.optionMonth = option2;
},
getData_month(id, index) {
let that = this;
let obj = {};
@ -694,7 +879,6 @@ export default {
obj.mpoint = id;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((res) => {
console.log(res);
let sum = 0;
res.forEach((item) => {
let ind = item.month + 2;
@ -702,6 +886,13 @@ export default {
sum += Number(item.val);
let keyName = item.month + "月";
that.tableDatas_month[index][keyName] = item.val;
if (item.mpoint_nickname == "工业水"){
that.gyhourlyData_year[item.month] = item.val;
}else if(item.mpoint_nickname == "生活水"){
that.shhourlyData_year[item.month] = item.val;
}else if(item.mpoint_nickname == "绿化水"){
that.lvhourlyData_year[item.month] = item.val;
}
});
sum = sum * 100;
sum = Math.round(sum);

View File

@ -25,11 +25,12 @@
>
<thead class="myTableHead">
<tr>
<th colspan="5">水泥包装工序生产报告</th>
<th colspan="6">水泥包装工序生产报告</th>
</tr>
<tr>
<th colspan="2">参数</th>
<th>昨日</th>
<th>本日</th>
<th>本月</th>
<th>本年</th>
</tr>
@ -60,8 +61,8 @@
>
{{ item[4] }}
</td>
<!-- <td class="numCell">{{ item[5] }}</td>
<td class="numCell">{{ item[6] }}</td>
<td class="numCell">{{ item[5] }}</td>
<!-- <td class="numCell">{{ item[6] }}</td>
<td class="numCell">{{ item[7] }}</td>
<td class="numCell">{{ item[8] }}</td> -->
</tr>
@ -98,6 +99,14 @@
></el-date-picker>
</div>
</div>
<div class="chartWrap" v-show="typeRadio == 'day'">
<div class="chartTitle">本日生产参数统计图</div>
<scEcharts
height="400px"
width="1033px"
:option="optionHours"
></scEcharts>
</div>
<div class="chartWrap" v-show="typeRadio == 'month'">
<div class="chartTitle">本月生产参数统计图</div>
<scEcharts
@ -262,7 +271,7 @@ let toolbox = {
};
let legend = {
top: "2%",
data: ["熟料", "分布电耗"],
data: ["熟料", "分布电耗", "总产量"],
};
let yAxis = [
{
@ -327,19 +336,19 @@ export default {
mgroup: "",
},
tableDatas: [
["出厂水泥", "P.O42.5R 散装t", 0, 0, 0],
["出厂水泥", "P.O42.5R 袋装t", 0, 0, 0],
["出厂水泥", "P.O42.5 袋装t", 0, 0, 0],
["出厂水泥", "P.O42.5 散装t", 0, 0, 0],
["出厂水泥", "复合硅酸盐水泥;42.5R;袋装水泥(t)", 0, 0, 0],
["出厂水泥", "复合硅酸盐水泥;42.5R;散装水泥(t)", 0, 0, 0],
["出厂水泥", "普通硅酸盐水泥;52.5;散装水泥(t)", 0, 0, 0],
["出厂水泥", "散装水泥(t)", 0, 0, 0],
["出厂水泥", "袋装水泥(t)", 0, 0, 0],
["出厂水泥", "出厂水泥合计t", 0, 0, 0, 0, 0, 0, 0],
["出厂熟料", "熟料t", 0, 0, 0],
["能耗", "单位产品分布电耗KW·h/t", 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0],
["出厂水泥", "P.O42.5R 散装t", 0,0, 0, 0],
["出厂水泥", "P.O42.5R 袋装t", 0, 0,0, 0],
["出厂水泥", "P.O42.5 袋装t", 0, 0,0, 0],
["出厂水泥", "P.O42.5 散装t", 0, 0,0, 0],
["出厂水泥", "复合硅酸盐水泥;42.5R;袋装水泥(t)", 0, 0, 0, 0],
["出厂水泥", "复合硅酸盐水泥;42.5R;散装水泥(t)", 0, 0, 0, 0],
["出厂水泥", "普通硅酸盐水泥;52.5;散装水泥(t)", 0,0, 0, 0],
["出厂水泥", "散装水泥(t)", 0,0, 0, 0],
["出厂水泥", "袋装水泥(t)", 0,0, 0, 0],
["出厂水泥", "出厂水泥合计t", 0,0, 0, 0, 0, 0, 0, 0],
["出厂熟料", "熟料t", 0,0, 0, 0],
["能耗", "单位产品分布电耗KW·h/t", 0,0, 0, 0],
["能耗", "总电耗KW·h", 0,0, 0, 0],
],
tableName: "生产报告",
@ -551,6 +560,46 @@ export default {
this.$API.enm.mpointstat.list.req(params1).then((res1) => {
if (res1.length > 0) {
res1.forEach((item) => {
if (item.mpoint_name == "水泥+P.O42.5R 散装") {
that.tableDatas[0][5] = item.val;
}else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){
that.tableDatas[1][5] = item.val;
}else if (item.mpoint_name == "水泥+P.O42.5 袋装") {
that.tableDatas[2][5] = item.val;
}else if (item.mpoint_name == "水泥+P.O42.5 散装") {
that.tableDatas[3][5] = item.val;
}else if (item.mpoint_name == "复合硅酸盐水泥;42.5R;袋装水泥") {
that.tableDatas[4][5] = item.val;
}else if (item.mpoint_name == "水泥+P.C42.5 散装") {
that.tableDatas[5][5] = item.val;
}else if (item.mpoint_name == "水泥+P.O52.5 散装") {
that.tableDatas[6][5] = item.val;
}else if (item.mpoint_name == "散装水泥总和"){
that.tableDatas[7][5] = item.val;
}else if (item.mpoint_name == "袋装水泥总和") {
that.tableDatas[8][5] = item.val;
}
else if (item.mpoint_name == "出厂水泥") {
that.tableDatas[9][5] = item.val;
}else if (item.mpoint_name == "出厂熟料"){
that.tableDatas[10][5] = item.val;
}else if (item.mpoint_name == "包装进线") {
that.tableDatas[11][5] = item.elec_consume_unit;
that.tableDatas[12][5] = item.val;
}
}
)}
}).then(()=>{
//
let params2 = {};
params2.page = 0;
params2.year_s = year;
params2.month_s = month;
params2.type = "month_s";
params2.mgroup = that.query.mgroup;
this.$API.enm.mpointstat.list.req(params2).then((res2) => {
if (res2.length > 0) {
res2.forEach((item) => {
if (item.mpoint_name == "水泥+P.O42.5R 散装") {
that.tableDatas[0][4] = item.val;
}else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){
@ -579,46 +628,6 @@ export default {
that.tableDatas[12][4] = item.val;
}
}
)}
}).then(()=>{
//
let params2 = {};
params2.page = 0;
params2.year_s = year;
params2.month_s = month;
params2.type = "month_s";
params2.mgroup = that.query.mgroup;
this.$API.enm.mpointstat.list.req(params2).then((res2) => {
if (res2.length > 0) {
res2.forEach((item) => {
if (item.mpoint_name == "水泥+P.O42.5R 散装") {
that.tableDatas[0][3] = item.val;
}else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){
that.tableDatas[1][3] = item.val;
}else if (item.mpoint_name == "水泥+P.O42.5 袋装") {
that.tableDatas[2][3] = item.val;
}else if (item.mpoint_name == "水泥+P.O42.5 散装") {
that.tableDatas[3][3] = item.val;
}else if (item.mpoint_name == "复合硅酸盐水泥;42.5R;袋装水泥") {
that.tableDatas[4][3] = item.val;
}else if (item.mpoint_name == "水泥+P.C42.5 散装") {
that.tableDatas[5][3] = item.val;
}else if (item.mpoint_name == "水泥+P.O52.5 散装") {
that.tableDatas[6][3] = item.val;
}else if (item.mpoint_name == "散装水泥总和"){
that.tableDatas[7][3] = item.val;
}else if (item.mpoint_name == "袋装水泥总和") {
that.tableDatas[8][3] = item.val;
}
else if (item.mpoint_name == "出厂水泥") {
that.tableDatas[9][3] = item.val;
}else if (item.mpoint_name == "出厂熟料"){
that.tableDatas[10][3] = item.val;
}else if (item.mpoint_name == "包装进线") {
that.tableDatas[11][3] = item.elec_consume_unit;
that.tableDatas[12][3] = item.val;
}
}
)
}
}).then(() => {
@ -661,16 +670,55 @@ export default {
that.tableDatas[12][2] = item.val;
}
}
)
}
)}
});
}
)
}).then(() => {
//
let params4 = {};
params4.page = 0;
params4.year_s = year_d;
params4.month_s = month_d;
params4.day_s = days;
params4.type = "day_s";
params4.mgroup = that.query.mgroup;
this.$API.enm.mpointstat.list.req(params4).then((res3) => {
if (res3.length > 0) {
res3.forEach((item) => {
if (item.mpoint_name == "水泥+P.O42.5R 散装") {
that.tableDatas[0][3] = item.val;
}else if (item.mpoint_name == "水泥+P.O42.5R 袋装"){
that.tableDatas[1][3] = item.val;
}else if (item.mpoint_name == "水泥+P.O42.5 袋装") {
that.tableDatas[2][3] = item.val;
}else if (item.mpoint_name == "水泥+P.O42.5 散装") {
that.tableDatas[3][3] = item.val;
}else if (item.mpoint_name == "复合硅酸盐水泥;42.5R;袋装水泥") {
that.tableDatas[4][3] = item.val;
}else if (item.mpoint_name == "水泥+P.C42.5 散装") {
that.tableDatas[5][3] = item.val;
}else if (item.mpoint_name == "水泥+P.O52.5 散装") {
that.tableDatas[6][3] = item.val;
}else if (item.mpoint_name == "散装水泥总和"){
that.tableDatas[7][3] = item.val;
}else if (item.mpoint_name == "袋装水泥总和") {
that.tableDatas[8][3] = item.val;
}
else if (item.mpoint_name == "出厂水泥") {
that.tableDatas[9][3] = item.val;
}else if (item.mpoint_name == "出厂熟料"){
that.tableDatas[10][3] = item.val;
}else if (item.mpoint_name == "包装进线") {
that.tableDatas[11][3] = item.elec_consume_unit;
that.tableDatas[12][3] = item.val;
}
}
)}
});
})
}
);
that.getDayData(year, month);
that.getMonthData(year);
});

View File

@ -272,7 +272,13 @@ export default {
dataArr.push(itemData.total_production);
}
// dataArr.push(itemData.coal_consume_unit);
dataArr.push(itemData.production_cost_unit);
let cost = 0;
if (itemData.total_production == 0){
cost = 0
}else{
cost = itemData.production_cost_unit
}
dataArr.push(cost);
let sub1data = itemData.imaterial_data;
for (let i = 0; i < sub1data.length; i++) {
if (sub1data[i].material_name === '湿电石渣进厂'|| sub1data[i].material_name === '动力电'|| sub1data[i].material_name === '工业水'){

View File

@ -404,9 +404,9 @@ export default {
},
tableDatas: [
["产量", "总产量t", 0, 0, 0, 0, 0, 0, 0, 0],
["产量", "台时产量t/h", 0, 0, 0, 0, 0, 0, 0, 0],
["运转时间", "运转时间h", 0, 0, 0, "/", 0, 0, "/", "/"],
["运转时间", "运转率(%", 0, 0, 0, "/", 0, 0, "/", "/"],
["产量", "台时产量t/h", "/", 0, 0, 0, 0, 0, 0, 0],
["运转时间", "运转时间h", "/", 0, 0, "/", 0, 0, "/", "/"],
["运转时间", "运转率(%", "/", 0, 0, "/", 0, 0, "/", "/"],
["能耗", "生料分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0, 0, "/", "/", "/","/"],
["成本", "生料成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0],
@ -796,7 +796,7 @@ export default {
let year_d = year,
month_d = month,
days_d = days;
//8
let newDate = timeDate - dayTime;
let lastDate = new Date(newDate);
@ -814,6 +814,7 @@ export default {
this.$API.mtm.mgroup.list
.req({ page: 0, search: "原料磨" })
.then((res) => {
console.log("原料磨", res);
that.query.mgroup = res[0].id;
//
let params3 = {};
@ -857,9 +858,6 @@ export default {
that.tableDatas[5][2] = 0;
that.tableDatas[6][2] = 0;
}else {
that.tableDatas[1][2] = data4.production_hour;
that.tableDatas[2][2] = data4.run_hour;
that.tableDatas[3][2] = data4.run_rate;
that.tableDatas[4][2] = data4.elec_consume_unit;
that.tableDatas[5][2] = data4.elec_consume;
that.tableDatas[6][2] = data4.production_cost_unit;}
@ -877,6 +875,7 @@ export default {
data5.forEach((item5) => {
let str = "goal_val_" + that.month;
debugger;
console.log(str, item5[str]);
if (item5.goal_cate_name == "总产量t") {
that.tableDatas[0][6] = item5[str];
@ -1027,6 +1026,7 @@ export default {
},
dateChange(val) {
let that = this;
console.log(val);
if (val !== null) {
if (this.typeRadio == "day") {
let year = val.split("-")[0];
@ -1066,6 +1066,7 @@ export default {
seriesData2 = [],
seriesData3 = [],
seriesData4 = [];
let data = response;
data.forEach((item) => {
let ind = item.hour;