Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
77224cdbd4
|
@ -57,6 +57,23 @@
|
||||||
placeholder="主要产品"
|
placeholder="主要产品"
|
||||||
clearable
|
clearable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
@clear="() => { form.product=null } "
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in materials"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="成本计算">
|
||||||
|
<el-select
|
||||||
|
v-model="form.product_cost"
|
||||||
|
placeholder="成本计算"
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
@clear="() => { form.product_cost=null } "
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in materials"
|
v-for="item in materials"
|
||||||
|
@ -136,10 +153,9 @@
|
||||||
const defaultForm = {
|
const defaultForm = {
|
||||||
name: "",
|
name: "",
|
||||||
cate: "",
|
cate: "",
|
||||||
product: "",
|
test_materials: [],
|
||||||
belong_dept: "",
|
input_materials: [],
|
||||||
test_materials: "",
|
|
||||||
input_materials: "",
|
|
||||||
};
|
};
|
||||||
export default {
|
export default {
|
||||||
emits: ["success", "closed"],
|
emits: ["success", "closed"],
|
||||||
|
@ -222,6 +238,7 @@ export default {
|
||||||
open(mode = "add") {
|
open(mode = "add") {
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
|
this.form = Object.assign({}, this.defaultForm);
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
//表单注入数据
|
//表单注入数据
|
||||||
|
|
|
@ -225,8 +225,8 @@ export default {
|
||||||
}
|
}
|
||||||
arr[12] = huanqicha; //当期与环期差值(KW·h/t)
|
arr[12] = huanqicha; //当期与环期差值(KW·h/t)
|
||||||
// arr[13] =
|
// arr[13] =
|
||||||
if (arr[11] !=="/" && arr[11]!==0 && arr[12] !==0 && arr[12] !== "undefined"){
|
if (arr[11] !=="/" && arr[11]!=0 && arr[12] !=0 && arr[12] !== "undefined"){
|
||||||
arr[13] = ((arr[11]/arr[12])*100).toFixed(2);
|
arr[13] = ((arr[12]/arr[11])*100).toFixed(2);
|
||||||
}else{
|
}else{
|
||||||
arr[13] = "/"; //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100%
|
arr[13] = "/"; //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100%
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,6 @@ export default {
|
||||||
// arr[15] = 0.0; //得分
|
// arr[15] = 0.0; //得分
|
||||||
arr[15] = 0;
|
arr[15] = 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));
|
||||||
|
@ -332,7 +331,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;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -159,7 +159,8 @@ export default {
|
||||||
bindClass(item, index) {
|
bindClass(item, index) {
|
||||||
let classInfo = { redColor: false, greenColor: false };
|
let classInfo = { redColor: false, greenColor: false };
|
||||||
if (index == 3 || index == 5) {
|
if (index == 3 || index == 5) {
|
||||||
if (typeof item == "number") {
|
if ( item != "/") {
|
||||||
|
item = Number(item);
|
||||||
if (item > 0) {
|
if (item > 0) {
|
||||||
classInfo.greenColor = true;
|
classInfo.greenColor = true;
|
||||||
classInfo.redColor = false;
|
classInfo.redColor = false;
|
||||||
|
@ -290,6 +291,7 @@ export default {
|
||||||
wrapArrs.push(arrs);
|
wrapArrs.push(arrs);
|
||||||
});
|
});
|
||||||
that.tableDatas = wrapArrs;
|
that.tableDatas = wrapArrs;
|
||||||
|
console.log(that.tableDatas);
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -321,7 +321,8 @@ export default {
|
||||||
bindClass(item, index) {
|
bindClass(item, index) {
|
||||||
let classInfo = { redColor: false, greenColor: false };
|
let classInfo = { redColor: false, greenColor: false };
|
||||||
if (index == 3 || index == 5) {
|
if (index == 3 || index == 5) {
|
||||||
if (typeof item == "number") {
|
if ( item != "/") {
|
||||||
|
item = Number(item);
|
||||||
if (item > 0) {
|
if (item > 0) {
|
||||||
classInfo.greenColor = true;
|
classInfo.greenColor = true;
|
||||||
classInfo.redColor = false;
|
classInfo.redColor = false;
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
>
|
>
|
||||||
<thead class="myTableHead">
|
<thead class="myTableHead">
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="18">水泥磨工段班组月度对比分析</th>
|
<th colspan="19">水泥磨工段班组月度对比分析</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="3">质量</th>
|
<th colspan="3">质量</th>
|
||||||
<th colspan="8">单位产品电耗</th>
|
<th colspan="9">单位产品电耗</th>
|
||||||
<th rowspan="2">得分</th>
|
<th rowspan="2">得分</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -60,6 +60,7 @@
|
||||||
<th>循环风机1906(KW·h/t)</th>
|
<th>循环风机1906(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>
|
<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>
|
||||||
|
@ -118,8 +119,26 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getGoalData() {
|
||||||
|
const self = this;
|
||||||
|
let params = {};
|
||||||
|
params.page = 0;
|
||||||
|
params.year = self.query.year_s;
|
||||||
|
params.mgroup = self.query.mgroup;
|
||||||
|
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||||
|
if (res.length > 0) {
|
||||||
|
res.forEach((item) => {
|
||||||
|
if (item.goal_cate_name == "单位产品分布电耗(KW·h/t)") {
|
||||||
|
this.getData(item);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('获取目标数据失败:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
getData(goalData) {
|
getData(goalData) {
|
||||||
console.log("goalData", goalData);
|
|
||||||
let that = this;
|
let that = this;
|
||||||
let query0 = {};
|
let query0 = {};
|
||||||
query0.page = 0;
|
query0.page = 0;
|
||||||
|
@ -202,23 +221,16 @@ export default {
|
||||||
item.系统风机_consume_unit != null
|
item.系统风机_consume_unit != null
|
||||||
? item.系统风机_consume_unit
|
? item.系统风机_consume_unit
|
||||||
: "/";
|
: "/";
|
||||||
// arr[11] =
|
|
||||||
// item.水平涡流选粉机1915_consume_unit != null
|
|
||||||
// ? item.水平涡流选粉机1915_consume_unit
|
|
||||||
// : "/";
|
|
||||||
// arr[12]=item.新增磨尾风机_consume_unit!=null?item.新增磨尾风机_consume_unit:'/';
|
|
||||||
|
|
||||||
// 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)//需要接口获取
|
|
||||||
if (goalData.length > 0){
|
if (goalData.length > 0){
|
||||||
goalData.forEach((item) => {
|
goalData.forEach((item) => {
|
||||||
if (item.goal_cate_name == "单位产品分布电耗(KW·h/t)"){
|
if (item.goal_cate_name == "单位产品分布电耗(KW·h/t)"){
|
||||||
arr[11] = item[keyVale]; //目标值(KW·h/t)//需要接口获取
|
arr[11] = item[keyVale]; //目标值(KW·h/t)//需要接口获取
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
arr[12] = item.celec_consume_unit - arr[11]; //当期与目标差值(KW·h/t)
|
arr[12] = item.elec_consume_unit; //当期值(KW·h/t)
|
||||||
|
arr[13] = (item.elec_consume_unit - arr[11]).toFixed(2); //当期与目标差值(KW·h/t)
|
||||||
let ind_pre = 0,
|
let ind_pre = 0,
|
||||||
huanqi = 0,
|
huanqi = 0,
|
||||||
huanqicha = 0,
|
huanqicha = 0,
|
||||||
|
@ -237,15 +249,15 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
arr[13] = huanqi; //环期值(KW·h/t)上个月的值
|
arr[14] = huanqi; //环期值(KW·h/t)上个月的值
|
||||||
if (huanqi !== "/") {
|
if (huanqi !== "/") {
|
||||||
huanqicha = item.celec_consume_unit - huanqi;
|
huanqicha = (item.elec_consume_unit - huanqi).toFixed(2);
|
||||||
} else {
|
} else {
|
||||||
huanqicha = item.celec_consume_unit;
|
huanqicha = item.elec_consume_unit;
|
||||||
}
|
}
|
||||||
arr[14] = huanqicha; //当期与环期差值(KW·h/t)
|
arr[15] = huanqicha; //当期与环期差值(KW·h/t)
|
||||||
arr[15] =
|
arr[16] =
|
||||||
huanqi != "/" ? (huanqicha / huanqi) * 100 : 0; //环比增长率(%)
|
huanqi != "/" && huanqicha!=0 && huanqi!=0 ? ((huanqicha / huanqi) * 100).toFixed(2) :"/" ; //环比增长率(%)
|
||||||
if (wrapArr0[n]) {
|
if (wrapArr0[n]) {
|
||||||
tongqicha =
|
tongqicha =
|
||||||
item.celec_consume_unit -
|
item.celec_consume_unit -
|
||||||
|
@ -256,9 +268,9 @@ export default {
|
||||||
tongqi = 0;
|
tongqi = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
arr[16] = tongqi; //同比增长率(%):本月-去年本月/去年
|
arr[17] = tongqi; //同比增长率(%):本月-去年本月/去年
|
||||||
// arr[18] = 0.0; //同比增长率(%)
|
// arr[18] = 0.0; //同比增长率(%)
|
||||||
arr[17] = 0;
|
arr[18] = 0;
|
||||||
if (month_obj[n]) {
|
if (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; // 单位产品电耗的值
|
||||||
|
@ -274,7 +286,7 @@ export default {
|
||||||
} else if (index === 3) {
|
} else if (index === 3) {
|
||||||
elec_score= 0;
|
elec_score= 0;
|
||||||
}
|
}
|
||||||
arr[17] += elec_score;
|
arr[18] += 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));
|
||||||
|
@ -289,7 +301,7 @@ export default {
|
||||||
} else if (run_rate_index === 3) {
|
} else if (run_rate_index === 3) {
|
||||||
run_rate_score= 0;
|
run_rate_score= 0;
|
||||||
}
|
}
|
||||||
arr[17] += run_rate_score;
|
arr[18] += 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));
|
||||||
|
@ -304,7 +316,7 @@ export default {
|
||||||
} else if (production_hour_index === 3) {
|
} else if (production_hour_index === 3) {
|
||||||
production_hour_score= 0;
|
production_hour_score= 0;
|
||||||
}
|
}
|
||||||
arr[17] += production_hour_score;
|
arr[18] += 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));
|
||||||
|
@ -319,7 +331,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[17] += production_cost_unit_score;
|
arr[18] += production_cost_unit_score;
|
||||||
|
|
||||||
const surface_area_itemValue = item.出磨水泥_比表面积_rate_pass; // 比表面积的值
|
const surface_area_itemValue = item.出磨水泥_比表面积_rate_pass; // 比表面积的值
|
||||||
const surface_area_sortedData = monthData.sort((a, b) => parseFloat(b.surface_area) - parseFloat(a.surface_area));
|
const surface_area_sortedData = monthData.sort((a, b) => parseFloat(b.surface_area) - parseFloat(a.surface_area));
|
||||||
|
@ -334,7 +346,7 @@ export default {
|
||||||
} else if (surface_area_index === 3) {
|
} else if (surface_area_index === 3) {
|
||||||
surface_area_score= 0;
|
surface_area_score= 0;
|
||||||
}
|
}
|
||||||
arr[17] += surface_area_score;
|
arr[18] += surface_area_score;
|
||||||
|
|
||||||
const SO3_itemValue = item.出磨水泥_SO3_rate_pass; // SO3的值
|
const SO3_itemValue = item.出磨水泥_SO3_rate_pass; // SO3的值
|
||||||
const SO3_sortedData = monthData.sort((a, b) => parseFloat(b.SO3) - parseFloat(a.SO3));
|
const SO3_sortedData = monthData.sort((a, b) => parseFloat(b.SO3) - parseFloat(a.SO3));
|
||||||
|
@ -349,7 +361,7 @@ export default {
|
||||||
} else if (SO3_index === 3) {
|
} else if (SO3_index === 3) {
|
||||||
SO3_score= 0;
|
SO3_score= 0;
|
||||||
}
|
}
|
||||||
arr[17] += SO3_score;
|
arr[18] += SO3_score;
|
||||||
|
|
||||||
const CLitemValue = item.出磨水泥_掺量_rate_pass; // SO3的值
|
const CLitemValue = item.出磨水泥_掺量_rate_pass; // SO3的值
|
||||||
const CL_sortedData = monthData.sort((a, b) => parseFloat(b.chanliang) - parseFloat(a.chanliang));
|
const CL_sortedData = monthData.sort((a, b) => parseFloat(b.chanliang) - parseFloat(a.chanliang));
|
||||||
|
@ -364,7 +376,7 @@ export default {
|
||||||
} else if (CL_index === 3) {
|
} else if (CL_index === 3) {
|
||||||
CL_score= 0;
|
CL_score= 0;
|
||||||
}
|
}
|
||||||
arr[17] += CL_score;
|
arr[18] += CL_score;
|
||||||
}
|
}
|
||||||
wrapArr.push(arr);
|
wrapArr.push(arr);
|
||||||
});
|
});
|
||||||
|
|
|
@ -208,8 +208,9 @@ export default {
|
||||||
// 动态绑定Class
|
// 动态绑定Class
|
||||||
bindClass(item, index) {
|
bindClass(item, index) {
|
||||||
let classInfo = { redColor: false, greenColor: false };
|
let classInfo = { redColor: false, greenColor: false };
|
||||||
if (index == 6) {
|
if (index == 6 || index == 7) {
|
||||||
if (typeof item == "number") {
|
if ( item != "/") {
|
||||||
|
item = Number(item);
|
||||||
if (item > 0) {
|
if (item > 0) {
|
||||||
classInfo.greenColor = true;
|
classInfo.greenColor = true;
|
||||||
classInfo.redColor = false;
|
classInfo.redColor = false;
|
||||||
|
@ -354,8 +355,9 @@ export default {
|
||||||
let lastRate = 0;
|
let lastRate = 0;
|
||||||
if (
|
if (
|
||||||
lastDiff !== "/" &&
|
lastDiff !== "/" &&
|
||||||
|
lastDiff !=0 &&
|
||||||
lastNum !== "/" &&
|
lastNum !== "/" &&
|
||||||
lastNum !== 0
|
lastNum != 0
|
||||||
) {
|
) {
|
||||||
lastRate = ((lastDiff / lastNum) * 100).toFixed(2);
|
lastRate = ((lastDiff / lastNum) * 100).toFixed(2);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -133,7 +133,8 @@ export default {
|
||||||
bindClass(item, index) {
|
bindClass(item, index) {
|
||||||
let classInfo = { redColor: false, greenColor: false };
|
let classInfo = { redColor: false, greenColor: false };
|
||||||
if (index == 3 || index == 5) {
|
if (index == 3 || index == 5) {
|
||||||
if (typeof item == "number") {
|
if ( item != "/") {
|
||||||
|
item = Number(item);
|
||||||
if (item > 0) {
|
if (item > 0) {
|
||||||
classInfo.greenColor = true;
|
classInfo.greenColor = true;
|
||||||
classInfo.redColor = false;
|
classInfo.redColor = false;
|
||||||
|
|
|
@ -105,7 +105,6 @@ export default {
|
||||||
{ id: 1, name: '日统计' },
|
{ id: 1, name: '日统计' },
|
||||||
{ id: 2, name: '月统计' },
|
{ id: 2, name: '月统计' },
|
||||||
],
|
],
|
||||||
tableNmae: '',
|
|
||||||
tableData1: [],
|
tableData1: [],
|
||||||
optionsShift: [],
|
optionsShift: [],
|
||||||
sourceData: {}
|
sourceData: {}
|
||||||
|
@ -133,6 +132,7 @@ export default {
|
||||||
})
|
})
|
||||||
this.mgroupOptions = this.mgroupOptions.reverse();
|
this.mgroupOptions = this.mgroupOptions.reverse();
|
||||||
this.query.mgroup = this.mgroupOptions[0].id;
|
this.query.mgroup = this.mgroupOptions[0].id;
|
||||||
|
this.query.mgroup_name = this.mgroupOptions[0].name;
|
||||||
this.tableName = this.mgroupOptions[0].name;
|
this.tableName = this.mgroupOptions[0].name;
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
})
|
})
|
||||||
|
@ -184,6 +184,7 @@ export default {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
params.page = 0;
|
params.page = 0;
|
||||||
params.mgroup = that.query.mgroup;
|
params.mgroup = that.query.mgroup;
|
||||||
|
params.mgroup_name = that.query.mgroup_name;
|
||||||
if (that.query.type == 0) {//班
|
if (that.query.type == 0) {//班
|
||||||
arr = that.query.day.split('-');
|
arr = that.query.day.split('-');
|
||||||
params.year_s = Number(arr[0]);
|
params.year_s = Number(arr[0]);
|
||||||
|
@ -264,7 +265,12 @@ export default {
|
||||||
dataArr.push(itemData.shift);
|
dataArr.push(itemData.shift);
|
||||||
dataArr.push(itemData.team_name);
|
dataArr.push(itemData.team_name);
|
||||||
}
|
}
|
||||||
dataArr.push(itemData.total_production);
|
if (itemData.mgroup_name === "原料磨"){
|
||||||
|
dataArr.push(itemData.total_production_cost
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
dataArr.push(itemData.total_production);
|
||||||
|
}
|
||||||
// dataArr.push(itemData.coal_consume_unit);
|
// dataArr.push(itemData.coal_consume_unit);
|
||||||
dataArr.push(itemData.production_cost_unit);
|
dataArr.push(itemData.production_cost_unit);
|
||||||
let sub1data = itemData.imaterial_data;
|
let sub1data = itemData.imaterial_data;
|
||||||
|
|
|
@ -112,7 +112,6 @@ 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;
|
||||||
|
@ -130,6 +129,26 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
getGoalData() {
|
||||||
|
const self = this;
|
||||||
|
let params = {};
|
||||||
|
params.page = 0;
|
||||||
|
params.year = self.query.year_s;
|
||||||
|
params.mgroup = self.query.mgroup;
|
||||||
|
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||||
|
if (res.length > 0) {
|
||||||
|
res.forEach((item) => {
|
||||||
|
if (item.goal_cate_name == "单位产品分布电耗(KW·h/t)") {
|
||||||
|
this.getData(item);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('获取目标数据失败:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
getData(goalData) {
|
getData(goalData) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query0 = {};
|
let query0 = {};
|
||||||
|
@ -230,7 +249,7 @@ export default {
|
||||||
arr[15] = 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[16] = goalData[keyVale]?goalData[keyVale]:0; //目标值(KW·h/t)//需要接口获取
|
arr[16] = goalData[keyVale]?goalData[keyVale]:0; //目标值(KW·h/t)//需要接口获取
|
||||||
arr[17] = item.celec_consume_unit - arr[16]; //当期与目标差值(KW·h/t)
|
arr[17] = (arr[15] - arr[16]).toFixed(2); //当期与目标差值(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) {
|
||||||
|
@ -253,9 +272,9 @@ export default {
|
||||||
}else{
|
}else{
|
||||||
arr[19] = "/"; //当期与环期差值(KW·h/t)
|
arr[19] = "/"; //当期与环期差值(KW·h/t)
|
||||||
}
|
}
|
||||||
arr[20] = item.celec_consume_unit; //环比增长率(%)
|
arr[20] = 0; //环比增长率(%)
|
||||||
if (arr[18] !=="/" && arr[19] !==0 && arr[19] !== "undefined"){
|
if (arr[18] !=="/" && arr[19] !==0 && arr[19] !== "undefined" && arr[18] !== 0){
|
||||||
arr[20] = ((arr[18]/arr[19])*100).toFixed(2);
|
arr[20] = ((arr[19]/arr[18])*100).toFixed(2);
|
||||||
}else{
|
}else{
|
||||||
arr[20] = "/"; //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100%
|
arr[20] = "/"; //环比增长率(%)= 当期与环期差值(KW·h/t)/环期值(KW·h/t)*100%
|
||||||
}
|
}
|
||||||
|
@ -263,7 +282,6 @@ export default {
|
||||||
|
|
||||||
arr[22] = 0;
|
arr[22] = 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));
|
||||||
|
@ -364,7 +382,7 @@ export default {
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.tableDatas = [];
|
this.tableDatas = [];
|
||||||
this.getData(this.goalDatas);
|
this.getGoalData();
|
||||||
},
|
},
|
||||||
itemClick(type, item) {
|
itemClick(type, item) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|
|
@ -114,6 +114,25 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getGoalData() {
|
||||||
|
const self = this;
|
||||||
|
let params = {};
|
||||||
|
params.page = 0;
|
||||||
|
params.year = self.query.year_s;
|
||||||
|
params.mgroup = self.query.mgroup;
|
||||||
|
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||||
|
if (res.length > 0) {
|
||||||
|
res.forEach((item) => {
|
||||||
|
if (item.goal_cate_name == "单位产品分布电耗(KW·h/t)") {
|
||||||
|
this.getData(item);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('获取目标数据失败:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
getData(goalData) {
|
getData(goalData) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let query0 = {};
|
let query0 = {};
|
||||||
|
@ -164,7 +183,7 @@ export default {
|
||||||
arr[4] = item.elec_consume_unit; //当期值(KW·h/t)
|
arr[4] = item.elec_consume_unit; //当期值(KW·h/t)
|
||||||
let keyVale = "goal_val_" + n;
|
let keyVale = "goal_val_" + n;
|
||||||
arr[5] = goalData[keyVale]; //目标值(KW·h/t)//需要接口获取
|
arr[5] = goalData[keyVale]; //目标值(KW·h/t)//需要接口获取
|
||||||
arr[6] = arr[4] - item.celec_consume_unit; //当期与目标差值(KW·h/t)
|
arr[6] = arr[4] - arr[5]; //当期与目标差值(KW·h/t)
|
||||||
let ind_pre = 0,
|
let ind_pre = 0,
|
||||||
huanqi = 0,
|
huanqi = 0,
|
||||||
huanqicha = 0,
|
huanqicha = 0,
|
||||||
|
@ -190,7 +209,13 @@ export default {
|
||||||
arr[8] = "/"; //当期与环期差值(KW·h/t)
|
arr[8] = "/"; //当期与环期差值(KW·h/t)
|
||||||
}
|
}
|
||||||
// arr[8] = huanqicha; //当期与环期差值(KW·h/t)
|
// arr[8] = huanqicha; //当期与环期差值(KW·h/t)
|
||||||
arr[9] = arr[8] != "/" ? ((arr[7] / arr[8]) * 100).toFixed(2) : 0; //环比增长率(%)
|
let growthRate = 0;
|
||||||
|
if (arr[8]!== "/" && arr[7]!== 0 && arr[8]!== 0 ) {
|
||||||
|
growthRate = ((arr[8] / arr[7]) * 100).toFixed(2);
|
||||||
|
} else{
|
||||||
|
growthRate = "/";
|
||||||
|
}
|
||||||
|
arr[9] = growthRate; //环比增长率(%)
|
||||||
if (wrapArr0[n]) {
|
if (wrapArr0[n]) {
|
||||||
tongqicha =
|
tongqicha =
|
||||||
item.celec_consume_unit -
|
item.celec_consume_unit -
|
||||||
|
@ -226,7 +251,7 @@ export default {
|
||||||
},
|
},
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.tableDatas = [];
|
this.tableDatas = [];
|
||||||
this.getData(this.goalDatas);
|
this.getGoalData();
|
||||||
},
|
},
|
||||||
itemClick(type, item) {
|
itemClick(type, item) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|
Loading…
Reference in New Issue