fix: 修改各个工段柱状图

This commit is contained in:
zty 2024-08-20 14:40:09 +08:00
parent 4aaad74a6a
commit e44e904abe
12 changed files with 104 additions and 76 deletions

View File

@ -1016,16 +1016,16 @@ const routes = [
},
component: "enm_energy/month_base",
},
{
name: "energyPicture",
path: "/enm_energy/energyPicture",
meta: {
title: "能源流向",
// icon: "el-icon-grid",
perms: ["enm_energy_picture"],
},
component: "enm_energy/energyPicture",
},
// {
// name: "energyPicture",
// path: "/enm_energy/energyPicture",
// meta: {
// title: "能源流向",
// // icon: "el-icon-grid",
// perms: ["enm_energy_picture"],
// },
// component: "enm_energy/energyPicture",
// },
],
},
//全厂报表
@ -2779,7 +2779,7 @@ const routes = [
title: "每月配置",
icon: "el-icon-checked",
type: "menu",
perms: ["enm"],
perms: ["enm_monthSet"],
},
children: [
{
@ -2808,7 +2808,7 @@ const routes = [
meta: {
title: "月度年度目标值",
// icon: "el-icon-grid",
perms: ["enm"],
perms: ["enm_goal"],
},
component: "enm_monthSet/goalSetting",
},

View File

@ -519,7 +519,7 @@ export default {
obj.day = days;
obj.mgroup__name = "煤磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -560,7 +560,7 @@ export default {
obj.month_s = month;
obj.mgroup__name = "煤磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -601,7 +601,7 @@ export default {
obj.year_s = year;
obj.mgroup__name = "煤磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {

View File

@ -471,7 +471,7 @@ export default {
obj.day = days;
obj.mgroup__name = "煤磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -512,7 +512,7 @@ export default {
obj.month_s = month;
obj.mgroup__name = "煤磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -553,7 +553,7 @@ export default {
obj.year_s = year;
obj.mgroup__name = "煤磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {

View File

@ -195,7 +195,7 @@
},
getData(){
let that = this;
let params = {};
let params = {page:0};
let arr = [];
if(that.query.type==0){//
params.type='day_s';
@ -205,11 +205,14 @@
}else if(that.query.type==1){//
params.type='month_s';
params.year_s = Number(that.query.year);
}else if (that.query.type==2){
params.type='year_s';
params.year_s = Number(that.query.yearStart);
}
params.mgroup__belong_dept = that.query.belong_dept;
this.$API.enm.enstat.req(params).then((res) => {
let data = res.results;
let data = res;
let wrapArr = [];
let innerArr = [];
let ind = 0;
@ -229,31 +232,41 @@
wrapArr[ind][0]=item
}else if(item.mgroup_name=='原料磨'){
wrapArr[ind][1]=item
}else if(item.mgroup_name=='原料压缩空气'){
wrapArr[ind][2]=item
}
}else if(that.deptName=='烧成车间'){
if(item.mgroup_name=='回转窑'){
wrapArr[ind][1]=item
}else if (item.mgroup_name=='烧成压缩空气') {
wrapArr[ind][2]=item
}else{
wrapArr[ind][0]=item
}
}else{
if(item.mgroup_name=='水泥磨'){
wrapArr[ind][1]=item
}else if(item.mgroup_name=='水泥压缩空气'){
wrapArr[ind][2]=item
}else{
wrapArr[ind][0]=item
}
}
});
// debugger;
// console.log(wrapArr);
console.log(wrapArr);
wrapArr.forEach((item1)=>{
//item1------
if(item1!=undefined){
let itemArr = [];
let time =item1[0].day_s!=null? item1[0].year_s+'.'+item1[0].month_s+'.'+item1[0].day_s:item1[0].year_s+'.'+item1[0].month_s;
let time = item1[0].day_s && item1[0].month_s
? item1[0].year_s + '.' + item1[0].month_s + '.' + item1[0].day_s
: item1[0].month_s
? item1[0].year_s + '.' + item1[0].month_s
: item1[0].year_s;
itemArr.push(time)
itemArr.push( item1[0].elec_consume)
itemArr.push( item1[0].elec_coal_consume)
itemArr.push( item1[0].elec_consume) //
itemArr.push( item1[0].elec_coal_consume) //
if(that.deptName=='烧成车间'){
itemArr.push( item1[0].pcoal_consume)//t
itemArr.push( item1[0].pcoal_coal_consume)//tce)
@ -265,18 +278,26 @@
}else if(that.deptName=='水泥车间'){
itemArr.push( item1[0].water_consume)//
}
itemArr.push( item1[0].total_production)
itemArr.push( item1[0].cen_consume_unit)
itemArr.push( item1[1].elec_consume)
itemArr.push( item1[1].elec_consume*0.1229/1000)
itemArr.push( item1[0].total_production) //
itemArr.push( item1[0].cen_consume_unit) //
if (item1[1]){
itemArr.push( item1[1].elec_consume)
itemArr.push( item1[1].elec_coal_consume)
}else{
itemArr.push( 0)
itemArr.push( 0)
}
if(that.deptName=='原料车间'){
itemArr.push( item1[1].water_consume)//
itemArr.push( item1[1].kiln_end_heat)//
}
itemArr.push( item1[1].total_production)
itemArr.push( item1[1].cen_consume_unit)
itemArr.push( item1[1].cair_consume)//
if(item1 &&item1[2]){
itemArr.push(item1[2].cair_consume)//
}else{
itemArr.push( 0)
}
innerArr.push(itemArr)
}
})

View File

@ -110,12 +110,12 @@ export default {
wrapArr2[i].industry_total_val;
this.tableDatas[i][2] =
wrapArr2[i].industry_add_val;
this.tableDatas[i][3] = wrapArr2[i].en_consume;
this.tableDatas[i][3] = wrapArr2[i].en_consume; //
let tValue3 = 0,
hValue3 = 0,
tPercent3 = 0,
hPercent3 = 0;
if (wrapArr2[i].month_s > 1) {
if (wrapArr2[i].month_s > 1 && i>0) {
tValue3 = wrapArr2[i - 1]
? wrapArr2[i - 1].en_consume
: "/";
@ -126,9 +126,9 @@ export default {
}
if (tValue3 !== "/" && tValue3 !== 0) {
tPercent3 =
((wrapArr2[i].en_consume - tValue3) /
(((wrapArr2[i].en_consume - tValue3) /
tValue3) *
100;
100).toFixed(2);
} else {
tPercent3 = "/";
}
@ -141,14 +141,14 @@ export default {
} else {
hPercent3 = "/";
}
this.tableDatas[i][4] = hPercent3;
this.tableDatas[i][5] = tPercent3;
this.tableDatas[i][6] = wrapArr2[i].en_consume_unit;
this.tableDatas[i][4] = hPercent3; //
this.tableDatas[i][5] = tPercent3; //
this.tableDatas[i][6] = wrapArr2[i].en_consume_unit; //
let tValue6 = 0,
hValue6 = 0,
tPercent6 = 0,
hPercent6 = 0;
if (wrapArr2[i].month_s > 1) {
if (wrapArr2[i].month_s > 1 && i > 0) {
tValue6 = wrapArr2[i - 1]
? wrapArr2[i - 1].en_consume_unit
: "/";
@ -156,7 +156,7 @@ export default {
tValue6 = wrapArr[12]
? wrapArr[12].en_consume_unit
: "/";
}
}
if (tValue6 !== "/" && tValue6 !== 0) {
tPercent6 =
((wrapArr2[i].en_consume_unit - tValue6) /
@ -176,15 +176,15 @@ export default {
} else {
hPercent6 = "/";
}
this.tableDatas[i][7] = hPercent6;
this.tableDatas[i][8] = tPercent6;
this.tableDatas[i][7] = hPercent6; //
this.tableDatas[i][8] = tPercent6; //
this.tableDatas[i][9] =
wrapArr2[i].en_add_consume_unit;
let tValue9 = 0,
hValue9 = 0,
tPercent9 = 0,
hPercent9 = 0;
if (wrapArr2[i].month_s > 1) {
if (wrapArr2[i].month_s > 1 && i > 0) {
tValue9 = wrapArr2[i - 1]
? wrapArr2[i - 1].en_add_consume_unit
: "/";

View File

@ -473,10 +473,6 @@ export default {
that.days = myDate.getDate();
that.hours = myDate.getHours();
that.getMpoints();
that.getTableHourData();
that.getHourData(that.year, that.month, that.days);
that.getDayData(that.year, that.month);
that.getMonthData(that.year);
},
methods: {
getMpoints() {
@ -484,9 +480,8 @@ export default {
let obj = {};
obj.mgroup__name = "回转窑";
obj.page = 0;
obj.enabled = 1;
// obj.enabled = 1;
obj.material__code__in = "elec,elec_0";
obj.ep_monitored__isnull = 0;
obj.need_display = 1;
obj.ordering = "report_sortstr";
this.$API.enm.mpoint.list.req(obj).then((res) => {
@ -497,13 +492,17 @@ export default {
});
console.log("arr", arr);
that.mpoints = arr;
that.getTableHourData();
that.getHourData(that.year, that.month, that.days);
that.getDayData(that.year, that.month);
that.getMonthData(that.year);
});
},
typeRadioChange() {
this.searchDate = "";
},
dateChange(val) {
console.log(val);
if (val !== null) {
if (this.typeRadio == "day") {
let year = val.split("-")[0];
@ -637,7 +636,7 @@ export default {
obj.day = days;
obj.mgroup__name = "回转窑";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -678,7 +677,7 @@ export default {
obj.month_s = month;
obj.mgroup__name = "回转窑";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// // obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -719,7 +718,7 @@ export default {
obj.year_s = year;
obj.mgroup__name = "回转窑";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -728,13 +727,14 @@ export default {
seriesData.push([]);
}
let data = response;
console.log('sd',seriesData, that.mpoints)
data.forEach((item) => {
let ind = item.month_s - 1;
let index = that.mpoints.indexOf(item.mpoint_name); //mpoint
if(index != undefined){
seriesData[index][ind] = item.elec_consume_unit;
if(index==-1){
return;
}
seriesData[index][ind] = item.elec_consume_unit;
});
let options = { ...that.option3 };
for (let j = 0; j < that.mpoints.length; j++) {

View File

@ -382,7 +382,7 @@ export default {
obj.hour = hours_h;
obj.mgroup__name = "回转窑";
obj.mpoint__material__code__in = "elec,elec_0";
// obj.mpoint__ep_monitored__isnull = 0;
// // obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((res) => {
@ -469,7 +469,7 @@ export default {
obj.day = days;
obj.mgroup__name = "回转窑";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -509,7 +509,7 @@ export default {
obj.month_s = month;
obj.mgroup__name = "回转窑";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -550,7 +550,7 @@ export default {
obj.year_s = year;
obj.mgroup__name = "回转窑";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {

View File

@ -591,7 +591,7 @@ export default {
obj.day = days;
obj.mgroup__name = "水泥磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -632,7 +632,7 @@ export default {
obj.month_s = month;
obj.mgroup__name = "水泥磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -673,7 +673,7 @@ export default {
obj.year_s = year;
obj.mgroup__name = "水泥磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -685,6 +685,9 @@ export default {
data.forEach((item) => {
let ind = item.month_s - 1;
let index = that.mpoints.indexOf(item.mpoint_name); //mpoint
if(index==-1){
return;
}
seriesData[index][ind] = item.elec_consume_unit;
});
let options = { ...that.option3 };

View File

@ -203,17 +203,17 @@
if(that.deptName=='原料车间'){
that.header2Obj=[{name:'辅料',lengths:3},{name:'干混生料',lengths:4}];
that.header2 = ['辅料','干混生料'];//
that.header3 = ['细度','Fe2O3','水分','细度','Fe2O3','水分','CaO'];//
// that.header3 = ['','Fe2O3','','','Fe2O3','','CaO'];//
that.header4 = ['平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率'];//
}else if(that.deptName=='烧成车间'){
that.header2Obj=[{name:'入窑生料',lengths:4},{name:'熟料',lengths:4}];
that.header2 = ['入窑生料','熟料'];//
that.header3 = ['CaO','Fe2O3','细度','水分','立升重','f-CaO','细度','水分'];//
// that.header3 = ['CaO','Fe2O3','','','','f-CaO','',''];//
that.header4 = ['平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率'];//
}else{
that.header2Obj=[{name:'出磨水泥',lengths:3}];
that.header2 = ['出磨水泥'];//
that.header3 = ['比表面积','SO3','掺量'];//
// that.header3 = ['','SO3',''];//
that.header4 = ['平均值','检次','合次','及格率','平均值','检次','合次','及格率','平均值','检次','合次','及格率'];//
}
let params = {page: 0};

View File

@ -570,7 +570,7 @@ export default {
obj.day = days;
obj.mgroup__name = "原料磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -611,7 +611,7 @@ export default {
obj.month_s = month;
obj.mgroup__name = "原料磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -652,7 +652,7 @@ export default {
obj.year_s = year;
obj.mgroup__name = "原料磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {

View File

@ -459,7 +459,7 @@ export default {
obj.day = days;
obj.mgroup__name = "原料磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -500,7 +500,7 @@ export default {
obj.month_s = month;
obj.mgroup__name = "原料磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -541,7 +541,7 @@ export default {
obj.year_s = year;
obj.mgroup__name = "原料磨";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {

View File

@ -277,9 +277,6 @@ export default {
that.month = myDate.getMonth() + 1;
that.days = myDate.getDate();
that.getMpoints();
that.getTableHourData();
that.getDayData(that.year, that.month);
that.getMonthData(that.year);
},
methods: {
getMpoints() {
@ -299,6 +296,10 @@ export default {
});
console.log("arr", arr);
that.mpoints = arr;
that.getTableHourData();
that.getDayData(that.year, that.month);
that.getMonthData(that.year);
});
},
typeRadioChange() {
@ -397,7 +398,7 @@ export default {
obj.month_s = month;
obj.mgroup__name = "电石渣";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -438,7 +439,7 @@ export default {
obj.year_s = year;
obj.mgroup__name = "电石渣";
obj.mpoint__material__code__in = "elec,elec_0";
obj.mpoint__ep_monitored__isnull = 0;
// obj.mpoint__ep_monitored__isnull = 0;
obj.mpoint__need_display = 1;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((response) => {
@ -450,6 +451,9 @@ export default {
data.forEach((item) => {
let ind = item.month_s - 1;
let index = that.mpoints.indexOf(item.mpoint_name); //mpoint
if(index==-1){
return;
}
seriesData[index][ind] = item.elec_consume_unit;
});
let options = { ...that.option3 };