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">
<el-header>
<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
type="primary"
@click="exportExcel()"
@ -88,7 +134,7 @@
</tr>
</tbody>
</table>
<div class="radioWrap">
<!-- <div class="radioWrap">
<el-radio-group
v-model="typeRadio"
@change="typeRadioChange"
@ -128,8 +174,8 @@
@change="dateChange"
></el-date-picker>
</div>
</div>
<div class="chartWrap" v-show="typeRadio == 'day'">
</div> -->
<div class="chartWrap" v-show="query.type == 0">
<div class="chartTitle">本日生产参数统计图</div>
<scEcharts
height="400px"
@ -137,7 +183,7 @@
:option="optionHour"
></scEcharts>
</div>
<div class="chartWrap" v-show="typeRadio == 'month'">
<div class="chartWrap" v-show="query.type == 1">
<div class="chartTitle">本月生产参数统计图</div>
<scEcharts
height="400px"
@ -145,7 +191,7 @@
:option="optionDay"
></scEcharts>
</div>
<div class="chartWrap" v-show="typeRadio == 'year'">
<div class="chartWrap" v-show="query.type == 2">
<div class="chartTitle">本年生产参数统计图</div>
<scEcharts
height="400px"
@ -401,7 +447,7 @@ let yAxis_hour = [
axisLine: {
show: true,
lineStyle: {
color: colors[3],
color: colors[1],
},
},
axisLabel: {
@ -432,8 +478,14 @@ export default {
month: 1,
days: 1,
hours: 1,
options: [
{id:0,name:'日统计'},
{id:1,name:'月统计'},
{id:2,name:'年统计'}
],
query: {
mgroup: "",
type: 0,
},
tableDatas: [
["产量", "煤磨总产量t", 0, 0, 0, 0, 0, 0, 0, 0],
@ -645,7 +697,6 @@ export default {
let year_h = hourDate.getFullYear();
let month_h = hourDate.getMonth() + 1;
let days_h = hourDate.getDate();
let hours_h = hourDate.getHours();
this.$API.mtm.mgroup.list
.req({ page: 0, search: "煤磨" })
.then((res) => {
@ -682,7 +733,6 @@ export default {
params4.day_s = days_h;
params4.type = "day_s";
params4.mgroup = that.query.mgroup;
console.log("本日----p", params4);
that.$API.enm.enstat.req(params4).then((res4) => {
if (res4) {
console.log("本日", res4);
@ -852,33 +902,194 @@ export default {
},
})
},
dateChange(val) {
dateChange() {
let that = this;
console.log(val);
if (val !== null) {
if (this.typeRadio == "day") {
let year = val.split("-")[0];
let month = val.split("-")[1];
let days = val.split("-")[2];
this.getHourData(year, month, days);
} else if (this.typeRadio == "month") {
let year = val.split("-")[0];
let month = val.split("-")[1];
this.getDayData(year, month);
} else {
this.getMonthData(val);
}
} else {
if (this.typeRadio == "day") {
that.getHourData(that.year, that.month, that.days);
} else if (this.typeRadio == "month") {
this.getDayData(that.year, that.month);
} else {
this.getMonthData(that.year);
}
let arr = [];
if(that.query.type==0 && that.query.day) {
arr = that.query.day.split('-');
that.year = Number(arr[0]);
that.month = Number(arr[1]);
that.days = Number(arr[2]);
this.getHourData(that.year, that.month, that.days);
this.get_days(that.year, that.month, that.days);
}
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.get_months(year, month);
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 = 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) {
let that = this;
let query = {};

View File

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

View File

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

View File

@ -97,7 +97,12 @@
style="width: 70%"
border
: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="设备" prop="mpoint__name" 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' },
],
tableData:[],
selectedRows: [],
tableDatas2: [
{ type: "波峰", time: "8:00--11:00 19:00-24: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;
});
},
dateChange() {
let that = this;
that.mpointList = []; //
let arr = [],
obj = {};
console.log(that.query.mgroupName, 'that.query.mgroupName')
that.$API.enm.mpoint.list
.req({
page: 0,
@ -279,7 +283,6 @@ import * as echarts from 'echarts';
if (res.length === 0) {
return;
}
console.log(res, 'res-----------')
that.mpointList = res
.filter((item) => item.report_sortstr !== "" && item.mgroup_name !== '生活区')
.map((item) => item.id); // id
@ -301,7 +304,6 @@ import * as echarts from 'echarts';
obj.start_time = that.daterange[0];
obj.end_time = that.daterange[1];
}
console.log(that.mpointList.length, 'that.mpointList')
let mpointID = that.mpointList.join(',');
obj.page = 0;
obj.type = 'hour';
@ -331,7 +333,6 @@ import * as echarts from 'echarts';
return acc;
}, []);
this.tableData = groupedData;
console.log("groupedData",groupedData)
})
.catch((error) => {
console.error("API 请求错误: ", error);
@ -339,6 +340,10 @@ import * as echarts from 'echarts';
});
},
handleSelectionChange(val) {
this.selectedRows = val;
console.log("选中的行数据:", this.selectedRows);
},
//
showBarChart(){
this.isChartDialogVisible = true;
@ -368,7 +373,7 @@ import * as echarts from 'echarts';
{ 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 => {
seriesData[0].data.push(item.flat ? parseFloat(item.flat) : 0); //
seriesData[1].data.push(item.high ? parseFloat(item.high) : 0); //

View File

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

View File

@ -2,6 +2,52 @@
<div class="app-container">
<el-header>
<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
type="primary"
@click="exportExcel()"
@ -11,7 +57,7 @@
</el-button>
<el-button type="primary" @click="handlePrint">打印 </el-button>
</div>
</el-header>
</el-header>
<el-card style="margin-top: 5px">
<div class="printWrap">
<div ref="print" id="myReport" class="printContainer">
@ -102,7 +148,7 @@
</tr>
</tbody>
</table>
<div class="radioWrap">
<!-- <div class="radioWrap">
<el-radio-group
v-model="typeRadio"
@change="typeRadioChange"
@ -142,9 +188,9 @@
@change="dateChange"
></el-date-picker>
</div>
</div>
</div> -->
<div class="chartWrap" v-show="typeRadio == 'day'">
<div class="chartWrap" v-show="query.type == 0">
<div class="chartTitle">本日生产参数统计图</div>
<scEcharts
height="400px"
@ -152,7 +198,7 @@
:option="optionHour"
></scEcharts>
</div>
<div class="chartWrap" v-show="typeRadio == 'month'">
<div class="chartWrap" v-show="query.type == 1">
<div class="chartTitle">本月生产参数统计图</div>
<scEcharts
height="400px"
@ -160,7 +206,7 @@
:option="optionDay"
></scEcharts>
</div>
<div class="chartWrap" v-show="typeRadio == 'year'">
<div class="chartWrap" v-show="query.type == 2">
<div class="chartTitle">本年生产参数统计图</div>
<scEcharts
height="400px"
@ -171,7 +217,7 @@
</div>
</div>
<sc-dialog v-model="chartShow" draggable title="烧成工序">
<!-- <sc-dialog v-model="chartShow" draggable title="烧成工序">
<div class="searchHead" v-if="type == 'hours'">
<el-date-picker
v-model="query.start_time"
@ -274,7 +320,7 @@
:option="myOption"
v-if="chartShow"
></scEcharts>
</sc-dialog>
</sc-dialog> -->
<charts
v-if="asynDialog"
:type="type"
@ -646,6 +692,7 @@ export default {
hours: 1,
query: {
mgroup: "",
type: 0,
},
tableDatas: [
["产量", "回转窑总产量t", 0, 0, 0, 0, 0, 0, 0, 0],
@ -670,6 +717,11 @@ export default {
showClose: true,
echartType: "line",
asynDialog: false,
options: [
{id:0,name:'日统计'},
{id:1,name:'月统计'},
{id:2,name:'年统计'}
],
option1: {
color: colors,
tooltip: tooltip,
@ -1157,7 +1209,7 @@ export default {
that.tableDatas[9][4] =
data2.production_cost_unit;
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[10][4] = data2.ammonia_consume;
@ -1190,31 +1242,295 @@ export default {
},
})
},
dateChange(val) {
dateChange() {
let that = this;
console.log(val);
if (val !== null) {
if (this.typeRadio == "day") {
let year = val.split("-")[0];
let month = val.split("-")[1];
let days = val.split("-")[2];
this.getHourData(year, month, days);
} else if (this.typeRadio == "month") {
let year = val.split("-")[0];
let month = val.split("-")[1];
this.getDayData(year, month);
} else {
this.getMonthData(val);
}
} else {
if (this.typeRadio == "day") {
that.getHourData(that.year, that.month, that.days);
} else if (this.typeRadio == "month") {
this.getDayData(that.year, that.month);
} else {
this.getMonthData(that.year);
}
let arr = [];
if(that.query.type==0 && that.query.day) {
console.log(that.query.day, 'that.query.day');
arr = that.query.day.split('-');
that.year = Number(arr[0]);
that.month = Number(arr[1]);
that.days = Number(arr[2]);
this.getHourData(that.year, that.month, that.days);
this.get_days(that.year, that.month, that.days);
}
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.get_months(year, month);
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{
that.tableDatas[0][2] = data4.total_production;
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.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 {
}
});
},
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) {

View File

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

View File

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

View File

@ -2,6 +2,52 @@
<div class="app-container">
<el-header>
<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
type="primary"
@click="exportExcel()"
@ -89,7 +135,7 @@
</tr>
</tbody>
</table>
<div class="radioWrap">
<!-- <div class="radioWrap">
<el-radio-group
v-model="typeRadio"
@change="typeRadioChange"
@ -127,8 +173,8 @@
@change="dateChange"
></el-date-picker>
</div>
</div>
<div class="chartWrap" v-show="typeRadio == 'day'">
</div> -->
<div class="chartWrap" v-show="query.type == 0">
<div class="chartTitle">本日生产参数统计图</div>
<scEcharts
height="400px"
@ -136,7 +182,7 @@
:option="optionHour"
></scEcharts>
</div>
<div class="chartWrap" v-show="typeRadio == 'month'">
<div class="chartWrap" v-show="query.type == 1">
<div class="chartTitle">本月生产参数统计图</div>
<scEcharts
height="400px"
@ -144,7 +190,7 @@
:option="optionDay"
></scEcharts>
</div>
<div class="chartWrap" v-show="typeRadio == 'year'">
<div class="chartWrap" v-show="query.type == 2">
<div class="chartTitle">本年生产参数统计图</div>
<scEcharts
height="400px"
@ -155,7 +201,7 @@
</div>
</div>
<sc-dialog v-model="chartShow" draggable title="水泥粉磨工序">
<!-- <sc-dialog v-model="chartShow" draggable title="水泥粉磨工序">
<div class="searchHead" v-if="type == 'hours'">
<el-date-picker
v-model="query.start_time"
@ -258,7 +304,7 @@
:option="myOption"
v-if="chartShow"
></scEcharts>
</sc-dialog>
</sc-dialog> -->
<charts
v-if="asynDialog"
:type="type"
@ -581,7 +627,13 @@ export default {
hours: 1,
query: {
mgroup: "",
type: 0,
},
options: [
{id:0,name:'日统计'},
{id:1,name:'月统计'},
{id:2,name:'年统计'}
],
tableDatas: [
["产量", "水泥磨总产量t", 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;
if (val !== null) {
if (this.typeRadio == "day") {
let year = val.split("-")[0];
let month = val.split("-")[1];
let days = val.split("-")[2];
this.getHourData(year, month, days);
} else if (this.typeRadio == "month") {
let year = val.split("-")[0];
let month = val.split("-")[1];
this.getDayData(year, month);
} else {
this.getMonthData(val);
}
} else {
if (this.typeRadio == "day") {
that.getHourData(that.year, that.month, that.days);
} else if (this.typeRadio == "month") {
this.getDayData(that.year, that.month);
} else {
this.getMonthData(that.year);
}
let arr = [];
if(that.query.type==0 && that.query.day) {
arr = that.query.day.split('-');
that.year = Number(arr[0]);
that.month = Number(arr[1]);
that.days = Number(arr[2]);
this.getHourData(that.year, that.month, that.days);
this.get_days(that.year, that.month, that.days);
}
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.get_months(year, month);
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{
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.cen_consume_unit;
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) {

View File

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

View File

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

View File

@ -2,6 +2,52 @@
<div class="app-container">
<el-header>
<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
type="primary"
@click="exportExcel()"
@ -68,7 +114,7 @@
</tr>
</tbody>
</table>
<div class="radioWrap">
<!-- <div class="radioWrap">
<el-radio-group
v-model="typeRadio"
@change="typeRadioChange"
@ -96,16 +142,16 @@
@change="dateChange"
></el-date-picker>
</div>
</div>
<div class="chartWrap" v-show="typeRadio == 'day'">
</div> -->
<!-- <div class="chartWrap" v-show="query.type == 0">
<div class="chartTitle">本日生产参数统计图</div>
<scEcharts
height="400px"
width="1033px"
:option="optionHours"
></scEcharts>
</div>
<div class="chartWrap" v-show="typeRadio == 'month'">
</div> -->
<div class="chartWrap" v-show="query.type == 1">
<div class="chartTitle">本月生产参数统计图</div>
<scEcharts
height="400px"
@ -113,7 +159,7 @@
:option="optionDay"
></scEcharts>
</div>
<div class="chartWrap" v-show="typeRadio == 'year'">
<div class="chartWrap" v-show="query.type == 2">
<div class="chartTitle">本年生产参数统计图</div>
<scEcharts
height="400px"
@ -124,7 +170,7 @@
</div>
</div>
<sc-dialog v-model="chartShow" draggable title="水泥包装工序">
<!-- <sc-dialog v-model="chartShow" draggable title="水泥包装工序">
<div class="searchHead" v-if="type == 'hours'">
<el-date-picker
v-model="query.start_time"
@ -227,7 +273,7 @@
:option="myOption"
v-if="chartShow"
></scEcharts>
</sc-dialog>
</sc-dialog> -->
<charts
v-if="asynDialog"
:type="type"
@ -344,8 +390,13 @@ export default {
task2__year: "",
page: 0,
},
options: [
{id:1,name:'月统计'},
{id:2,name:'年统计'}
],
query: {
mgroup: "",
type:1,
},
tableDatas: [
["出厂水泥", "P.O42.5R 散装t", 0,0, 0, 0],
@ -715,24 +766,103 @@ export default {
typeRadioChange() {
this.searchDate = "";
},
dateChange(val) {
dateChange() {
let that = this;
if (val !== null) {
if (this.typeRadio == "month") {
let year = val.split("-")[0];
let month = val.split("-")[1];
this.getDayData(year, month);
} else {
this.getMonthData(val);
}
} else {
if (this.typeRadio == "month") {
this.getDayData(that.year, that.month);
} else {
this.getMonthData(that.year);
}
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.get_months(year, month);
}else if (that.query.type==2 && that.query.year ) {
let year = that.query.year;
this.getMonthData(year);
this.get_year(year);
}
},
get_year(year){
let that = this;
let params1 = {};
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) {
let that = this;
@ -742,6 +872,7 @@ export default {
query1.month_s = month;
query1.type = "day_s";
query1.mgroup = this.query.mgroup;
this.$API.enm.mpointstat.list.req(query1).then((response) => {
let seriesData1 = [],
seriesData2 = [],

View File

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

View File

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

View File

@ -70,6 +70,16 @@
</el-header>
<el-card style="margin-top:5px">
<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">
<thead class="myTableHead">
<tr>
@ -86,11 +96,34 @@
<th v-for="item4 in header4" :key="item4">{{item4}}</th>
</tr>
</thead>
<tr v-for="(item,index) in tableDatas3" :key="index">
<td v-for="(item1,index1) in item" :key="index1" class="numCell">{{item1}}</td>
<tr v-for="(row, rowIndex) in tableDatas3" :key="rowIndex">
<td
v-for="(cell, cellIndex) in row"
:key="cellIndex"
:class="getCellClass(cell, cellIndex)"
class="numCell"
@click="handleCellClick(cell, rowIndex, cellIndex)"
>
{{ cell }}
</td>
</tr>
</table>
</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>
</div>
</template>
@ -111,6 +144,8 @@
],
titleLength:1,
mgroupOptions:[],
threshold: 80, //
currentThreshold: "80%", //
tableTime:'',
deptName:'',
typeName:'质检日报表',
@ -145,6 +180,9 @@
tableData:[],
header2Obj:[],
deptOptions:[],
dialogVisible: false, //
currentColumnIndex: null, //
thresholds: {}, // key
};
},
watch: {
@ -178,6 +216,34 @@
}
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){
let that = this;
that.deptOptions.forEach(item=>{
@ -197,6 +263,13 @@
this.getTableData();
});
},
handleCellClick(cell, rowIndex, cellIndex){
if ((cellIndex - 1) % 4 === 3) { //
this.currentColumnIndex = cellIndex; //
this.currentThreshold = this.thresholds[cellIndex] || ""; //
this.dialogVisible = true; //
}
},
getTableData(){
let that = this;
that.tableDatas3 = [];
@ -263,7 +336,6 @@
wrapArr = wrapArr.filter(item=>{
return item
})
console.log(wrapArr,'warpArr')
wrapArr.forEach((item1,index1)=>{
if(item1!=undefined){//
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;
itemArr.push(time)
//
console.log(itemArr, 'itemArr--')
item1.forEach(item2=>{
let data2 =item2.qua_data;
//
@ -371,5 +442,11 @@
.tableContainer{
overflow-x: scroll;
}
.red-text {
color: red;
}
.green-text {
color: green;
}
</style>

View File

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

View File

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

View File

@ -459,7 +459,7 @@ let yAxis_hour = [
axisLine: {
show: true,
lineStyle: {
color: colors[3],
color: colors[1],
},
},
axisLabel: {
@ -1190,7 +1190,7 @@ export default {
dateChange() {
let that = this;
let arr = [];
if(that.query.type==0) {
if(that.query.type==0 && that.query.day) {
arr = that.query.day.split('-');
that.year = Number(arr[0]);
that.month = Number(arr[1]);
@ -1198,14 +1198,14 @@ export default {
this.getHourData(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 month = that.query.month.split("-")[1];
month = Number(month);
this.getDayData(year, month);
this.get_months(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;
this.getMonthData(year);
this.get_years(year);
@ -1250,54 +1250,54 @@ export default {
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.elec_consume_unit;
that.tableDatas[1][7] = consume_precen(
that.tableDatas[1][4],
that.tableDatas[1][6]
);
that.tableDatas[2][4] = data2.elec_consume;
that.tableDatas[3][4] =
data2.production_cost_unit;
that.tableDatas[3][7] = consume_precen(
that.tableDatas[3][3],
that.tableDatas[3][6]
);
that.tableDatas[2][7] = consume_precen(
that.tableDatas[2][4],
that.tableDatas[2][6]
);
if (data2.imaterial_data.length > 0) {
data2.imaterial_data.forEach((item) => {
if (item.material_name == "湿电石渣消耗") {
that.tableDatas[4][4] = (item.amount_consume).toFixed(2);
that.tableDatas[4][7] = precen(
that.tableDatas[4][4],
that.tableDatas[4][6]
);
}else if(item.material_name == "湿电石渣进厂"){
that.tableDatas[5][4] = (item.amount_consume).toFixed(2);
that.tableDatas[5][7] = precen(
that.tableDatas[5][4],
that.tableDatas[5][6]
);
}
});
}
}
});
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.elec_consume_unit;
that.tableDatas[1][7] = consume_precen(
that.tableDatas[1][4],
that.tableDatas[1][6]
);
that.tableDatas[2][4] = data2.elec_consume;
that.tableDatas[3][4] =
data2.production_cost_unit;
that.tableDatas[3][7] = consume_precen(
that.tableDatas[3][3],
that.tableDatas[3][6]
);
that.tableDatas[2][7] = consume_precen(
that.tableDatas[2][4],
that.tableDatas[2][6]
);
if (data2.imaterial_data.length > 0) {
data2.imaterial_data.forEach((item) => {
if (item.material_name == "湿电石渣消耗") {
that.tableDatas[4][4] = (item.amount_consume).toFixed(2);
that.tableDatas[4][7] = precen(
that.tableDatas[4][4],
that.tableDatas[4][6]
);
}else if(item.material_name == "湿电石渣进厂"){
that.tableDatas[5][4] = (item.amount_consume).toFixed(2);
that.tableDatas[5][7] = precen(
that.tableDatas[5][4],
that.tableDatas[5][6]
);
}
});
}
}
});
},
get_month_year_goal(year, month){
let that = this;

View File

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

View File

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

View File

@ -2,6 +2,52 @@
<div class="app-container">
<el-header>
<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
type="primary"
@click="exportExcel()"
@ -87,7 +133,7 @@
</tr>
</tbody>
</table>
<div class="radioWrap">
<!-- <div class="radioWrap">
<el-radio-group
v-model="typeRadio"
@change="typeRadioChange"
@ -127,9 +173,9 @@
@change="dateChange"
></el-date-picker>
</div>
</div>
</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>
<scEcharts
height="400px"
@ -137,7 +183,7 @@
:option="optionHour"
></scEcharts>
</div>
<div class="chartWrap" v-show="typeRadio == 'month'">
<div class="chartWrap" v-show="query.type == 1">
<div class="chartTitle">本月生产参数统计图</div>
<scEcharts
height="400px"
@ -145,7 +191,7 @@
:option="optionDay"
></scEcharts>
</div>
<div class="chartWrap" v-show="typeRadio == 'year'">
<div class="chartWrap" v-show="query.type == 2">
<div class="chartTitle">本年生产参数统计图</div>
<scEcharts
height="400px"
@ -156,7 +202,7 @@
</div>
</div>
<sc-dialog v-model="chartShow" draggable title="生料工序">
<!-- <sc-dialog v-model="chartShow" draggable title="生料工序">
<div class="searchHead" v-if="type == 'hours'">
<el-date-picker
v-model="query.start_time"
@ -259,7 +305,7 @@
:option="myOption"
v-if="chartShow"
></scEcharts>
</sc-dialog>
</sc-dialog> -->
<charts
v-if="asynDialog"
:type="type"
@ -524,12 +570,18 @@ export default {
optionDay: {},
optionMonth: {},
goal_list: [],
year: 2023,
options: [
{id:0,name:'日统计'},
{id:1,name:'月统计'},
{id:2,name:'年统计'}
],
year: 2025,
month: 1,
days: 1,
hours: 1,
query: {
mgroup: "",
type: 0,
},
tableDatas: [
["产量", "生料总产量t", 0, 0, 0, 0, 0, 0, 0, 0],
@ -734,6 +786,7 @@ export default {
dataX: [],
dataY: [],
dataY2: [],
option: {
color: [
"#647bfe",
@ -1194,31 +1247,225 @@ export default {
},
})
},
dateChange(val) {
dateChange() {
let that = this;
console.log(val);
if (val !== null) {
if (this.typeRadio == "day") {
let year = val.split("-")[0];
let month = val.split("-")[1];
let days = val.split("-")[2];
this.getHourData(year, month, days);
} else if (this.typeRadio == "month") {
let year = val.split("-")[0];
let month = val.split("-")[1];
this.getDayData(year, month);
} else {
this.getMonthData(val);
}
} else {
if (this.typeRadio == "day") {
that.getHourData(that.year, that.month, that.days);
} else if (this.typeRadio == "month") {
this.getDayData(that.year, that.month);
} else {
this.getMonthData(that.year);
}
let arr = [];
if(that.query.type==0 && that.query.day) {
arr = that.query.day.split('-');
that.year = Number(arr[0]);
that.month = Number(arr[1]);
that.days = Number(arr[2]);
this.getHourData(that.year, that.month, that.days);
this.get_days(that.year, that.month, that.days);
}
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.get_months(year, month);
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 {
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;}
}
});
},
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 {
}
});
},
//
getHourData(year, month, days) {

View File

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

View File

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

View File

@ -479,8 +479,7 @@ let yAxis = [
},
];
let yAxis_hour = [
let yAxis_day = [
{
type: "value",
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 {
components: {
scEcharts,
@ -645,7 +713,7 @@ export default {
},
data: [],
},
yAxis: yAxis_hour,
yAxis: yAxis_day,
series: [
{
name: "电石渣干粉总产量",
@ -750,7 +818,24 @@ export default {
tooltip: tooltip,
grid: grid,
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: {
axisTick: {
show: true,
@ -784,19 +869,7 @@ export default {
type: "bar",
yAxisIndex: 3,
data: [],
},
{
name: "湿电石渣消耗",
type: "bar",
yAxisIndex: 4,
data: [],
},
{
name: "湿电石渣进厂",
type: "bar",
yAxisIndex: 5,
data: [],
},
}
],
},
};
@ -1022,7 +1095,7 @@ export default {
that.tableDatas[3][4] =
data2.production_cost_unit;
that.tableDatas[3][7] = consume_precen(
that.tableDatas[3][3],
that.tableDatas[3][6]-that.tableDatas[3][4],
that.tableDatas[3][6]
);
that.tableDatas[2][7] = consume_precen(
@ -1254,7 +1327,7 @@ export default {
dateChange() {
let that = this;
let arr = [];
if(that.query.type==0) {
if(that.query.type==0 && that.query.day) {
arr = that.query.day.split('-');
that.year = Number(arr[0]);
that.month = Number(arr[1]);
@ -1262,14 +1335,14 @@ export default {
this.getHourData(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 month = that.query.month.split("-")[1];
month = Number(month);
this.getDayData(year, month);
this.get_months(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;
this.getMonthData(year);
this.get_years(year);
@ -1316,8 +1389,8 @@ export default {
options.series[1].data = seriesData2;
options.series[2].data = seriesData5;
options.series[3].data = seriesData1;
options.series[4].data = seriesData3;
options.series[5].data = seriesData4;
// options.series[4].data = seriesData3;
// options.series[5].data = seriesData4;
let hourXAxis = [];
for (let i = 0; i < 24; i++) {
let item = i + "时";

View File

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

View File

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