feat: 新增得分功能

This commit is contained in:
zty 2024-09-19 15:43:46 +08:00
parent 659226e6ad
commit 9c3992b448
10 changed files with 526 additions and 29 deletions

View File

@ -3,8 +3,8 @@ NODE_ENV = development
# 标题 # 标题
# VUE_APP_TITLE = '曲阳金隅安全智能管控平台' # VUE_APP_TITLE = '曲阳金隅安全智能管控平台'
VUE_APP_TITLE = '托克逊能源管理平台' # VUE_APP_TITLE = '托克逊能源管理平台'
# VUE_APP_TITLE = '中建材光子科技有限公司' VUE_APP_TITLE = '中建材光子科技有限公司'
# VUE_APP_TITLE = '超低排放系统' # VUE_APP_TITLE = '超低排放系统'
VUE_APP_PJ = '' VUE_APP_PJ = ''
@ -13,21 +13,21 @@ VUE_APP_PJ = ''
#VUE_APP_WS_API = 'ws://localhost:8000' #VUE_APP_WS_API = 'ws://localhost:8000'
# VUE_APP_API_BASEURL = http://222.222.144.147:6013/api # VUE_APP_API_BASEURL = http://222.222.144.147:6013/api
#VUE_APP_API_BASEURL = http://10.99.5.79:20309/api #VUE_APP_API_BASEURL = http://10.99.5.79:20309/api
# VUE_APP_API_BASEURL = http://127.0.0.1:2226/api # VUE_APP_API_BASEURL = http://127.0.0.1:8887/api
#测试环境 #测试环境
# VUE_APP_API_BASEURL = http://10.50.211.228:2250/api VUE_APP_API_BASEURL = http://10.50.211.228:2250/api
#VUE_APP_API_BASEURL = http://127.0.0.1:2226/api #VUE_APP_API_BASEURL = http://127.0.0.1:2226/api
VUE_APP_BASEURL = http://10.50.211.228:2250/ VUE_APP_BASEURL = http://10.50.211.228:2250/
# VUE_APP_BASEURL = http://10.50.211.228:2250 # VUE_APP_BASEURL = http://127.0.0.1:8887
#VUE_APP_BASEURL = http://127.0.0.1:2226 #VUE_APP_BASEURL = http://127.0.0.1:2226
# #光子 # #光子
VUE_APP_API_BASEURL = http://49.232.14.174:2226/api # VUE_APP_API_BASEURL = http://49.232.14.174:2226/api
VUE_APP_BASEURL = http://49.232.14.174:2226 # VUE_APP_BASEURL = http://49.232.14.174:2226
#
# 本地端口 # 本地端口
VUE_APP_PORT = 2800 VUE_APP_PORT = 2800

View File

