Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
2c58eec472
|
@ -77,6 +77,7 @@
|
|||
>
|
||||
{{ item1 }}
|
||||
</div>
|
||||
<div style="display: none;" v-if="ind == 8">{{ item1 }}</div>
|
||||
<el-popover
|
||||
trigger="hover"
|
||||
placement="top"
|
||||
|
|
|
@ -89,6 +89,7 @@
|
|||
>
|
||||
{{ item1 }}
|
||||
</div>
|
||||
<div style="display: none;" v-if="ind == 8">{{ item1 }}</div>
|
||||
<el-popover
|
||||
trigger="hover"
|
||||
placement="top"
|
||||
|
|
|
@ -88,6 +88,7 @@
|
|||
>
|
||||
{{ item1 }}
|
||||
</div>
|
||||
<div style="display: none;" v-if="ind == 9">{{ item1 }}</div>
|
||||
<el-popover
|
||||
trigger="hover"
|
||||
placement="top"
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
>
|
||||
{{ item1 }}
|
||||
</div>
|
||||
<div style="display: none;" v-if="ind == 8">{{ item1 }}</div>
|
||||
<el-popover
|
||||
trigger="hover"
|
||||
placement="top"
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="6">
|
||||
生料工序主要设备(100KW以上)单位产品电耗数据表
|
||||
生料辅料工序主要设备(100KW以上)单位产品电耗数据表
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -235,7 +235,7 @@ export default {
|
|||
mgroup: "",
|
||||
},
|
||||
mpoint: "",
|
||||
tableName: "主要设备(100KW以上)单位产品电耗数据表",
|
||||
tableName: "生料辅料工序主要设备(100KW以上)单位产品电耗数据表",
|
||||
tableDatas: [
|
||||
["立磨主电机", "", "kW·h/t", "", "", ""],
|
||||
["循环风机", "", "kW·h/t", "", "", ""],
|
||||
|
|
|
@ -38,14 +38,13 @@
|
|||
>
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="23">生料工序班组月度对比分析</th>
|
||||
<th colspan="22">生料工序班组月度对比分析</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">月份</th>
|
||||
<th rowspan="2">班组</th>
|
||||
<th colspan="2">产量</th>
|
||||
<th>运转率</th>
|
||||
<th>成本</th>
|
||||
<th colspan="7">质量</th>
|
||||
<th colspan="9">单位产品电耗</th>
|
||||
<th rowspan="2">得分</th>
|
||||
|
@ -54,7 +53,6 @@
|
|||
<th>总产量(t)</th>
|
||||
<th>台时产量(t/h)</th>
|
||||
<th>运转率(%)</th>
|
||||
<th>单位产品成本(元/吨)</th>
|
||||
<th>细度(%)</th>
|
||||
<th>Fe₂O₃(%)</th>
|
||||
<th>水分(%)</th>
|
||||
|
@ -207,50 +205,50 @@ export default {
|
|||
arr.push(item.total_production);
|
||||
arr.push(item.production_hour);
|
||||
arr.push(item.run_rate);
|
||||
arr.push(item.production_cost_unit);
|
||||
// arr.push(item.production_cost_unit);
|
||||
//质量
|
||||
arr[6] =
|
||||
arr[5] =
|
||||
item.辅料_细度_rate_pass != null
|
||||
? item.辅料_细度_rate_pass
|
||||
: "/";
|
||||
arr[7] =
|
||||
arr[6] =
|
||||
item.辅料_Fe2O3_rate_pass != null
|
||||
? item.辅料_Fe2O3_rate_pass
|
||||
: "/";
|
||||
arr[8] =
|
||||
arr[7] =
|
||||
item.辅料_水分_rate_pass != null
|
||||
? item.辅料_水分_rate_pass
|
||||
: "/";
|
||||
arr[9] =
|
||||
arr[8] =
|
||||
item.干混生料_细度_rate_pass != null
|
||||
? item.干混生料_细度_rate_pass
|
||||
: "/";
|
||||
arr[10] =
|
||||
arr[9] =
|
||||
item.干混生料_Fe2O3_rate_pass != null
|
||||
? item.干混生料_Fe2O3_rate_pass
|
||||
: "/";
|
||||
arr[11] =
|
||||
arr[10] =
|
||||
item.干混生料_水分_rate_pass != null
|
||||
? item.干混生料_水分_rate_pass
|
||||
: "/";
|
||||
arr[12] =
|
||||
arr[11] =
|
||||
item.干混生料_CaO_rate_pass != null
|
||||
? item.干混生料_CaO_rate_pass
|
||||
: "/";
|
||||
//设备
|
||||
arr[13] =
|
||||
arr[12] =
|
||||
item.循环风机_consume_unit != null
|
||||
? item.循环风机_consume_unit
|
||||
: "/";
|
||||
arr[14] =
|
||||
arr[13] =
|
||||
item.立磨主电机_consume_unit != null
|
||||
? item.立磨主电机_consume_unit
|
||||
: "/";
|
||||
//
|
||||
arr[15] = item.elec_consume_unit; //当期值(kW·h/t)
|
||||
arr[14] = item.elec_consume_unit; //当期值(kW·h/t)
|
||||
let keyVale = "goal_val_" + n;
|
||||
arr[16] = goalData[keyVale]?goalData[keyVale]:0; //目标值(kW·h/t)//需要接口获取
|
||||
arr[17] = (arr[15] - arr[16]).toFixed(2); //当期与目标差值(kW·h/t)
|
||||
arr[15] = goalData[keyVale]?goalData[keyVale]:0; //目标值(kW·h/t)//需要接口获取
|
||||
arr[16] = (arr[14] - arr[15]).toFixed(2); //当期与目标差值(kW·h/t)
|
||||
let ind_pre = 0,
|
||||
huanbi = 0;
|
||||
if (item.month_s == 1) {
|
||||
|
@ -266,22 +264,22 @@ export default {
|
|||
}
|
||||
})
|
||||
}
|
||||
arr[18] = huanbi; //环期值(kW·h/t)上个月的值
|
||||
arr[17] = Number(huanbi) ; //环期值(kW·h/t)上个月的值
|
||||
//当期与环期差值(kW·h/t)
|
||||
if (arr[19] !== "/"){
|
||||
arr[19] = (arr[15] - arr[18]).toFixed(2); //当期与环期差值(kW·h/t)
|
||||
if (arr[18] !== "/"){
|
||||
arr[18] = (arr[14] - arr[17]).toFixed(2); //当期与环期差值(kW·h/t)
|
||||
}else{
|
||||
arr[19] = "/"; //当期与环期差值(kW·h/t)
|
||||
arr[18] = "/"; //当期与环期差值(kW·h/t)
|
||||
}
|
||||
arr[20] = 0; //环比增长率(%)
|
||||
if (arr[18] !=="/" && arr[19] !==0 && arr[19] !== "undefined" && arr[18] !== 0){
|
||||
arr[20] = ((arr[19]/arr[18])*100).toFixed(2);
|
||||
arr[19] = 0; //环比增长率(%)
|
||||
if (arr[17] !=="/" && arr[18] !==0 && arr[18] !== "undefined" && arr[17] !== 0){
|
||||
arr[19] = ((arr[18]/arr[17])*100).toFixed(2);
|
||||
}else{
|
||||
arr[20] = "/"; //环比增长率(%)= 当期与环期差值(kW·h/t)/环期值(kW·h/t)*100%
|
||||
arr[19] = "/"; //环比增长率(%)= 当期与环期差值(kW·h/t)/环期值(kW·h/t)*100%
|
||||
}
|
||||
arr[21] = item.celec_consume_unit; //同比增长率(%)
|
||||
arr[20] = item.celec_consume_unit; //同比增长率(%)
|
||||
|
||||
arr[22] = 0;
|
||||
arr[21] = 0;
|
||||
if (month_obj[n]) {
|
||||
const monthData = month_obj[n];
|
||||
const itemValue = item.elec_consume_unit; // 单位产品电耗的值
|
||||
|
@ -297,7 +295,7 @@ export default {
|
|||
} else if (index === 3) {
|
||||
elec_score= 0;
|
||||
}
|
||||
arr[22] += elec_score;
|
||||
arr[21] += 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));
|
||||
|
@ -312,7 +310,7 @@ export default {
|
|||
} else if (run_rate_index === 3) {
|
||||
run_rate_score= 0;
|
||||
}
|
||||
arr[22] += run_rate_score;
|
||||
arr[21] += 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));
|
||||
|
@ -327,7 +325,7 @@ export default {
|
|||
} else if (production_hour_index === 3) {
|
||||
production_hour_score= 0;
|
||||
}
|
||||
arr[22] += production_hour_score;
|
||||
arr[21] += 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));
|
||||
|
@ -342,7 +340,7 @@ export default {
|
|||
} else if (production_cost_unit_index === 3) {
|
||||
production_cost_unit_score= 0;
|
||||
}
|
||||
arr[22] += production_cost_unit_score;
|
||||
arr[21] += production_cost_unit_score;
|
||||
|
||||
const xidu_itemValue = item.辅料_细度_rate_pass; // 辅料细度的值
|
||||
const xidu_sortedData = monthData.sort((a, b) => parseFloat(b.xidu) - parseFloat(a.xidu));
|
||||
|
@ -357,7 +355,7 @@ export default {
|
|||
} else if (xidu_index === 3) {
|
||||
xidu_score= 0;
|
||||
}
|
||||
arr[22] += xidu_score;
|
||||
arr[21] += xidu_score;
|
||||
|
||||
const Fe203_itemValue = item.辅料_Fe2O3_rate_pass; // 辅料Fe203的值
|
||||
const Fe203_sortedData = monthData.sort((a, b) => parseFloat(b.Fe203) - parseFloat(a.Fe203));
|
||||
|
@ -372,7 +370,7 @@ export default {
|
|||
} else if (Fe203_index === 3) {
|
||||
Fe203_score= 0;
|
||||
}
|
||||
arr[22] += Fe203_score;
|
||||
arr[21] += Fe203_score;
|
||||
}
|
||||
wrapArr.push(arr);
|
||||
});
|
||||
|
|
|
@ -77,6 +77,7 @@
|
|||
>
|
||||
{{ item1 }}
|
||||
</div>
|
||||
<div style="display: none;" v-if="ind == 8">{{ item1 }}</div>
|
||||
<el-popover
|
||||
trigger="hover"
|
||||
placement="top"
|
||||
|
|
|
@ -49,11 +49,11 @@
|
|||
<th rowspan="2">得分</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>当期值(kkW·h/t)</th>
|
||||
<th>目标值(kkW·h/t)</th>
|
||||
<th>当期与目标值差值(kW·h/t)</th>
|
||||
<th>环期值(kW·h/t)</th>
|
||||
<th>当期与环期值差值(kW·h/t)</th>
|
||||
<th>当期值(kKW·h/t)</th>
|
||||
<th>目标值(kKW·h/t)</th>
|
||||
<th>当期与目标值差值(KW·h/t)</th>
|
||||
<th>环期值(KW·h/t)</th>
|
||||
<th>当期与环期值差值(KW·h/t)</th>
|
||||
<th>环比增长率(%)</th>
|
||||
<th>同比增长率(%)</th>
|
||||
</tr>
|
||||
|
@ -95,24 +95,11 @@ export default {
|
|||
let year = myDate.getFullYear();
|
||||
this.timeStamp = myDate.getTime();
|
||||
that.query.year_s = year;
|
||||
this.$API.mtm.mgroup.list
|
||||
.req({ page: 0, search: "电石渣" })
|
||||
.then((res) => {
|
||||
that.query.mgroup = res[0].id;
|
||||
let params = {};
|
||||
params.page = 0;
|
||||
params.year = year;
|
||||
params.mgroup = that.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)") {
|
||||
that.getData(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
this.$API.mtm.mgroup.list.req({ page: 0, search: "电石渣" }).then((res) => {
|
||||
console.log("工段数据:", res);
|
||||
that.query.mgroup = res[0].id;
|
||||
that.getGoalData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getGoalData() {
|
||||
|
@ -121,18 +108,18 @@ export default {
|
|||
params.page = 0;
|
||||
params.year = self.query.year_s;
|
||||
params.mgroup = self.query.mgroup;
|
||||
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||
self.$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);
|
||||
});
|
||||
res.forEach((item) => {
|
||||
if (item.goal_cate_name == "单位产品分布电耗(kW·h/t)") {
|
||||
console.log("目标数据:", item);
|
||||
self.getData(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('获取目标数据失败:', error);
|
||||
});
|
||||
},
|
||||
getData(goalData) {
|
||||
let that = this;
|
||||
|
@ -155,120 +142,118 @@ export default {
|
|||
} else {
|
||||
}
|
||||
});
|
||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||
let data = res;
|
||||
if (data.length > 0) {
|
||||
data.forEach((item, index) => {
|
||||
//先按月份排序,再按班组排序
|
||||
let compareArr = [];
|
||||
compareArr.push(item.month_s);
|
||||
compareArr.push(item.team_name);
|
||||
compareArr.push(item.elec_consume_unit);
|
||||
compareArr0[index]=compareArr;
|
||||
if (!month_obj[item.month_s]) {
|
||||
month_obj[item.month_s] = [];
|
||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||
let data = res;
|
||||
if (data.length > 0) {
|
||||
data.forEach((item, index) => {
|
||||
//先按月份排序,再按班组排序
|
||||
let compareArr = [];
|
||||
compareArr.push(item.month_s);
|
||||
compareArr.push(item.team_name);
|
||||
compareArr.push(item.elec_consume_unit);
|
||||
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,
|
||||
elec_consume: item.elec_consume
|
||||
}
|
||||
month_obj[item.month_s].push(
|
||||
{
|
||||
team:item.team_name,
|
||||
value: item.elec_consume_unit,
|
||||
elec_consume: item.elec_consume
|
||||
}
|
||||
);
|
||||
// month_list.push(month_obj)
|
||||
});
|
||||
data.forEach((item) => {
|
||||
//先按月份排序,再按班组排序
|
||||
let n = item.month_s;
|
||||
let arr = [];
|
||||
let time = "" + item.year_s + "." + item.month_s;
|
||||
arr.push(time);
|
||||
arr.push(item.team_name);
|
||||
arr.push(item.total_production);
|
||||
arr.push(item.production_hour);
|
||||
);
|
||||
// month_list.push(month_obj)
|
||||
});
|
||||
data.forEach((item) => {
|
||||
//先按月份排序,再按班组排序
|
||||
let n = item.month_s;
|
||||
let arr = [];
|
||||
let time = "" + item.year_s + "." + item.month_s;
|
||||
arr.push(time);
|
||||
arr.push(item.team_name);
|
||||
arr.push(item.total_production);
|
||||
arr.push(item.production_hour);
|
||||
|
||||
arr[4] = item.elec_consume_unit; //当期值(kW·h/t)
|
||||
let keyVale = "goal_val_" + n;
|
||||
arr[5] = goalData[keyVale]; //目标值(kW·h/t)//需要接口获取
|
||||
arr[6] = (arr[4] - arr[5]).toFixed(2); //当期与目标差值(kW·h/t)
|
||||
let ind_pre = 0,
|
||||
huanqi = 0,
|
||||
huanqicha = 0,
|
||||
tongqi = 0,
|
||||
tongqicha = 0;
|
||||
if (n == 1) {
|
||||
ind_pre = 12;
|
||||
huanqi = wrapArr0[ind_pre]
|
||||
? wrapArr0[ind_pre].elec_consume_unit
|
||||
: "/";
|
||||
} else {
|
||||
// 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi
|
||||
compareArr0.forEach((item0) => {
|
||||
if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) {
|
||||
huanqi = item0[2];
|
||||
}
|
||||
})
|
||||
arr[4] = item.elec_consume_unit; //当期值(KW·h/t)
|
||||
let keyVale = "goal_val_" + n;
|
||||
arr[5] = goalData[keyVale]; //目标值(KW·h/t)//需要接口获取
|
||||
arr[6] = (arr[4] - arr[5]).toFixed(2); //当期与目标差值(KW·h/t)
|
||||
let ind_pre = 0,
|
||||
huanqi = 0,
|
||||
tongqi = 0,
|
||||
tongqicha = 0;
|
||||
if (n == 1) {
|
||||
ind_pre = 12;
|
||||
huanqi = wrapArr0[ind_pre]
|
||||
? wrapArr0[ind_pre].elec_consume_unit
|
||||
: "/";
|
||||
} else {
|
||||
// 如果 wrapArr数组长度大于0,那么循环遍历wrapArr数组,找到与item.month_s相差1的元素 而 item.name相同,并赋值给huanbi
|
||||
compareArr0.forEach((item0) => {
|
||||
if (item0[0] == item.month_s - 1 && item0[1] == item.team_name) {
|
||||
huanqi = item0[2];
|
||||
}
|
||||
arr[7] = huanqi; //环期值(kW·h/t)上个月的值
|
||||
if (arr[6] !== "/"){
|
||||
arr[8] = (arr[4] - arr[7]).toFixed(2); //当期与环期差值(kW·h/t)
|
||||
}else{
|
||||
arr[8] = "/"; //当期与环期差值(kW·h/t)
|
||||
})
|
||||
}
|
||||
arr[7] = Number(huanqi); //环期值(KW·h/t)上个月的值
|
||||
if (arr[6] !== "/"){
|
||||
arr[8] = (Number(arr[4]) - arr[7]).toFixed(2); //当期与环期差值(KW·h/t)
|
||||
}else{
|
||||
arr[8] = "/"; //当期与环期差值(KW·h/t)
|
||||
}
|
||||
let growthRate = 0;
|
||||
if (arr[8]!== "/" && arr[7]!== 0 && arr[8]!== 0 ) {
|
||||
growthRate = ((Number(arr[8]) /arr[7]) * 100).toFixed(2);
|
||||
} else{
|
||||
growthRate = "/";
|
||||
}
|
||||
arr[9] = growthRate; //环比增长率(%)
|
||||
if (wrapArr0[n]) {
|
||||
tongqicha =
|
||||
item.celec_consume_unit -
|
||||
wrapArr0[n].celec_consume_unit;
|
||||
tongqi = tongqicha / tongqi;
|
||||
} else {
|
||||
tongqicha = item.celec_consume_unit;
|
||||
tongqi = 0;
|
||||
}
|
||||
arr[10] = tongqi; //同比增长率(%)
|
||||
//如果n = month_list的key值,则遍历里面的对象按照value排序, 如果 index==0,则arr[11] = 100,如果 index==1,则arr[11] = 80,如果 index==2,则arr[11] = 70,如果 index==3,则arr[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] = 50;
|
||||
} else if (index === 1) {
|
||||
arr[11] = 40;
|
||||
} else if (index === 2) {
|
||||
arr[11] = 30;
|
||||
} else if (index === 3) {
|
||||
arr[11] = 20;
|
||||
}
|
||||
// arr[8] = huanqicha; //当期与环期差值(kW·h/t)
|
||||
let growthRate = 0;
|
||||
if (arr[8]!== "/" && arr[7]!== 0 && arr[8]!== 0 ) {
|
||||
growthRate = ((arr[8] / arr[7]) * 100).toFixed(2);
|
||||
} else{
|
||||
growthRate = "/";
|
||||
const total_elec_consume = item.elec_consume;
|
||||
const sortedTotalData = monthData.sort((a, b) => parseFloat(b.elec_consume) - parseFloat(a.elec_consume));
|
||||
const totalIndex = sortedTotalData.findIndex(obj => parseFloat(obj.elec_consume) === parseFloat(total_elec_consume));
|
||||
let total_elec_consume_score = 0;
|
||||
if (totalIndex === 0){
|
||||
total_elec_consume_score = 50;
|
||||
} else if (totalIndex === 1) {
|
||||
total_elec_consume_score = 40;
|
||||
} else if (totalIndex === 2) {
|
||||
total_elec_consume_score = 30;
|
||||
} else if (totalIndex === 3) {
|
||||
total_elec_consume_score = 20;
|
||||
}
|
||||
arr[9] = growthRate; //环比增长率(%)
|
||||
if (wrapArr0[n]) {
|
||||
tongqicha =
|
||||
item.celec_consume_unit -
|
||||
wrapArr0[n].celec_consume_unit;
|
||||
tongqi = tongqicha / tongqi;
|
||||
} else {
|
||||
tongqicha = item.celec_consume_unit;
|
||||
tongqi = 0;
|
||||
}
|
||||
arr[10] = tongqi; //同比增长率(%)
|
||||
//如果n = month_list的key值,则遍历里面的对象按照value排序, 如果 index==0,则arr[11] = 100,如果 index==1,则arr[11] = 80,如果 index==2,则arr[11] = 70,如果 index==3,则arr[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] = 50;
|
||||
} else if (index === 1) {
|
||||
arr[11] = 40;
|
||||
} else if (index === 2) {
|
||||
arr[11] = 30;
|
||||
} else if (index === 3) {
|
||||
arr[11] = 20;
|
||||
}
|
||||
const total_elec_consume = item.elec_consume;
|
||||
const sortedTotalData = monthData.sort((a, b) => parseFloat(b.elec_consume) - parseFloat(a.elec_consume));
|
||||
const totalIndex = sortedTotalData.findIndex(obj => parseFloat(obj.elec_consume) === parseFloat(total_elec_consume));
|
||||
let total_elec_consume_score = 0;
|
||||
if (totalIndex === 0){
|
||||
total_elec_consume_score = 50;
|
||||
} else if (totalIndex === 1) {
|
||||
total_elec_consume_score = 40;
|
||||
} else if (totalIndex === 2) {
|
||||
total_elec_consume_score = 30;
|
||||
} else if (totalIndex === 3) {
|
||||
total_elec_consume_score = 20;
|
||||
}
|
||||
arr[11] += total_elec_consume_score; // 电耗得分
|
||||
}
|
||||
wrapArr.push(arr);
|
||||
});
|
||||
that.tableDatas = wrapArr;
|
||||
} else {
|
||||
}
|
||||
});
|
||||
arr[11] += total_elec_consume_score; // 电耗得分
|
||||
}
|
||||
wrapArr.push(arr);
|
||||
});
|
||||
that.tableDatas = wrapArr;
|
||||
} else {
|
||||
}
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.tableDatas = [];
|
||||
|
@ -278,13 +263,6 @@ export default {
|
|||
this.type = type;
|
||||
this.asynDialog = true;
|
||||
},
|
||||
itemClick1(type, item) {
|
||||
this.chartShow = false;
|
||||
this.$API.bi.dataset.exec.req("3322567213885833216").then((res) => {
|
||||
this.myOption = JSON.parse(res.echart_options);
|
||||
this.chartShow = true;
|
||||
});
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT("#myReport");
|
||||
},
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
>
|
||||
{{ item1 }}
|
||||
</div>
|
||||
<div style="display: none;" v-if="ind == 8">{{ item1 }}</div>
|
||||
<el-popover
|
||||
trigger="hover"
|
||||
placement="top"
|
||||
|
|
|
@ -401,7 +401,7 @@ export default {
|
|||
key = "退火";
|
||||
} else if (
|
||||
item5.车间 == "6车间" &&
|
||||
item5.工序 == "管料成型"
|
||||
item5.工序 == "管料退火"
|
||||
) {
|
||||
key = "库存";
|
||||
} else if (
|
||||
|
|
|
@ -195,6 +195,7 @@
|
|||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<!-- 检测项和判断项 -->
|
||||
<div style="padding-left: 50px" v-else>
|
||||
<el-descriptions :column="4">
|
||||
<el-descriptions-item label="划伤">{{
|
||||
|
|
|
@ -34,37 +34,10 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号" prop="wm_in">
|
||||
<el-input ref="codeInput" v-model="wm_in" clearable @change="formWminChange"></el-input>
|
||||
<!-- <el-select
|
||||
v-model="form.wm_in"
|
||||
placeholder="交接物料"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.id"
|
||||
:label="item.batch"
|
||||
:value="item.id"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
"
|
||||
>
|
||||
<span>{{ item.batch }}</span
|
||||
><span>{{ item.count }}</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select> -->
|
||||
<el-input ref="codeInput" v-model="wm_in" clearable @change="formWminChange(wm_in)"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
@ -74,7 +47,9 @@ const defaultForm = {
|
|||
mlog: "",
|
||||
mtask: "",
|
||||
batch: "",
|
||||
wn_in: "",
|
||||
count_use: 1,
|
||||
note:''
|
||||
};
|
||||
export default {
|
||||
props: {
|
||||
|
@ -110,14 +85,7 @@ export default {
|
|||
message: "请填写批次号",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
count_use: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写领用数量",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
]
|
||||
},
|
||||
wm_in:'',
|
||||
options: [],
|
||||
|
@ -135,6 +103,7 @@ export default {
|
|||
open() {
|
||||
this.visible = true;
|
||||
},
|
||||
//获取任务列表
|
||||
getMtask() {
|
||||
let that = this;
|
||||
this.$API.pm.mtask.list
|
||||
|
@ -158,29 +127,31 @@ export default {
|
|||
});
|
||||
},
|
||||
//扫描后处理方法
|
||||
formWminChange(){
|
||||
//根据扫描内容获取输入物料
|
||||
this.materialOptions.forEach((item) => {
|
||||
if (item.batch == this.wm_in) {
|
||||
this.form.wm_in = item.id;
|
||||
//提交
|
||||
this.submit();
|
||||
}
|
||||
});
|
||||
formWminChange(wm_in){
|
||||
// wn_in:扫码获取的内容
|
||||
let that = this;
|
||||
let arr = that.materialOptions.filter((item) => {
|
||||
return item.batch == wm_in;
|
||||
});
|
||||
if (arr.length > 0) {
|
||||
that.form.wm_in = arr[0].id;
|
||||
that.form.mlog = that.mlog;
|
||||
that.form.mtask = that.mtask;
|
||||
//提交
|
||||
that.submit();
|
||||
}else{
|
||||
that.wm_in = '';
|
||||
that.$message.error("批次号不存在");
|
||||
}
|
||||
},
|
||||
//表单提交方法
|
||||
submit() {
|
||||
let that = this;
|
||||
that.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
that.form.mlog = that.mlog;
|
||||
that.$API.wpm.mlogb.in.req(that.form).then((res) => {
|
||||
that.$emit("mlogbinSuccess");
|
||||
that.$message.success("添加成功");
|
||||
}).catch((err) => {
|
||||
});
|
||||
}
|
||||
});
|
||||
that.form.mlog = that.mlog;
|
||||
that.$API.wpm.mlogb.in.req(that.form).then((res) => {
|
||||
that.$message.success("添加成功");
|
||||
that.wm_in = '';
|
||||
}).catch((err) => {});
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
|
|
Loading…
Reference in New Issue