feat: 修改大屏内容和报表

This commit is contained in:
zty 2024-12-17 16:22:29 +08:00
parent 25a2427138
commit fbda02f549
15 changed files with 218 additions and 94 deletions

View File

@ -286,6 +286,11 @@ BABYLON.DracoCompression.Configuration.decoder.fallbackUrl =
import "babylonjs-loaders"; import "babylonjs-loaders";
import "animate.css"; import "animate.css";
export default { export default {
beforeRouteLeave(to, from, next) {
//
window.location.reload();
next();
},
components: { value }, components: { value },
data() { data() {
return { return {
@ -428,21 +433,21 @@ export default {
new echarts.graphic.LinearGradient(0, 0, 0, 1, [ new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ {
offset: 0, offset: 0,
color: "rgb(243, 84, 9)", color: "rgb(246, 5, 213)",
}, },
{ {
offset: 1, offset: 1,
color: "rgb(191, 69, 12)", color: "rgb(244, 130, 9 )",
}, },
]), ]),
new echarts.graphic.LinearGradient(0, 0, 0, 1, [ new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ {
offset: 0, offset: 0,
color: "rgb(213, 9, 241)", color: "rgb(18, 6, 248)",
}, },
{ {
offset: 1, offset: 1,
color: "rgb(138, 34, 153)", color: "rgb(6, 248, 80)",
}, },
]), ]),
], ],
@ -641,11 +646,11 @@ export default {
[ [
{ {
offset: 0, offset: 0,
color: "rgb(223, 65, 19)", color: "rgb(241, 56, 4)",
}, },
{ {
offset: 1, offset: 1,
color: "rgb(223, 20, 20)", color: "rgb(12, 35, 196)",
}, },
] ]
), ),
@ -892,7 +897,7 @@ export default {
index2++; index2++;
} else { } else {
index2 = 0; index2 = 0;
clearInterval(intervalId); // clearInterval(intervalId);
} }
}, 1000); }, 1000);
}); });
@ -1093,7 +1098,7 @@ export default {
index3++; index3++;
} else { } else {
index3 = 0; index3 = 0;
clearInterval(intervalId); // clearInterval(intervalId);
} }
}, 1000); }, 1000);
}); });
@ -1190,7 +1195,6 @@ export default {
this.$API.enm.enstat.req(params).then((ress) => { this.$API.enm.enstat.req(params).then((ress) => {
that.hotData.bz_elec_consume_unit = that.hotData.bz_elec_consume_unit =
ress[0].elec_consume_unit; ress[0].elec_consume_unit;
that.hotData.sn_cen_consume_unit = ress[0].cen_consume_unit;
}); });
}); });
}, },
@ -1376,7 +1380,7 @@ export default {
index3++; index3++;
} else { } else {
index3 = 0; index3 = 0;
clearInterval(intervalId); // clearInterval(intervalId);
} }
}, 1000); }, 1000);
}); });
@ -2026,9 +2030,9 @@ export default {
beforeUnmount() { beforeUnmount() {
let that = this; let that = this;
this.scene = null; this.scene = null;
clearInterval(that.timerTime); // clearInterval(that.timerTime);
clearInterval(that.timerData); // clearInterval(that.timerData);
clearInterval(that.qualityTimer); // clearInterval(that.qualityTimer);
that.timerTime = null; that.timerTime = null;
that.timerData = null; that.timerData = null;
that.qualityTimer = null; that.qualityTimer = null;
@ -2036,9 +2040,9 @@ export default {
beforeDestoryed() { beforeDestoryed() {
let that = this; let that = this;
this.scene = null; this.scene = null;
clearInterval(that.timerTime); // clearInterval(that.timerTime);
clearInterval(that.timerData); // clearInterval(that.timerData);
clearInterval(that.qualityTimer); // clearInterval(that.qualityTimer);
that.timerTime = null; that.timerTime = null;
that.timerData = null; that.timerData = null;
that.qualityTimer = null; that.qualityTimer = null;

View File

@ -74,9 +74,9 @@
> >
{{ item[5] }} {{ item[5] }}
</td> </td>
<td class="numCell">{{ item[6].toFixed(2) }}</td> <td class="numCell">{{ item[6]}}</td>
<td class="numCell">{{ item[7] }}</td> <td class="numCell">{{ item[7] }}</td>
<td class="numCell">{{ item[8].toFixed(2) }}</td> <td class="numCell">{{ item[8]}}</td>
<td class="numCell">{{ item[9] }}</td> <td class="numCell">{{ item[9] }}</td>
</tr> </tr>
</tbody> </tbody>
@ -271,7 +271,7 @@ export default {
["运转时间", "运转时间h", "/", 0, 0, 0, 0, 0, 0, 0], ["运转时间", "运转时间h", "/", 0, 0, 0, 0, 0, 0, 0],
["运转时间", "运转率(%", "/", 0, 0, 0, 0, 0, 0, 0], ["运转时间", "运转率(%", "/", 0, 0, 0, 0, 0, 0, 0],
["能耗", "煤磨分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "煤磨分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0, 0, 0, 0, 0, 0] ["能耗", "总电耗KW·h", 0, 0, 0, 0, "/", "/", "/", "/"]
], ],
tableName: "生产报告", tableName: "生产报告",
modelValue: true, modelValue: true,

View File

@ -54,7 +54,7 @@
:loading="exportLoading" :loading="exportLoading"
>导出xlsx >导出xlsx
</el-button> </el-button>
<el-button type="primary" @click="handlePrint">打印 </el-button> <!-- <el-button type="primary" @click="handlePrint">打印 </el-button> -->
</div> </div>
</el-header> </el-header>
<el-card style="margin-top:5px"> <el-card style="margin-top:5px">
@ -82,9 +82,11 @@
</table> </table>
</div> </div>
</el-card> </el-card>
<div id="barChart" style="width: 100%; height: 400px;"></div>
</div> </div>
</template> </template>
<script> <script>
import * as echarts from 'echarts';
export default { export default {
data() { data() {
return { return {
@ -124,7 +126,9 @@
month = '0'+month; month = '0'+month;
} }
this.query.month = myDate.getFullYear()+'-'+month; this.query.month = myDate.getFullYear()+'-'+month;
// this.getMgroup(); this.query.day = myDate.getFullYear()+'-'+(myDate.getMonth()+1)+'-'+myDate.getDate();
this.query.year = myDate.getFullYear();
this.dateChange();
}, },
methods: { methods: {
@ -171,6 +175,7 @@
obj.mpoint__in = that.mpointList[0]; obj.mpoint__in = that.mpointList[0];
this.$API.enm.mpointstat.groupValues.req(obj) this.$API.enm.mpointstat.groupValues.req(obj)
.then((res) => { .then((res) => {
let chartData = {};
res.forEach(item => { res.forEach(item => {
// //
const colIndex = this.mpoint_name.indexOf(item.mpoint__name) + 2; const colIndex = this.mpoint_name.indexOf(item.mpoint__name) + 2;
@ -178,36 +183,89 @@
if (rowIndex > -1 && colIndex > 1) { if (rowIndex > -1 && colIndex > 1) {
this.tableData[rowIndex][colIndex] = (item.total_val).toFixed(2); this.tableData[rowIndex][colIndex] = (item.total_val).toFixed(2);
} }
}); //
if (!chartData[item.mpoint__name]) {
chartData[item.mpoint__name] = [];
}
chartData[item.mpoint__name].push({
level: item.val_level,
total_val: item.total_val
});
});
//
console.log('chartData',chartData);
that.createBarChart(chartData);
}) })
.catch((error) => { .catch((error) => {
console.error("API 请求错误: ", error); console.error("API 请求错误: ", error);
}); });
}, },
//
// let that = this; createBarChart(chartData) {
// let params = {page:0}; //
// let arr = []; let chartDom = document.getElementById('barChart');
// if(that.query.type==0){// let myChart = echarts.init(chartDom);
// params.type='day_s';
// arr = that.query.month.split('-'); //
// params.year_s = Number(arr[0]); let seriesData = [];
// params.month_s = Number(arr[1]); let categories = this.mpoint_name; //
// params.day = Number(arr[2]); let rowList = this.row_list; // ['peak', 'high', 'low', 'deep', 'flat']
// }else if(that.query.type==1){//
// params.type='month_s'; // 'peak', 'high', 'low', 'deep', 'flat'
// params.year_s = Number(that.query.year); rowList.forEach(level => {
// }else if (that.query.type==2){ let data = categories.map(device => {
// params.type='year_s'; //
// params.year_s = Number(that.query.yearStart); let deviceData = chartData[device]?.find(item => item.level === level);
// } return deviceData ? Math.round(deviceData.total_val) : ''; // 0
});
// },
getTableData(){ seriesData.push({
this.getData(); name: level, // peakhigh
}, type: 'bar',
data: data, //
label: {
show: true,
position: 'top',
formatter: '{c}' //
}
});
});
//
let option = {
title: {
text: '电量统计柱状图',
left: 'center'
},
tooltip: {
trigger: 'axis',
axisPointer: { type: 'shadow' } //
},
legend: {
data: rowList, // 'peak', 'high'
top: '10%'
},
xAxis: {
type: 'category',
data: this.headers, //
axisLabel: {
rotate: 45 //
}
},
yAxis: {
type: 'value',
axisLabel: {
formatter: '{value} kWh' // kWh
}
},
series: seriesData
};
//
myChart.setOption(option);
},
handlePrint() { handlePrint() {
this.$PRINT('#myReport'); this.$PRINT('#myReport');
}, },

View File

@ -288,7 +288,7 @@ export default {
let arr = []; let arr = [];
let obj = {}; let obj = {};
if (that.queryset.type == 0) { if (that.query.type == 0) {
arr = e.split('-'); arr = e.split('-');
that.year = Number(arr[0]); that.year = Number(arr[0]);
that.month = Number(arr[1]); that.month = Number(arr[1]);

View File

@ -108,7 +108,7 @@
{index:2,name:'熟料单位产品综合能耗(kgce/t)',value:0,note:''}, {index:2,name:'熟料单位产品综合能耗(kgce/t)',value:0,note:''},
{index:3,name:'熟料单位产品综合电耗(kw.h/t)',value:0,note:''}, {index:3,name:'熟料单位产品综合电耗(kw.h/t)',value:0,note:''},
{index:4,name:'熟料单位产品综合煤耗(kgce/t)',value:0,note:''}, {index:4,name:'熟料单位产品综合煤耗(kgce/t)',value:0,note:''},
{index:5,name:'水泥单位产品分布能耗(kgce/t)',value:0,note:''}, {index:5,name:'水泥单位产品分布电耗(kw.h/t)',value:0,note:''},
], ],
}; };
@ -142,8 +142,11 @@
arr = that.query.searchMonth.split('-'); arr = that.query.searchMonth.split('-');
year_s = Number(arr[0]); year_s = Number(arr[0]);
month_s = Number(arr[1]); month_s = Number(arr[1]);
day_s = null;
}else if (that.query.type==2){ }else if (that.query.type==2){
type='year_s'; type='year_s';
day_s = null;
month_s = null;
year_s = Number(that.query.searchYear); year_s = Number(that.query.searchYear);
} }
let params1 = { let params1 = {

View File

@ -530,7 +530,6 @@ export default {
obj.mpoint = id; obj.mpoint = id;
obj.page = 0; obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((res) => { this.$API.enm.mpoint.stat.req(obj).then((res) => {
// console.log(res);
let sum = 0; let sum = 0;
res.forEach((item) => { res.forEach((item) => {
let ind = item.hour + 3; let ind = item.hour + 3;

View File

@ -92,9 +92,9 @@
> >
{{ item[5] }} {{ item[5] }}
</td> </td>
<td class="numCell">{{ item[6].toFixed(2) }}</td> <td class="numCell">{{ item[6]}}</td>
<td class="numCell">{{ item[7] }}</td> <td class="numCell">{{ item[7] }}</td>
<td class="numCell">{{ item[8].toFixed(2) }}</td> <td class="numCell">{{ item[8]}}</td>
<td class="numCell">{{ item[9] }}</td> <td class="numCell">{{ item[9] }}</td>
</tr> </tr>
</tbody> </tbody>
@ -444,10 +444,10 @@ export default {
["能耗", "单位产品综合电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "单位产品综合电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "单位产品标煤耗kgce/t", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "单位产品标煤耗kgce/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "单位产品综合能耗kgce/t", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "单位产品综合能耗kgce/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "总电耗KW·h", 0, 0, 0, 0, "/", "/", "/", "/"],
["成本", "单位产品成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0], ["成本", "单位产品成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0],
["氨水", "氨水消耗量(t)", 0, 0, 0, 0, 0, 0, 0, 0], ["氨水", "氨水消耗量(t)", 0, 0, 0, 0, "/", "/", "/", "/"],
["氨水", "单位氨水消耗量(kg/t)", 0, 0, 0, 0, 0, 0, 0, 0], ["氨水", "单位氨水消耗量(kg/t)", 0, 0, 0, 0, "/", "/", "/", "/"],
], ],
tableName: "生产报告", tableName: "生产报告",
modelValue: true, modelValue: true,

View File

@ -81,9 +81,9 @@
> >
{{ item[5] }} {{ item[5] }}
</td> </td>
<td class="numCell">{{ item[6].toFixed(2) }}</td> <td class="numCell">{{ item[6]}}</td>
<td class="numCell">{{ item[7] }}</td> <td class="numCell">{{ item[7]}}</td>
<td class="numCell">{{ item[8].toFixed(2) }}</td> <td class="numCell">{{ item[8]}}</td>
<td class="numCell">{{ item[9] }}</td> <td class="numCell">{{ item[9] }}</td>
</tr> </tr>
</tbody> </tbody>
@ -408,7 +408,7 @@ export default {
["运转时间", "运转率(%", "/", 0, 0, 0, 0, 0, 0, 0], ["运转时间", "运转率(%", "/", 0, 0, 0, 0, 0, 0, 0],
["能耗", "单位产品分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "单位产品分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "单位产品综合能耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "单位产品综合能耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "总电耗KW·h", 0, 0, 0, 0, "/", "/", "/", "/"],
["成本", "单位产品成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0], ["成本", "单位产品成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0],
], ],
tableName: "生产报告", tableName: "生产报告",
@ -857,7 +857,6 @@ export default {
query.type = "hour_s"; query.type = "hour_s";
query.mgroup = that.query.mgroup; query.mgroup = that.query.mgroup;
this.$API.enm.enstat.req(query).then((response) => { this.$API.enm.enstat.req(query).then((response) => {
// debugger;
let seriesData0 = [], let seriesData0 = [],
seriesData1 = [], seriesData1 = [],
seriesData2 = [], seriesData2 = [],

View File

@ -143,7 +143,7 @@ export default {
data() { data() {
return { return {
apiObj: null, apiObj: null,
mgroup_name :["电石渣", "回转窑", "水泥磨"], mgroup_name :["电石渣", "回转窑", "水泥磨","原料磨"],
query: { query: {
date: "", date: "",
fee: "", fee: "",
@ -173,7 +173,7 @@ 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 => {
if(['煤磨','原料磨','水泥包装'].includes(element.name)){ if(['煤磨','水泥包装'].includes(element.name)){
return; return;
} }
this.options.push(element); this.options.push(element);

View File

@ -341,7 +341,7 @@ export default {
["出厂水泥", "出厂水泥合计t", 0, 0, 0, 0, 0, 0, 0], ["出厂水泥", "出厂水泥合计t", 0, 0, 0, 0, 0, 0, 0],
["出厂熟料", "熟料t", 0, 0, 0, "/", "/", "/","/"], ["出厂熟料", "熟料t", 0, 0, 0, "/", "/", "/","/"],
["能耗", "单位产品分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0], ["能耗", "单位产品分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0, 0, 0, 0, 0], ["能耗", "总电耗KW·h", 0, 0, 0, "/", "/", "/","/"],
], ],
tableName: "生产报告", tableName: "生产报告",

View File

@ -156,7 +156,12 @@ export default {
if (!month_obj[item.month_s]) { if (!month_obj[item.month_s]) {
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_obj[item.month_s].push(
{
team:item.team_name,
value: item.elec_consume_unit,
elec_consume:item.elec_consume
});
}); });
data.forEach((item) => { data.forEach((item) => {
@ -223,14 +228,28 @@ export default {
const sortedData = monthData.sort((a, b) => parseFloat(b.value) - parseFloat(a.value)); const sortedData = monthData.sort((a, b) => parseFloat(b.value) - parseFloat(a.value));
const index = sortedData.findIndex(obj => parseFloat(obj.value) === parseFloat(itemValue)); const index = sortedData.findIndex(obj => parseFloat(obj.value) === parseFloat(itemValue));
if (index === 0){ if (index === 0){
arr[10] = 100; arr[10] = 50;
} else if (index === 1) { } else if (index === 1) {
arr[10] = 80; arr[10] = 40;
} else if (index === 2) { } else if (index === 2) {
arr[10] = 70; arr[10] = 30;
} else if (index === 3) { } else if (index === 3) {
arr[10] = 0; arr[10] = 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[10] += total_elec_consume_score; //
} }
wrapArr.push(arr); wrapArr.push(arr);
// console.log(wrapArr); // console.log(wrapArr);

View File

@ -3,21 +3,27 @@
<el-container class="app-container"> <el-container class="app-container">
<el-header> <el-header>
<div> <div>
<el-select v-model="query.mgroup" placeholder="工段" clearable @change="mgroupChange" class="headerSearch"> <el-select v-model="query.mgroup" placeholder="工段" clearable class="headerSearch">
<el-option v-for="item in mgroupOptions" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in mgroupOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<el-select v-model="query.type" placeholder="查询类型" clearable class="headerSearch" @change="typeCange"> <el-select v-model="query.type" placeholder="查询类型" clearable class="headerSearch" @change="typeCange">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<el-date-picker <el-select
v-model="query.shift" v-model="query.sflogs__team"
type="datetime" placeholder="班组"
value-format="YYYY-MM-DD" clearable
format="YYYY-MM-DD" style="margin-left: 2px; width: 120px"
placeholder="班次" class="headerSearch"
class="headerSearch" @change="teamChange"
v-if="query.type == 0" >
/> <el-option
v-for="item in teams"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-date-picker <el-date-picker
v-model="value1" v-model="value1"
type="datetimerange" type="datetimerange"
@ -119,7 +125,7 @@
对应值班记录 对应值班记录
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <scTable
ref="expTable" ref="expTable"
:data="sflogexpList" :data="sflogexpList"
row-key="id" row-key="id"
@ -185,7 +191,11 @@ export default {
mgroup: '', mgroup: '',
start_time__gt: '', start_time__gt: '',
start_time__lt: '', start_time__lt: '',
start_time__month: '',
sflogs__team: '',
start_time__year: '',
shift: '', shift: '',
team: null,
}, },
params:{ params:{
mgroup: "", mgroup: "",
@ -195,6 +205,7 @@ export default {
value1:[], value1:[],
materialList: [], materialList: [],
sflogexpList: [], sflogexpList: [],
teams: [],
mgroupOptions: [], mgroupOptions: [],
tableName: '班组成本计算', tableName: '班组成本计算',
options: [ options: [
@ -217,6 +228,7 @@ export default {
} }
this.getShift(); this.getShift();
this.getMgroup(); this.getMgroup();
this.getTeams();
}, },
methods: { methods: {
@ -227,13 +239,23 @@ export default {
this.mgroupOptions.push(item); this.mgroupOptions.push(item);
}) })
this.mgroupOptions = this.mgroupOptions.reverse(); this.mgroupOptions = this.mgroupOptions.reverse();
// this.query.mgroup = this.mgroupOptions[0].id;
// this.params.mgroup = this.mgroupOptions[0].id;
this.apiObjStlog = this.$API.wpm.stlog.list; this.apiObjStlog = this.$API.wpm.stlog.list;
this.tableName = this.mgroupOptions[0].name; this.tableName = this.mgroupOptions[0].name;
this.getTableData(); this.getTableData();
// this.getMgroup1(this.mgroupOptions[0].name);
}) })
}, },
//
getTeams() {
let form = {};
form.page = 0;
this.teams = [];
this.$API.mtm.team.list.req(form).then((res) => {
this.teams = res;
});
},
// //
getShift() { getShift() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => { this.$API.mtm.shift.list.req({ page: 0 }).then(res => {

View File

@ -79,9 +79,9 @@
> >
{{ item[5] }} {{ item[5] }}
</td> </td>
<td class="numCell">{{ item[6].toFixed(2) }}</td> <td class="numCell">{{ item[6]}}</td>
<td class="numCell">{{ item[7] }}</td> <td class="numCell">{{ item[7] }}</td>
<td class="numCell">{{ item[8].toFixed(2) }}</td> <td class="numCell">{{ item[8]}}</td>
<td class="numCell">{{ item[9] }}</td> <td class="numCell">{{ item[9] }}</td>
</tr> </tr>
</tbody> </tbody>
@ -408,7 +408,7 @@ export default {
["运转时间", "运转时间h", "/", 0, 0, 0, 0, 0, 0, 0], ["运转时间", "运转时间h", "/", 0, 0, 0, 0, 0, 0, 0],
["运转时间", "运转率(%", "/", 0, 0, 0, 0, 0, 0, 0], ["运转时间", "运转率(%", "/", 0, 0, 0, 0, 0, 0, 0],
["能耗", "生料分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "生料分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "总电耗KW·h", 0, 0, 0, 0, "/", "/", "/","/"],
["成本", "生料成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0], ["成本", "生料成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0],
], ],
tableName: "生产报告", tableName: "生产报告",

View File

@ -70,9 +70,9 @@
> >
{{ item[4] }} {{ item[4] }}
</td> </td>
<td class="numCell">{{ item[5].toFixed(2) }}</td> <td class="numCell">{{ item[5]}}</td>
<td class="numCell">{{ item[6] }}</td> <td class="numCell">{{ item[6] }}</td>
<td class="numCell">{{ item[7].toFixed(2) }}</td> <td class="numCell">{{ item[7]}}</td>
<td class="numCell">{{ item[8] }}</td> <td class="numCell">{{ item[8] }}</td>
</tr> </tr>
</tbody> </tbody>
@ -398,10 +398,10 @@ export default {
tableDatas: [ tableDatas: [
["产量", "总产量t", 0, 0, 0, 0, 0, 0, 0, 0], ["产量", "总产量t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "单位产品分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "单位产品分布电耗KW·h/t", 0, 0, 0, 0, 0, 0, 0, 0],
["能耗", "总电耗KW·h", 0, 0, 0, 0, 0, 0, 0, 0], ["能耗", "总电耗KW·h", 0, 0, 0, "/", "/", "/", "/", "/"],
["成本", "电石渣成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0], ["成本", "电石渣成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0],
["湿电石渣", "消耗", 0, 0, 0, 0, 0, 0, 0, 0], ["湿电石渣", "消耗", 0, 0, 0, "/", "/", "/", "/", "/"],
["湿电石渣", "进厂", 0, 0, 0, 0, 0, 0, 0, 0], ["湿电石渣", "进厂", 0, 0, 0, "/", "/", "/", "/", "/"],
], ],
cate: "", cate: "",
apiObj: this.$API.enm.enstat, apiObj: this.$API.enm.enstat,
@ -681,9 +681,9 @@ export default {
if (data2.imaterial_data.length > 0) { if (data2.imaterial_data.length > 0) {
data2.imaterial_data.forEach((item) => { data2.imaterial_data.forEach((item) => {
if (item.material_name == "湿电石渣消耗") { if (item.material_name == "湿电石渣消耗") {
that.tableDatas[4][3] = item.amount_consume; that.tableDatas[4][3] = (item.amount_consume).toFixed(2);
}else if(item.material_name == "湿电石渣进厂"){ }else if(item.material_name == "湿电石渣进厂"){
that.tableDatas[5][3] = item.amount_consume; that.tableDatas[5][3] = (item.amount_consume).toFixed(2);
} }
}); });
} }

View File

@ -168,7 +168,13 @@ export default {
if (!month_obj[item.month_s]) { if (!month_obj[item.month_s]) {
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_obj[item.month_s].push(
{
team:item.team_name,
value: item.elec_consume_unit,
elec_consume: item.elec_consume
}
);
// month_list.push(month_obj) // month_list.push(month_obj)
}); });
data.forEach((item) => { data.forEach((item) => {
@ -234,14 +240,28 @@ export default {
const sortedData = monthData.sort((a, b) => parseFloat(b.value) - parseFloat(a.value)); const sortedData = monthData.sort((a, b) => parseFloat(b.value) - parseFloat(a.value));
const index = sortedData.findIndex(obj => parseFloat(obj.value) === parseFloat(itemValue)); const index = sortedData.findIndex(obj => parseFloat(obj.value) === parseFloat(itemValue));
if (index === 0){ if (index === 0){
arr[11] = 100; arr[11] = 50;
} else if (index === 1) { } else if (index === 1) {
arr[11] = 80; arr[11] = 40;
} else if (index === 2) { } else if (index === 2) {
arr[11] = 70; arr[11] = 30;
} else if (index === 3) { } else if (index === 3) {
arr[11] = 0; 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); wrapArr.push(arr);
}); });