fix:石灰石破碎mgroup根据名称获取

This commit is contained in:
shijing 2024-04-29 16:18:45 +08:00
parent 4e8a3d486a
commit 74e65ba199
3 changed files with 168 additions and 215 deletions

View File

@ -246,8 +246,8 @@ export default {
this.apiObj = this.$API.wpm.sflog.list;
this.deptId = res[0].belong_dept;
this.getTeam();
});
this.getShfit();
});
},
methods: {
getTeam() {

View File

@ -306,8 +306,10 @@ export default {
},
data() {
return {
exportLoading: false,
chartShow: false,
myOption: null,
timeStamp: null,
optionHour: {},
optionDay: {},
optionMonth: {},
@ -450,50 +452,6 @@ export default {
},
],
},
list: [
{
x: 1,
y: 1,
z: 99,
k: 11,
},
{
x: 2,
y: 2,
z: 70,
k: 11,
},
{
x: 3,
y: 3,
z: 1,
k: 11,
},
{
x: 4,
y: 4,
z: 30,
k: 11,
},
{
x: 5,
y: 1,
z: 20,
k: 11,
},
{
x: 6,
y: 0,
z: 18,
k: 11,
},
{
x: 7,
y: 10,
z: 12,
k: 11,
},
],
dataX: [],
dataY: [],
dataY2: [],
@ -519,34 +477,6 @@ export default {
}
}
let that = this;
this.$nextTick(() => {
this.dataX = this.list.map((item) => item.x);
// 1Y
this.dataY.push({
name: "AA",
type: "line", // 线
yAxisIndex: 0, // Y
symbolSize: "10",
// lineStyle: { color: '#4485f4' },
data: this.list.map((item) => item.y),
});
// 2Y
this.dataY.push({
name: "BB",
type: "line",
yAxisIndex: 1, // Y
data: this.list.map((item) => item.z),
});
// 3Y
this.dataY.push({
name: "CC",
type: "line",
yAxisIndex: 2, // Y
data: this.list.map((item) => item.k),
});
// this.init(this.dataX, this.dataY);
});
this.$nextTick(() => {
var myDate = new Date();
let year = (that.year = myDate.getFullYear());
@ -574,7 +504,11 @@ export default {
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) => {
console.log("电石渣", res);
that.query.mgroup = res[0].id;
//
let params3 = {};
params3.page = 0;
@ -582,8 +516,8 @@ export default {
params3.month_s = month_d;
params3.day_s = days_d;
params3.type = "day_s";
params3.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params3).then((res3) => {
params3.mgroup = that.query.mgroup;
that.$API.enm.enstat.req(params3).then((res3) => {
if (res3.length > 0) {
let data3 = res3[0];
that.tableDatas[0][3] = data3.total_production;
@ -598,8 +532,8 @@ export default {
params4.day = days_h;
params4.hour = hours_h;
params4.type = "hour_st";
params4.mgroup = this.query.mgroup;
this.$API.enm.enstat.req(params4).then((res4) => {
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;
@ -609,17 +543,14 @@ export default {
//
let params5 = {};
params5.page = 0;
params5.mgroup = "3346520558031773696";
this.$API.mtm.goal.list
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_" + that.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;
@ -643,13 +574,15 @@ export default {
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][5] =
data1.total_production;
that.tableDatas[0][9] = precen(
that.tableDatas[0][5],
that.tableDatas[0][8]
);
that.tableDatas[1][5] = data1.elec_consume_unit;
that.tableDatas[1][5] =
data1.elec_consume_unit;
that.tableDatas[1][9] = precen(
that.tableDatas[1][5],
that.tableDatas[1][8]
@ -667,8 +600,12 @@ export default {
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.tableDatas[0][4] =
data2.total_production;
if (
that.tableDatas[0][4] >
that.tableDatas[0][6]
) {
that.wraning = true;
}
that.tableDatas[0][7] = precen(
@ -676,7 +613,8 @@ export default {
that.tableDatas[0][6]
);
that.tableDatas[1][4] = data2.elec_consume_unit;
that.tableDatas[1][4] =
data2.elec_consume_unit;
that.tableDatas[1][7] = precen(
that.tableDatas[1][4],
that.tableDatas[1][6]
@ -688,13 +626,9 @@ export default {
that.getDayData();
that.getMonthData();
});
});
},
methods: {
// init(dataX, dataY) {
// this.myChart = echarts.init(document.getElementById("main"));
// // 使
// this.myChart.setOption(this.option);
// },
//
getHourData() {
let that = this;

View File

@ -95,8 +95,10 @@ export default {
},
data() {
return {
exportLoading: false,
chartShow: false,
myOption: null,
timeStamp: null,
query: {
mgroup: "3555859873776693248",
},
@ -116,7 +118,36 @@ export default {
var myDate = new Date();
let year = myDate.getFullYear();
that.query.year_s = year;
that.timeStamp = myDate.getTime();
this.$API.mtm.mgroup.list
.req({ page: 0, search: "石灰石破碎" })
.then((res) => {
console.log("石灰石破碎", res);
that.query.mgroup = res[0].id;
//
this.getMonthGoal();
});
},
methods: {
// Class
bindClass(item, index) {
let classInfo = { redColor: false, greenColor: false };
if (index == 3 || index == 5) {
if (typeof item == "number") {
if (item > 0) {
classInfo.greenColor = true;
classInfo.redColor = false;
} else if (item < 0) {
classInfo.redColor = true;
classInfo.greenColor = false;
}
}
}
return classInfo;
},
//
getMonthGoal() {
let that = this;
let paramsGoal = {};
paramsGoal.page = 0;
paramsGoal.mgroup = that.query.mgroup;
@ -124,7 +155,9 @@ export default {
if (ress.length > 0) {
let monthGoal = [];
ress.forEach((goal) => {
if (goal.goal_cate_name == "单位产品分布电耗KW·h/t") {
if (
goal.goal_cate_name == "单位产品分布电耗KW·h/t"
) {
monthGoal[0] = goal.goal_val;
monthGoal[1] = goal.goal_val_2;
monthGoal[2] = goal.goal_val_3;
@ -147,23 +180,6 @@ export default {
}
});
},
methods: {
// Class
bindClass(item, index) {
let classInfo = { redColor: false, greenColor: false };
if (index == 3 || index == 5) {
if (typeof item == "number") {
if (item > 0) {
classInfo.greenColor = true;
classInfo.redColor = false;
} else if (item < 0) {
classInfo.redColor = true;
classInfo.greenColor = false;
}
}
}
return classInfo;
},
getData() {
let that = this;
let query0 = {};
@ -293,6 +309,9 @@ export default {
this.chartShow = true;
});
},
handleQuery() {
this.getMonthGoal();
},
handlePrint() {
this.$PRINT("#myReport");
},