feat: tkx/enm 修改班组 和 生产日报报表增加 目标值等功能
This commit is contained in:
parent
553f2761bb
commit
7fd709b7a6
|
@ -1150,6 +1150,16 @@ const routes = [
|
|||
},
|
||||
component: "enm_energy/energyPicture",
|
||||
},
|
||||
{
|
||||
name: "carbon",
|
||||
path: "/enm_energy/carbon",
|
||||
meta: {
|
||||
title: "碳排放",
|
||||
// icon: "el-icon-grid",
|
||||
perms: ["carbon_base"],
|
||||
},
|
||||
component: "enm_energy/carbon",
|
||||
},
|
||||
],
|
||||
},
|
||||
//全厂报表
|
||||
|
|
|
@ -58,8 +58,8 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="购置日期" prop="buy_date">
|
||||
</el-table-column>
|
||||
<el-table-column label="工段运行" prop="indicate_mgroup_running">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="工段运行" prop="indicate_mgroup_running">
|
||||
</el-table-column> -->
|
||||
<el-table-column label="设备负责人" prop="device_people" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -95,7 +95,7 @@
|
|||
<!-- <el-table-column label="保管人">
|
||||
<template #default="scope">{{ scope.row.keeper_name }}</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="存放位置" show-overflow-tooltip>
|
||||
<el-table-column label="安装位置" show-overflow-tooltip>
|
||||
<template #default="scope">{{ scope.row.place }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="维修记录" show-overflow-tooltip>
|
||||
|
|
|
@ -152,8 +152,8 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="存放位置">
|
||||
<el-input v-model="form.place" placeholder="存放位置" />
|
||||
<el-form-item label="安装位置">
|
||||
<el-input v-model="form.place" placeholder="安装位置" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="生产厂家" prop="factory" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="检定日期" prop="check_date" ></el-table-column>
|
||||
<el-table-column label="检定/校准" prop="check_date" ></el-table-column>
|
||||
<el-table-column label="检定周期/月" prop="cycle" width="70">
|
||||
</el-table-column>
|
||||
<el-table-column label="设备状态" width="70">
|
||||
|
@ -98,7 +98,7 @@
|
|||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="下次检定日期" prop="next_check_date" width="70">
|
||||
<el-table-column label="下次检定/校准" prop="next_check_date" width="70">
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" show-overflow-tooltip>
|
||||
<template #default="scope">{{ scope.row.description }}</template>
|
||||
|
@ -162,7 +162,7 @@
|
|||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="设备名称" prop="equipment_name" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="检定日期" prop="check_date">
|
||||
<el-table-column label="检定/校准" prop="check_date">
|
||||
</el-table-column>
|
||||
<el-table-column label="检定结果" prop="result">
|
||||
<template #default="scope">
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
v-model="typeRadio"
|
||||
@change="typeRadioChange"
|
||||
>
|
||||
<!-- <el-radio-button label="day">本日</el-radio-button> -->
|
||||
<el-radio-button label="day">小时</el-radio-button>
|
||||
<el-radio-button label="month"
|
||||
>按日</el-radio-button
|
||||
>
|
||||
|
@ -128,14 +128,14 @@
|
|||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="chartWrap" v-show="typeRadio == 'day'">
|
||||
<div class="chartWrap" v-show="typeRadio == 'day'">
|
||||
<div class="chartTitle">本日生产参数统计图</div>
|
||||
<scEcharts
|
||||
height="400px"
|
||||
width="1033px"
|
||||
:option="optionHour"
|
||||
></scEcharts>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="chartWrap" v-show="typeRadio == 'month'">
|
||||
<div class="chartTitle">本月生产参数统计图</div>
|
||||
<scEcharts
|
||||
|
@ -208,6 +208,20 @@ let legend = {
|
|||
top: "2%",
|
||||
data: ["煤磨总产量", "煤磨台时产量", "煤磨运转率", "煤磨分布电耗"],
|
||||
};
|
||||
let legend_hour = {
|
||||
selector: [
|
||||
{
|
||||
type: 'all',
|
||||
title: '全选'
|
||||
},
|
||||
{
|
||||
type: 'inverse',
|
||||
title: '反选'
|
||||
}
|
||||
],
|
||||
top: "2%",
|
||||
data: ["煤磨总产量", "煤磨分布电耗"],
|
||||
};
|
||||
let yAxis = [
|
||||
{
|
||||
type: "value",
|
||||
|
@ -276,6 +290,40 @@ let yAxis = [
|
|||
},
|
||||
},
|
||||
];
|
||||
let yAxis_hour = [
|
||||
{
|
||||
type: "value",
|
||||
name: "产量 (t)",
|
||||
position: "left",
|
||||
alignTicks: true,
|
||||
nameRotate: 50,
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: colors[0],
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
formatter: "{value}",
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "value",
|
||||
name: "煤磨分布电耗(kW·h/t)",
|
||||
position: "right",
|
||||
alignTicks: true,
|
||||
nameRotate: 50,
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: colors[3],
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
formatter: "{value}",
|
||||
},
|
||||
},
|
||||
];
|
||||
import scEcharts from "@/components/scEcharts";
|
||||
import { defineAsyncComponent } from "vue";
|
||||
export default {
|
||||
|
@ -288,7 +336,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
searchDate: "",
|
||||
typeRadio: "month",
|
||||
typeRadio: "day",
|
||||
chartShow: false,
|
||||
myOption: null,
|
||||
optionHour: {},
|
||||
|
@ -323,7 +371,7 @@ export default {
|
|||
tooltip: tooltip,
|
||||
grid: grid,
|
||||
toolbox: toolbox,
|
||||
legend: legend,
|
||||
legend: legend_hour,
|
||||
xAxis: {
|
||||
axisTick: {
|
||||
show: true,
|
||||
|
@ -346,7 +394,7 @@ export default {
|
|||
"十二月",
|
||||
],
|
||||
},
|
||||
yAxis: yAxis,
|
||||
yAxis: yAxis_hour,
|
||||
series: [
|
||||
{
|
||||
name: "煤磨总产量",
|
||||
|
@ -355,23 +403,12 @@ export default {
|
|||
data: [],
|
||||
},
|
||||
{
|
||||
name: "煤磨台时产量",
|
||||
name: "煤磨分布电耗",
|
||||
type: "bar",
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "煤磨运转率",
|
||||
type: "line",
|
||||
yAxisIndex: 2,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "煤磨分布电耗",
|
||||
type: "bar",
|
||||
yAxisIndex: 3,
|
||||
data: [],
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
option2: {
|
||||
|
@ -757,19 +794,18 @@ export default {
|
|||
seriesData2 = [],
|
||||
seriesData3 = [];
|
||||
let data = response;
|
||||
console.log('data---------------------',data);
|
||||
data.forEach((item) => {
|
||||
let ind = item.hour;
|
||||
seriesData0[ind] = item.total_production; //总产量
|
||||
seriesData1[ind] = item.production_hour; //台时产量
|
||||
seriesData2[ind] = item.run_rate; //运转率
|
||||
// seriesData1[ind] = item.production_hour; //台时产量
|
||||
// seriesData2[ind] = item.run_rate; //运转率
|
||||
seriesData3[ind] = item.elec_consume_unit; //分布电耗
|
||||
});
|
||||
let options = { ...that.option1 };
|
||||
options.series[0].data = seriesData0;
|
||||
options.series[1].data = seriesData1;
|
||||
options.series[2].data = seriesData2;
|
||||
options.series[3].data = seriesData3;
|
||||
// options.series[1].data = seriesData1;
|
||||
// options.series[2].data = seriesData2;
|
||||
options.series[1].data = seriesData3;
|
||||
let hourXAxis = [];
|
||||
for (let i = 0; i < 24; i++) {
|
||||
let item = i + "时";
|
||||
|
|
|
@ -269,13 +269,13 @@ export default {
|
|||
const index = sortedData.findIndex(obj => parseFloat(obj.elec) === parseFloat(itemValue));
|
||||
let elec_score = 0;
|
||||
if (index === 0){
|
||||
elec_score= 15;
|
||||
} else if (index === 1) {
|
||||
elec_score= 10;
|
||||
} else if (index === 2) {
|
||||
elec_score= 8;
|
||||
} else if (index === 3) {
|
||||
elec_score= 5;
|
||||
} else if (index === 1) {
|
||||
elec_score= 8;
|
||||
} else if (index === 2) {
|
||||
elec_score= 10;
|
||||
} else if (index === 3) {
|
||||
elec_score= 15;
|
||||
}
|
||||
arr[15] += elec_score;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">
|
||||
煤磨工序车间单位产品电耗月度分析表
|
||||
粉磨分布电耗月度分析表
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -149,17 +149,18 @@ export default {
|
|||
|
||||
ress.forEach((goal) => {
|
||||
monthGoal[0] = goal.goal_val;
|
||||
monthGoal[1] = goal.goal_val_2;
|
||||
monthGoal[2] = goal.goal_val_3;
|
||||
monthGoal[3] = goal.goal_val_4;
|
||||
monthGoal[4] = goal.goal_val_5;
|
||||
monthGoal[5] = goal.goal_val_6;
|
||||
monthGoal[6] = goal.goal_val_7;
|
||||
monthGoal[7] = goal.goal_val_8;
|
||||
monthGoal[8] = goal.goal_val_9;
|
||||
monthGoal[9] = goal.goal_val_10;
|
||||
monthGoal[10] = goal.goal_val_11;
|
||||
monthGoal[11] = goal.goal_val_12;
|
||||
monthGoal[1] = goal.goal_val_1;
|
||||
monthGoal[2] = goal.goal_val_2;
|
||||
monthGoal[3] = goal.goal_val_3;
|
||||
monthGoal[4] = goal.goal_val_4;
|
||||
monthGoal[5] = goal.goal_val_5;
|
||||
monthGoal[6] = goal.goal_val_6;
|
||||
monthGoal[7] = goal.goal_val_7;
|
||||
monthGoal[8] = goal.goal_val_8;
|
||||
monthGoal[9] = goal.goal_val_9;
|
||||
monthGoal[10] = goal.goal_val_10;
|
||||
monthGoal[11] = goal.goal_val_11;
|
||||
monthGoal[12] = goal.goal_val_12;
|
||||
});
|
||||
}
|
||||
this.getData(monthGoal);
|
||||
|
|
|
@ -0,0 +1,928 @@
|
|||
<!-- 全厂水量统计 -->
|
||||
<template>
|
||||
<div class="app-container" id="app-container" style="height: 50%">
|
||||
<el-header id="app-header">
|
||||
<div class="left-panel">
|
||||
<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="daterange"
|
||||
type="datetimerange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
format="YYYY-MM-DD HH"
|
||||
popper-class="tpc"
|
||||
v-if="query.type==3"
|
||||
@change="changeDate"/>
|
||||
|
||||
<el-date-picker
|
||||
v-model="query.day"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
placeholder="天"
|
||||
v-if="query.type==0"
|
||||
style="margin-right: 6px"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="query.month"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
format="YYYY-MM"
|
||||
placeholder="查询月份"
|
||||
v-if="query.type==1"
|
||||
class="headerSearch"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="query.year"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
format="YYYY"
|
||||
placeholder="查询年份"
|
||||
v-if="query.type==2"
|
||||
class="headerSearch"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="dateChange"
|
||||
></el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading="exportLoading"
|
||||
v-auth="'export_excel'"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handlePrint">打印 </el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<el-card>
|
||||
<div>
|
||||
<div ref="print" id="myReport" class="printContainer">
|
||||
<el-table
|
||||
v-if="query.type==0"
|
||||
id="hourBaseTable"
|
||||
:data="tableDatas2"
|
||||
style="width: 100%"
|
||||
border
|
||||
:height="tableHeight"
|
||||
@cell-click="handleCellClick"
|
||||
>
|
||||
<el-table-column
|
||||
label="分类"
|
||||
prop="nickname"
|
||||
width="110"
|
||||
fixed
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" prop="unit" fixed>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="(item, index) in 24"
|
||||
:key="item"
|
||||
:label="index + '时'"
|
||||
:prop="index + '时'"
|
||||
width="120"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="合计"
|
||||
prop="sum"
|
||||
width="130"
|
||||
fixed="right"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table
|
||||
v-if="query.type==1"
|
||||
id="hourBaseTable"
|
||||
:data="tableDatas_day"
|
||||
style="width: 100%"
|
||||
border
|
||||
:height="tableHeight"
|
||||
@cell-click="handleCellClick1"
|
||||
>
|
||||
<el-table-column
|
||||
label="分类"
|
||||
prop="nickname"
|
||||
width="110"
|
||||
fixed
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" prop="unit" fixed>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="item in xAxisData_day"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:prop="item"
|
||||
width="120"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="合计"
|
||||
prop="sum"
|
||||
width="130"
|
||||
fixed="right"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table
|
||||
v-if="query.type==2"
|
||||
id="hourBaseTable"
|
||||
:data="tableDatas_month"
|
||||
style="width: 100%"
|
||||
border
|
||||
:height="tableHeight"
|
||||
@cell-click="handleCellClick_month"
|
||||
>
|
||||
<el-table-column
|
||||
label="分类"
|
||||
prop="nickname"
|
||||
width="110"
|
||||
fixed
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" prop="unit" fixed>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="item in months"
|
||||
:key="item"
|
||||
:label="item + '月'"
|
||||
:prop="item + '月'"
|
||||
width="120"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="合计"
|
||||
prop="sum"
|
||||
width="130"
|
||||
fixed="right"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table
|
||||
v-if="query.type==3"
|
||||
id="hourBaseTable"
|
||||
:data="tableDatas_range"
|
||||
style="width: 100%"
|
||||
border
|
||||
:height="tableHeight"
|
||||
@cell-click="handleCellClick_range"
|
||||
>
|
||||
<el-table-column
|
||||
label="分类"
|
||||
prop="mpoint__nickname"
|
||||
fixed
|
||||
align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" prop="mpoint__unit" fixed align="center">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label = "总碳排放量" prop="total_val" fixed align="center">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="chartWrap" v-show="query.type==0">
|
||||
<div class="chartTitle">本日生产参数统计图</div>
|
||||
<scEcharts
|
||||
height="400px"
|
||||
width="1500px"
|
||||
:option="optionHour"
|
||||
></scEcharts>
|
||||
</div> -->
|
||||
<div class="chartWrap" v-show="query.type==1">
|
||||
<div class="chartTitle">本月生产参数统计图</div>
|
||||
<scEcharts
|
||||
height="400px"
|
||||
width="1500px"
|
||||
:option="optionDay"
|
||||
></scEcharts>
|
||||
</div>
|
||||
<div class="chartWrap" v-show="query.type==2">
|
||||
<div class="chartTitle">本年生产参数统计图</div>
|
||||
<scEcharts
|
||||
height="400px"
|
||||
width="1500px"
|
||||
:option="optionMonth"
|
||||
></scEcharts>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-main>
|
||||
<el-dialog v-model="itemVisible" :title="itemChartTitle" width="1100px">
|
||||
<scEcharts
|
||||
height="400px"
|
||||
width="1033px"
|
||||
:option="option"
|
||||
></scEcharts>
|
||||
<template #footer>
|
||||
<slot name="footer"></slot>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
let legend = {
|
||||
top: "2%",
|
||||
data: ["碳排放量(t)"],
|
||||
};
|
||||
let colors = ["##36492E", "#4BA328", "#C6F47D"];
|
||||
import scEcharts from "@/components/scEcharts";
|
||||
export default {
|
||||
components: {
|
||||
scEcharts,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
days: 30,
|
||||
day: "",
|
||||
year: "",
|
||||
month: "",
|
||||
daterange:[],
|
||||
search_date: "",
|
||||
query:{
|
||||
type:1,
|
||||
day:'',
|
||||
year:'',
|
||||
month:'',
|
||||
yearStart:'',
|
||||
start_time:'',
|
||||
end_time:'',
|
||||
},
|
||||
mgroupObj: {},
|
||||
indexList: [],
|
||||
mpointList: [],
|
||||
tableDatas: [],
|
||||
optionHour: {},
|
||||
optionDay: {},
|
||||
optionMonth: {},
|
||||
options: [
|
||||
{id:1,name:'月统计'},
|
||||
{id:2,name:'年统计'},
|
||||
{id:3,name:'时间段'},
|
||||
],
|
||||
tableDatas2: [],
|
||||
tableDatas_day:[],
|
||||
tableDatas_range:[],
|
||||
tableDatas_month:[],
|
||||
months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
||||
hours: [
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
|
||||
19, 20, 21, 22, 23, 24,
|
||||
],
|
||||
tableHeight: 600,
|
||||
itemChartTitle: "",
|
||||
itemChartData: [],
|
||||
itemChartXData: [],
|
||||
itemChartYData: [],
|
||||
itemChartLegend: [],
|
||||
itemChartSeries: [],
|
||||
timeStamp: null,
|
||||
itemVisible: false,
|
||||
exportLoading: false,
|
||||
tableName: "全厂电量小时统计",
|
||||
sourceData: {},
|
||||
option: {
|
||||
title: {
|
||||
x: "center",
|
||||
},
|
||||
grid: {
|
||||
top: "20%",
|
||||
left: "3%",
|
||||
right: "10%",
|
||||
bottom: "5%",
|
||||
containLabel: true,
|
||||
},
|
||||
legend: {
|
||||
orient: "horizontal",
|
||||
x: "right",
|
||||
y: "10",
|
||||
data: [],
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: [],
|
||||
name: "时间",
|
||||
|
||||
nameTextStyle: {
|
||||
fontWeight: 600,
|
||||
fontSize: 14,
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#3366CC",
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
rotate: 45,
|
||||
interval: 0,
|
||||
},
|
||||
boundaryGap: false,
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
name: "对象值",
|
||||
nameTextStyle: {
|
||||
fontWeight: 500,
|
||||
fontSize: 14,
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#3366CC",
|
||||
},
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
type: "cross",
|
||||
axis: "auto",
|
||||
snap: true,
|
||||
},
|
||||
showContent: true,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "",
|
||||
data: [],
|
||||
type: "line",
|
||||
symbolSize: 8,
|
||||
symbol: "circle",
|
||||
smooth: 0.5,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
label: {
|
||||
show: true,
|
||||
},
|
||||
lineStyle: {
|
||||
width: 1,
|
||||
type: "dotted",
|
||||
color: "#3366CC",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
xAxisData: [],
|
||||
xAxisData_day: [],
|
||||
xAxisData_month: [],
|
||||
xTtimeRange: [],
|
||||
gyhourlyData : [],
|
||||
lvhourlyData : [],
|
||||
shhourlyData : [], // 用于存储每小时的数据
|
||||
gyhourlyData_month : [],
|
||||
lvhourlyData_month : [],
|
||||
shhourlyData_month : [], // 用于存储每小时的数据
|
||||
gyhourlyData_year : [],
|
||||
lvhourlyData_year : [],
|
||||
shhourlyData_year : [], // 用于存储每小时的数据
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
var nowDate = new Date();
|
||||
let year = nowDate.getFullYear();
|
||||
let month = nowDate.getMonth() + 1;
|
||||
let day = nowDate.getDate();
|
||||
that.timeStamp = nowDate.getTime();
|
||||
that.days = new Date(year, month, 0).getDate();
|
||||
that.day = day;
|
||||
that.year = year;
|
||||
that.month = month;
|
||||
for (let n = 0; n < 24; n++) {
|
||||
that.xAxisData.push(n + "时");
|
||||
}
|
||||
that.timeStamp = nowDate.getTime();
|
||||
that.headerLength = that.days + 4;
|
||||
that.tableWidth = that.headerLength * 100 + "";
|
||||
for (let n = 1; n < 13; n++) {
|
||||
that.xAxisData_month.push(n + "月");
|
||||
}
|
||||
for (let n = 1; n <= that.days; n++) {
|
||||
that.xAxisData_day.push(n + "日");
|
||||
}
|
||||
let colors = ["##36492E", "#4BA328", "#C6F47D"];
|
||||
this.getMPoints();
|
||||
let heightContainer =
|
||||
document.getElementById("app-container").clientHeight;
|
||||
let heightHeader = document.getElementById("app-header").clientHeight;
|
||||
let heightTable = heightContainer - heightHeader - 35;
|
||||
that.tableHeight = heightTable;
|
||||
},
|
||||
methods: {
|
||||
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
let that = this;
|
||||
if (columnIndex == 0) {
|
||||
if (that.indexList.indexOf(rowIndex) > -1) {
|
||||
let rowspans = that.mgroupObj[row.mgroupName];
|
||||
return {
|
||||
rowspan: rowspans,
|
||||
colspan: 1,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
rowspan: 1,
|
||||
colspan: 0,
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
changeDate(){
|
||||
let obj = {};
|
||||
obj.type = "day";
|
||||
obj.start_time = this.daterange[0];
|
||||
obj.end_time = this.daterange[1];
|
||||
obj.mpoint__in = "3750125939653558272";
|
||||
obj.page = 0;
|
||||
this.$API.enm.mpointstat.groupValues.req(obj).then((res) => {
|
||||
//处理res数组中的 total_val 字段 保留两位
|
||||
res.forEach(item => {
|
||||
item.total_val = Number(item.total_val).toFixed(2);
|
||||
});
|
||||
this.tableDatas_range = res;
|
||||
});
|
||||
},
|
||||
dateChange() {
|
||||
let that = this;
|
||||
that.tableDatas = [];
|
||||
let arr = [];
|
||||
if(that.query.type==0){//日
|
||||
arr = that.query.day.split('-');
|
||||
that.year = Number(arr[0]);
|
||||
that.month = Number(arr[1]);
|
||||
that.day = Number(arr[2]);
|
||||
that.dataLoop();
|
||||
}else if(that.query.type==1){//月
|
||||
let arr = that.query.month.split('-');
|
||||
that.year = Number(arr[0]);
|
||||
that.month = Number(arr[1]);
|
||||
that.days = new Date(that.year, that.month, 0).getDate();
|
||||
that.xAxisData_day = [];
|
||||
for (let n = 1; n <= that.days; n++) {
|
||||
that.xAxisData_day.push(n + "日");
|
||||
}
|
||||
that.dataLoop1();
|
||||
}else if (that.query.type==2){
|
||||
that.year = that.query.year;
|
||||
that.dataLoop_month();
|
||||
}else if(that.query.type==3){//时间段
|
||||
that.xTtimeRange.push("总计")
|
||||
}
|
||||
let nowDate = new Date();
|
||||
that.timeStamp = nowDate.getTime();
|
||||
// that.getLengthData();
|
||||
},
|
||||
getMPoints() {
|
||||
let that = this;
|
||||
that.$API.enm.mpoint.list
|
||||
.req({
|
||||
page: 0,
|
||||
// enabled: 1,
|
||||
// need_display: 1,
|
||||
ordering: "report_sortstr",
|
||||
code__in: "tpfl",
|
||||
query: "{ id, name, nickname, mgroup_name, unit, report_sortstr }",
|
||||
})
|
||||
.then((res) => {
|
||||
// that.mpointList = that.mockDatas.filter((item) => {
|
||||
that.mpointList = res
|
||||
that.dataLoop();
|
||||
});
|
||||
},
|
||||
dataLoop() {
|
||||
let that = this;
|
||||
that.tableDatas = [];
|
||||
that.tableDatas2 = [];
|
||||
let _mgroup = [],
|
||||
_nameLength = [],
|
||||
indexList = [];
|
||||
let mgroupObj = {};
|
||||
that.mpointList.forEach((item, index) => {
|
||||
let indexs = _mgroup.indexOf(item.mgroup_name);
|
||||
if (indexs > -1) {
|
||||
_nameLength[indexs] += 1;
|
||||
} else {
|
||||
_mgroup.push(item.mgroup_name);
|
||||
_nameLength.push(1);
|
||||
indexList.push(index);
|
||||
}
|
||||
|
||||
for (let i = 0; i < _mgroup.length; i++) {
|
||||
mgroupObj[_mgroup[i]] = _nameLength[i];
|
||||
}
|
||||
let arr = [];
|
||||
arr[0] =
|
||||
item.mgroup_name != null ? item.mgroup_name : item.name;
|
||||
arr[1] = item.nickname != null ? item.nickname : item.name;
|
||||
arr[2] = item.unit;
|
||||
for (let i = 0; i < 24; i++) {
|
||||
arr[i + 3] = 0;
|
||||
}
|
||||
that.tableDatas.push(arr);
|
||||
let obj = {};
|
||||
obj.mgroupName =
|
||||
item.mgroup_name != null ? item.mgroup_name : item.name;
|
||||
obj.nickname =
|
||||
item.nickname != null && item.nickname != ""
|
||||
? item.nickname
|
||||
: item.name;
|
||||
obj.unit = item.unit;
|
||||
that.tableDatas2.push(obj);
|
||||
that.getData(item.id, index);
|
||||
});
|
||||
that.updateChart(that.gyhourlyData, that.shhourlyData, that.lvhourlyData);
|
||||
that.mgroupObj = mgroupObj;
|
||||
that.indexList = indexList;
|
||||
},
|
||||
getData(id, index) {
|
||||
let that = this;
|
||||
let obj = {};
|
||||
obj.type = "hour";
|
||||
obj.year = that.year;
|
||||
obj.month = that.month;
|
||||
obj.day = that.day;
|
||||
obj.mpoint = id;
|
||||
obj.page = 0;
|
||||
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||
let sum = 0;
|
||||
res.forEach((item) => {
|
||||
let ind = item.hour + 3;
|
||||
that.tableDatas[index][ind] = item.val;
|
||||
sum += Number(item.val);
|
||||
let keyName = item.hour + "时";
|
||||
that.tableDatas2[index][keyName] = item.val;
|
||||
if (item.mpoint_nickname == "碳排放量"){
|
||||
that.gyhourlyData[item.hour] = item.val;
|
||||
}
|
||||
});
|
||||
sum = sum * 100;
|
||||
sum = Math.round(sum);
|
||||
sum = sum / 100;
|
||||
that.tableDatas[index][27] = sum.toFixed(2);
|
||||
that.tableDatas2[index].sum = sum.toFixed(2);
|
||||
|
||||
that.$forceUpdate();
|
||||
});
|
||||
},
|
||||
updateChart(gyhourlyData, shhourlyData, lvhourlyData) {
|
||||
let that = this;
|
||||
// 创建 ECharts 配置
|
||||
let option = {
|
||||
legend: legend,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: ['0时', '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '21时', '22时', '23时'],
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: ''
|
||||
},
|
||||
series: [{
|
||||
name: '工业水(t)', // 此处修改为对应分类的名称
|
||||
type: 'bar',
|
||||
data: gyhourlyData, // 每小时的用水量
|
||||
itemStyle: {
|
||||
color: '#518A3A',
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
name: '绿化水(t)', // 此处修改为对应分类的名称
|
||||
type: 'bar',
|
||||
data: lvhourlyData, // 每小时的用水量
|
||||
itemStyle: {
|
||||
color: '#DCE6CB',
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
name: '生活水(t)', // 此处修改为对应分类的名称
|
||||
type: 'bar',
|
||||
data: shhourlyData, // 每小时的用水量
|
||||
itemStyle: {
|
||||
color: '#93F607',
|
||||
},
|
||||
|
||||
},
|
||||
]
|
||||
};
|
||||
that.optionHour = option;
|
||||
},
|
||||
dataLoop1() {
|
||||
let that = this;
|
||||
that.tableDatas = [];
|
||||
that.tableDatas_day = [];
|
||||
let _mgroup = [],
|
||||
_nameLength = [],
|
||||
indexList = [];
|
||||
let mgroupObj = {};
|
||||
that.mpointList.forEach((item, index) => {
|
||||
let indexs = _mgroup.indexOf(item.mgroup_name);
|
||||
if (indexs > -1) {
|
||||
_nameLength[indexs] += 1;
|
||||
} else {
|
||||
_mgroup.push(item.mgroup_name);
|
||||
_nameLength.push(1);
|
||||
indexList.push(index);
|
||||
}
|
||||
|
||||
for (let i = 0; i < _mgroup.length; i++) {
|
||||
mgroupObj[_mgroup[i]] = _nameLength[i];
|
||||
}
|
||||
let arr = [];
|
||||
arr[0] =
|
||||
item.mgroup_name != null
|
||||
? item.mgroup_name
|
||||
: item.nickname != null
|
||||
? item.nickname
|
||||
: item.name;
|
||||
arr[1] = item.nickname != null ? item.nickname : item.name;
|
||||
arr[2] = item.unit;
|
||||
for (let i = 0; i < that.days; i++) {
|
||||
arr[i + 2] = 0;
|
||||
}
|
||||
that.tableDatas.push(arr);
|
||||
let obj = {};
|
||||
obj.mgroupName =
|
||||
item.mgroup_name != null ? item.mgroup_name : item.name;
|
||||
obj.nickname =
|
||||
item.nickname != null && item.nickname != ""
|
||||
? item.nickname
|
||||
: item.name;
|
||||
obj.unit = item.unit;
|
||||
|
||||
that.tableDatas_day.push(obj);
|
||||
that.getData1(item.id, index);
|
||||
});
|
||||
that.updateMonthChart(that.gyhourlyData_month);
|
||||
that.mgroupObj = mgroupObj;
|
||||
that.indexList = indexList;
|
||||
|
||||
},
|
||||
|
||||
updateMonthChart(gyhourlyData) {
|
||||
let that = this;
|
||||
// 创建 ECharts 配置
|
||||
let option1 = {
|
||||
legend: legend,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: [],
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: ''
|
||||
},
|
||||
series: [{
|
||||
name: '碳排放量(t)', // 此处修改为对应分类的名称
|
||||
type: 'bar',
|
||||
data: gyhourlyData, // 每小时的用水量
|
||||
itemStyle: {
|
||||
color: '#518A3A',
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
]
|
||||
};
|
||||
option1.xAxis.data = that.xAxisData_day;
|
||||
that.optionDay = option1;
|
||||
},
|
||||
getData1(id, index) {
|
||||
let that = this;
|
||||
let obj = {};
|
||||
obj.type = "day";
|
||||
obj.year = that.year;
|
||||
obj.month = that.month;
|
||||
obj.mpoint = id;
|
||||
obj.page = 0;
|
||||
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||
let sum = 0;
|
||||
res.forEach((item) => {
|
||||
let ind = item.day+2;
|
||||
that.tableDatas[index][ind] = item.val;
|
||||
sum += Number(item.val);
|
||||
let keyName = item.day + "日";
|
||||
that.tableDatas_day[index][keyName] = item.val;
|
||||
if (item.mpoint_nickname == "碳排放量"){
|
||||
that.gyhourlyData_month[item.day-1] = item.val;
|
||||
}
|
||||
});
|
||||
sum = sum * 100;
|
||||
sum = Math.round(sum);
|
||||
sum = sum / 100;
|
||||
let dayss = 0;
|
||||
dayss = this.days + 3;
|
||||
that.tableDatas[index][dayss] = sum.toFixed(2);
|
||||
that.tableDatas_day[index].sum = sum.toFixed(2);
|
||||
that.$forceUpdate();
|
||||
});
|
||||
},
|
||||
dataLoop_month() {
|
||||
let that = this;
|
||||
that.tableDatas = [];
|
||||
that.tableDatas_month = [];
|
||||
let _mgroup = [],
|
||||
_nameLength = [],
|
||||
indexList = [];
|
||||
let mgroupObj = {};
|
||||
that.mpointList.forEach((item, index) => {
|
||||
let indexs = _mgroup.indexOf(item.mgroup_name);
|
||||
if (indexs > -1) {
|
||||
_nameLength[indexs] += 1;
|
||||
} else {
|
||||
_mgroup.push(item.mgroup_name);
|
||||
_nameLength.push(1);
|
||||
indexList.push(index);
|
||||
}
|
||||
|
||||
for (let i = 0; i < _mgroup.length; i++) {
|
||||
mgroupObj[_mgroup[i]] = _nameLength[i];
|
||||
}
|
||||
let arr = [];
|
||||
arr[0] =
|
||||
item.mgroup_name != null ? item.mgroup_name : item.name;
|
||||
arr[1] = item.nickname != null ? item.nickname : item.name;
|
||||
arr[2] = item.unit;
|
||||
for (let i = 0; i < 12; i++) {
|
||||
arr[i + 3] = 0;
|
||||
}
|
||||
that.tableDatas.push(arr);
|
||||
let obj = {};
|
||||
obj.mgroupName =
|
||||
item.mgroup_name != null ? item.mgroup_name : item.name;
|
||||
obj.nickname =
|
||||
item.nickname != null && item.nickname != ""
|
||||
? item.nickname
|
||||
: item.name;
|
||||
obj.unit = item.unit;
|
||||
that.tableDatas_month.push(obj);
|
||||
that.getData_month(item.id, index);
|
||||
});
|
||||
that.updateMonthChart_month(that.gyhourlyData_year, that.shhourlyData_year, that.lvhourlyData_year);
|
||||
that.mgroupObj = mgroupObj;
|
||||
that.indexList = indexList;
|
||||
},
|
||||
updateMonthChart_month(gyhourlyData) {
|
||||
let that = this;
|
||||
let option2 = {
|
||||
legend: legend,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: [],
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: ''
|
||||
},
|
||||
series: [{
|
||||
name: '工业水', // 此处修改为对应分类的名称
|
||||
type: 'bar',
|
||||
data: gyhourlyData, // 每小时的用水量
|
||||
itemStyle: {
|
||||
color: '#518A3A',
|
||||
},
|
||||
|
||||
}
|
||||
]
|
||||
};
|
||||
option2.xAxis.data = that.xAxisData_month;
|
||||
that.optionMonth = option2;
|
||||
},
|
||||
getData_month(id, index) {
|
||||
let that = this;
|
||||
let obj = {};
|
||||
obj.type = "month";
|
||||
obj.year = that.year;
|
||||
obj.mpoint = id;
|
||||
obj.page = 0;
|
||||
this.$API.enm.mpoint.stat.req(obj).then((res) => {
|
||||
let sum = 0;
|
||||
res.forEach((item) => {
|
||||
let ind = item.month + 2;
|
||||
that.tableDatas[index][ind] = item.val;
|
||||
sum += Number(item.val);
|
||||
let keyName = item.month + "月";
|
||||
that.tableDatas_month[index][keyName] = item.val;
|
||||
if (item.mpoint_nickname == "碳排放量"){
|
||||
that.gyhourlyData_year[item.month-1] = item.val;
|
||||
}
|
||||
});
|
||||
sum = sum * 100;
|
||||
sum = Math.round(sum);
|
||||
sum = sum / 100;
|
||||
that.tableDatas[index][15] = sum.toFixed(2);
|
||||
that.tableDatas_month[index].sum = sum.toFixed(2);
|
||||
that.$forceUpdate();
|
||||
});
|
||||
},
|
||||
|
||||
handleCellClick(row, column, cell, event) {
|
||||
let that = this;
|
||||
console.log("row", row);
|
||||
console.log("column", column);
|
||||
console.log("cell", cell);
|
||||
let index = that.tableDatas2.indexOf(row);
|
||||
console.log(index, "index");
|
||||
let lineData = that.tableDatas[index].slice(2, 26);
|
||||
that.option.xAxis.data = that.xAxisData;
|
||||
that.option.series[0].data = lineData;
|
||||
this.itemVisible = true;
|
||||
},
|
||||
handleCellClick1(row, column, cell, event) {
|
||||
let that = this;
|
||||
let index = that.tableDatas_day.indexOf(row);
|
||||
console.log('row', row)
|
||||
that.tableName = `${row.nickname}-电量日统计`
|
||||
let lineData = that.tableDatas[index].slice(3, that.days + 3);
|
||||
that.option.xAxis.data = that.xAxisData_day;
|
||||
that.option.series[0].data = lineData;
|
||||
this.itemVisible = true;
|
||||
},
|
||||
handleCellClick_month(row, column, cell, event) {
|
||||
let that = this;
|
||||
let index = that.tableDatas_month.indexOf(row);
|
||||
that.tableName = `${row.nickname}-电量日统计`
|
||||
//获取图数据
|
||||
let lineData = that.tableDatas[index].slice(2, 13);
|
||||
that.option.xAxis.data = that.xAxisData_month;
|
||||
that.option.series[0].data = lineData;
|
||||
this.itemVisible = true;
|
||||
},
|
||||
handleCellClick_range(row, column, cell, event) {
|
||||
let that = this;
|
||||
let index = that.tableDatas_range.indexOf(row);
|
||||
// that.tableName = `${row.nickname}-电量范围统计`
|
||||
//获取图数据
|
||||
// let lineData = that.tableDatas[index].slice(2, 3);
|
||||
// that.option.xAxis.data = that.xAxisData_month;
|
||||
// that.option.series[0].data = lineData;
|
||||
this.itemVisible = true;
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX("#hourBaseTable", this.tableName);
|
||||
this.exportLoading = false;
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT("#myReport");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.printWrap {
|
||||
width: 100%;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.printContainer {
|
||||
width: 100%;
|
||||
}
|
||||
.chartTitle{
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
.chartWrap {
|
||||
width: 1500px;
|
||||
margin-top: 20px;
|
||||
border: 1px solid #eeeeee;
|
||||
}
|
||||
</style>
|
|
@ -225,7 +225,7 @@
|
|||
class="numCell"
|
||||
v-if="reportItem.出窑熟料_立升重_rate_pass"
|
||||
>
|
||||
{{reportItem.出窑熟料_立升重_rate_pass *100}}
|
||||
{{(reportItem.出窑熟料_立升重_rate_pass *100).toFixed(2)}}
|
||||
</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">熟料f-CaO合格率(%)</td>
|
||||
|
@ -233,7 +233,7 @@
|
|||
class="numCell"
|
||||
v-if="reportItem.出窑熟料_fCaO_rate_pass"
|
||||
>
|
||||
{{reportItem.出窑熟料_fCaO_rate_pass*100}}
|
||||
{{(reportItem.出窑熟料_fCaO_rate_pass*100).toFixed(2)}}
|
||||
</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
|
@ -243,7 +243,7 @@
|
|||
class="numCell"
|
||||
v-if="reportItem.入窑生料_CaO_rate_pass"
|
||||
>
|
||||
{{reportItem.入窑生料_CaO_rate_pass * 100}}
|
||||
{{(reportItem.入窑生料_CaO_rate_pass * 100).toFixed(2)}}
|
||||
</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">
|
||||
|
@ -253,7 +253,7 @@
|
|||
class="numCell"
|
||||
v-if="reportItem.入窑生料_Fe2O3_rate_pass"
|
||||
>
|
||||
{{reportItem.入窑生料_Fe2O3_rate_pass *100}}
|
||||
{{(reportItem.入窑生料_Fe2O3_rate_pass *100).toFixed(2)}}
|
||||
</td>
|
||||
|
||||
<td class="numCell" v-else>0</td>
|
||||
|
|
|
@ -325,7 +325,7 @@ let legend = {
|
|||
}
|
||||
],
|
||||
top: "2%",
|
||||
width: "400px",
|
||||
width: "500px",
|
||||
data: [
|
||||
"回转窑总产量",
|
||||
"台时产量",
|
||||
|
@ -493,7 +493,7 @@ export default {
|
|||
tooltip: tooltip,
|
||||
grid: grid,
|
||||
toolbox: toolbox,
|
||||
legend: Object.assign(legend, {data: ["回转窑总产量", "台时产量","回转窑运转率", "熟料分布电耗", "熟料标煤耗", "熟料单位成本"]}),
|
||||
legend: Object.assign(legend, {data: ["回转窑总产量", "熟料分布电耗", "熟料标煤耗", "熟料单位成本"]}),
|
||||
xAxis: {
|
||||
axisTick: {
|
||||
show: true,
|
||||
|
|
|
@ -371,13 +371,13 @@ export default {
|
|||
const index = sortedData.findIndex(obj => parseFloat(obj.elec) === parseFloat(itemValue));
|
||||
let elec_score = 0;
|
||||
if (index === 0){
|
||||
elec_score= 15;
|
||||
} else if (index === 1) {
|
||||
elec_score= 10;
|
||||
} else if (index === 2) {
|
||||
elec_score= 8;
|
||||
} else if (index === 3) {
|
||||
elec_score= 5;
|
||||
} else if (index === 1) {
|
||||
elec_score= 8;
|
||||
} else if (index === 2) {
|
||||
elec_score= 10;
|
||||
} else if (index === 3) {
|
||||
elec_score= 15;
|
||||
}
|
||||
arr[29] += elec_score;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
>
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">车间单位产品电耗月度分析表</th>
|
||||
<th colspan="9">熟料分布电耗月度分析表</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>月份</th>
|
||||
|
@ -117,7 +117,7 @@
|
|||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="10">
|
||||
车间单位产品综合电耗月度分析表
|
||||
熟料单位产品综合电耗月度分析表
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -186,7 +186,7 @@
|
|||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="10">
|
||||
车间单位产品标煤耗月度分析表
|
||||
熟料单位产品标煤耗月度分析表
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -255,7 +255,7 @@
|
|||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="10">
|
||||
车间单位产品综合能耗月度分析表
|
||||
熟料单位产品综合能耗月度分析表
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -471,17 +471,17 @@ export default {
|
|||
goal.goal_cate_name == "单位产品分布电耗(kW·h/t)"
|
||||
) {
|
||||
monthGoal[0] = goal.goal_val;
|
||||
monthGoal[1] = goal.goal_val_2;
|
||||
monthGoal[2] = goal.goal_val_3;
|
||||
monthGoal[3] = goal.goal_val_4;
|
||||
monthGoal[4] = goal.goal_val_5;
|
||||
monthGoal[5] = goal.goal_val_6;
|
||||
monthGoal[6] = goal.goal_val_7;
|
||||
monthGoal[7] = goal.goal_val_8;
|
||||
monthGoal[8] = goal.goal_val_9;
|
||||
monthGoal[9] = goal.goal_val_10;
|
||||
monthGoal[10] = goal.goal_val_11;
|
||||
monthGoal[11] = goal.goal_val_12;
|
||||
monthGoal[1] = goal.goal_val_1;
|
||||
monthGoal[2] = goal.goal_val_2;
|
||||
monthGoal[3] = goal.goal_val_3;
|
||||
monthGoal[4] = goal.goal_val_4;
|
||||
monthGoal[5] = goal.goal_val_5;
|
||||
monthGoal[6] = goal.goal_val_6;
|
||||
monthGoal[7] = goal.goal_val_7;
|
||||
monthGoal[8] = goal.goal_val_8;
|
||||
monthGoal[9] = goal.goal_val_9;
|
||||
monthGoal[10] = goal.goal_val_10;
|
||||
monthGoal[11] = goal.goal_val_11;
|
||||
monthGoal[12] = goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
|
@ -489,33 +489,33 @@ export default {
|
|||
goal.goal_cate_name == "单位产品综合电耗(kW·h/t)"
|
||||
) {
|
||||
monthGoal2[0] = goal.goal_val;
|
||||
monthGoal2[1] = goal.goal_val_2;
|
||||
monthGoal2[2] = goal.goal_val_3;
|
||||
monthGoal2[3] = goal.goal_val_4;
|
||||
monthGoal2[4] = goal.goal_val_5;
|
||||
monthGoal2[5] = goal.goal_val_6;
|
||||
monthGoal2[6] = goal.goal_val_7;
|
||||
monthGoal2[7] = goal.goal_val_8;
|
||||
monthGoal2[8] = goal.goal_val_9;
|
||||
monthGoal2[9] = goal.goal_val_10;
|
||||
monthGoal2[10] = goal.goal_val_11;
|
||||
monthGoal2[11] = goal.goal_val_12;
|
||||
monthGoal2[1] = goal.goal_val_1;
|
||||
monthGoal2[2] = goal.goal_val_2;
|
||||
monthGoal2[3] = goal.goal_val_3;
|
||||
monthGoal2[4] = goal.goal_val_4;
|
||||
monthGoal2[5] = goal.goal_val_5;
|
||||
monthGoal2[6] = goal.goal_val_6;
|
||||
monthGoal2[7] = goal.goal_val_7;
|
||||
monthGoal2[8] = goal.goal_val_8;
|
||||
monthGoal2[9] = goal.goal_val_9;
|
||||
monthGoal2[10] = goal.goal_val_10;
|
||||
monthGoal2[11] = goal.goal_val_11;
|
||||
monthGoal2[12] = goal.goal_val_12;
|
||||
that.monthGoal2 = monthGoal2;
|
||||
}
|
||||
if (goal.goal_cate_name == "单位产品标煤耗(kgce/t)") {
|
||||
monthGoal3[0] = goal.goal_val;
|
||||
monthGoal3[1] = goal.goal_val_2;
|
||||
monthGoal3[2] = goal.goal_val_3;
|
||||
monthGoal3[3] = goal.goal_val_4;
|
||||
monthGoal3[4] = goal.goal_val_5;
|
||||
monthGoal3[5] = goal.goal_val_6;
|
||||
monthGoal3[6] = goal.goal_val_7;
|
||||
monthGoal3[7] = goal.goal_val_8;
|
||||
monthGoal3[8] = goal.goal_val_9;
|
||||
monthGoal3[9] = goal.goal_val_10;
|
||||
monthGoal3[10] = goal.goal_val_11;
|
||||
monthGoal3[11] = goal.goal_val_12;
|
||||
monthGoal3[1] = goal.goal_val_1;
|
||||
monthGoal3[2] = goal.goal_val_2;
|
||||
monthGoal3[3] = goal.goal_val_3;
|
||||
monthGoal3[4] = goal.goal_val_4;
|
||||
monthGoal3[5] = goal.goal_val_5;
|
||||
monthGoal3[6] = goal.goal_val_6;
|
||||
monthGoal3[7] = goal.goal_val_7;
|
||||
monthGoal3[8] = goal.goal_val_8;
|
||||
monthGoal3[9] = goal.goal_val_9;
|
||||
monthGoal3[10] = goal.goal_val_10;
|
||||
monthGoal3[11] = goal.goal_val_11;
|
||||
monthGoal3[12] = goal.goal_val_12;
|
||||
that.monthGoal3 = monthGoal3;
|
||||
}
|
||||
|
|
|
@ -431,7 +431,7 @@ export default {
|
|||
tooltip: tooltip,
|
||||
grid: grid,
|
||||
toolbox: toolbox,
|
||||
legend: Object.assign(legend, {data: ["水泥磨总产量", "分布电耗", "水泥单位成本","水泥磨台时产量","水泥磨运转率"]}),
|
||||
legend: Object.assign(legend, {data: ["水泥磨总产量", "分布电耗", "水泥单位成本"]}),
|
||||
xAxis: {
|
||||
axisTick: {
|
||||
show: true,
|
||||
|
|
|
@ -285,13 +285,13 @@ export default {
|
|||
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;
|
||||
} else if (index === 1) {
|
||||
elec_score= 3;
|
||||
} else if (index === 2) {
|
||||
elec_score= 7;
|
||||
} else if (index === 3) {
|
||||
elec_score= 10;
|
||||
}
|
||||
arr[18] += elec_score;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="10">
|
||||
水泥粉磨工序车间单位产品电耗月度分析表
|
||||
水泥分布电耗月度分析表
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -50,14 +50,14 @@
|
|||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
<!-- <div class="right-panel">
|
||||
<div class="right-panel">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="table_add"
|
||||
v-auth="'feeset.create'"
|
||||
></el-button>
|
||||
</div> -->
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" :params="params" row-key="id">
|
||||
|
@ -210,7 +210,7 @@ export default {
|
|||
//删除
|
||||
async table_del(row) {
|
||||
var id = row.id;
|
||||
var res = await this.$API.mtm.mgroup.delete.req(id);
|
||||
var res = await this.$API.fim.feeset.delete.req(id);
|
||||
if (res.err_msg) {
|
||||
this.$message.error(res.err_msg);
|
||||
} else {
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">
|
||||
水泥包装工序车间单位产品电耗月度分析表
|
||||
包装工序分布电耗月度分析表
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -175,17 +175,17 @@ export default {
|
|||
goal.goal_cate_name == "单位产品分布电耗(kW·h/t)"
|
||||
) {
|
||||
monthGoal[0] = goal.goal_val;
|
||||
monthGoal[1] = goal.goal_val_2;
|
||||
monthGoal[2] = goal.goal_val_3;
|
||||
monthGoal[3] = goal.goal_val_4;
|
||||
monthGoal[4] = goal.goal_val_5;
|
||||
monthGoal[5] = goal.goal_val_6;
|
||||
monthGoal[6] = goal.goal_val_7;
|
||||
monthGoal[7] = goal.goal_val_8;
|
||||
monthGoal[8] = goal.goal_val_9;
|
||||
monthGoal[9] = goal.goal_val_10;
|
||||
monthGoal[10] = goal.goal_val_11;
|
||||
monthGoal[11] = goal.goal_val_12;
|
||||
monthGoal[1] = goal.goal_val_1;
|
||||
monthGoal[2] = goal.goal_val_2;
|
||||
monthGoal[3] = goal.goal_val_3;
|
||||
monthGoal[4] = goal.goal_val_4;
|
||||
monthGoal[5] = goal.goal_val_5;
|
||||
monthGoal[6] = goal.goal_val_6;
|
||||
monthGoal[7] = goal.goal_val_7;
|
||||
monthGoal[8] = goal.goal_val_8;
|
||||
monthGoal[9] = goal.goal_val_9;
|
||||
monthGoal[10] = goal.goal_val_10;
|
||||
monthGoal[11] = goal.goal_val_11;
|
||||
monthGoal[12] = goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
|
|
|
@ -49,19 +49,19 @@
|
|||
<th v-if="data1 > 0" :colspan="data1">原材料</th>
|
||||
<th v-if="data3 > 0" :colspan="data3">辅助材料</th>
|
||||
<th v-if="data2 > 0" :colspan="data2">电/水</th>
|
||||
<th colspan="7">制造费用</th>
|
||||
<th rowspan="2">制造费用</th>
|
||||
<th rowspan="2">直接人工</th>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th v-for="(item, index) in materialList" :key="index">{{ item }}</th>
|
||||
<th>无形资产摊销</th>
|
||||
<!-- <th>无形资产摊销</th>
|
||||
<th>职工薪酬</th>
|
||||
<th>固定资产折旧</th>
|
||||
<th>差旅费</th>
|
||||
<th>装卸费</th>
|
||||
<th>修理费</th>
|
||||
<th>材料出库</th>
|
||||
<th>材料出库</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="(item, index) in tableData1" :key="index">
|
||||
|
@ -311,9 +311,9 @@ export default {
|
|||
}
|
||||
let otherdata = itemData.other_cost_data;
|
||||
for (let j = 0; j < otherdata.length; j++) {
|
||||
if (otherdata[j].cate == '其他费用' ||otherdata[j].cate == '倒运费用') {
|
||||
continue;
|
||||
}
|
||||
// if (otherdata[j].cate == '其他费用' ||otherdata[j].cate == '直接人工') {
|
||||
// continue;
|
||||
// }
|
||||
dataArr.push((otherdata[j].cost_unit).toFixed(2))
|
||||
}
|
||||
that.tableData1.push(dataArr)
|
||||
|
|
|
@ -433,7 +433,7 @@ export default {
|
|||
tooltip: tooltip,
|
||||
grid: grid,
|
||||
toolbox: toolbox,
|
||||
legend: Object.assign(legend, {data: ["立磨总产量", "立磨台时产量", "立磨运转率", "分布电耗"]}),
|
||||
legend: Object.assign(legend, {data: ["立磨总产量", "分布电耗"]}),
|
||||
xAxis: {
|
||||
axisTick: {
|
||||
show: true,
|
||||
|
@ -443,7 +443,40 @@ export default {
|
|||
},
|
||||
data: [],
|
||||
},
|
||||
yAxis: yAxis,
|
||||
yAxis: [
|
||||
{
|
||||
type: "value",
|
||||
name: "产量 (t)",
|
||||
position: "left",
|
||||
alignTicks: true,
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: colors[0],
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
formatter: "{value}",
|
||||
},
|
||||
nameRotate: 50
|
||||
},
|
||||
{
|
||||
type: "value",
|
||||
name: "分布电耗(kW·h)",
|
||||
position: "right",
|
||||
alignTicks: true,
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: colors[3],
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
formatter: "{value}",
|
||||
},
|
||||
nameRotate: 50
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: "立磨总产量",
|
||||
|
@ -451,22 +484,10 @@ export default {
|
|||
yAxisIndex: 0,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "立磨台时产量",
|
||||
type: "bar",
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "立磨运转率",
|
||||
type: "line",
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "分布电耗",
|
||||
type: "bar",
|
||||
yAxisIndex: 2,
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
},
|
||||
],
|
||||
|
@ -1061,7 +1082,7 @@ export default {
|
|||
options.series[0].data = seriesData0;
|
||||
// options.series[1].data = seriesData1;
|
||||
// options.series[2].data = seriesData2;
|
||||
options.series[3].data = seriesData3;
|
||||
options.series[1].data = seriesData3;
|
||||
let hourXAxis = [];
|
||||
for (let i = 0; i < 24; i++) {
|
||||
let item = i + "时";
|
||||
|
|
|
@ -277,13 +277,13 @@ export default {
|
|||
const index = sortedData.findIndex(obj => parseFloat(obj.elec) === parseFloat(itemValue));
|
||||
let elec_score = 0;
|
||||
if (index === 0){
|
||||
elec_score= 15;
|
||||
} else if (index === 1) {
|
||||
elec_score= 10;
|
||||
} else if (index === 2) {
|
||||
elec_score= 8;
|
||||
} else if (index === 3) {
|
||||
elec_score= 5;
|
||||
} else if (index === 1) {
|
||||
elec_score= 8;
|
||||
} else if (index === 2) {
|
||||
elec_score= 10;
|
||||
} else if (index === 3) {
|
||||
elec_score= 15;
|
||||
}
|
||||
arr[17] += elec_score;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">
|
||||
生料辅料工序车间单位产品电耗月度分析表
|
||||
辅料分布电耗月度分析表
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -176,17 +176,17 @@ export default {
|
|||
goal.goal_cate_name == "单位产品分布电耗(kW·h/t)"
|
||||
) {
|
||||
monthGoal[0] = goal.goal_val;
|
||||
monthGoal[1] = goal.goal_val_2;
|
||||
monthGoal[2] = goal.goal_val_3;
|
||||
monthGoal[3] = goal.goal_val_4;
|
||||
monthGoal[4] = goal.goal_val_5;
|
||||
monthGoal[5] = goal.goal_val_6;
|
||||
monthGoal[6] = goal.goal_val_7;
|
||||
monthGoal[7] = goal.goal_val_8;
|
||||
monthGoal[8] = goal.goal_val_9;
|
||||
monthGoal[9] = goal.goal_val_10;
|
||||
monthGoal[10] = goal.goal_val_11;
|
||||
monthGoal[11] = goal.goal_val_12;
|
||||
monthGoal[1] = goal.goal_val_1;
|
||||
monthGoal[2] = goal.goal_val_2;
|
||||
monthGoal[3] = goal.goal_val_3;
|
||||
monthGoal[4] = goal.goal_val_4;
|
||||
monthGoal[5] = goal.goal_val_5;
|
||||
monthGoal[6] = goal.goal_val_6;
|
||||
monthGoal[7] = goal.goal_val_7;
|
||||
monthGoal[8] = goal.goal_val_8;
|
||||
monthGoal[9] = goal.goal_val_9;
|
||||
monthGoal[10] = goal.goal_val_10;
|
||||
monthGoal[11] = goal.goal_val_11;
|
||||
monthGoal[12] = goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
|
|
|
@ -281,13 +281,13 @@ export default {
|
|||
const index = sortedData.findIndex(obj => parseFloat(obj.elec) === parseFloat(itemValue));
|
||||
let elec_score = 0;
|
||||
if (index === 0){
|
||||
elec_score= 15;
|
||||
} else if (index === 1) {
|
||||
elec_score= 10;
|
||||
} else if (index === 2) {
|
||||
elec_score= 8;
|
||||
} else if (index === 3) {
|
||||
elec_score= 5;
|
||||
} else if (index === 1) {
|
||||
elec_score= 8;
|
||||
} else if (index === 2) {
|
||||
elec_score= 10;
|
||||
} else if (index === 3) {
|
||||
elec_score= 15;
|
||||
}
|
||||
arr[17] += elec_score;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">
|
||||
生料工序车间单位产品电耗月度分析表
|
||||
生料分布电耗月度分析表
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -175,17 +175,17 @@ export default {
|
|||
goal.goal_cate_name == "单位产品分布电耗(kW·h/t)"
|
||||
) {
|
||||
monthGoal[0] = goal.goal_val;
|
||||
monthGoal[1] = goal.goal_val_2;
|
||||
monthGoal[2] = goal.goal_val_3;
|
||||
monthGoal[3] = goal.goal_val_4;
|
||||
monthGoal[4] = goal.goal_val_5;
|
||||
monthGoal[5] = goal.goal_val_6;
|
||||
monthGoal[6] = goal.goal_val_7;
|
||||
monthGoal[7] = goal.goal_val_8;
|
||||
monthGoal[8] = goal.goal_val_9;
|
||||
monthGoal[9] = goal.goal_val_10;
|
||||
monthGoal[10] = goal.goal_val_11;
|
||||
monthGoal[11] = goal.goal_val_12;
|
||||
monthGoal[1] = goal.goal_val_1;
|
||||
monthGoal[2] = goal.goal_val_2;
|
||||
monthGoal[3] = goal.goal_val_3;
|
||||
monthGoal[4] = goal.goal_val_4;
|
||||
monthGoal[5] = goal.goal_val_5;
|
||||
monthGoal[6] = goal.goal_val_6;
|
||||
monthGoal[7] = goal.goal_val_7;
|
||||
monthGoal[8] = goal.goal_val_8;
|
||||
monthGoal[9] = goal.goal_val_9;
|
||||
monthGoal[10] = goal.goal_val_10;
|
||||
monthGoal[11] = goal.goal_val_11;
|
||||
monthGoal[12] = goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
|
|
|
@ -291,7 +291,7 @@ let legend = {
|
|||
width: "400px",
|
||||
x: 'center',
|
||||
y:'top',
|
||||
data: ["电石渣干粉总产量", "电石渣干粉分布电耗", "电石渣工段总电量", "成本", "湿电石渣消耗", "湿电石渣进厂"],
|
||||
data: ["电石渣干粉总产量", "电石渣干粉分布电耗", "电石渣工段总电量", "成本", "湿电石渣消耗", "湿电石渣进厂","分布电耗目标值"],
|
||||
};
|
||||
let yAxis = [
|
||||
{
|
||||
|
@ -395,6 +395,24 @@ let yAxis = [
|
|||
formatter: "{value}",
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "value",
|
||||
name: "分布电耗目标值",
|
||||
position: "right",
|
||||
alignTicks: true,
|
||||
nameRotate: 50,
|
||||
offset: 100,
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: colors[5],
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
formatter: "{value}",
|
||||
},
|
||||
},
|
||||
|
||||
];
|
||||
export default {
|
||||
components: {
|
||||
|
@ -436,6 +454,7 @@ export default {
|
|||
showClose: true,
|
||||
echartType: "line",
|
||||
asynDialog: false,
|
||||
goal_list :[],
|
||||
option1: {
|
||||
color: colors,
|
||||
tooltip: tooltip,
|
||||
|
@ -542,6 +561,12 @@ export default {
|
|||
yAxisIndex: 5,
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "分布电耗目标值",
|
||||
type: "line",
|
||||
yAxisIndex: 5,
|
||||
data: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
@ -623,7 +648,6 @@ export default {
|
|||
params4.day_s = days;
|
||||
params4.type = "day_s";
|
||||
params4.mgroup = this.query.mgroup;
|
||||
console.log(params4,"params4");
|
||||
this.$API.enm.enstat.req(params4).then((res4) => {
|
||||
if (res4.length > 0) {
|
||||
let data4 = res4[0];
|
||||
|
@ -668,6 +692,7 @@ export default {
|
|||
item5.goal_cate_name ==
|
||||
"单位产品分布电耗(kW·h/t)"
|
||||
) {
|
||||
that.goal_list.push(item5);
|
||||
that.tableDatas[1][6] = item5[str];
|
||||
that.tableDatas[1][8] = item5.goal_val;
|
||||
} else if (
|
||||
|
@ -811,7 +836,7 @@ export default {
|
|||
let month = val.split("-")[1];
|
||||
month = Number(month);
|
||||
this.getDayData(year, month);
|
||||
} else {
|
||||
} else if (this.typeRadio == "year") {
|
||||
this.getMonthData(val);
|
||||
}
|
||||
} else {
|
||||
|
@ -822,6 +847,33 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
//获取年度目标值
|
||||
getGoalData(year) {
|
||||
let params5 = {};
|
||||
let goal_list = [];
|
||||
let that = this;
|
||||
params5.page = 0;
|
||||
params5.year = year;
|
||||
params5.mgroup = that.query.mgroup;
|
||||
this.$API.mtm.goal.list
|
||||
.req(params5)
|
||||
.then((res5) => {
|
||||
if (res5.length > 0) {
|
||||
let data5 = res5;
|
||||
data5.forEach((item5) => {
|
||||
if (
|
||||
item5.goal_cate_name ==
|
||||
"单位产品分布电耗(kW·h/t)"
|
||||
) {
|
||||
goal_list.push(item5);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
return res5;
|
||||
})
|
||||
|
||||
},
|
||||
//获取天数据
|
||||
getDayData(year, month) {
|
||||
let that = this;
|
||||
|
@ -874,25 +926,49 @@ export default {
|
|||
//获取月数据
|
||||
getMonthData(year) {
|
||||
let that = this;
|
||||
let query2 = {};
|
||||
let params5 = {};
|
||||
params5.page = 0;
|
||||
params5.year = year;
|
||||
params5.mgroup = that.query.mgroup;
|
||||
this.$API.mtm.goal.list
|
||||
.req(params5)
|
||||
.then((res5) => {
|
||||
if (res5.length > 0) {
|
||||
let data5 = res5;
|
||||
data5.forEach((item5) => {
|
||||
if (
|
||||
item5.goal_cate_name ==
|
||||
"单位产品分布电耗(kW·h/t)"
|
||||
) {
|
||||
that.goal_list.push(item5);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}).then(() => {
|
||||
let query2 = {};
|
||||
query2.page = 0;
|
||||
query2.year_s = year;
|
||||
query2.type = "month_s";
|
||||
query2.mgroup = that.query.mgroup;
|
||||
|
||||
this.$API.enm.enstat.req(query2).then((response) => {
|
||||
let seriesData0 = [],
|
||||
seriesData1 = [],
|
||||
seriesData2 = [],
|
||||
seriesData3 = [],
|
||||
seriesData4 = [],
|
||||
seriesData5 = [];
|
||||
seriesData5 = [],
|
||||
seriesData6 = [];
|
||||
let data = response;
|
||||
data.forEach((item) => {
|
||||
let goal_index = 'goal_val_' + item.month_s;
|
||||
let ind = item.month_s - 1;
|
||||
seriesData0[ind] = item.total_production;
|
||||
seriesData1[ind] = item.production_cost_unit;
|
||||
seriesData2[ind] = item.elec_consume_unit;
|
||||
seriesData5[ind] = item.elec_consume;
|
||||
seriesData6[ind] = that.goal_list[0][goal_index];
|
||||
if (item.imaterial_data.length > 0) {
|
||||
item.imaterial_data.forEach((items_n) => {
|
||||
if (items_n.material_name == "湿电石渣消耗") {
|
||||
|
@ -910,7 +986,11 @@ export default {
|
|||
options.series[3].data = seriesData1;
|
||||
options.series[4].data = seriesData3;
|
||||
options.series[5].data = seriesData4;
|
||||
options.series[6].data = seriesData6;
|
||||
let monthXAxis = [];
|
||||
if (year < that.year){
|
||||
that.month = 12;
|
||||
}
|
||||
for (let i = 1; i <= that.month; i++) {
|
||||
let item = i + "月";
|
||||
monthXAxis.push(item);
|
||||
|
@ -918,12 +998,12 @@ export default {
|
|||
options.xAxis.data = monthXAxis;
|
||||
that.optionMonth = options;
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
itemClick(type, item) {
|
||||
console.log(item);
|
||||
this.type = type;
|
||||
this.cate = item[1];
|
||||
console.log(this.type);
|
||||
this.asynDialog = true;
|
||||
},
|
||||
handlePrint() {
|
||||
|
|
|
@ -174,7 +174,7 @@ export default {
|
|||
arr.push(time);
|
||||
arr.push(item.team_name);
|
||||
arr.push(item.total_production);
|
||||
arr.push(item.production_hour);
|
||||
arr.push(item.production_cost_unit);
|
||||
|
||||
arr[4] = item.elec_consume_unit; //当期值(KW·h/t)
|
||||
let keyVale = "goal_val_" + n;
|
||||
|
@ -232,13 +232,13 @@ 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] = 20;
|
||||
} else if (index === 1) {
|
||||
arr[11] = 15;
|
||||
} else if (index === 2) {
|
||||
arr[11] = 10;
|
||||
} else if (index === 3) {
|
||||
arr[11] = 5;
|
||||
} else if (index === 1) {
|
||||
arr[11] = 10;
|
||||
} else if (index === 2) {
|
||||
arr[11] = 15;
|
||||
} else if (index === 3) {
|
||||
arr[11] = 20;
|
||||
}
|
||||
const total_elec_consume = item.production_hour;
|
||||
const sortedTotalData = monthData.sort((a, b) => parseFloat(b.production_hour) - parseFloat(a.production_hour));
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
>
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th colspan="9">车间单位产品电耗月度分析表</th>
|
||||
<th colspan="9">电石渣干粉单位电耗月度分析表</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>月份</th>
|
||||
|
@ -148,6 +148,7 @@ export default {
|
|||
let that = this;
|
||||
let paramsGoal = {};
|
||||
paramsGoal.page = 0;
|
||||
paramsGoal.year = that.query.year_s;
|
||||
paramsGoal.mgroup = that.query.mgroup;
|
||||
that.$API.mtm.goal.list.req(paramsGoal).then((ress) => {
|
||||
if (ress.length > 0) {
|
||||
|
@ -157,17 +158,17 @@ export default {
|
|||
goal.goal_cate_name == "单位产品分布电耗(kW·h/t)"
|
||||
) {
|
||||
monthGoal[0] = goal.goal_val;
|
||||
monthGoal[1] = goal.goal_val_2;
|
||||
monthGoal[2] = goal.goal_val_3;
|
||||
monthGoal[3] = goal.goal_val_4;
|
||||
monthGoal[4] = goal.goal_val_5;
|
||||
monthGoal[5] = goal.goal_val_6;
|
||||
monthGoal[6] = goal.goal_val_7;
|
||||
monthGoal[7] = goal.goal_val_8;
|
||||
monthGoal[8] = goal.goal_val_9;
|
||||
monthGoal[9] = goal.goal_val_10;
|
||||
monthGoal[10] = goal.goal_val_11;
|
||||
monthGoal[11] = goal.goal_val_12;
|
||||
monthGoal[1] = goal.goal_val_1;
|
||||
monthGoal[2] = goal.goal_val_2;
|
||||
monthGoal[3] = goal.goal_val_3;
|
||||
monthGoal[4] = goal.goal_val_4;
|
||||
monthGoal[5] = goal.goal_val_5;
|
||||
monthGoal[6] = goal.goal_val_6;
|
||||
monthGoal[7] = goal.goal_val_7;
|
||||
monthGoal[8] = goal.goal_val_8;
|
||||
monthGoal[9] = goal.goal_val_9;
|
||||
monthGoal[10] = goal.goal_val_10;
|
||||
monthGoal[11] = goal.goal_val_11;
|
||||
monthGoal[12] = goal.goal_val_12;
|
||||
that.monthGoal = monthGoal;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue