This commit is contained in:
shijing 2024-12-17 17:07:45 +08:00
commit af45254d43
15 changed files with 218 additions and 94 deletions

View File

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

View File

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

View File

@ -54,7 +54,7 @@
:loading="exportLoading"
>导出xlsx
</el-button>
<el-button type="primary" @click="handlePrint">打印 </el-button>
<!-- <el-button type="primary" @click="handlePrint">打印 </el-button> -->
</div>
</el-header>
<el-card style="margin-top:5px">
@ -82,9 +82,11 @@
</table>
</div>
</el-card>
<div id="barChart" style="width: 100%; height: 400px;"></div>
</div>
</template>
<script>
import * as echarts from 'echarts';
export default {
data() {
return {
@ -124,7 +126,9 @@
month = '0'+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: {
@ -171,6 +175,7 @@
obj.mpoint__in = that.mpointList[0];
this.$API.enm.mpointstat.groupValues.req(obj)
.then((res) => {
let chartData = {};
res.forEach(item => {
//
const colIndex = this.mpoint_name.indexOf(item.mpoint__name) + 2;
@ -178,36 +183,89 @@
if (rowIndex > -1 && colIndex > 1) {
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) => {
console.error("API 请求错误: ", error);
});
},
// let that = this;
// let params = {page:0};
// let arr = [];
// if(that.query.type==0){//
// params.type='day_s';
// arr = that.query.month.split('-');
// params.year_s = Number(arr[0]);
// params.month_s = Number(arr[1]);
// params.day = Number(arr[2]);
// }else if(that.query.type==1){//
// params.type='month_s';
// params.year_s = Number(that.query.year);
// }else if (that.query.type==2){
// params.type='year_s';
// params.year_s = Number(that.query.yearStart);
// }
// },
getTableData(){
this.getData();
},
//
createBarChart(chartData) {
//
let chartDom = document.getElementById('barChart');
let myChart = echarts.init(chartDom);
//
let seriesData = [];
let categories = this.mpoint_name; //
let rowList = this.row_list; // ['peak', 'high', 'low', 'deep', 'flat']
// 'peak', 'high', 'low', 'deep', 'flat'
rowList.forEach(level => {
let data = categories.map(device => {
//
let deviceData = chartData[device]?.find(item => item.level === level);
return deviceData ? Math.round(deviceData.total_val) : ''; // 0
});
seriesData.push({
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() {
this.$PRINT('#myReport');
},

View File

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

View File

@ -108,7 +108,7 @@
{index:2,name:'熟料单位产品综合能耗(kgce/t)',value:0,note:''},
{index:3,name:'熟料单位产品综合电耗(kw.h/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('-');
year_s = Number(arr[0]);
month_s = Number(arr[1]);
day_s = null;
}else if (that.query.type==2){
type='year_s';
day_s = null;
month_s = null;
year_s = Number(that.query.searchYear);
}
let params1 = {

View File

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

View File

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

View File

@ -81,9 +81,9 @@
>
{{ item[5] }}
</td>
<td class="numCell">{{ item[6].toFixed(2) }}</td>
<td class="numCell">{{ item[7] }}</td>
<td class="numCell">{{ item[8].toFixed(2) }}</td>
<td class="numCell">{{ item[6]}}</td>
<td class="numCell">{{ item[7]}}</td>
<td class="numCell">{{ item[8]}}</td>
<td class="numCell">{{ item[9] }}</td>
</tr>
</tbody>
@ -408,7 +408,7 @@ export default {
["运转时间", "运转率(%", "/", 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],
],
tableName: "生产报告",
@ -857,7 +857,6 @@ export default {
query.type = "hour_s";
query.mgroup = that.query.mgroup;
this.$API.enm.enstat.req(query).then((response) => {
// debugger;
let seriesData0 = [],
seriesData1 = [],
seriesData2 = [],

View File

@ -143,7 +143,7 @@ export default {
data() {
return {
apiObj: null,
mgroup_name :["电石渣", "回转窑", "水泥磨"],
mgroup_name :["电石渣", "回转窑", "水泥磨","原料磨"],
query: {
date: "",
fee: "",
@ -173,7 +173,7 @@ export default {
this.$API.mtm.mgroup.list.req({ page: 0, cate:"section"}).then((res) => {
//res.name=options
res.forEach(element => {
if(['煤磨','原料磨','水泥包装'].includes(element.name)){
if(['煤磨','水泥包装'].includes(element.name)){
return;
}
this.options.push(element);

View File

@ -341,7 +341,7 @@ export default {
["出厂水泥", "出厂水泥合计t", 0, 0, 0, 0, 0, 0, 0],
["出厂熟料", "熟料t", 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: "生产报告",

View File

@ -156,7 +156,12 @@ export default {
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_obj[item.month_s].push(
{
team:item.team_name,
value: item.elec_consume_unit,
elec_consume:item.elec_consume
});
});
data.forEach((item) => {
@ -223,14 +228,28 @@ export default {
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;
arr[10] = 50;
} else if (index === 1) {
arr[10] = 80;
arr[10] = 40;
} else if (index === 2) {
arr[10] = 70;
arr[10] = 30;
} 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);
// console.log(wrapArr);

View File

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

View File

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

View File

@ -70,9 +70,9 @@
>
{{ item[4] }}
</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[7].toFixed(2) }}</td>
<td class="numCell">{{ item[7]}}</td>
<td class="numCell">{{ item[8] }}</td>
</tr>
</tbody>
@ -398,10 +398,10 @@ export default {
tableDatas: [
["产量", "总产量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, "/", "/", "/", "/", "/"],
],
cate: "",
apiObj: this.$API.enm.enstat,
@ -681,9 +681,9 @@ export default {
if (data2.imaterial_data.length > 0) {
data2.imaterial_data.forEach((item) => {
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 == "湿电石渣进厂"){
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]) {
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)
});
data.forEach((item) => {
@ -234,14 +240,28 @@ export default {
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;
arr[11] = 50;
} else if (index === 1) {
arr[11] = 80;
arr[11] = 40;
} else if (index === 2) {
arr[11] = 70;
arr[11] = 30;
} 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);
});