@ -128,6 +128,7 @@ export default {
let wrapArr = [], let wrapArr = [],
wrapArr0 = [], wrapArr0 = [],
compareArr0 = [], compareArr0 = [],
month_obj = {},
wrapArrs = []; wrapArrs = [];
this.$API.enm.enstat.req(query0).then((res0) => { this.$API.enm.enstat.req(query0).then((res0) => {
let data0 = res0; let data0 = res0;
@ -149,6 +150,20 @@ export default {
compareArr.push(item.team_name); compareArr.push(item.team_name);
compareArr.push(item.elec_consume_unit); compareArr.push(item.elec_consume_unit);
compareArr0.push(compareArr); compareArr0.push(compareArr);
if (!month_obj[item.month_s]) {
month_obj[item.month_s] = [];
}
month_obj[item.month_s].push(
{
team:item.team_name,
production_hour: item.production_hour,
run_rate:item.run_rate,
xidu:item.出磨煤粉_细度_rate_pass,
coal_powder:item.出磨煤粉_水分_rate_pass,
elec:item.elec_consume_unit,
}
);
}); });
data.forEach((item) => { data.forEach((item) => {
// //
@ -205,13 +220,92 @@ 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[11] !==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[11]/arr[12])*100).toFixed(2);
}else{ }else{
arr[13] = "/"; //%= KW·h/t/KW·h/t*100% arr[13] = "/"; //%= KW·h/t/KW·h/t*100%
} }
arr[14] = tongqi; //% arr[14] = tongqi; //%
arr[15] = 0.0; // // arr[15] = 0.0; //
arr[15] = 0;
if (month_obj[n]) {
console.log("month_obj[n]",month_obj[n])
const monthData = month_obj[n];
const itemValue = item.elec_consume_unit; //
const sortedData = monthData.sort((a, b) => parseFloat(b.elec) - parseFloat(a.elec));
const index = sortedData.findIndex(obj => parseFloat(obj.elec) === parseFloat(itemValue));
let elec_score = 0;
if (index === 0){
elec_score= 20;
} else if (index === 1) {
elec_score= 15;
} else if (index === 2) {
elec_score= 5;
} else if (index === 3) {
elec_score= 0;
}
arr[15] += elec_score;
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_index = run_rate_sortedData.findIndex(obj => parseFloat(obj.run_rate) === parseFloat(run_rate_itemValue));
let run_rate_score = 0;
if (run_rate_index === 0){
run_rate_score= 20;
} else if (run_rate_index === 1) {
run_rate_score= 15;
} else if (run_rate_index === 2) {
run_rate_score= 5;
} else if (run_rate_index === 3) {
run_rate_score= 0;
}
arr[15] += run_rate_score;
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_index = production_hour_sortedData.findIndex(obj => parseFloat(obj.production_hour) === parseFloat(production_hour_itemValue));
let production_hour_score = 0;
if (production_hour_index === 0){
production_hour_score= 20;
} else if (production_hour_index === 1) {
production_hour_score= 15;
} else if (production_hour_index === 2) {
production_hour_score= 5;
} else if (production_hour_index === 3) {
production_hour_score= 0;
}
arr[15] += production_hour_score;
const xidu_itemValue = item.出磨煤粉_细度_rate_pass; //
const xidu_sortedData = monthData.sort((a, b) => parseFloat(b.xidu) - parseFloat(a.xidu));
const xidu_index = xidu_sortedData.findIndex(obj => parseFloat(obj.xidu) === parseFloat(xidu_itemValue));
let xidu_score = 0;
if (xidu_index === 0){
xidu_score= 20;
} else if (xidu_index === 1) {
xidu_score= 15;
} else if (xidu_index === 2) {
xidu_score= 5;
} else if (xidu_index === 3) {
xidu_score= 0;
}
arr[15] += xidu_score;
const coal_powder_itemValue = item.出磨煤粉_水分_rate_pass; //
const coal_powder_sortedData = monthData.sort((a, b) => parseFloat(b.coal_powder) - parseFloat(a.coal_powder));
const coal_powder_index = coal_powder_sortedData.findIndex(obj => parseFloat(obj.coal_powder) === parseFloat(coal_powder_itemValue));
let coal_powder_score = 0;
if (coal_powder_index === 0){
coal_powder_score= 20;
} else if (coal_powder_index === 1) {
coal_powder_score= 15;
} else if (coal_powder_index === 2) {
coal_powder_score= 5;
} else if (coal_powder_index === 3) {
coal_powder_score= 0;
}
arr[15] += coal_powder_score;
}
wrapArr.push(arr); wrapArr.push(arr);
}); });
that.tableDatas = wrapArr; that.tableDatas = wrapArr;

View File

