This commit is contained in:
shijing 2025-01-20 17:13:51 +08:00
commit eff75a7c86
26 changed files with 1568 additions and 235 deletions

View File

@ -2,6 +2,52 @@
<div class="app-container"> <div class="app-container">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-select
v-model="query.type"
placeholder="查询类型"
clearable
class="headerSearch"
@change="typeCange"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-date-picker
v-model="query.day"
type="date"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
placeholder="天"
v-if="query.type==0"
style="margin-right: 6px"
/>
<el-date-picker
v-model="query.month"
type="month"
value-format="YYYY-MM"
format="YYYY-MM"
placeholder="查询月份"
v-if="query.type==1"
class="headerSearch"
/>
<el-date-picker
v-model="query.year"
type="year"
value-format="YYYY"
format="YYYY"
placeholder="查询年份"
v-if="query.type==2"
class="headerSearch"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="dateChange"
></el-button>
<el-button <el-button
type="primary" type="primary"
@click="exportExcel()" @click="exportExcel()"
@ -88,7 +134,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="radioWrap"> <!-- <div class="radioWrap">
<el-radio-group <el-radio-group
v-model="typeRadio" v-model="typeRadio"
@change="typeRadioChange" @change="typeRadioChange"
@ -128,8 +174,8 @@
@change="dateChange" @change="dateChange"
></el-date-picker> ></el-date-picker>
</div> </div>
</div> </div> -->
<div class="chartWrap" v-show="typeRadio == 'day'"> <div class="chartWrap" v-show="query.type == 0">
<div class="chartTitle">本日生产参数统计图</div> <div class="chartTitle">本日生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -137,7 +183,7 @@
:option="optionHour" :option="optionHour"
></scEcharts> ></scEcharts>
</div> </div>
<div class="chartWrap" v-show="typeRadio == 'month'"> <div class="chartWrap" v-show="query.type == 1">
<div class="chartTitle">本月生产参数统计图</div> <div class="chartTitle">本月生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -145,7 +191,7 @@
:option="optionDay" :option="optionDay"
></scEcharts> ></scEcharts>
</div> </div>
<div class="chartWrap" v-show="typeRadio == 'year'"> <div class="chartWrap" v-show="query.type == 2">
<div class="chartTitle">本年生产参数统计图</div> <div class="chartTitle">本年生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -401,7 +447,7 @@ let yAxis_hour = [
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: colors[3], color: colors[1],
}, },
}, },
axisLabel: { axisLabel: {
@ -432,8 +478,14 @@ export default {
month: 1, month: 1,
days: 1, days: 1,
hours: 1, hours: 1,
options: [
{id:0,name:'日统计'},
{id:1,name:'月统计'},
{id:2,name:'年统计'}
],
query: { query: {
mgroup: "", mgroup: "",
type: 0,
}, },
tableDatas: [ tableDatas: [
["产量", "煤磨总产量t", 0, 0, 0, 0, 0, 0, 0, 0], ["产量", "煤磨总产量t", 0, 0, 0, 0, 0, 0, 0, 0],
@ -645,7 +697,6 @@ export default {
let year_h = hourDate.getFullYear(); let year_h = hourDate.getFullYear();
let month_h = hourDate.getMonth() + 1; let month_h = hourDate.getMonth() + 1;
let days_h = hourDate.getDate(); let days_h = hourDate.getDate();
let hours_h = hourDate.getHours();
this.$API.mtm.mgroup.list this.$API.mtm.mgroup.list
.req({ page: 0, search: "煤磨" }) .req({ page: 0, search: "煤磨" })
.then((res) => { .then((res) => {
@ -682,7 +733,6 @@ export default {
params4.day_s = days_h; params4.day_s = days_h;
params4.type = "day_s"; params4.type = "day_s";
params4.mgroup = that.query.mgroup; params4.mgroup = that.query.mgroup;
console.log("本日----p", params4);
that.$API.enm.enstat.req(params4).then((res4) => { that.$API.enm.enstat.req(params4).then((res4) => {
if (res4) { if (res4) {
console.log("本日", res4); console.log("本日", res4);
@ -852,33 +902,194 @@ export default {
}, },
}) })
}, },
dateChange(val) { dateChange() {
let that = this; let that = this;
console.log(val); let arr = [];
if (val !== null) { if(that.query.type==0 && that.query.day) {
if (this.typeRadio == "day") { arr = that.query.day.split('-');
let year = val.split("-")[0]; that.year = Number(arr[0]);
let month = val.split("-")[1]; that.month = Number(arr[1]);
let days = val.split("-")[2]; that.days = Number(arr[2]);
this.getHourData(year, month, days); this.getHourData(that.year, that.month, that.days);
} else if (this.typeRadio == "month") { this.get_days(that.year, that.month, that.days);
let year = val.split("-")[0]; }
let month = val.split("-")[1]; else if(that.query.type==1 && that.query.month) {
let year = that.query.month.split("-")[0];
let month = that.query.month.split("-")[1];
month = Number(month);
this.getDayData(year, month); this.getDayData(year, month);
} else { this.get_months(year, month);
this.getMonthData(val); this.get_month_year_goal(year, month);
} }else if (that.query.type==2 && that.query.year ) {
} else { let year = that.query.year;
if (this.typeRadio == "day") { this.getMonthData(year);
that.getHourData(that.year, that.month, that.days); this.get_years(year);
} else if (this.typeRadio == "month") { this.get_month_year_goal(year , 1);
this.getDayData(that.year, that.month);
} else {
this.getMonthData(that.year);
}
} }
}, },
get_days(year_d, month_d, days){
let that = this;
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;
that.$API.enm.enstat.req(params4).then((res4) => {
if (res4) {
let data4 = res4[0];
that.tableDatas[0][2] = data4.total_production;
if (data4.total_production < 1 ){
that.tableDatas[0][2] = 0;
that.tableDatas[1][2] = 0;
that.tableDatas[2][2] = 0;
that.tableDatas[3][2] = 0;
that.tableDatas[4][2] = 0;
that.tableDatas[5][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;
}
}
});
},
// //
get_months(year_d, month_d){
let that = this;
let params2 = {};
params2.page = 0;
params2.year_s = year_d;
params2.month_s = month_d;
params2.type = "month_s";
params2.mgroup = that.query.mgroup;
that.$API.enm.enstat.req(params2).then((res2) => {
if (res2.length > 0) {
let data2 = res2[0];
that.tableDatas[0][4] = data2.total_production;
that.tableDatas[0][7] = precen(
that.tableDatas[0][4],
that.tableDatas[0][6]
);
that.tableDatas[1][4] = data2.production_hour;
that.tableDatas[1][7] = precen(
that.tableDatas[1][4],
that.tableDatas[1][6]
);
that.tableDatas[2][4] = data2.run_hour;
that.tableDatas[2][7] = precen(
that.tableDatas[2][4],
that.tableDatas[2][6]
);
that.tableDatas[3][4] = data2.run_rate;
that.tableDatas[3][7] = precen(
that.tableDatas[3][4],
that.tableDatas[3][6]
);
that.tableDatas[4][4] = data2.elec_consume_unit;
that.tableDatas[4][7] = consume_precen(
(that.tableDatas[4][6]-that.tableDatas[4][4]),
that.tableDatas[4][6]
);
that.tableDatas[5][4] = data2.elec_consume;
that.tableDatas[5][7] = consume_precen(
(that.tableDatas[5][6]-that.tableDatas[5][4]),
that.tableDatas[5][6]
);
}
});
},
get_years(year){
let that = this;
let params1 = {};
params1.page = 0;
params1.year_s = year;
params1.type = "year_s";
params1.mgroup = that.query.mgroup;
that.$API.enm.enstat.req(params1).then((res1) => {
if (res1.length > 0) {
let data1 = res1[0];
that.tableDatas[0][5] = data1.total_production;
that.tableDatas[0][9] = precen(
that.tableDatas[0][5],
that.tableDatas[0][8]
);
that.tableDatas[1][5] = data1.production_hour;
that.tableDatas[1][9] = precen(
that.tableDatas[1][5],
that.tableDatas[1][8]
);
that.tableDatas[2][5] = data1.run_hour;
that.tableDatas[2][9] = precen(
that.tableDatas[2][5],
that.tableDatas[2][8]
);
that.tableDatas[3][5] = data1.run_rate;
that.tableDatas[3][9] = precen(
that.tableDatas[3][5],
that.tableDatas[3][8]
);
that.tableDatas[4][5] = data1.elec_consume_unit;
that.tableDatas[4][9] = consume_precen(
that.tableDatas[4][8] - that.tableDatas[4][5],
that.tableDatas[4][8]
);
that.tableDatas[5][5] = data1.elec_consume;
that.tableDatas[5][9] = consume_precen(
(that.tableDatas[5][8]-that.tableDatas[5][5]),
that.tableDatas[5][8]
);
}
});
},
get_month_year_goal(year, month){
let that = this;
let params5 = {};
params5.page = 0;
params5.year = year;
params5.mgroup = that.query.mgroup;
this.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
let str = "goal_val_" + month;
if (item5.goal_cate_name == "总产量t") {
that.tableDatas[0][6] = item5[str];
that.tableDatas[0][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "台时产量t/h"
) {
that.tableDatas[1][6] = item5[str];
that.tableDatas[1][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "运转时间h"
) {
that.tableDatas[2][6] = item5[str];
that.tableDatas[2][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "运转率(%"
) {
that.tableDatas[3][6] = item5[str];
that.tableDatas[3][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品分布电耗kW·h/t"
) {
that.tableDatas[4][6] = item5[str];
that.tableDatas[4][8] = item5.goal_val;
}else if (item5.goal_cate_name == "总电量kW·h") {
that.tableDatas[5][6] = item5[str];
that.tableDatas[5][8] = item5.goal_val;
}
});
}
})
},
getHourData(year, month, days) { getHourData(year, month, days) {
let that = this; let that = this;
let query = {}; let query = {};

View File

@ -92,6 +92,7 @@ export default {
}, },
tableDatas: [], tableDatas: [],
goalDatas: [], goalDatas: [],
tableName:'煤磨工序生产报告',
}; };
}, },
mounted() { mounted() {

View File

@ -125,6 +125,7 @@ export default {
showClose: true, showClose: true,
echartType: "line", echartType: "line",
asynDialog: false, asynDialog: false,
tableName:'煤磨工序生产报告'
}; };
}, },
async mounted() { async mounted() {

View File

@ -97,7 +97,12 @@
style="width: 70%" style="width: 70%"
border border
:height="tableHeight" :height="tableHeight"
> @selection-change="handleSelectionChange"
><!-- 复选框列 -->
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column label="100KW以上设备用电峰谷平" align="center" width="100" fixed> <el-table-column label="100KW以上设备用电峰谷平" align="center" width="100" fixed>
<el-table-column label="设备" prop="mpoint__name" min-width="110" fixed></el-table-column> <el-table-column label="设备" prop="mpoint__name" min-width="110" fixed></el-table-column>
<el-table-column label="单位" prop="unit" min-width="110" fixed></el-table-column> <el-table-column label="单位" prop="unit" min-width="110" fixed></el-table-column>
@ -177,6 +182,7 @@ import * as echarts from 'echarts';
{ label: '深谷', prop: 'deep' }, { label: '深谷', prop: 'deep' },
], ],
tableData:[], tableData:[],
selectedRows: [],
tableDatas2: [ tableDatas2: [
{ type: "波峰", time: "8:00--11:00 19:00-24:00" }, { type: "波峰", time: "8:00--11:00 19:00-24:00" },
{ type: "尖峰", time: "7月 21:00--23:00, 1、11、12月19:00--21:00" }, { type: "尖峰", time: "7月 21:00--23:00, 1、11、12月19:00--21:00" },
@ -257,13 +263,11 @@ import * as echarts from 'echarts';
this.tableDatas_range = res; this.tableDatas_range = res;
}); });
}, },
dateChange() { dateChange() {
let that = this; let that = this;
that.mpointList = []; // that.mpointList = []; //
let arr = [], let arr = [],
obj = {}; obj = {};
console.log(that.query.mgroupName, 'that.query.mgroupName')
that.$API.enm.mpoint.list that.$API.enm.mpoint.list
.req({ .req({
page: 0, page: 0,
@ -279,7 +283,6 @@ import * as echarts from 'echarts';
if (res.length === 0) { if (res.length === 0) {
return; return;
} }
console.log(res, 'res-----------')
that.mpointList = res that.mpointList = res
.filter((item) => item.report_sortstr !== "" && item.mgroup_name !== '生活区') .filter((item) => item.report_sortstr !== "" && item.mgroup_name !== '生活区')
.map((item) => item.id); // id .map((item) => item.id); // id
@ -301,7 +304,6 @@ import * as echarts from 'echarts';
obj.start_time = that.daterange[0]; obj.start_time = that.daterange[0];
obj.end_time = that.daterange[1]; obj.end_time = that.daterange[1];
} }
console.log(that.mpointList.length, 'that.mpointList')
let mpointID = that.mpointList.join(','); let mpointID = that.mpointList.join(',');
obj.page = 0; obj.page = 0;
obj.type = 'hour'; obj.type = 'hour';
@ -331,13 +333,16 @@ import * as echarts from 'echarts';
return acc; return acc;
}, []); }, []);
this.tableData = groupedData; this.tableData = groupedData;
console.log("groupedData",groupedData)
}) })
.catch((error) => { .catch((error) => {
console.error("API 请求错误: ", error); console.error("API 请求错误: ", error);
}); });
}); });
},
handleSelectionChange(val) {
this.selectedRows = val;
console.log("选中的行数据:", this.selectedRows);
}, },
// //
showBarChart(){ showBarChart(){
@ -368,7 +373,7 @@ import * as echarts from 'echarts';
{ name: '尖峰', data: [] }, { name: '尖峰', data: [] },
{ name: '深谷', data: [] } { name: '深谷', data: [] }
]; ];
let categories = this.tableData.map(item => item.mpoint__name); // const categories = this.selectedRows.map(item => item.mpoint__name); //
this.tableData.forEach(item => { this.tableData.forEach(item => {
seriesData[0].data.push(item.flat ? parseFloat(item.flat) : 0); // seriesData[0].data.push(item.flat ? parseFloat(item.flat) : 0); //
seriesData[1].data.push(item.high ? parseFloat(item.high) : 0); // seriesData[1].data.push(item.high ? parseFloat(item.high) : 0); //

View File

@ -137,6 +137,7 @@ export default {
timeStamp: 0, timeStamp: 0,
year_s: "", year_s: "",
tableDatas: [], tableDatas: [],
tableName:'全厂能源统计',
optionMonth:{}, optionMonth:{},
query: {"year_s":""}, query: {"year_s":""},
option1: { option1: {

View File

@ -2,6 +2,52 @@
<div class="app-container"> <div class="app-container">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-select
v-model="query.type"
placeholder="查询类型"
clearable
class="headerSearch"
@change="typeCange"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-date-picker
v-model="query.day"
type="date"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
placeholder="天"
v-if="query.type==0"
style="margin-right: 6px"
/>
<el-date-picker
v-model="query.month"
type="month"
value-format="YYYY-MM"
format="YYYY-MM"
placeholder="查询月份"
v-if="query.type==1"
class="headerSearch"
/>
<el-date-picker
v-model="query.year"
type="year"
value-format="YYYY"
format="YYYY"
placeholder="查询年份"
v-if="query.type==2"
class="headerSearch"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="dateChange"
></el-button>
<el-button <el-button
type="primary" type="primary"
@click="exportExcel()" @click="exportExcel()"
@ -102,7 +148,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="radioWrap"> <!-- <div class="radioWrap">
<el-radio-group <el-radio-group
v-model="typeRadio" v-model="typeRadio"
@change="typeRadioChange" @change="typeRadioChange"
@ -142,9 +188,9 @@
@change="dateChange" @change="dateChange"
></el-date-picker> ></el-date-picker>
</div> </div>
</div> </div> -->
<div class="chartWrap" v-show="typeRadio == 'day'"> <div class="chartWrap" v-show="query.type == 0">
<div class="chartTitle">本日生产参数统计图</div> <div class="chartTitle">本日生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -152,7 +198,7 @@
:option="optionHour" :option="optionHour"
></scEcharts> ></scEcharts>
</div> </div>
<div class="chartWrap" v-show="typeRadio == 'month'"> <div class="chartWrap" v-show="query.type == 1">
<div class="chartTitle">本月生产参数统计图</div> <div class="chartTitle">本月生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -160,7 +206,7 @@
:option="optionDay" :option="optionDay"
></scEcharts> ></scEcharts>
</div> </div>
<div class="chartWrap" v-show="typeRadio == 'year'"> <div class="chartWrap" v-show="query.type == 2">
<div class="chartTitle">本年生产参数统计图</div> <div class="chartTitle">本年生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -171,7 +217,7 @@
</div> </div>
</div> </div>
<sc-dialog v-model="chartShow" draggable title="烧成工序"> <!-- <sc-dialog v-model="chartShow" draggable title="烧成工序">
<div class="searchHead" v-if="type == 'hours'"> <div class="searchHead" v-if="type == 'hours'">
<el-date-picker <el-date-picker
v-model="query.start_time" v-model="query.start_time"
@ -274,7 +320,7 @@
:option="myOption" :option="myOption"
v-if="chartShow" v-if="chartShow"
></scEcharts> ></scEcharts>
</sc-dialog> </sc-dialog> -->
<charts <charts
v-if="asynDialog" v-if="asynDialog"
:type="type" :type="type"
@ -646,6 +692,7 @@ export default {
hours: 1, hours: 1,
query: { query: {
mgroup: "", mgroup: "",
type: 0,
}, },
tableDatas: [ tableDatas: [
["产量", "回转窑总产量t", 0, 0, 0, 0, 0, 0, 0, 0], ["产量", "回转窑总产量t", 0, 0, 0, 0, 0, 0, 0, 0],
@ -670,6 +717,11 @@ export default {
showClose: true, showClose: true,
echartType: "line", echartType: "line",
asynDialog: false, asynDialog: false,
options: [
{id:0,name:'日统计'},
{id:1,name:'月统计'},
{id:2,name:'年统计'}
],
option1: { option1: {
color: colors, color: colors,
tooltip: tooltip, tooltip: tooltip,
@ -1157,7 +1209,7 @@ export default {
that.tableDatas[9][4] = that.tableDatas[9][4] =
data2.production_cost_unit; data2.production_cost_unit;
that.tableDatas[9][7] = consume_precen( that.tableDatas[9][7] = consume_precen(
that.tableDatas[9][4]-that.tableDatas[9][6], that.tableDatas[9][6]-that.tableDatas[9][4],
that.tableDatas[9][6] that.tableDatas[9][6]
); );
that.tableDatas[10][4] = data2.ammonia_consume; that.tableDatas[10][4] = data2.ammonia_consume;
@ -1190,31 +1242,295 @@ export default {
}, },
}) })
}, },
dateChange(val) { dateChange() {
let that = this; let that = this;
console.log(val); let arr = [];
if (val !== null) { if(that.query.type==0 && that.query.day) {
if (this.typeRadio == "day") { console.log(that.query.day, 'that.query.day');
let year = val.split("-")[0]; arr = that.query.day.split('-');
let month = val.split("-")[1]; that.year = Number(arr[0]);
let days = val.split("-")[2]; that.month = Number(arr[1]);
this.getHourData(year, month, days); that.days = Number(arr[2]);
} else if (this.typeRadio == "month") { this.getHourData(that.year, that.month, that.days);
let year = val.split("-")[0]; this.get_days(that.year, that.month, that.days);
let month = val.split("-")[1]; }
else if(that.query.type==1 && that.query.month) {
let year = that.query.month.split("-")[0];
let month = that.query.month.split("-")[1];
month = Number(month);
this.getDayData(year, month); this.getDayData(year, month);
} else { this.get_months(year, month);
this.getMonthData(val); this.get_month_year_goal(year, month);
}else if (that.query.type==2 && that.query.year) {
let year = that.query.year;
this.getMonthData(year);
this.get_years(year);
this.get_month_year_goal(year , 1);
} }
},
get_days(year_d, month_d, day){
let that = this;
let params4 = {};
params4.page = 0;
params4.year_s = year_d;
params4.month_s = month_d;
params4.day_s = day;
params4.type = "day_s";
params4.mgroup = that.query.mgroup;
that.$API.enm.enstat.req(params4).then((res4) => {
if (res4.length > 0) {
let data4 = res4[0];
that.tableDatas[0][2] = data4.total_production;
if (data4.total_production < 1){
that.tableDatas[4][2] = 0;
that.tableDatas[5][2] = 0;
that.tableDatas[6][2] = 0;
that.tableDatas[7][2] = 0;
that.tableDatas[8][2] = 0;
}else{ }else{
if (this.typeRadio == "day") { that.tableDatas[0][2] = data4.total_production;
that.getHourData(that.year, that.month, that.days); that.tableDatas[1][2] = data4.production_hour;
} else if (this.typeRadio == "month") { that.tableDatas[2][2] = data4.run_hour;
this.getDayData(that.year, that.month); that.tableDatas[3][2] = data4.run_rate;
that.tableDatas[4][2] = data4.elec_consume_unit;
that.tableDatas[5][2] = data4.celec_consume_unit;
that.tableDatas[6][2] = data4.coal_consume_unit;
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;
that.tableDatas[11][2] = (data4.ammonia_consume*1000/data4.total_production).toFixed(2);}
}
});
},
get_months(year, month){
let that = this;
let params2 = {};
params2.page = 0;
params2.year_s = year;
params2.month_s = month;
params2.type = "month_s";
params2.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params2).then((res2) => {
if (res2.length > 0) {
let data2 = res2[0];
that.tableDatas[0][4] = data2.total_production;
that.tableDatas[0][7] = precen(
that.tableDatas[0][4],
that.tableDatas[0][6]
);
that.tableDatas[1][4] = data2.production_hour;
that.tableDatas[1][7] = precen(
that.tableDatas[1][4],
that.tableDatas[1][6]
);
that.tableDatas[2][4] = data2.run_hour;
that.tableDatas[2][7] = precen(
that.tableDatas[2][4],
that.tableDatas[2][6]
);
that.tableDatas[3][4] = data2.run_rate;
that.tableDatas[3][7] = precen(
that.tableDatas[3][4],
that.tableDatas[3][6]
);
that.tableDatas[4][4] = data2.elec_consume_unit;
that.tableDatas[4][7] = consume_precen(
that.tableDatas[4][6] - that.tableDatas[4][4],
that.tableDatas[4][6]
);
that.tableDatas[5][4] =
data2.celec_consume_unit;
that.tableDatas[5][7] = consume_precen(
that.tableDatas[5][6] - that.tableDatas[5][4],
that.tableDatas[5][6]
);
that.tableDatas[6][4] = data2.coal_consume_unit;
that.tableDatas[6][7] = consume_precen(
that.tableDatas[6][6]-that.tableDatas[6][4],
that.tableDatas[6][6]
);
that.tableDatas[7][4] = data2.cen_consume_unit;
that.tableDatas[7][7] = consume_precen(
that.tableDatas[7][6]-that.tableDatas[7][4],
that.tableDatas[7][6]
);
that.tableDatas[8][4] = data2.elec_consume;
that.tableDatas[8][7] = consume_precen(
that.tableDatas[8][6]-that.tableDatas[8][4],
that.tableDatas[8][6]
);
that.tableDatas[9][4] =
data2.production_cost_unit;
that.tableDatas[9][7] = consume_precen(
that.tableDatas[9][6]-that.tableDatas[9][4],
that.tableDatas[9][6]
);
that.tableDatas[10][4] = data2.ammonia_consume;
that.tableDatas[10][7] = consume_precen(
that.tableDatas[10][6] - that.tableDatas[10][4],
that.tableDatas[10][6]
)
that.tableDatas[11][4] = (data2.ammonia_consume*1000/data2.total_production).toFixed(2);
that.tableDatas[11][7] = consume_precen(
that.tableDatas[11][6] - that.tableDatas[11][4],
that.tableDatas[11][6]
)
}
});
},
get_years(year){
let that = this;
let params1 = {};
params1.page = 0;
params1.year_s = year;
params1.type = "year_s";
params1.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params1).then((res1) => {
if (res1.length > 0) {
let data1 = res1[0];
that.tableDatas[0][5] = data1.total_production;
that.tableDatas[0][9] = precen(
that.tableDatas[0][5],
that.tableDatas[0][8]
);
that.tableDatas[1][5] = data1.production_hour;
that.tableDatas[1][9] = precen(
that.tableDatas[1][5],
that.tableDatas[1][8]
);
that.tableDatas[2][5] = data1.run_hour;
that.tableDatas[2][9] = precen(
that.tableDatas[2][5],
that.tableDatas[2][8]
);
that.tableDatas[3][5] = data1.run_rate;
that.tableDatas[3][9] = precen(
that.tableDatas[3][5],
that.tableDatas[3][8]
);
that.tableDatas[4][5] = data1.elec_consume_unit;
that.tableDatas[4][9] = consume_precen(
(that.tableDatas[4][8]-that.tableDatas[4][5]),
that.tableDatas[4][8]
);
that.tableDatas[5][5] =
data1.celec_consume_unit;
that.tableDatas[5][9] = consume_precen(
(that.tableDatas[5][8]-that.tableDatas[5][5]),
that.tableDatas[5][8]
);
that.tableDatas[6][5] = data1.coal_consume_unit;
that.tableDatas[6][9] = consume_precen(
(that.tableDatas[6][8]-that.tableDatas[6][5]),
that.tableDatas[6][8]
);
that.tableDatas[7][5] = data1.cen_consume_unit;
that.tableDatas[7][9] = consume_precen(
(that.tableDatas[7][8]-that.tableDatas[7][5]),
that.tableDatas[7][8]
);
that.tableDatas[8][5] = data1.elec_consume;
that.tableDatas[8][9] = consume_precen(
(that.tableDatas[8][8]-that.tableDatas[8][5]),
that.tableDatas[8][8]
);
that.tableDatas[9][5] =
data1.production_cost_unit;
that.tableDatas[9][9] = consume_precen(
(that.tableDatas[9][8]-that.tableDatas[9][5]),
that.tableDatas[9][8]
);
that.tableDatas[10][5] = data1.ammonia_consume;
that.tableDatas[10][9] = consume_precen(
that.tableDatas[10][8] - that.tableDatas[10][5],
that.tableDatas[10][8]
);
that.tableDatas[11][5] = (data1.ammonia_consume*1000/data1.total_production).toFixed(2);
that.tableDatas[11][9] = consume_precen(
that.tableDatas[11][8] - that.tableDatas[11][5],
that.tableDatas[11][8]
);
} else { } else {
this.getMonthData(that.year);
} }
});
},
get_month_year_goal(year , month){
let that = this;
let params5 = {};
params5.page = 0;
params5.year = year;
params5.mgroup = that.query.mgroup;
that.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
let str = "goal_val_" + month;
if (item5.goal_cate_name == "总产量t") {
that.tableDatas[0][6] = item5[str];
that.tableDatas[0][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "台时产量t/h"
) {
that.tableDatas[1][6] = item5[str];
that.tableDatas[1][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "运转时间h"
) {
that.tableDatas[2][6] = item5[str];
that.tableDatas[2][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "运转率(%"
) {
that.tableDatas[3][6] = item5[str];
that.tableDatas[3][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品分布电耗kW·h/t"
) {
that.tableDatas[4][6] = item5[str];
that.tableDatas[4][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品综合电耗KW·h/t"
) {
that.tableDatas[5][6] = item5[str];
that.tableDatas[5][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品标煤耗kgce/t"
) {
that.tableDatas[6][6] = item5[str];
that.tableDatas[6][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品综合能耗kgce/t"
) {
that.tableDatas[7][6] = item5[str];
that.tableDatas[7][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品成本(元/吨)"
) {
that.tableDatas[9][6] = item5[str];
that.tableDatas[9][8] = item5.goal_val;
}else if(item5.goal_cate_name == "总电量kW·h"){
that.tableDatas[8][6] = item5[str];
that.tableDatas[8][8] = item5.goal_val;
}else if(item5.goal_cate_name == "氨水消耗量(t)"){
that.tableDatas[10][6] = item5[str];
that.tableDatas[10][8] = item5.goal_val;
}else if (item5.goal_cate_name == "熟料单位氨水消耗量(kg/t)"){
that.tableDatas[11][6] = item5[str];
that.tableDatas[11][8] = item5.goal_val;
} }
});
}
})
}, },
// //
getHourData(year, month, days) { getHourData(year, month, days) {

View File

@ -112,6 +112,7 @@ export default {
}, },
tableDatas: [], tableDatas: [],
exportLoading: false, exportLoading: false,
tableName:'烧成工序班组月度对比分析',
}; };
}, },
mounted() { mounted() {

View File

@ -371,6 +371,7 @@ export default {
showClose: true, showClose: true,
echartType: "line", echartType: "line",
asynDialog: false, asynDialog: false,
tableName:'熟料分布电耗月度分析表',
}; };
}, },
mounted() { mounted() {

View File

@ -2,6 +2,52 @@
<div class="app-container"> <div class="app-container">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-select
v-model="query.type"
placeholder="查询类型"
clearable
class="headerSearch"
@change="typeCange"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-date-picker
v-model="query.day"
type="date"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
placeholder="天"
v-if="query.type==0"
style="margin-right: 6px"
/>
<el-date-picker
v-model="query.month"
type="month"
value-format="YYYY-MM"
format="YYYY-MM"
placeholder="查询月份"
v-if="query.type==1"
class="headerSearch"
/>
<el-date-picker
v-model="query.year"
type="year"
value-format="YYYY"
format="YYYY"
placeholder="查询年份"
v-if="query.type==2"
class="headerSearch"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="dateChange"
></el-button>
<el-button <el-button
type="primary" type="primary"
@click="exportExcel()" @click="exportExcel()"
@ -89,7 +135,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="radioWrap"> <!-- <div class="radioWrap">
<el-radio-group <el-radio-group
v-model="typeRadio" v-model="typeRadio"
@change="typeRadioChange" @change="typeRadioChange"
@ -127,8 +173,8 @@
@change="dateChange" @change="dateChange"
></el-date-picker> ></el-date-picker>
</div> </div>
</div> </div> -->
<div class="chartWrap" v-show="typeRadio == 'day'"> <div class="chartWrap" v-show="query.type == 0">
<div class="chartTitle">本日生产参数统计图</div> <div class="chartTitle">本日生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -136,7 +182,7 @@
:option="optionHour" :option="optionHour"
></scEcharts> ></scEcharts>
</div> </div>
<div class="chartWrap" v-show="typeRadio == 'month'"> <div class="chartWrap" v-show="query.type == 1">
<div class="chartTitle">本月生产参数统计图</div> <div class="chartTitle">本月生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -144,7 +190,7 @@
:option="optionDay" :option="optionDay"
></scEcharts> ></scEcharts>
</div> </div>
<div class="chartWrap" v-show="typeRadio == 'year'"> <div class="chartWrap" v-show="query.type == 2">
<div class="chartTitle">本年生产参数统计图</div> <div class="chartTitle">本年生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -155,7 +201,7 @@
</div> </div>
</div> </div>
<sc-dialog v-model="chartShow" draggable title="水泥粉磨工序"> <!-- <sc-dialog v-model="chartShow" draggable title="水泥粉磨工序">
<div class="searchHead" v-if="type == 'hours'"> <div class="searchHead" v-if="type == 'hours'">
<el-date-picker <el-date-picker
v-model="query.start_time" v-model="query.start_time"
@ -258,7 +304,7 @@
:option="myOption" :option="myOption"
v-if="chartShow" v-if="chartShow"
></scEcharts> ></scEcharts>
</sc-dialog> </sc-dialog> -->
<charts <charts
v-if="asynDialog" v-if="asynDialog"
:type="type" :type="type"
@ -581,7 +627,13 @@ export default {
hours: 1, hours: 1,
query: { query: {
mgroup: "", mgroup: "",
type: 0,
}, },
options: [
{id:0,name:'日统计'},
{id:1,name:'月统计'},
{id:2,name:'年统计'}
],
tableDatas: [ tableDatas: [
["产量", "水泥磨总产量t", 0, 0, 0, 0, 0, 0, 0, 0], ["产量", "水泥磨总产量t", 0, 0, 0, 0, 0, 0, 0, 0],
["产量", "水泥磨台时产量t/h", 0, 0, 0, 0, 0, 0, 0, 0], ["产量", "水泥磨台时产量t/h", 0, 0, 0, 0, 0, 0, 0, 0],
@ -1044,30 +1096,230 @@ export default {
}, },
}) })
}, },
dateChange(val) { dateChange() {
let that = this; let that = this;
if (val !== null) { let arr = [];
if (this.typeRadio == "day") { if(that.query.type==0 && that.query.day) {
let year = val.split("-")[0]; arr = that.query.day.split('-');
let month = val.split("-")[1]; that.year = Number(arr[0]);
let days = val.split("-")[2]; that.month = Number(arr[1]);
this.getHourData(year, month, days); that.days = Number(arr[2]);
} else if (this.typeRadio == "month") { this.getHourData(that.year, that.month, that.days);
let year = val.split("-")[0]; this.get_days(that.year, that.month, that.days);
let month = val.split("-")[1]; }
else if(that.query.type==1 && that.query.month) {
let year = that.query.month.split("-")[0];
let month = that.query.month.split("-")[1];
month = Number(month);
this.getDayData(year, month); this.getDayData(year, month);
} else { this.get_months(year, month);
this.getMonthData(val); this.get_month_year_goal(year, month);
}else if (that.query.type==2 && that.query.year ) {
let year = that.query.year;
this.getMonthData(year);
this.get_years(year);
this.get_month_year_goal(year , 1);
} }
},
get_days(year_h, month_h, days_h){
let that = this;
let params4 = {};
params4.page = 0;
params4.year_s = year_h;
params4.month_s = month_h;
params4.day_s = days_h;
params4.type = "day_s";
params4.mgroup = that.query.mgroup;
that.$API.enm.enstat.req(params4).then((res4) => {
if (res4.length > 0) {
let data4 = res4[0];
that.tableDatas[0][2] = data4.total_production;
if (data4.total_production < 1){
that.tableDatas[1][2] = 0;
that.tableDatas[2][2] = 0;
that.tableDatas[3][2] = 0;
that.tableDatas[4][2] = 0;
that.tableDatas[5][2] = 0;
that.tableDatas[6][2] = 0;
that.tableDatas[7][2] = 0;
}else{ }else{
if (this.typeRadio == "day") { that.tableDatas[1][2] = data4.production_hour;
that.getHourData(that.year, that.month, that.days); that.tableDatas[2][2] = data4.run_hour;
} else if (this.typeRadio == "month") { that.tableDatas[3][2] = data4.run_rate;
this.getDayData(that.year, that.month); that.tableDatas[4][2] = data4.elec_consume_unit;
} else { that.tableDatas[5][2] = data4.cen_consume_unit;
this.getMonthData(that.year); that.tableDatas[6][2] = data4.elec_consume;
that.tableDatas[7][2] = data4.production_cost_unit;}
} }
});
},
get_months(year, month){
let that = this;
let params2 = {};
params2.page = 0;
params2.year_s = year;
params2.month_s = month;
params2.type = "month_s";
params2.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params2).then((res2) => {
if (res2.length > 0) {
let data2 = res2[0];
that.tableDatas[0][4] = data2.total_production;
that.tableDatas[0][7] = precen(
that.tableDatas[0][4],
that.tableDatas[0][6]
);
that.tableDatas[1][4] = data2.production_hour;
that.tableDatas[1][7] = precen(
that.tableDatas[1][4],
that.tableDatas[1][6]
);
that.tableDatas[2][4] = data2.run_hour;
that.tableDatas[2][7] = precen(
that.tableDatas[2][4],
that.tableDatas[2][6]
);
that.tableDatas[3][4] = data2.run_rate;
that.tableDatas[3][7] = precen(
that.tableDatas[3][4],
that.tableDatas[3][6]
);
that.tableDatas[4][4] = data2.elec_consume_unit;
that.tableDatas[4][7] = consume_precen(
that.tableDatas[4][6]-that.tableDatas[4][4],
that.tableDatas[4][6]
);
that.tableDatas[5][4] = data2.cen_consume_unit;
that.tableDatas[5][7] = consume_precen(
that.tableDatas[5][6]-that.tableDatas[5][4],
that.tableDatas[5][6]
);
that.tableDatas[7][4] =
data2.production_cost_unit;
that.tableDatas[6][4] = data2.elec_consume;
that.tableDatas[6][7] = consume_precen(
that.tableDatas[6][6]-that.tableDatas[6][4],
that.tableDatas[6][6]
);
that.tableDatas[7][7] = consume_precen(
that.tableDatas[7][6]-that.tableDatas[7][4],
that.tableDatas[7][6]
);
} }
});
},
get_years(year){
let that = this;
let params1 = {};
params1.page = 0;
params1.year_s = year;
params1.type = "year_s";
params1.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params1).then((res1) => {
if (res1.length > 0) {
let data1 = res1[0];
that.tableDatas[0][5] = data1.total_production;
that.tableDatas[0][9] = precen(
that.tableDatas[0][5],
that.tableDatas[0][8]
);
that.tableDatas[1][5] = data1.production_hour;
that.tableDatas[1][9] = precen(
that.tableDatas[1][5],
that.tableDatas[1][8]
);
that.tableDatas[2][5] = data1.run_hour;
that.tableDatas[2][9] = precen(
that.tableDatas[2][5],
that.tableDatas[2][8]
);
that.tableDatas[3][5] = data1.run_rate;
that.tableDatas[3][9] = precen(
that.tableDatas[3][5],
that.tableDatas[3][8]
);
that.tableDatas[4][5] = data1.elec_consume_unit;
that.tableDatas[4][9] = consume_precen(
that.tableDatas[4][8]-that.tableDatas[4][5],
that.tableDatas[4][8]
);
that.tableDatas[5][5] = data1.cen_consume_unit;
that.tableDatas[5][9] = consume_precen(
that.tableDatas[5][8]-that.tableDatas[5][5],
that.tableDatas[5][8]
);
that.tableDatas[6][5] = data1.elec_consume;
that.tableDatas[6][9] = consume_precen(
that.tableDatas[6][8]-that.tableDatas[6][5],
that.tableDatas[6][8]
);
that.tableDatas[7][5] =
data1.production_cost_unit;
that.tableDatas[7][9] = consume_precen(
that.tableDatas[7][8]-that.tableDatas[7][5],
that.tableDatas[7][8]
);
}
});
},
get_month_year_goal(year, month) {
let that = this;
let params5 = {};
params5.page = 0;
params5.year = year;
params5.mgroup = that.query.mgroup;
this.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
let str = "goal_val_" + month;
if (item5.goal_cate_name == "总产量t") {
that.tableDatas[0][6] = item5[str];
that.tableDatas[0][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "台时产量t/h"
) {
that.tableDatas[1][6] = item5[str];
that.tableDatas[1][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "运转时间h"
) {
that.tableDatas[2][6] = item5[str];
that.tableDatas[2][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "运转率(%"
) {
that.tableDatas[3][6] = item5[str];
that.tableDatas[3][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品分布电耗kW·h/t"
) {
that.tableDatas[4][6] = item5[str];
that.tableDatas[4][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品综合能耗kgce/t"
) {
that.tableDatas[5][6] = item5[str];
that.tableDatas[5][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品成本(元/吨)"
) {
that.tableDatas[7][6] = item5[str];
that.tableDatas[7][8] = item5.goal_val;
} else if(
item5.goal_cate_name ==
"总电量kW·h"){
that.tableDatas[6][6] = item5[str];
that.tableDatas[6][8] = item5.goal_val;
}
});
}
})
}, },
// //
getHourData(year, month, days) { getHourData(year, month, days) {

View File

@ -99,6 +99,7 @@ export default {
}, },
tableDatas: [], tableDatas: [],
exportLoading: false, exportLoading: false,
tableName: "水泥粉磨工序班组月度对比分析",
}; };
}, },
mounted() { mounted() {

View File

@ -196,6 +196,7 @@ export default {
monthGoal2: [], monthGoal2: [],
tableDatas: [], tableDatas: [],
tableDatas2: [], tableDatas2: [],
tableName:'水泥分布电耗月度分析表',
options: [ options: [
{ {
name: "电耗", name: "电耗",

View File

@ -2,6 +2,52 @@
<div class="app-container"> <div class="app-container">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-select
v-model="query.type"
placeholder="查询类型"
clearable
class="headerSearch"
@change="typeCange"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-date-picker
v-model="query.day"
type="date"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
placeholder="天"
v-if="query.type==0"
style="margin-right: 6px"
/>
<el-date-picker
v-model="query.month"
type="month"
value-format="YYYY-MM"
format="YYYY-MM"
placeholder="查询月份"
v-if="query.type==1"
class="headerSearch"
/>
<el-date-picker
v-model="query.year"
type="year"
value-format="YYYY"
format="YYYY"
placeholder="查询年份"
v-if="query.type==2"
class="headerSearch"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="dateChange"
></el-button>
<el-button <el-button
type="primary" type="primary"
@click="exportExcel()" @click="exportExcel()"
@ -68,7 +114,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="radioWrap"> <!-- <div class="radioWrap">
<el-radio-group <el-radio-group
v-model="typeRadio" v-model="typeRadio"
@change="typeRadioChange" @change="typeRadioChange"
@ -96,16 +142,16 @@
@change="dateChange" @change="dateChange"
></el-date-picker> ></el-date-picker>
</div> </div>
</div> </div> -->
<div class="chartWrap" v-show="typeRadio == 'day'"> <!-- <div class="chartWrap" v-show="query.type == 0">
<div class="chartTitle">本日生产参数统计图</div> <div class="chartTitle">本日生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
width="1033px" width="1033px"
:option="optionHours" :option="optionHours"
></scEcharts> ></scEcharts>
</div> </div> -->
<div class="chartWrap" v-show="typeRadio == 'month'"> <div class="chartWrap" v-show="query.type == 1">
<div class="chartTitle">本月生产参数统计图</div> <div class="chartTitle">本月生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -113,7 +159,7 @@
:option="optionDay" :option="optionDay"
></scEcharts> ></scEcharts>
</div> </div>
<div class="chartWrap" v-show="typeRadio == 'year'"> <div class="chartWrap" v-show="query.type == 2">
<div class="chartTitle">本年生产参数统计图</div> <div class="chartTitle">本年生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -124,7 +170,7 @@
</div> </div>
</div> </div>
<sc-dialog v-model="chartShow" draggable title="水泥包装工序"> <!-- <sc-dialog v-model="chartShow" draggable title="水泥包装工序">
<div class="searchHead" v-if="type == 'hours'"> <div class="searchHead" v-if="type == 'hours'">
<el-date-picker <el-date-picker
v-model="query.start_time" v-model="query.start_time"
@ -227,7 +273,7 @@
:option="myOption" :option="myOption"
v-if="chartShow" v-if="chartShow"
></scEcharts> ></scEcharts>
</sc-dialog> </sc-dialog> -->
<charts <charts
v-if="asynDialog" v-if="asynDialog"
:type="type" :type="type"
@ -344,8 +390,13 @@ export default {
task2__year: "", task2__year: "",
page: 0, page: 0,
}, },
options: [
{id:1,name:'月统计'},
{id:2,name:'年统计'}
],
query: { query: {
mgroup: "", mgroup: "",
type:1,
}, },
tableDatas: [ tableDatas: [
["出厂水泥", "P.O42.5R 散装t", 0,0, 0, 0], ["出厂水泥", "P.O42.5R 散装t", 0,0, 0, 0],
@ -715,23 +766,102 @@ export default {
typeRadioChange() { typeRadioChange() {
this.searchDate = ""; this.searchDate = "";
}, },
dateChange(val) { dateChange() {
let that = this; let that = this;
if (val !== null) { if(that.query.type==1 && that.query.month) {
if (this.typeRadio == "month") { let year = that.query.month.split("-")[0];
let year = val.split("-")[0]; let month = that.query.month.split("-")[1];
let month = val.split("-")[1]; month = Number(month);
this.getDayData(year, month); this.getDayData(year, month);
} else { this.get_months(year, month);
this.getMonthData(val); }else if (that.query.type==2 && that.query.year ) {
let year = that.query.year;
this.getMonthData(year);
this.get_year(year);
} }
} else { },
if (this.typeRadio == "month") { get_year(year){
this.getDayData(that.year, that.month); let that = this;
} else { let params1 = {};
this.getMonthData(that.year); params1.page = 0;
params1.year_s = year;
params1.type = "year_s";
params1.mgroup = that.query.mgroup;
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;
} }
})}
})
},
get_months(year, month){
let that = this;
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 袋装"){
that.tableDatas[1][4] = item.val;
}else if (item.mpoint_name == "水泥+P.O42.5 袋装") {
that.tableDatas[2][4] = item.val;
}else if (item.mpoint_name == "水泥+P.O42.5 散装") {
that.tableDatas[3][4] = item.val;
}else if (item.mpoint_name == "复合硅酸盐水泥;42.5R;袋装水泥") {
that.tableDatas[4][4] = item.val;
}else if (item.mpoint_name == "水泥+P.C42.5 散装") {
that.tableDatas[5][4] = item.val;
}else if (item.mpoint_name == "水泥+P.O52.5 散装") {
that.tableDatas[6][4] = item.val;
}else if (item.mpoint_name == "散装水泥总和"){
that.tableDatas[7][4] = item.val;
}else if (item.mpoint_name == "袋装水泥总和") {
that.tableDatas[8][4] = item.val;
}
else if (item.mpoint_name == "出厂水泥") {
that.tableDatas[9][4] = item.val;
}else if (item.mpoint_name == "出厂熟料"){
that.tableDatas[10][4] = item.val;
}else if (item.mpoint_name == "包装进线") {
that.tableDatas[11][4] = item.elec_consume_unit;
that.tableDatas[12][4] = item.val;
}
})
}
})
}, },
//- //-
getDayData(year, month) { getDayData(year, month) {
@ -742,6 +872,7 @@ export default {
query1.month_s = month; query1.month_s = month;
query1.type = "day_s"; query1.type = "day_s";
query1.mgroup = this.query.mgroup; query1.mgroup = this.query.mgroup;
this.$API.enm.mpointstat.list.req(query1).then((response) => { this.$API.enm.mpointstat.list.req(query1).then((response) => {
let seriesData1 = [], let seriesData1 = [],
seriesData2 = [], seriesData2 = [],

View File

@ -88,6 +88,7 @@ export default {
mgroup: "", mgroup: "",
}, },
tableDatas: [], tableDatas: [],
tableName:'水泥分布电耗月度分析表',
}; };
}, },
mounted() { mounted() {

View File

@ -126,6 +126,7 @@ export default {
showClose: true, showClose: true,
echartType: "line", echartType: "line",
asynDialog: false, asynDialog: false,
tableName:'水泥分布电耗月度分析表'
}; };
}, },
mounted() { mounted() {

View File

@ -70,6 +70,16 @@
</el-header> </el-header>
<el-card style="margin-top:5px"> <el-card style="margin-top:5px">
<div class="tableContainer"> <div class="tableContainer">
<!-- <div>
<label for="threshold">输入合格率阈值</label>
<input
type="text"
id="threshold"
v-model="currentThreshold"
placeholder="例如80%"
@input="updateThreshold"
/>
</div> -->
<table border="1" cellspacing="0" :key="timeStamp" id="myTable" class="myTable"> <table border="1" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
<thead class="myTableHead"> <thead class="myTableHead">
<tr> <tr>
@ -86,11 +96,34 @@
<th v-for="item4 in header4" :key="item4">{{item4}}</th> <th v-for="item4 in header4" :key="item4">{{item4}}</th>
</tr> </tr>
</thead> </thead>
<tr v-for="(item,index) in tableDatas3" :key="index"> <tr v-for="(row, rowIndex) in tableDatas3" :key="rowIndex">
<td v-for="(item1,index1) in item" :key="index1" class="numCell">{{item1}}</td> <td
v-for="(cell, cellIndex) in row"
:key="cellIndex"
:class="getCellClass(cell, cellIndex)"
class="numCell"
@click="handleCellClick(cell, rowIndex, cellIndex)"
>
{{ cell }}
</td>
</tr> </tr>
</table> </table>
</div> </div>
<el-dialog
title="设置合格率的阈值"
v-model="dialogVisible"
width="30%"
@close="resetDialog"
>
<div>
<label>当前阈值:</label>
<el-input v-model="currentThreshold" placeholder="请输入合格率阈值" style="width: 200px;"></el-input>
</div>
<template #footer>
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="updateThreshold"> </el-button>
</template>
</el-dialog>
</el-card> </el-card>
</div> </div>
</template> </template>
@ -111,6 +144,8 @@
], ],
titleLength:1, titleLength:1,
mgroupOptions:[], mgroupOptions:[],
threshold: 80, //
currentThreshold: "80%", //
tableTime:'', tableTime:'',
deptName:'', deptName:'',
typeName:'质检日报表', typeName:'质检日报表',
@ -145,6 +180,9 @@
tableData:[], tableData:[],
header2Obj:[], header2Obj:[],
deptOptions:[], deptOptions:[],
dialogVisible: false, //
currentColumnIndex: null, //
thresholds: {}, // key
}; };
}, },
watch: { watch: {
@ -178,6 +216,34 @@
} }
that.tableName = that.deptName+that.typeName; that.tableName = that.deptName+that.typeName;
}, },
updateThreshold() {
const num = parseFloat(this.currentThreshold.replace("%", ""));
if (!isNaN(num)) {
//
this.thresholds[this.currentColumnIndex] = num;
this.dialogVisible = false; //
} else {
this.$message.error("请输入有效的阈值例如80%");
}
},
//
resetDialog() {
this.currentColumnIndex = null;
this.currentThreshold = "";
},
//
getCellClass(cell, cellIndex) {
if (cellIndex > 0 && ((cellIndex - 1) % 4 === 3)) {
//
const cellValue = String(cell);
const value = parseFloat(cellValue.replace("%", ""));
const threshold = this.thresholds[cellIndex] || 0; //
if (!isNaN(value)) {
return value > threshold ? "green-text" : "red-text";
}
}
return "";
},
deptChange(e){ deptChange(e){
let that = this; let that = this;
that.deptOptions.forEach(item=>{ that.deptOptions.forEach(item=>{
@ -197,6 +263,13 @@
this.getTableData(); this.getTableData();
}); });
}, },
handleCellClick(cell, rowIndex, cellIndex){
if ((cellIndex - 1) % 4 === 3) { //
this.currentColumnIndex = cellIndex; //
this.currentThreshold = this.thresholds[cellIndex] || ""; //
this.dialogVisible = true; //
}
},
getTableData(){ getTableData(){
let that = this; let that = this;
that.tableDatas3 = []; that.tableDatas3 = [];
@ -263,7 +336,6 @@
wrapArr = wrapArr.filter(item=>{ wrapArr = wrapArr.filter(item=>{
return item return item
}) })
console.log(wrapArr,'warpArr')
wrapArr.forEach((item1,index1)=>{ wrapArr.forEach((item1,index1)=>{
if(item1!=undefined){// if(item1!=undefined){//
let itemArr = []; let itemArr = [];
@ -271,7 +343,6 @@
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!=null? item1[0].year_s+'.'+item1[0].month_s+'.'+item1[0].day_s:item1[0].year_s+'.'+item1[0].month_s;
itemArr.push(time) itemArr.push(time)
// //
console.log(itemArr, 'itemArr--')
item1.forEach(item2=>{ item1.forEach(item2=>{
let data2 =item2.qua_data; let data2 =item2.qua_data;
// //
@ -371,5 +442,11 @@
.tableContainer{ .tableContainer{
overflow-x: scroll; overflow-x: scroll;
} }
.red-text {
color: red;
}
.green-text {
color: green;
}
</style> </style>

View File

@ -215,7 +215,7 @@
params.page = 0; params.page = 0;
params.year_s = that.year; params.year_s = that.year;
params.month_s = that.month; params.month_s = that.month;
params.day_s = that.day; // params.day_s = that.day;
params.type = 'day_s'; params.type = 'day_s';
that.tableName = that.year+'-'+that.month+'-'+that.day+'-生产日报表'; that.tableName = that.year+'-'+that.month+'-'+that.day+'-生产日报表';
this.$API.enm.enstat.req(params).then((res) => { this.$API.enm.enstat.req(params).then((res) => {

View File

@ -48,6 +48,7 @@
end-placeholder="结束日期" end-placeholder="结束日期"
v-if="query.type == 1" v-if="query.type == 1"
style="width: 300px;" style="width: 300px;"
@change = getTableData
/> />
<el-date-picker <el-date-picker
v-model="query.month" v-model="query.month"
@ -56,6 +57,7 @@
format="YYYY-MM" format="YYYY-MM"
placeholder="月" placeholder="月"
v-if="query.type == 2" v-if="query.type == 2"
@change = getTableData
/> />
<el-button type="primary" icon="el-icon-search" <el-button type="primary" icon="el-icon-search"
@click="getTableData"> @click="getTableData">
@ -298,10 +300,14 @@ export default {
getTableData() { getTableData() {
let that = this; let that = this;
let arr = []; let arr = [];
if (that.query.type == 1) { this.query.start_time__gte = null;
this.query.end_time__lt = null;
this.query.end_time__year = null;
this.query.end_time__month = null;
if (that.query.type == 1 && this.value1 && this.value1.length > 0) {
this.query.start_time__gte = this.value1[0]; this.query.start_time__gte = this.value1[0];
this.query.end_time__lt = this.value1[1];} this.query.end_time__lt = this.value1[1];}
else if (that.query.type == 2) { else if (that.query.type == 2 && that.query.month) {
this.query.start_time__gte = '', this.query.start_time__gte = '',
this.query.end_time__lt = '', this.query.end_time__lt = '',
arr = that.query.month.split('-'); arr = that.query.month.split('-');

View File

@ -459,7 +459,7 @@ let yAxis_hour = [
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: colors[3], color: colors[1],
}, },
}, },
axisLabel: { axisLabel: {
@ -1190,7 +1190,7 @@ export default {
dateChange() { dateChange() {
let that = this; let that = this;
let arr = []; let arr = [];
if(that.query.type==0) { if(that.query.type==0 && that.query.day) {
arr = that.query.day.split('-'); arr = that.query.day.split('-');
that.year = Number(arr[0]); that.year = Number(arr[0]);
that.month = Number(arr[1]); that.month = Number(arr[1]);
@ -1198,14 +1198,14 @@ export default {
this.getHourData(that.year, that.month, that.days); this.getHourData(that.year, that.month, that.days);
this.get_days(that.year, that.month, that.days); this.get_days(that.year, that.month, that.days);
} }
else if(that.query.type==1) { else if(that.query.type==1 && that.query.month) {
let year = that.query.month.split("-")[0]; let year = that.query.month.split("-")[0];
let month = that.query.month.split("-")[1]; let month = that.query.month.split("-")[1];
month = Number(month); month = Number(month);
this.getDayData(year, month); this.getDayData(year, month);
this.get_months(year, month); this.get_months(year, month);
this.get_month_year_goal(year, month); this.get_month_year_goal(year, month);
}else if (that.query.type==2) { }else if (that.query.type==2 && that.query.year) {
let year = that.query.year; let year = that.query.year;
this.getMonthData(year); this.getMonthData(year);
this.get_years(year); this.get_years(year);

View File

@ -98,6 +98,7 @@ export default {
tableDatas: [], tableDatas: [],
goalDatas: [], goalDatas: [],
exportLoading: false, exportLoading: false,
tableName : '生料辅料工序班组月度对比分析',
}; };
}, },
mounted() { mounted() {

View File

@ -126,6 +126,7 @@ export default {
echartType: "line", echartType: "line",
asynDialog: false, asynDialog: false,
monthGoal: [], monthGoal: [],
tableName:'生料辅料工序班组月度对比分析',
}; };
}, },
mounted() { mounted() {

View File

@ -2,6 +2,52 @@
<div class="app-container"> <div class="app-container">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-select
v-model="query.type"
placeholder="查询类型"
clearable
class="headerSearch"
@change="typeCange"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-date-picker
v-model="query.day"
type="date"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
placeholder="天"
v-if="query.type==0"
style="margin-right: 6px"
/>
<el-date-picker
v-model="query.month"
type="month"
value-format="YYYY-MM"
format="YYYY-MM"
placeholder="查询月份"
v-if="query.type==1"
class="headerSearch"
/>
<el-date-picker
v-model="query.year"
type="year"
value-format="YYYY"
format="YYYY"
placeholder="查询年份"
v-if="query.type==2"
class="headerSearch"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="dateChange"
></el-button>
<el-button <el-button
type="primary" type="primary"
@click="exportExcel()" @click="exportExcel()"
@ -87,7 +133,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="radioWrap"> <!-- <div class="radioWrap">
<el-radio-group <el-radio-group
v-model="typeRadio" v-model="typeRadio"
@change="typeRadioChange" @change="typeRadioChange"
@ -127,9 +173,9 @@
@change="dateChange" @change="dateChange"
></el-date-picker> ></el-date-picker>
</div> </div>
</div> </div> -->
<!-- <div id="main" style="width:1200px;height:600px;"></div> --> <!-- <div id="main" style="width:1200px;height:600px;"></div> -->
<div class="chartWrap" v-show="typeRadio == 'day'"> <div class="chartWrap" v-show="query.type == 0">
<div class="chartTitle">本日生产参数统计图</div> <div class="chartTitle">本日生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -137,7 +183,7 @@
:option="optionHour" :option="optionHour"
></scEcharts> ></scEcharts>
</div> </div>
<div class="chartWrap" v-show="typeRadio == 'month'"> <div class="chartWrap" v-show="query.type == 1">
<div class="chartTitle">本月生产参数统计图</div> <div class="chartTitle">本月生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -145,7 +191,7 @@
:option="optionDay" :option="optionDay"
></scEcharts> ></scEcharts>
</div> </div>
<div class="chartWrap" v-show="typeRadio == 'year'"> <div class="chartWrap" v-show="query.type == 2">
<div class="chartTitle">本年生产参数统计图</div> <div class="chartTitle">本年生产参数统计图</div>
<scEcharts <scEcharts
height="400px" height="400px"
@ -156,7 +202,7 @@
</div> </div>
</div> </div>
<sc-dialog v-model="chartShow" draggable title="生料工序"> <!-- <sc-dialog v-model="chartShow" draggable title="生料工序">
<div class="searchHead" v-if="type == 'hours'"> <div class="searchHead" v-if="type == 'hours'">
<el-date-picker <el-date-picker
v-model="query.start_time" v-model="query.start_time"
@ -259,7 +305,7 @@
:option="myOption" :option="myOption"
v-if="chartShow" v-if="chartShow"
></scEcharts> ></scEcharts>
</sc-dialog> </sc-dialog> -->
<charts <charts
v-if="asynDialog" v-if="asynDialog"
:type="type" :type="type"
@ -524,12 +570,18 @@ export default {
optionDay: {}, optionDay: {},
optionMonth: {}, optionMonth: {},
goal_list: [], goal_list: [],
year: 2023, options: [
{id:0,name:'日统计'},
{id:1,name:'月统计'},
{id:2,name:'年统计'}
],
year: 2025,
month: 1, month: 1,
days: 1, days: 1,
hours: 1, hours: 1,
query: { query: {
mgroup: "", mgroup: "",
type: 0,
}, },
tableDatas: [ tableDatas: [
["产量", "生料总产量t", 0, 0, 0, 0, 0, 0, 0, 0], ["产量", "生料总产量t", 0, 0, 0, 0, 0, 0, 0, 0],
@ -734,6 +786,7 @@ export default {
dataX: [], dataX: [],
dataY: [], dataY: [],
dataY2: [], dataY2: [],
option: { option: {
color: [ color: [
"#647bfe", "#647bfe",
@ -1194,31 +1247,225 @@ export default {
}, },
}) })
}, },
dateChange(val) { dateChange() {
let that = this; let that = this;
console.log(val); let arr = [];
if (val !== null) { if(that.query.type==0 && that.query.day) {
if (this.typeRadio == "day") { arr = that.query.day.split('-');
let year = val.split("-")[0]; that.year = Number(arr[0]);
let month = val.split("-")[1]; that.month = Number(arr[1]);
let days = val.split("-")[2]; that.days = Number(arr[2]);
this.getHourData(year, month, days); this.getHourData(that.year, that.month, that.days);
} else if (this.typeRadio == "month") { this.get_days(that.year, that.month, that.days);
let year = val.split("-")[0]; }
let month = val.split("-")[1]; else if(that.query.type==1 && that.query.month) {
let year = that.query.month.split("-")[0];
let month = that.query.month.split("-")[1];
month = Number(month);
this.getDayData(year, month); this.getDayData(year, month);
} else { this.get_months(year, month);
this.getMonthData(val); this.get_month_year_goal(year, month);
}else if (that.query.type==2 && that.query.year) {
let year = that.query.year;
this.getMonthData(year);
this.get_years(year);
this.get_month_year_goal(year , 1);
} }
},
get_days(year_d, month_d, days){
let that = this;
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 = this.query.mgroup;
this.$API.enm.enstat.req(params4).then((res4) => {
if (res4.length > 0) {
let data4 = res4[0];
that.tableDatas[0][2] = data4.total_production < 1 ? 0 : data4.total_production;
if (data4.total_production == 0) {
that.tableDatas[4][2] = 0;
that.tableDatas[5][2] = 0;
that.tableDatas[6][2] = 0;
}else { }else {
if (this.typeRadio == "day") { that.tableDatas[1][2] = data4.production_hour;
that.getHourData(that.year, that.month, that.days); that.tableDatas[2][2] = data4.run_hour;
} else if (this.typeRadio == "month") { that.tableDatas[3][2] = data4.run_rate;
this.getDayData(that.year, that.month); that.tableDatas[4][2] = data4.elec_consume_unit;
that.tableDatas[5][2] = data4.elec_consume;
that.tableDatas[6][2] = data4.production_cost_unit;}
}
});
},
get_months(year, month){
let that = this;
let params2 = {};
params2.page = 0;
params2.year_s = year;
params2.month_s = month;
params2.type = "month_s";
params2.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params2).then((res2) => {
if (res2.length > 0) {
let data2 = res2[0];
that.tableDatas[0][4] =
data2.total_production;
if (
that.tableDatas[0][4] >
that.tableDatas[0][6]
) {
that.wraning = true;
}
that.tableDatas[0][7] = precen(
that.tableDatas[0][4],
that.tableDatas[0][6]
);
that.tableDatas[1][4] =
data2.production_hour;
that.tableDatas[1][7] = precen(
that.tableDatas[1][4],
that.tableDatas[1][6]
);
that.tableDatas[2][4] = data2.run_hour;
that.tableDatas[2][7] = precen(
that.tableDatas[2][4],
that.tableDatas[2][6]
);
that.tableDatas[3][4] = data2.run_rate;
that.tableDatas[3][7] = precen(
that.tableDatas[3][4],
that.tableDatas[3][6]
);
that.tableDatas[4][4] =
data2.elec_consume_unit;
that.tableDatas[4][7] = consume_precen(
(that.tableDatas[4][6]-that.tableDatas[4][4]),
that.tableDatas[4][6]
);
that.tableDatas[5][4] = data2.elec_consume;
that.tableDatas[5][7] = consume_precen(
(that.tableDatas[5][6]-that.tableDatas[5][4]),
that.tableDatas[5][6]
);
that.tableDatas[6][4] =
data2.production_cost_unit;
that.tableDatas[6][7] = consume_precen(
(that.tableDatas[6][6] - that.tableDatas[6][4]),
that.tableDatas[6][6]
);
}
});
},
get_month_year_goal(year, month){
let that = this;
let params5 = {};
params5.page = 0;
params5.year = year;
params5.mgroup = that.query.mgroup;
this.$API.mtm.goal.list
.req(params5)
.then((res5) => {
if (res5.length > 0) {
let data5 = res5;
data5.forEach((item5) => {
let str = "goal_val_" + month;
debugger;
console.log(str, item5[str]);
if (item5.goal_cate_name == "总产量t") {
that.tableDatas[0][6] = item5[str];
that.tableDatas[0][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"台时产量t/h"
) {
that.tableDatas[1][6] = item5[str];
that.tableDatas[1][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "运转时间h"
) {
that.tableDatas[2][6] = item5[str];
that.tableDatas[2][8] = item5.goal_val;
} else if (
item5.goal_cate_name == "运转率(%"
) {
that.tableDatas[3][6] = item5[str];
that.tableDatas[3][8] = item5.goal_val;
} else if (
item5.goal_cate_name ==
"单位产品分布电耗kW·h/t"
) {
that.tableDatas[4][6] = item5[str];
that.tableDatas[4][8] = item5.goal_val;
} else if (item5.goal_cate_name ==
"总电量kW·h"){
that.tableDatas[5][6] = item5[str];
that.tableDatas[5][8] = item5.goal_val;
}
else if (
item5.goal_cate_name ==
"单位产品成本(元/吨)"
) {
that.tableDatas[6][6] = item5[str];
that.tableDatas[6][8] = item5.goal_val;
}
});
}
})
},
get_years(year){
let params1 = {};
params1.page = 0;
params1.year_s = year;
params1.type = "year_s";
params1.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params1).then((res1) => {
if (res1.length > 0) {
let data1 = res1[0];
that.tableDatas[0][5] =
data1.total_production;
that.tableDatas[0][9] = precen(
that.tableDatas[0][5],
that.tableDatas[0][8]
);
that.tableDatas[1][5] =
data1.production_hour;
that.tableDatas[1][9] = precen(
that.tableDatas[1][5],
that.tableDatas[1][8]
);
that.tableDatas[2][5] = data1.run_hour;
that.tableDatas[2][9] = precen(
that.tableDatas[2][5],
that.tableDatas[2][8]
);
that.tableDatas[3][5] = data1.run_rate;
that.tableDatas[3][9] = precen(
that.tableDatas[3][5],
that.tableDatas[3][8]
);
that.tableDatas[4][5] =
data1.elec_consume_unit;
that.tableDatas[4][9] = consume_precen(
(that.tableDatas[4][8] - that.tableDatas[4][5]),
that.tableDatas[4][8]
);
that.tableDatas[5][5] = data1.elec_consume;
that.tableDatas[5][9] = consume_precen(
(that.tableDatas[5][8] - that.tableDatas[5][5]),
that.tableDatas[5][8]
);
that.tableDatas[6][5] =
data1.production_cost_unit;
that.tableDatas[6][9] = precen(
(that.tableDatas[6][8] - that.tableDatas[6][5]),
that.tableDatas[6][8]
);
} else { } else {
this.getMonthData(that.year);
}
} }
});
}, },
// //
getHourData(year, month, days) { getHourData(year, month, days) {

View File

@ -100,6 +100,7 @@ export default {
tableDatas: [], tableDatas: [],
goalDatas: [], goalDatas: [],
exportLoading: false, exportLoading: false,
tableName:'生料工序班组月度对比分析',
}; };
}, },
mounted() { mounted() {

View File

@ -125,6 +125,7 @@ export default {
echartType: "line", echartType: "line",
asynDialog: false, asynDialog: false,
monthGoal: [], monthGoal: [],
tableName:'生料分布电耗月度分析表'
}; };
}, },
mounted() { mounted() {

View File

@ -479,8 +479,7 @@ let yAxis = [
}, },
]; ];
let yAxis_day = [
let yAxis_hour = [
{ {
type: "value", type: "value",
name: "电石渣干粉总产量 (t)", name: "电石渣干粉总产量 (t)",
@ -584,6 +583,75 @@ let yAxis_hour = [
} }
]; ];
let yAxis_hour = [
{
type: "value",
name: "电石渣干粉总产量 (t)",
position: "left",
alignTicks: true,
nameRotate: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[0],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
nameRotate: 50,
name: "电石渣干粉分布电耗(kW·h/t)",
position: "right",
alignTicks: true,
offset: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[1],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
nameRotate: 50,
name: "电石渣工段总电量(kW·h)",
position: "left",
alignTicks: true,
offset: 50,
axisLine: {
show: true,
lineStyle: {
color: colors[2],
},
},
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
nameRotate: 50,
name: "成本(元/t)",
position: "right",
alignTicks: true,
axisLine: {
show: true,
lineStyle: {
color: colors[3],
},
},
axisLabel: {
formatter: "{value}",
},
}
];
export default { export default {
components: { components: {
scEcharts, scEcharts,
@ -645,7 +713,7 @@ export default {
}, },
data: [], data: [],
}, },
yAxis: yAxis_hour, yAxis: yAxis_day,
series: [ series: [
{ {
name: "电石渣干粉总产量", name: "电石渣干粉总产量",
@ -750,7 +818,24 @@ export default {
tooltip: tooltip, tooltip: tooltip,
grid: grid, grid: grid,
toolbox: toolbox, toolbox: toolbox,
legend: legend, legend: {
selector: [
{
type: 'all',
title: '全选'
},
{
type: 'inverse',
title: '反选'
}
],
orient: 'horizontal', // 'vertical'
// top: "2%",
width: "500px",
x: 'center',
y:'top',
data: ["电石渣干粉总产量", "电石渣干粉分布电耗", "电石渣工段总电量", "成本"],
},
xAxis: { xAxis: {
axisTick: { axisTick: {
show: true, show: true,
@ -784,19 +869,7 @@ export default {
type: "bar", type: "bar",
yAxisIndex: 3, yAxisIndex: 3,
data: [], data: [],
}, }
{
name: "湿电石渣消耗",
type: "bar",
yAxisIndex: 4,
data: [],
},
{
name: "湿电石渣进厂",
type: "bar",
yAxisIndex: 5,
data: [],
},
], ],
}, },
}; };
@ -1022,7 +1095,7 @@ export default {
that.tableDatas[3][4] = that.tableDatas[3][4] =
data2.production_cost_unit; data2.production_cost_unit;
that.tableDatas[3][7] = consume_precen( that.tableDatas[3][7] = consume_precen(
that.tableDatas[3][3], that.tableDatas[3][6]-that.tableDatas[3][4],
that.tableDatas[3][6] that.tableDatas[3][6]
); );
that.tableDatas[2][7] = consume_precen( that.tableDatas[2][7] = consume_precen(
@ -1254,7 +1327,7 @@ export default {
dateChange() { dateChange() {
let that = this; let that = this;
let arr = []; let arr = [];
if(that.query.type==0) { if(that.query.type==0 && that.query.day) {
arr = that.query.day.split('-'); arr = that.query.day.split('-');
that.year = Number(arr[0]); that.year = Number(arr[0]);
that.month = Number(arr[1]); that.month = Number(arr[1]);
@ -1262,14 +1335,14 @@ export default {
this.getHourData(that.year, that.month, that.days); this.getHourData(that.year, that.month, that.days);
this.get_days(that.year, that.month, that.days); this.get_days(that.year, that.month, that.days);
} }
else if(that.query.type==1) { else if(that.query.type==1 && that.query.month) {
let year = that.query.month.split("-")[0]; let year = that.query.month.split("-")[0];
let month = that.query.month.split("-")[1]; let month = that.query.month.split("-")[1];
month = Number(month); month = Number(month);
this.getDayData(year, month); this.getDayData(year, month);
this.get_months(year, month); this.get_months(year, month);
this.get_month_year_goal(year, month); this.get_month_year_goal(year, month);
} else if (that.query.type==2) { } else if (that.query.type==2 && that.query.year) {
let year = that.query.year; let year = that.query.year;
this.getMonthData(year); this.getMonthData(year);
this.get_years(year); this.get_years(year);
@ -1316,8 +1389,8 @@ export default {
options.series[1].data = seriesData2; options.series[1].data = seriesData2;
options.series[2].data = seriesData5; options.series[2].data = seriesData5;
options.series[3].data = seriesData1; options.series[3].data = seriesData1;
options.series[4].data = seriesData3; // options.series[4].data = seriesData3;
options.series[5].data = seriesData4; // options.series[5].data = seriesData4;
let hourXAxis = []; let hourXAxis = [];
for (let i = 0; i < 24; i++) { for (let i = 0; i < 24; i++) {
let item = i + "时"; let item = i + "时";

View File

@ -88,6 +88,7 @@ export default {
exportLoading: false, exportLoading: false,
tableDatas: [], tableDatas: [],
goalDatas: [], goalDatas: [],
tableName:'电石渣工序班组月度对比分析',
}; };
}, },
mounted() { mounted() {

View File

@ -121,6 +121,7 @@ export default {
modelValue: true, modelValue: true,
type: "hours", type: "hours",
title: "title", title: "title",
tableName : '电石渣干粉单位电耗月度分析表',
apiObj: "", apiObj: "",
showClose: true, showClose: true,
echartType: "line", echartType: "line",