This commit is contained in:
shijing 2024-09-24 16:40:27 +08:00
commit 64016cf2dc
8 changed files with 220 additions and 228 deletions

View File

@ -9,7 +9,7 @@
<div class="top_block"> <div class="top_block">
<div class="top_block_time"> <div class="top_block_time">
<img src="img/photon_top_line.png" /> <img src="img/photon_top_line.png" />
<span>托克逊</span> <span>新疆中泰化学托克逊能化有限公司绿色建材分公司能源数据采集平台</span>
{{ currentDay }}{{ currentWeek }}{{ currentTime }} {{ currentDay }}{{ currentWeek }}{{ currentTime }}
<img <img
src="img/photon_top_line.png" src="img/photon_top_line.png"
@ -107,7 +107,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="flexItem"> <!-- <div class="flexItem">
<div class="itemTitle"> <div class="itemTitle">
<div class="itemTitleIcon"></div> <div class="itemTitleIcon"></div>
<div>数据采集</div> <div>数据采集</div>
@ -147,13 +147,13 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</div> </div> -->
</div> </div>
<div class="right_block"> <div class="right_block">
<div class="flexItem"> <div class="flexItem">
<div class="itemTitle"> <div class="itemTitle">
<div class="itemTitleIcon"></div> <div class="itemTitleIcon"></div>
<div>工序电耗</div> <div>主机设备电耗电耗</div>
</div> </div>
<div class="itemBody itemBodyFlex"> <div class="itemBody itemBodyFlex">
<div id="radar" style="height: 100%"></div> <div id="radar" style="height: 100%"></div>
@ -200,32 +200,32 @@
<div class="flexItem"> <div class="flexItem">
<div class="itemTitle"> <div class="itemTitle">
<div class="itemTitleIcon"></div> <div class="itemTitleIcon"></div>
<div>环保数据</div> <div>能源数据</div>
</div> </div>
<div class="itemBody" style="padding: 5%"> <div class="itemBody" style="padding: 5%">
<div class="elecItem"> <div class="elecItem">
<div class="elecItem_wrap"> <div class="elecItem_wrap">
<span>当月发电量</span> <span>熟料综合电耗</span>
<p class="elec_number"> <p class="elec_number">
{{ hotData.total_production }} {{ hotData.celec_consume_unit }}
<span class="elec_unit">kwh</span> <span class="elec_unit">kwh</span>
</p> </p>
</div> </div>
</div> </div>
<div class="elecItem"> <div class="elecItem">
<div class="elecItem_wrap"> <div class="elecItem_wrap">
<span>NOx折算值</span> <span>熟料综合煤耗</span>
<p class="elec_number"> <p class="elec_number">
{{ hotData.NOx }} {{ hotData.coal_consume_unit }}
<span class="elec_unit">mg/</span> <span class="elec_unit">kwh</span>
</p> </p>
</div> </div>
</div> </div>
<div class="elecItem"> <div class="elecItem">
<div class="elecItem_wrap"> <div class="elecItem_wrap">
<span>发电量</span> <span>熟料综合能耗</span>
<p class="elec_number"> <p class="elec_number">
{{ hotData.production_elec_unit }} {{ hotData.cen_consume_unit }}
<span class="elec_unit">kwh</span> <span class="elec_unit">kwh</span>
</p> </p>
</div> </div>
@ -233,28 +233,19 @@
<div class="elecItem"> <div class="elecItem">
<div class="elecItem_wrap"> <div class="elecItem_wrap">
<span>SO2折算值</span> <span>水泥综合能耗</span>
<p class="elec_number"> <p class="elec_number">
{{ hotData.SO2 }} {{ hotData.sn_cen_consume_unit}}
<span class="elec_unit">mg/</span>
</p>
</div>
</div>
<div class="elecItem">
<div class="elecItem_wrap">
<span>自用电量</span>
<p class="elec_number">
{{ hotData.elec_consume }}
<span class="elec_unit">kwh</span> <span class="elec_unit">kwh</span>
</p> </p>
</div> </div>
</div> </div>
<div class="elecItem"> <div class="elecItem">
<div class="elecItem_wrap"> <div class="elecItem_wrap">
<span>颗粒物折算值</span> <span>水泥工序电耗</span>
<p class="elec_number"> <p class="elec_number">
{{ hotData.klw }} {{ hotData.sn_elec_consume_unit }}
<span class="elec_unit">mg/</span> <span class="elec_unit">kwh</span>
</p> </p>
</div> </div>
</div> </div>
@ -451,12 +442,11 @@ export default {
{ name: "水泥包装", value: 0 }, { name: "水泥包装", value: 0 },
], ],
hotData: { hotData: {
total_production: "", celec_consume_unit: "", //
production_elec_unit: "", coal_consume_unit: "", //
elec_consume: "", cen_consume_unit: "", //
NOx: "", sn_cen_consume_unit: "", //
SO2: "", sn_elec_consume_unit: "",//
klw: "",
}, },
tableData: [], tableData: [],
tezhongData: [], tezhongData: [],
@ -824,9 +814,8 @@ export default {
generation() { generation() {
let that = this; let that = this;
this.$API.mtm.mgroup.list this.$API.mtm.mgroup.list
.req({ page: 0, search: "余热发电" }) .req({ page: 0, search: "回转窑" })
.then((res) => { .then((res) => {
// console.log("", res);
that.yurefadianId = res[0].id; that.yurefadianId = res[0].id;
let params = {}; let params = {};
params.page = 0; params.page = 0;
@ -835,51 +824,68 @@ export default {
params.type = "month_s"; params.type = "month_s";
params.mgroup = that.yurefadianId; params.mgroup = that.yurefadianId;
this.$API.enm.enstat.req(params).then((ress) => { this.$API.enm.enstat.req(params).then((ress) => {
that.hotData.total_production = that.hotData.celec_consume_unit =
ress[0].total_production; ress[0].celec_consume_unit;
that.hotData.production_elec_unit = that.hotData.coal_consume_unit =
ress[0].production_elec_unit; ress[0].coal_consume_unit;
that.hotData.elec_consume = ress[0].elec_consume; that.hotData.cen_consume_unit = ress[0].cen_consume_unit;
}); });
}); });
// this.$API.mtm.mgroup.list
this.$API.enm.mpoint.list .req({ page: 0, search: "水泥磨" })
.req({ .then((res) => {
page: 0, that.yurefadianId = res[0].id;
code: "K_TX_IP20_TX_MD500", //nox let params = {};
query: " { id, name, code, last_data, gather_state }", params.page = 0;
}) params.year_s = that.currentYear;
.then((res0) => { params.month_s = that.currentMonth;
if (res0[0].last_data.last_val) { params.type = "month_s";
that.hotData.NOx = params.mgroup = that.yurefadianId;
res0[0].last_data.last_val.toFixed(2); this.$API.enm.enstat.req(params).then((ress) => {
} that.hotData.sn_elec_consume_unit =
ress[0].elec_consume_unit;
that.hotData.sn_cen_consume_unit = ress[0].cen_consume_unit;
}); });
this.$API.enm.mpoint.list });
.req({ },
page: 0, // //
code: "K_TX_IP20_TX_MD508", //so2 // this.$API.enm.mpoint.list
query: "{ id, name, code, last_data, gather_state }", // .req({
}) // page: 0,
.then((res1) => { // code: "K_TX_IP20_TX_MD500", //nox
if (res1[0].last_data.last_val) { // query: " { id, name, code, last_data, gather_state }",
that.hotData.SO2 = // })
res1[0].last_data.last_val.toFixed(2); // .then((res0) => {
} // if (res0[0].last_data.last_val) {
}); // that.hotData.NOx =
this.$API.enm.mpoint.list // res0[0].last_data.last_val.toFixed(2);
.req({ // }
page: 0, // });
code: "K_TX_IP20_TX_MD504", // // this.$API.enm.mpoint.list
query: "{ id, name, code, last_data, gather_state }", // .req({
}) // page: 0,
.then((res2) => { // code: "K_TX_IP20_TX_MD508", //so2
if (res2[0].last_data.last_val) { // query: "{ id, name, code, last_data, gather_state }",
that.hotData.klw = // })
res2[0].last_data.last_val.toFixed(2); // .then((res1) => {
} // if (res1[0].last_data.last_val) {
}); // that.hotData.SO2 =
}, // res1[0].last_data.last_val.toFixed(2);
// }
// });
// this.$API.enm.mpoint.list
// .req({
// page: 0,
// code: "K_TX_IP20_TX_MD504", //
// query: "{ id, name, code, last_data, gather_state }",
// })
// .then((res2) => {
// if (res2[0].last_data.last_val) {
// that.hotData.klw =
// res2[0].last_data.last_val.toFixed(2);
// }
// });
// //
proceElec() { proceElec() {
let that = this; let that = this;
@ -954,50 +960,50 @@ export default {
}); });
console.log("数据采集tableData", that.tableData); console.log("数据采集tableData", that.tableData);
let chartDom6 = document.getElementById("pieChart"); // let chartDom6 = document.getElementById("pieChart");
let myChart6 = echarts.init(chartDom6); // let myChart6 = echarts.init(chartDom6);
let colors = []; // let colors = [];
colors.push(that.linearGradientColors[0]); // colors.push(that.linearGradientColors[0]);
colors.push(that.linearGradientColors[3]); // colors.push(that.linearGradientColors[3]);
let option6 = { // let option6 = {
color: colors, // color: colors,
tooltip: { // tooltip: {
trigger: "item", // trigger: "item",
}, // },
legend: { // legend: {
top: "2%", // top: "2%",
left: "center", // left: "center",
textStyle: { // textStyle: {
color: "#fff", // color: "#fff",
}, // },
}, // },
series: [ // series: [
{ // {
name: "运行状态", // name: "",
type: "pie", // type: "pie",
radius: ["40%", "70%"], // radius: ["40%", "70%"],
padAngle: 5, // padAngle: 5,
itemStyle: { // itemStyle: {
borderRadius: 5, // borderRadius: 5,
}, // },
label: { // label: {
show: true, // show: true,
position: "inner", // position: "inner",
fontSize: 16, // fontSize: 16,
formatter: "{d}%", // formatter: "{d}%",
color: "#fff", // color: "#fff",
}, // },
labelLine: { // labelLine: {
show: false, // show: false,
}, // },
data: [ // data: [
{ value: success_num, name: "正常" }, // { value: success_num, name: "" },
{ value: error_num, name: "掉线" }, // { value: error_num, name: "线" },
], // ],
}, // },
], // ],
}; // };
myChart6.setOption(option6); // myChart6.setOption(option6);
}); });
}, },
showTime() { showTime() {
@ -1029,8 +1035,8 @@ export default {
var model = document.getElementsByClassName("model")[0]; var model = document.getElementsByClassName("model")[0];
var left_block = document.getElementsByClassName("left_block")[0]; var left_block = document.getElementsByClassName("left_block")[0];
var right_block = document.getElementsByClassName("right_block")[0]; var right_block = document.getElementsByClassName("right_block")[0];
var pieChart = document.getElementById("pieChart"); // var pieChart = document.getElementById("pieChart");
var elTable = document.getElementById("elTable"); // var elTable = document.getElementById("elTable");
var radarChart = document.getElementById("radar"); var radarChart = document.getElementById("radar");
if (windowWidth > 960) { if (windowWidth > 960) {
container.style.overflow = "hidden"; container.style.overflow = "hidden";
@ -1056,10 +1062,10 @@ export default {
var itemBody = itemBodys[i]; var itemBody = itemBodys[i];
itemBody.style.height = itemBodyHeight + "px"; itemBody.style.height = itemBodyHeight + "px";
} }
elTable.style.height = itemBodyHeight - 20 + "px"; // elTable.style.height = itemBodyHeight - 20 + "px";
let pieWidth = Math.round(windowWidth / 100) * 22 - 180; let pieWidth = Math.round(windowWidth / 100) * 22 - 180;
let radarWidth = Math.round(windowWidth / 100) * 22 - 130; let radarWidth = Math.round(windowWidth / 100) * 22 - 130;
pieChart.style.width = pieWidth + "px"; // pieChart.style.width = pieWidth + "px";
radarChart.style.width = radarWidth + "px"; radarChart.style.width = radarWidth + "px";
} else { } else {
container.style.overflow = "auto"; container.style.overflow = "auto";
@ -1071,7 +1077,7 @@ export default {
that.engine.resize(); that.engine.resize();
} }
that.resizeChart("line1"); that.resizeChart("line1");
that.resizeChart("pieChart"); // that.resizeChart("pieChart");
that.resizeChart("radar"); that.resizeChart("radar");
that.resizeChart("line3"); that.resizeChart("line3");
}, },
@ -2154,10 +2160,7 @@ export default {
background: #0000ff; background: #0000ff;
} }
/* // 表格——el-table 去除背景颜色*/ /* // 表格——el-table 去除背景颜色*/
#elTable {
/* border-radius: 5px; */
margin-top: 10px;
}
.successCircle { .successCircle {
width: 10px; width: 10px;
height: 10px; height: 10px;

View File

@ -111,9 +111,12 @@ export default {
this.$API.mtm.goal.list.req(params).then((res) => { this.$API.mtm.goal.list.req(params).then((res) => {
// let data = []; // let data = [];
if (res.length > 0) { if (res.length > 0) {
this.goalDatas = res[0]; res.forEach((item) => {
if (item.goal_cate_name == "单位产品分布电耗KW·h/t") {
that.getData(item);
}
})
} }
that.getData(this.goalDatas);
}); });
}); });
}, },
@ -187,13 +190,15 @@ export default {
: "/"; : "/";
// //
arr[7] = arr[7] =
item.煤磨排风机_consume_unit !== undefined && item.煤磨排风机_consume_unit !== null item.煤磨排风机主电机_consume_unit
? item.煤磨排风机_consume_unit !== undefined && item.煤磨排风机主电机_consume_unit
!== null
? item.煤磨排风机主电机_consume_unit
: "/"; : "/";
let keyVale = "goal_val_" + n; let keyVale = "goal_val_" + n;
arr[8] = item.elec_consume_unit; //KW·h/t arr[8] = item.elec_consume_unit; //KW·h/t
arr[9] = goalData[keyVale]; //KW·h/t// arr[9] = goalData[keyVale]; //KW·h/t//
arr[10] = item.celec_consume_unit - arr[9]; //KW·h/t arr[10] = (arr[8] - arr[9]).toFixed(2); //KW·h/t
let ind_pre = 0, let ind_pre = 0,
huanqi = 0, huanqi = 0,
huanqicha = 0, huanqicha = 0,
@ -214,9 +219,9 @@ export default {
} }
arr[11] = huanqi; //KW·h/t arr[11] = huanqi; //KW·h/t
if (huanqi !== "/") { if (huanqi !== "/") {
huanqicha = item.celec_consume_unit - huanqi; huanqicha = (arr[8] - arr[11]).toFixed(2);
} else { } else {
huanqicha = item.celec_consume_unit; huanqicha = 0;
} }
arr[12] = huanqicha; //KW·h/t arr[12] = huanqicha; //KW·h/t
// arr[13] = // arr[13] =