@ -154,6 +154,7 @@ export default {
wrapArr0 = [], wrapArr0 = [],
wrapArrs = [], wrapArrs = [],
comparEarr = [], // comparEarr = [], //
month_obj = {},
compareArr0 = []; compareArr0 = [];
this.$API.enm.enstat.req(query0).then((res0) => { this.$API.enm.enstat.req(query0).then((res0) => {
let data0 = res0; let data0 = res0;
@ -189,6 +190,20 @@ export default {
elecArr.push(item.elec_consume_unit); elecArr.push(item.elec_consume_unit);
compareArr0.push(compareArr); compareArr0.push(compareArr);
comparEarr.push(elecArr); comparEarr.push(elecArr);
if (!month_obj[item.month_s]) {
month_obj[item.month_s] = [];
};
month_obj[item.month_s].push(
{
team:item.team_name,
production_hour: item.production_hour,
run_rate:item.run_rate,
production_cost_unit:item.production_cost_unit,
CaO:item.出窑熟料_fCaO_rate_pass,
coal_consume_unit:item.coal_consume_unit,
elec:item.elec_consume_unit,
}
);
}); });
data.forEach((item) => { data.forEach((item) => {
// //
@ -339,6 +354,100 @@ export default {
}else{ }else{
arr[29] = 0}; //% arr[29] = 0}; //%
arr[30] = item.celec_consume_unit; //% arr[30] = item.celec_consume_unit; //%
arr[31] = 0;
if (month_obj[n]) {
console.log("month_obj[n]",month_obj[n])
const monthData = month_obj[n];
const itemValue = item.elec_consume_unit; //
const sortedData = monthData.sort((a, b) => parseFloat(b.elec) - parseFloat(a.elec));
const index = sortedData.findIndex(obj => parseFloat(obj.elec) === parseFloat(itemValue));
let elec_score = 0;
if (index === 0){
elec_score= 20;
} else if (index === 1) {
elec_score= 15;
} else if (index === 2) {
elec_score= 5;
} else if (index === 3) {
elec_score= 0;
}
arr[31] += elec_score;
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_index = run_rate_sortedData.findIndex(obj => parseFloat(obj.run_rate) === parseFloat(run_rate_itemValue));
let run_rate_score = 0;
if (run_rate_index === 0){
run_rate_score= 10;
} else if (run_rate_index === 1) {
run_rate_score= 7;
} else if (run_rate_index === 2) {
run_rate_score= 3;
} else if (run_rate_index === 3) {
run_rate_score= 0;
}
arr[31] += run_rate_score;
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_index = production_hour_sortedData.findIndex(obj => parseFloat(obj.production_hour) === parseFloat(production_hour_itemValue));
let production_hour_score = 0;
if (production_hour_index === 0){
production_hour_score= 20;
} else if (production_hour_index === 1) {
production_hour_score= 15;
} else if (production_hour_index === 2) {
production_hour_score= 5;
} else if (production_hour_index === 3) {
production_hour_score= 0;
}
arr[31] += production_hour_score;
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_index = production_cost_unit_sortedData.findIndex(obj => parseFloat(obj.production_cost_unit) === parseFloat(production_cost_unit_itemValue));
let production_cost_unit_score = 0;
if (production_cost_unit_index === 0){
production_cost_unit_score= 10;
} else if (production_cost_unit_index === 1) {
production_cost_unit_score= 7;
} else if (production_cost_unit_index === 2) {
production_cost_unit_score= 3;
} else if (production_cost_unit_index === 3) {
production_cost_unit_score= 0;
}
arr[31] += production_cost_unit_score;
const CaO_itemValue = item.出窑熟料_fCaO_rate_pass; // CaO
const CaO_sortedData = monthData.sort((a, b) => parseFloat(b.CaO) - parseFloat(a.CaO));
const CaO_index = CaO_sortedData.findIndex(obj => parseFloat(obj.CaO) === parseFloat(CaO_itemValue));
let CaO_score = 0;
if (CaO_index === 0){
CaO_score= 20;
} else if (CaO_index === 1) {
CaO_score= 15;
} else if (CaO_index === 2) {
CaO_score= 5;
} else if (CaO_index === 3) {
CaO_score= 0;
}
arr[31] += CaO_score;
const coal_itemValue = item.coal_consume_unit; //
const coal_sortedData = monthData.sort((a, b) => parseFloat(b.coal_consume_unit) - parseFloat(a.coal_consume_unit));
const coal_index = coal_sortedData.findIndex(obj => parseFloat(obj.coal_consume_unit) === parseFloat(coal_itemValue));
let coal_score = 0;
if (coal_index === 0){
coal_score= 20;
} else if (coal_index === 1) {
coal_score= 15;
} else if (coal_index === 2) {
coal_score= 5;
} else if (coal_index === 3) {
coal_score= 0;
}
arr[31] += coal_score;
}
wrapArr.push(arr); wrapArr.push(arr);
}); });
that.tableDatas = wrapArr; that.tableDatas = wrapArr;

View File

@ -144,6 +144,7 @@ export default {
let wrapArr = [], let wrapArr = [],
wrapArr0 = [], wrapArr0 = [],
compareArr0 = [], compareArr0 = [],
month_obj = {},
wrapArrs = []; wrapArrs = [];
this.$API.enm.enstat.req(query0).then((res0) => { this.$API.enm.enstat.req(query0).then((res0) => {
let data0 = []; // let data0 = []; //
@ -167,6 +168,21 @@ export default {
compareArr.push(item.team_name); compareArr.push(item.team_name);
compareArr.push(item.elec_consume_unit); compareArr.push(item.elec_consume_unit);
compareArr0.push(compareArr); compareArr0.push(compareArr);
if (!month_obj[item.month_s]) {
month_obj[item.month_s] = [];
};
month_obj[item.month_s].push(
{
team:item.team_name,
production_hour: item.production_hour,
run_rate:item.run_rate,
production_cost_unit:item.production_cost_unit,
surface_area :item.出磨水泥_比表面积_rate_pass,
SO3:item.出磨水泥_SO3_rate_pass,
chanliang:item.出磨水泥_掺量_rate_pass,
elec:item.elec_consume_unit,
}
);
}); });
data.forEach((item) => { data.forEach((item) => {
// //
@ -250,7 +266,116 @@ export default {
} }
arr[17] = tongqi; //%:-/ arr[17] = tongqi; //%:-/
arr[18] = 0.0; //% // arr[18] = 0.0; //%
arr[18] = 0;
if (month_obj[n]) {
console.log("month_obj[n]",month_obj[n])
const monthData = month_obj[n];
const itemValue = item.elec_consume_unit; //
const sortedData = monthData.sort((a, b) => parseFloat(b.elec) - parseFloat(a.elec));
const index = sortedData.findIndex(obj => parseFloat(obj.elec) === parseFloat(itemValue));
let elec_score = 0;
if (index === 0){
elec_score= 10;
} else if (index === 1) {
elec_score= 7;
} else if (index === 2) {
elec_score= 3;
} else if (index === 3) {
elec_score= 0;
}
arr[18] += elec_score;
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_index = run_rate_sortedData.findIndex(obj => parseFloat(obj.run_rate) === parseFloat(run_rate_itemValue));
let run_rate_score = 0;
if (run_rate_index === 0){
run_rate_score= 10;
} else if (run_rate_index === 1) {
run_rate_score= 7;
} else if (run_rate_index === 2) {
run_rate_score= 3;
} else if (run_rate_index === 3) {
run_rate_score= 0;
}
arr[18] += run_rate_score;
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_index = production_hour_sortedData.findIndex(obj => parseFloat(obj.production_hour) === parseFloat(production_hour_itemValue));
let production_hour_score = 0;
if (production_hour_index === 0){
production_hour_score= 20;
} else if (production_hour_index === 1) {
production_hour_score= 15;
} else if (production_hour_index === 2) {
production_hour_score= 5;
} else if (production_hour_index === 3) {
production_hour_score= 0;
}
arr[18] += production_hour_score;
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_index = production_cost_unit_sortedData.findIndex(obj => parseFloat(obj.production_cost_unit) === parseFloat(production_cost_unit_itemValue));
let production_cost_unit_score = 0;
if (production_cost_unit_index === 0){
production_cost_unit_score= 10;
} else if (production_cost_unit_index === 1) {
production_cost_unit_score= 7;
} else if (production_cost_unit_index === 2) {
production_cost_unit_score= 3;
} else if (production_cost_unit_index === 3) {
production_cost_unit_score= 0;
}
arr[18] += production_cost_unit_score;
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_index = surface_area_sortedData.findIndex(obj => parseFloat(obj.surface_area) === parseFloat(surface_area_itemValue));
let surface_area_score = 0;
if (surface_area_index === 0){
surface_area_score= 20;
} else if (surface_area_index === 1) {
surface_area_score= 15;
} else if (surface_area_index === 2) {
surface_area_score= 5;
} else if (surface_area_index === 3) {
surface_area_score= 0;
}
arr[18] += surface_area_score;
const SO3_itemValue = item.出磨水泥_SO3_rate_pass; // SO3
const SO3_sortedData = monthData.sort((a, b) => parseFloat(b.SO3) - parseFloat(a.SO3));
const SO3_index = SO3_sortedData.findIndex(obj => parseFloat(obj.SO3) === parseFloat(SO3_itemValue));
let SO3_score = 0;
if (SO3_index === 0){
SO3_score= 20;
} else if (SO3_index === 1) {
SO3_score= 15;
} else if (SO3_index === 2) {
SO3_score= 5;
} else if (SO3_index === 3) {
SO3_score= 0;
}
arr[18] += SO3_score;
const CLitemValue = item.出磨水泥_掺量_rate_pass; // SO3
const CL_sortedData = monthData.sort((a, b) => parseFloat(b.chanliang) - parseFloat(a.chanliang));
const CL_index = CL_sortedData.findIndex(obj => parseFloat(obj.chanliang) === parseFloat(CLitemValue));
let CL_score = 0;
if (CL_index === 0){
CL_score= 10;
} else if (CL_index === 1) {
CL_score= 7;
} else if (SO3_inCL_indexdex === 2) {
CL_score= 3;
} else if (CL_index === 3) {
CL_score= 0;
}
arr[18] += CL_score;
}
wrapArr.push(arr); wrapArr.push(arr);
}); });
let newArr = []; let newArr = [];

View File

@ -167,13 +167,27 @@ export default {
// //
getMgroup() { getMgroup() {
this.$API.mtm.mgroup.list.req({ page: 0, cate:"section"}).then((res) => { this.$API.mtm.mgroup.list.req({ page: 0, cate:"section"}).then((res) => {
this.options = res; //res.name=options
res.forEach(element => {
// console.log(element.name);
if(['煤磨','原料磨','水泥包装'].includes(element.name)){
return;
}
this.options.push(element);
});
console.log(this.options);
}); });
}, },
// //
getFee() { getFee() {
this.$API.fim.fee.req({ page: 0 }).then((res) => { this.$API.fim.fee.req({ page: 0 }).then((res) => {
this.feeOptions = res; res.forEach(element => {
// console.log(element.name);
if(['煤磨','原料磨','水泥包装'].includes(element.name)){
return;
}
this.feeOptions.push(element);
});
}); });
}, },
// //

View File

@ -175,6 +175,7 @@
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="年份" prop="year"> <el-form-item label="年份" prop="year">
<el-date-picker <el-date-picker
:disabled="type === 'edit'"
v-model="form.year" v-model="form.year"
type="year" type="year"
format="YYYY" format="YYYY"
@ -187,6 +188,7 @@
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="关联工段" prop="mgroup"> <el-form-item label="关联工段" prop="mgroup">
<el-select <el-select
:disabled="type == 'edit'"
v-model="form.mgroup" v-model="form.mgroup"
placeholder="关联工段" placeholder="关联工段"
clearable clearable

View File

@ -128,6 +128,7 @@ export default {
query0.year_s = that.query.year_s - 1; query0.year_s = that.query.year_s - 1;
let wrapArr = [], let wrapArr = [],
wrapArr0 = [], wrapArr0 = [],
month_obj = {},
compareArr0 = []; compareArr0 = [];
this.$API.enm.enstat.req(query0).then((res0) => { this.$API.enm.enstat.req(query0).then((res0) => {
let data0 = res0; let data0 = res0;
@ -151,6 +152,10 @@ export default {
compareArr.push(item.team_name); compareArr.push(item.team_name);
compareArr.push(item.elec_consume_unit); compareArr.push(item.elec_consume_unit);
compareArr0.push(compareArr); compareArr0.push(compareArr);
if (!month_obj[item.month_s]) {
month_obj[item.month_s] = [];
}
month_obj[item.month_s].push({team:item.team_name, value: item.elec_consume_unit});
}); });
data.forEach((item) => { data.forEach((item) => {
@ -211,6 +216,21 @@ export default {
} }
arr[9] = sameRate; ///%/ wrapArr0[ind].elec_consume_unit arr[9] = sameRate; ///%/ wrapArr0[ind].elec_consume_unit
// arr[10] = item.celec_consume_unit; //%-wrapArr0[ind].elec_consume_unit // arr[10] = item.celec_consume_unit; //%-wrapArr0[ind].elec_consume_unit
if (month_obj[n]) {
const monthData = month_obj[n];
const itemValue = item.elec_consume_unit; //
const sortedData = monthData.sort((a, b) => parseFloat(b.value) - parseFloat(a.value));
const index = sortedData.findIndex(obj => parseFloat(obj.value) === parseFloat(itemValue));
if (index === 0){
arr[10] = 100;
} else if (index === 1) {
arr[10] = 80;
} else if (index === 2) {
arr[10] = 70;
} else if (index === 3) {
arr[10] = 0;
}
}
wrapArr.push(arr); wrapArr.push(arr);
// console.log(wrapArr); // console.log(wrapArr);
}); });

View File

@ -616,6 +616,7 @@ export default {
return { return {
deptId: "", deptId: "",
mgroupId: "", mgroupId: "",
sflogId: "",
hideAdd: true, hideAdd: true,
visible: false, visible: false,
hideDelete: true, hideDelete: true,
@ -661,7 +662,7 @@ export default {
mpoint__type: 30, mpoint__type: 30,
has_create_by: 1, has_create_by: 1,
}, },
querystlog: { mgroup: "" }, querystlog: { mgroup: "", sflogs: ""},
stlogVisiable: false, stlogVisiable: false,
cateOptions: ["工艺", "机械", "电气", "其他"], cateOptions: ["工艺", "机械", "电气", "其他"],
checkList: [], checkList: [],
@ -679,12 +680,16 @@ export default {
mounted() { mounted() {
this.deptId = this.$route.query.deptId; this.deptId = this.$route.query.deptId;
this.mgroupId = this.$route.query.mgroupId; this.mgroupId = this.$route.query.mgroupId;
this.sflogId = this.$route.query.sflogId;
this.querymplogX.mgroup = this.mgroupId; this.querymplogX.mgroup = this.mgroupId;
this.querystlog.mgroup = this.mgroupId;
this.apiObj = this.$API.enm.mpoint.stat; this.apiObj = this.$API.enm.mpoint.stat;
this.apiObjStlog = this.$API.wpm.stlog.list;
let form = this.$TOOL.data.get("sflogItem"); let form = this.$TOOL.data.get("sflogItem");
this.form = JSON.parse(form); this.form = JSON.parse(form);
this.querystlog.mgroup = this.mgroupId;
this.querystlog.sflogs = this.form.id;
this.apiObjStlog = this.$API.wpm.stlog.list;
this.getMpoint(); this.getMpoint();
this.getTeam(); this.getTeam();
let height = document.getElementById("elMain").clientHeight; let height = document.getElementById("elMain").clientHeight;

View File

@ -138,6 +138,7 @@ export default {
let wrapArr = [], let wrapArr = [],
wrapArr0 = [], wrapArr0 = [],
wrapArrs = [], wrapArrs = [],
month_obj = {},
compareArr0 = []; compareArr0 = [];
this.$API.enm.enstat.req(query0).then((res0) => { this.$API.enm.enstat.req(query0).then((res0) => {
let data0 = res0; let data0 = res0;
@ -147,7 +148,7 @@ export default {
wrapArr0[ind0] = item0; wrapArr0[ind0] = item0;
}); });
} else { } else {
} }});
this.$API.enm.enstat.req(that.query).then((res) => { this.$API.enm.enstat.req(that.query).then((res) => {
let data = res; let data = res;
if (data.length > 0) { if (data.length > 0) {
@ -158,6 +159,20 @@ export default {
compareArr.push(item.team_name); compareArr.push(item.team_name);
compareArr.push(item.elec_consume_unit); compareArr.push(item.elec_consume_unit);
compareArr0.push(compareArr); compareArr0.push(compareArr);
if (!month_obj[item.month_s]) {
month_obj[item.month_s] = [];
}
month_obj[item.month_s].push(
{
team:item.team_name,
production_hour: item.production_hour,
run_rate:item.run_rate,
production_cost_unit:item.production_cost_unit,
xidu:item.辅料_细度_rate_pass,
Fe203:item.辅料_Fe2O3_rate_pass,
elec:item.elec_consume_unit,
}
);
}); });
data.forEach((item) => { data.forEach((item) => {
// //
@ -247,14 +262,107 @@ export default {
arr[21] = "/"; //%= KW·h/t/KW·h/t*100% arr[21] = "/"; //%= KW·h/t/KW·h/t*100%
} }
arr[22] = item.celec_consume_unit; //% arr[22] = item.celec_consume_unit; //%
arr[23] = item.celec_consume_unit; //%
arr[23] = 0;
if (month_obj[n]) {
console.log("month_obj[n]",month_obj[n])
const monthData = month_obj[n];
const itemValue = item.elec_consume_unit; //
const sortedData = monthData.sort((a, b) => parseFloat(b.elec) - parseFloat(a.elec));
const index = sortedData.findIndex(obj => parseFloat(obj.elec) === parseFloat(itemValue));
let elec_score = 0;
if (index === 0){
elec_score= 20;
} else if (index === 1) {
elec_score= 15;
} else if (index === 2) {
elec_score= 5;
} else if (index === 3) {
elec_score= 0;
}
arr[23] += elec_score;
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_index = run_rate_sortedData.findIndex(obj => parseFloat(obj.run_rate) === parseFloat(run_rate_itemValue));
let run_rate_score = 0;
if (run_rate_index === 0){
run_rate_score= 10;
} else if (run_rate_index === 1) {
run_rate_score= 7;
} else if (run_rate_index === 2) {
run_rate_score= 3;
} else if (run_rate_index === 3) {
run_rate_score= 0;
}
arr[23] += run_rate_score;
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_index = production_hour_sortedData.findIndex(obj => parseFloat(obj.production_hour) === parseFloat(production_hour_itemValue));
let production_hour_score = 0;
if (production_hour_index === 0){
production_hour_score= 20;
} else if (production_hour_index === 1) {
production_hour_score= 15;
} else if (production_hour_index === 2) {
production_hour_score= 5;
} else if (production_hour_index === 3) {
production_hour_score= 0;
}
arr[23] += production_hour_score;
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_index = production_cost_unit_sortedData.findIndex(obj => parseFloat(obj.production_cost_unit) === parseFloat(production_cost_unit_itemValue));
let production_cost_unit_score = 0;
if (production_cost_unit_index === 0){
production_cost_unit_score= 10;
} else if (production_cost_unit_index === 1) {
production_cost_unit_score= 7;
} else if (production_cost_unit_index === 2) {
production_cost_unit_score= 3;
} else if (production_cost_unit_index === 3) {
production_cost_unit_score= 0;
}
arr[23] += production_cost_unit_score;
const xidu_itemValue = item.辅料_细度_rate_pass; //
const xidu_sortedData = monthData.sort((a, b) => parseFloat(b.xidu) - parseFloat(a.xidu));
const xidu_index = xidu_sortedData.findIndex(obj => parseFloat(obj.xidu) === parseFloat(xidu_itemValue));
let xidu_score = 0;
if (xidu_index === 0){
xidu_score= 20;
} else if (xidu_index === 1) {
xidu_score= 15;
} else if (xidu_index === 2) {
xidu_score= 5;
} else if (xidu_index === 3) {
xidu_score= 0;
}
arr[23] += xidu_score;
const Fe203_itemValue = item.辅料_Fe2O3_rate_pass; // Fe203
const Fe203_sortedData = monthData.sort((a, b) => parseFloat(b.Fe203) - parseFloat(a.Fe203));
const Fe203_index = Fe203_sortedData.findIndex(obj => parseFloat(obj.Fe203) === parseFloat(Fe203_itemValue));
let Fe203_score = 0;
if (Fe203_index === 0){
Fe203_score= 20;
} else if (Fe203_index === 1) {
Fe203_score= 15;
} else if (Fe203_index === 2) {
Fe203_score= 5;
} else if (Fe203_index === 3) {
Fe203_score= 0;
}
arr[23] += Fe203_score;
}
wrapArr.push(arr); wrapArr.push(arr);
}); });
that.tableDatas = wrapArr; that.tableDatas = wrapArr;
} else { } else {
} }
}); });
});
}, },
handleQuery() { handleQuery() {
this.tableDatas = []; this.tableDatas = [];

View File

@ -122,8 +122,8 @@ export default {
query0.mgroup = that.query.mgroup; query0.mgroup = that.query.mgroup;
let wrapArr = [], let wrapArr = [],
wrapArr0 = [], wrapArr0 = [],
compareArr0 = [], month_obj = {},
wrapArrs = []; compareArr0 = [];
this.$API.enm.enstat.req(query0).then((res0) => { this.$API.enm.enstat.req(query0).then((res0) => {
let data0 = res0; let data0 = res0;
if (data0.length > 0) { if (data0.length > 0) {
@ -132,17 +132,24 @@ export default {
wrapArr0[ind0] = item0; wrapArr0[ind0] = item0;
}); });
} else { } else {
} }
});
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) => { data.forEach((item, index) => {
// //
let compareArr = []; let compareArr = [];
compareArr.push(item.month_s); compareArr.push(item.month_s);
compareArr.push(item.team_name); compareArr.push(item.team_name);
compareArr.push(item.elec_consume_unit); compareArr.push(item.elec_consume_unit);
compareArr0.push(compareArr); compareArr0[index]=compareArr;
if (!month_obj[item.month_s]) {
month_obj[item.month_s] = [];
}
month_obj[item.month_s].push({team:item.team_name, value: item.elec_consume_unit});
// month_list.push(month_obj)
}); });
data.forEach((item) => { data.forEach((item) => {
// //
@ -194,16 +201,29 @@ export default {
tongqi = 0; tongqi = 0;
} }
arr[10] = tongqi; //% arr[10] = tongqi; //%
arr[11] = 0; // //n = month_listkeyvalue, index==0arr[11] = 100 index==1arr[11] = 80 index==2arr[11] = 70 index==3arr[11] = 0
if (month_obj[n]) {
const monthData = month_obj[n];
const itemValue = item.elec_consume_unit; //
const sortedData = monthData.sort((a, b) => parseFloat(b.value) - parseFloat(a.value));
const index = sortedData.findIndex(obj => parseFloat(obj.value) === parseFloat(itemValue));
if (index === 0){
arr[11] = 100;
} else if (index === 1) {
arr[11] = 80;
} else if (index === 2) {
arr[11] = 70;
} else if (index === 3) {
arr[11] = 0;
}
}
wrapArr.push(arr); wrapArr.push(arr);
}); });
console.log(wrapArr); // console.log(wrapArr);
that.tableDatas = wrapArr; that.tableDatas = wrapArr;
} else { } else {
} }
}); });
});
}, },
handleQuery() { handleQuery() {
this.tableDatas = []; this.tableDatas = [];