View File

@ -248,9 +248,9 @@ export default {
let keyValue = "goal_val_" + n; let keyValue = "goal_val_" + n;
if (goalData.length > 0){ if (goalData.length > 0){
goalData.forEach((item) => { goalData.forEach((item) => {
if (item.id == "3638341891940192256") { if (item.goal_cate_name == "单位产品标煤耗kgce/t") {
arr[13] = item[keyValue]; //KW·h/t// arr[13] = item[keyValue]; //KW·h/t//
}else if (item.id == "3637651365016526848"){ }else if (item.goal_cate_name == "单位产品分布电耗KW·h/t"){
arr[25] = item[keyValue]; //KW·h/t// arr[25] = item[keyValue]; //KW·h/t//
} }
}); });

View File

@ -108,33 +108,19 @@ export default {
this.$API.mtm.mgroup.list this.$API.mtm.mgroup.list
.req({ page: 0, search: "水泥磨" }) .req({ page: 0, search: "水泥磨" })
.then((res) => { .then((res) => {
console.log("水泥磨", res);
that.query.mgroup = res[0].id; that.query.mgroup = res[0].id;
let params = {}; let params = {};
params.page = 0; params.page = 0;
params.year = year; params.year = year;
params.mgroup = that.query.mgroup; params.mgroup = that.query.mgroup;
this.$API.mtm.goal.list.req(params).then((res) => { this.$API.mtm.goal.list.req(params).then((res) => {
let data = []; that.getData(res);
if (res.length > 0) { });
data = res[0];
}
that.getGoalData();
});
}); });
}, },
methods: { methods: {
getGoalData() {
let that = this;
let params = {};
params.page = 0;
params.year = that.query.year_s;
params.mgroup = that.query.mgroup;
this.$API.mtm.goal.list.req(params).then((res) => {
that.getData(res);
});
},
getData(goalData) { getData(goalData) {
console.log("goalData", goalData);
let that = this; let that = this;
let query0 = {}; let query0 = {};
query0.page = 0; query0.page = 0;
@ -144,8 +130,7 @@ export default {
let wrapArr = [], let wrapArr = [],
wrapArr0 = [], wrapArr0 = [],
compareArr0 = [], compareArr0 = [],
month_obj = {}, month_obj = {};
wrapArrs = [];
this.$API.enm.enstat.req(query0).then((res0) => { this.$API.enm.enstat.req(query0).then((res0) => {
let data0 = []; // let data0 = []; //
data0 = res0; data0 = res0;
@ -226,7 +211,14 @@ export default {
// arr[13]=item.elec_consume_unit//KW·h/t // arr[13]=item.elec_consume_unit//KW·h/t
let keyVale = "goal_val_" + n; let keyVale = "goal_val_" + n;
arr[12] = goalData[keyVale]; //KW·h/t// // arr[12] = goalData[keyVale]; //KW·h/t//
if (goalData.length > 0){
goalData.forEach((item) => {
if (item.goal_cate_name == "单位产品分布电耗KW·h/t"){
arr[12] = item[keyVale]; //KW·h/t//
}
});
};
arr[13] = arr[12] - item.celec_consume_unit; //KW·h/t arr[13] = arr[12] - item.celec_consume_unit; //KW·h/t
let ind_pre = 0, let ind_pre = 0,
huanqi = 0, huanqi = 0,
@ -269,7 +261,6 @@ export default {
// arr[18] = 0.0; //% // arr[18] = 0.0; //%
arr[18] = 0; arr[18] = 0;
if (month_obj[n]) { if (month_obj[n]) {
console.log("month_obj[n]",month_obj[n])
const monthData = month_obj[n]; const monthData = month_obj[n];
const itemValue = item.elec_consume_unit; // const itemValue = item.elec_consume_unit; //
const sortedData = monthData.sort((a, b) => parseFloat(b.elec) - parseFloat(a.elec)); const sortedData = monthData.sort((a, b) => parseFloat(b.elec) - parseFloat(a.elec));
@ -369,7 +360,7 @@ export default {
CL_score= 10; CL_score= 10;
} else if (CL_index === 1) { } else if (CL_index === 1) {
CL_score= 7; CL_score= 7;
} else if (SO3_inCL_indexdex === 2) { } else if (CL_index === 2) {
CL_score= 3; CL_score= 3;
} else if (CL_index === 3) { } else if (CL_index === 3) {
CL_score= 0; CL_score= 0;
@ -381,7 +372,6 @@ export default {
let newArr = []; let newArr = [];
for (let i = 0; i < wrapArr.length; i++) { for (let i = 0; i < wrapArr.length; i++) {
let item = wrapArr[i]; let item = wrapArr[i];
console.log(item);
if (item == undefined) { if (item == undefined) {
} else { } else {
newArr.push(wrapArr[i]); newArr.push(wrapArr[i]);
@ -406,7 +396,6 @@ export default {
this.$API.bi.dataset.exec.req("3322567213885833216").then((res) => { this.$API.bi.dataset.exec.req("3322567213885833216").then((res) => {
this.myOption = JSON.parse(res.echart_options); this.myOption = JSON.parse(res.echart_options);
// debugger; // debugger;
console.log(this.myOption);
this.chartShow = true; this.chartShow = true;
}); });
}, },

View File

@ -142,14 +142,16 @@ export default {
}, },
data() { data() {
return { return {
apiObj: this.$API.fim.feeset.list, apiObj: null,
mgroup_name :["电石渣", "回转窑", "水泥磨"],
query: { query: {
date: "", date: "",
fee: "", fee: "",
mgroup: "", mgroup: "",
}, },
params:{ params:{
mgroup__cate:"section" mgroup__cate:"section",
mgroup__name__in: "",
}, },
dialog: { dialog: {
save: false, save: false,
@ -162,6 +164,8 @@ export default {
mounted() { mounted() {
this.getFee(); this.getFee();
this.getMgroup(); this.getMgroup();
this.params.mgroup__name__in = this.mgroup_name.join(",");
this.apiObj = this.$API.fim.feeset.list;
}, },
methods: { methods: {
// //
@ -169,7 +173,6 @@ export default {
this.$API.mtm.mgroup.list.req({ page: 0, cate:"section"}).then((res) => { this.$API.mtm.mgroup.list.req({ page: 0, cate:"section"}).then((res) => {
//res.name=options //res.name=options
res.forEach(element => { res.forEach(element => {
// console.log(element.name);
if(['煤磨','原料磨','水泥包装'].includes(element.name)){ if(['煤磨','原料磨','水泥包装'].includes(element.name)){
return; return;
} }
@ -182,10 +185,10 @@ export default {
getFee() { getFee() {
this.$API.fim.fee.req({ page: 0 }).then((res) => { this.$API.fim.fee.req({ page: 0 }).then((res) => {
res.forEach(element => { res.forEach(element => {
// console.log(element.name); // console.log('element', element);
if(['煤磨','原料磨','水泥包装'].includes(element.name)){ // if(['','',''].includes(element.name)){
return; // return;
} // }
this.feeOptions.push(element); this.feeOptions.push(element);
}); });
}); });

View File

@ -202,10 +202,17 @@
</el-table-column> </el-table-column>
<el-table-column label="录入值" prop="val"> <el-table-column label="录入值" prop="val">
</el-table-column> </el-table-column>
<el-table-column label="班组时间"> <el-table-column label="班组开始时间">
<template #default="scope"> <template #default="scope">
<span> <span>
{{ scope.row.year_s }}-{{scope.row.month_s}}-{{ scope.row.day_s }} {{ scope.row.sflog_start_time}}
</span>
</template>
</el-table-column>
<el-table-column label="班组结束时间">
<template #default="scope">
<span>
{{ scope.row.sflog_end_time}}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
@ -687,6 +694,7 @@ export default {
let form = this.$TOOL.data.get("sflogItem"); let form = this.$TOOL.data.get("sflogItem");
this.form = JSON.parse(form); this.form = JSON.parse(form);
console.log('----------------',this.form);
this.querystlog.mgroup = this.mgroupId; this.querystlog.mgroup = this.mgroupId;
this.querystlog.sflogs = this.form.id; this.querystlog.sflogs = this.form.id;
this.apiObjStlog = this.$API.wpm.stlog.list; this.apiObjStlog = this.$API.wpm.stlog.list;
@ -728,9 +736,18 @@ export default {
if (res.length > 0) { if (res.length > 0) {
that.mpointOptions = []; that.mpointOptions = [];
res.forEach((item) => { res.forEach((item) => {
item.mpFormVal = ""; item.mpFormVal = null;
item.mpFormValAble = false; item.mpFormValAble = false;
that.mpointOptions.push(item); that.$API.enm.mpoint.stat.req({mpoint: item.id, sflog: this.form.id, page: 0}).then(res=>{
if(res.length>0){
item.mpFormVal = res[0].val;
}else{
item.mpFormVal = 0;
}
that.mpointOptions.push(item);
})
}); });
that.getMpointStat(); that.getMpointStat();
} }
@ -744,26 +761,6 @@ export default {
form.mgroup = that.mgroupId; form.mgroup = that.mgroupId;
that.$API.enm.mpoint.stat.req(form).then((res) => { that.$API.enm.mpoint.stat.req(form).then((res) => {
that.mpointStat = res.results; that.mpointStat = res.results;
res.results.forEach((item) => {
let month_s =
item.month_s > 9 ? item.month_s : "0" + item.month_s;
let day_s = item.day_s > 9 ? item.day_s : "0" + item.day_s;
let work_date = item.year_s + "-" + month_s + "-" + day_s;
that.mpointOptions.forEach((item2) => {
let work_date =
item.year_s + "-" + month_s + "-" + day_s;
if (
item2.name == item.mpoint_name &&
work_date == this.form.work_date
) {
item2.mpFormValAble = true;
item2.mpFormVal = item.val;
}
});
// console.log(that.mpointOptions);
that.updateKey = !that.updateKey;
that.$forceUpdate();
});
}); });
}, },
mpointStat_del(row) { mpointStat_del(row) {

View File

@ -37,7 +37,7 @@
> >
<thead class="myTableHead"> <thead class="myTableHead">
<tr> <tr>
<th colspan="24">原料磨工段班组月度对比分析</th> <th colspan="23">原料磨工段班组月度对比分析</th>
</tr> </tr>
<tr> <tr>
<th rowspan="2">月份</th> <th rowspan="2">月份</th>
@ -46,7 +46,7 @@
<th>运转率</th> <th>运转率</th>
<th>成本</th> <th>成本</th>
<th colspan="7">质量</th> <th colspan="7">质量</th>
<th colspan="10">单位产品电耗</th> <th colspan="9">单位产品电耗</th>
<th rowspan="2">得分</th> <th rowspan="2">得分</th>
</tr> </tr>
<tr> <tr>
@ -62,7 +62,6 @@
<th>水分%</th> <th>水分%</th>
<th>CaO%</th> <th>CaO%</th>
<th>循环风机KW·h/t</th> <th>循环风机KW·h/t</th>
<th>尾排风机KW·h/t</th>
<th>立磨主电机KW·h/t</th> <th>立磨主电机KW·h/t</th>
<th>当期值KW·h/t</th> <th>当期值KW·h/t</th>
@ -121,9 +120,12 @@ export default {
params.mgroup = that.query.mgroup; params.mgroup = that.query.mgroup;
this.$API.mtm.goal.list.req(params).then((res) => { this.$API.mtm.goal.list.req(params).then((res) => {
if (res.length > 0) { if (res.length > 0) {
that.goalDatas = res[0]; res.forEach((item) => {
if (item.goal_cate_name == "单位产品分布电耗KW·h/t") {
that.getData(item);
}
})
} }
that.getData(that.goalDatas);
}); });
}); });
}, },
@ -221,18 +223,14 @@ export default {
? item.循环风机_consume_unit ? item.循环风机_consume_unit
: "/"; : "/";
arr[14] = arr[14] =
item.尾排风机_consume_unit != null
? item.尾排风机_consume_unit
: "/";
arr[15] =
item.立磨主电机_consume_unit != null item.立磨主电机_consume_unit != null
? item.立磨主电机_consume_unit ? item.立磨主电机_consume_unit
: "/"; : "/";
// //
arr[16] = item.elec_consume_unit; //KW·h/t arr[15] = item.elec_consume_unit; //KW·h/t
let keyVale = "goal_val_" + n; let keyVale = "goal_val_" + n;
arr[17] = goalData[keyVale]?goalData[keyVale]:0; //KW·h/t// arr[16] = goalData[keyVale]?goalData[keyVale]:0; //KW·h/t//
arr[18] = item.celec_consume_unit - arr[16]; //KW·h/t arr[17] = item.celec_consume_unit - arr[16]; //KW·h/t
let ind_pre = 0, let ind_pre = 0,
huanbi = 0; huanbi = 0;
if (item.month_s == 1) { if (item.month_s == 1) {
@ -248,22 +246,22 @@ export default {
} }
}) })
} }
arr[19] = huanbi; //KW·h/t arr[18] = huanbi; //KW·h/t
//KW·h/t //KW·h/t
if (arr[19] !== "/"){ if (arr[19] !== "/"){
arr[20] = (arr[16] - arr[19]).toFixed(2); //KW·h/t arr[19] = (arr[15] - arr[18]).toFixed(2); //KW·h/t
}else{ }else{
arr[20] = "/"; //KW·h/t arr[19] = "/"; //KW·h/t
} }
arr[21] = item.celec_consume_unit; //% arr[20] = item.celec_consume_unit; //%
if (arr[19] !=="/" && arr[20] !==0 && arr[20] !== "undefined"){ if (arr[18] !=="/" && arr[19] !==0 && arr[19] !== "undefined"){
arr[21] = ((arr[19]/arr[20])*100).toFixed(2); arr[20] = ((arr[18]/arr[19])*100).toFixed(2);
}else{ }else{
arr[21] = "/"; //%= KW·h/t/KW·h/t*100% arr[20] = "/"; //%= KW·h/t/KW·h/t*100%
} }
arr[22] = item.celec_consume_unit; //% arr[21] = item.celec_consume_unit; //%
arr[23] = 0; arr[22] = 0;
if (month_obj[n]) { if (month_obj[n]) {
console.log("month_obj[n]",month_obj[n]) console.log("month_obj[n]",month_obj[n])
const monthData = month_obj[n]; const monthData = month_obj[n];
@ -280,7 +278,7 @@ export default {
} else if (index === 3) { } else if (index === 3) {
elec_score= 0; elec_score= 0;
} }
arr[23] += elec_score; arr[22] += elec_score;
const run_rate_itemValue = item.run_rate; // const run_rate_itemValue = item.run_rate; //
const run_rate_sortedData = monthData.sort((a, b) => parseFloat(b.run_rate) - parseFloat(a.run_rate)); const run_rate_sortedData = monthData.sort((a, b) => parseFloat(b.run_rate) - parseFloat(a.run_rate));
@ -295,7 +293,7 @@ export default {
} else if (run_rate_index === 3) { } else if (run_rate_index === 3) {
run_rate_score= 0; run_rate_score= 0;
} }
arr[23] += run_rate_score; arr[22] += run_rate_score;
const production_hour_itemValue = item.production_hour; // const production_hour_itemValue = item.production_hour; //
const production_hour_sortedData = monthData.sort((a, b) => parseFloat(b.production_hour) - parseFloat(a.production_hour)); const production_hour_sortedData = monthData.sort((a, b) => parseFloat(b.production_hour) - parseFloat(a.production_hour));
@ -310,7 +308,7 @@ export default {
} else if (production_hour_index === 3) { } else if (production_hour_index === 3) {
production_hour_score= 0; production_hour_score= 0;
} }
arr[23] += production_hour_score; arr[22] += production_hour_score;
const production_cost_unit_itemValue = item.production_cost_unit; // const production_cost_unit_itemValue = item.production_cost_unit; //
const production_cost_unit_sortedData = monthData.sort((a, b) => parseFloat(b.production_cost_unit) - parseFloat(a.production_cost_unit)); const production_cost_unit_sortedData = monthData.sort((a, b) => parseFloat(b.production_cost_unit) - parseFloat(a.production_cost_unit));
@ -325,7 +323,7 @@ export default {
} else if (production_cost_unit_index === 3) { } else if (production_cost_unit_index === 3) {
production_cost_unit_score= 0; production_cost_unit_score= 0;
} }
arr[23] += production_cost_unit_score; arr[22] += production_cost_unit_score;
const xidu_itemValue = item.辅料_细度_rate_pass; // const xidu_itemValue = item.辅料_细度_rate_pass; //
const xidu_sortedData = monthData.sort((a, b) => parseFloat(b.xidu) - parseFloat(a.xidu)); const xidu_sortedData = monthData.sort((a, b) => parseFloat(b.xidu) - parseFloat(a.xidu));
@ -340,7 +338,7 @@ export default {
} else if (xidu_index === 3) { } else if (xidu_index === 3) {
xidu_score= 0; xidu_score= 0;
} }
arr[23] += xidu_score; arr[22] += xidu_score;
const Fe203_itemValue = item.辅料_Fe2O3_rate_pass; // Fe203 const Fe203_itemValue = item.辅料_Fe2O3_rate_pass; // Fe203
const Fe203_sortedData = monthData.sort((a, b) => parseFloat(b.Fe203) - parseFloat(a.Fe203)); const Fe203_sortedData = monthData.sort((a, b) => parseFloat(b.Fe203) - parseFloat(a.Fe203));
@ -355,7 +353,7 @@ export default {
} else if (Fe203_index === 3) { } else if (Fe203_index === 3) {
Fe203_score= 0; Fe203_score= 0;
} }
arr[23] += Fe203_score; arr[22] += Fe203_score;
} }
wrapArr.push(arr); wrapArr.push(arr);
}); });

View File

@ -97,18 +97,19 @@ export default {
this.$API.mtm.mgroup.list this.$API.mtm.mgroup.list
.req({ page: 0, search: "电石渣" }) .req({ page: 0, search: "电石渣" })
.then((res) => { .then((res) => {
console.log("电石渣", res);
that.query.mgroup = res[0].id; that.query.mgroup = res[0].id;
let params = {}; let params = {};
params.page = 0; params.page = 0;
params.year = year; params.year = year;
params.mgroup = that.query.mgroup; params.mgroup = that.query.mgroup;
this.$API.mtm.goal.list.req(params).then((res) => { this.$API.mtm.goal.list.req(params).then((res) => {
let data = [];
if (res.length > 0) { if (res.length > 0) {
this.goalDatas = res[0]; res.forEach((item) => {
if (item.goal_cate_name == "单位产品分布电耗KW·h/t") {
that.getData(item);
}
})
} }
that.getData(this.goalDatas);
}); });
}); });
}, },
@ -136,7 +137,6 @@ export default {
}); });
this.$API.enm.enstat.req(that.query).then((res) => { this.$API.enm.enstat.req(that.query).then((res) => {
let data = res; let data = res;
console.log("data", data);
if (data.length > 0) { if (data.length > 0) {
data.forEach((item, index) => { data.forEach((item, index) => {
// //
@ -219,7 +219,6 @@ export default {
} }
wrapArr.push(arr); wrapArr.push(arr);
}); });
// console.log(wrapArr);
that.tableDatas = wrapArr; that.tableDatas = wrapArr;
} else { } else {
} }
@ -237,8 +236,6 @@ export default {
this.chartShow = false; this.chartShow = false;
this.$API.bi.dataset.exec.req("3322567213885833216").then((res) => { this.$API.bi.dataset.exec.req("3322567213885833216").then((res) => {
this.myOption = JSON.parse(res.echart_options); this.myOption = JSON.parse(res.echart_options);
debugger;
console.log(this.myOption);
this.chartShow = true; this.chartShow = true;
}); });
}, },