fix : 修改 tkx 工序内容

This commit is contained in:
zty 2024-11-25 18:32:52 +08:00
parent cbd7ec9e8d
commit 893f7a6cd7
33 changed files with 778 additions and 400 deletions

View File

@ -52,7 +52,7 @@
start-placeholder="结束日期" start-placeholder="结束日期"
:picker-options="pickerOptions" :picker-options="pickerOptions"
/> />
<el-button type="primary" class="searchBtn" @click="dataSearch" <el-button type="primary" class="searchBtnx" @click="dataSearch"
>查询</el-button >查询</el-button
> >
</div> </div>
@ -73,7 +73,7 @@
start-placeholder="结束日期" start-placeholder="结束日期"
:picker-options="pickerOptions" :picker-options="pickerOptions"
/> />
<el-button type="primary" class="searchBtn" @click="dataSearch" <el-button type="primary" class="searchBtnx" @click="dataSearch"
>查询</el-button >查询</el-button
> >
</div> </div>
@ -94,7 +94,7 @@
start-placeholder="结束月份" start-placeholder="结束月份"
:picker-options="pickerOptions" :picker-options="pickerOptions"
/> />
<el-button type="primary" class="searchBtn" @click="dataSearch" <el-button type="primary" class="searchBtnx" @click="dataSearch"
>查询</el-button >查询</el-button
> >
</div> </div>
@ -115,7 +115,7 @@
start-placeholder="结束日期" start-placeholder="结束日期"
:picker-options="pickerOptions" :picker-options="pickerOptions"
/> />
<el-button type="primary" class="searchBtn" @click="dataSearch" <el-button type="primary" class="searchBtnx" @click="dataSearch"
>查询</el-button >查询</el-button
> >
</div> </div>
@ -306,7 +306,7 @@ export default {
this.option.series[0].name = that.cate; this.option.series[0].name = that.cate;
console.log(that.mgroup) console.log(that.mgroup)
if (that.mgroup) { if (that.mgroup) {
if (that.cate == "总产量t"|| that.cate =="熟料t" ||that.cate == "出厂水泥合计t") { if (that.cate == "总产量t" || that.cate == "出厂水泥合计t") {
that.cateName = "total_production"; that.cateName = "total_production";
} else if ( } else if (
that.cate == "单位产品分布电耗KW·h/t" || that.cate == "单位产品分布电耗KW·h/t" ||
@ -336,7 +336,7 @@ export default {
that.cateName = "production_hour"; that.cateName = "production_hour";
} else if (that.cate == "吨熟料发电量KW·h/t") { } else if (that.cate == "吨熟料发电量KW·h/t") {
that.cateName = "production_elec_unit"; that.cateName = "production_elec_unit";
} else if (that.cate == "用电量KW·h") { } else if (that.cate == "总电耗KW·h") {
that.cateName = "elec_consume"; that.cateName = "elec_consume";
} }
} else { } else {
@ -447,7 +447,7 @@ export default {
margin: 0 5px; margin: 0 5px;
display: inline-block; display: inline-block;
} }
.searchBtn { .searchBtnx {
margin-left: 5px; margin-left: 5px;
} }
.sc-dialog__headerbtn { .sc-dialog__headerbtn {

View File

@ -244,7 +244,7 @@ const routes = [
name: "enm_slag", name: "enm_slag",
path: "/enm_slag", path: "/enm_slag",
meta: { meta: {
title: "电石渣", title: "电石渣工序",
icon: "el-icon-menu", icon: "el-icon-menu",
type: "menu", type: "menu",
perms: ["enm_slag"], perms: ["enm_slag"],
@ -350,7 +350,7 @@ const routes = [
name: "enm_rm", name: "enm_rm",
path: "/enm_rm", path: "/enm_rm",
meta: { meta: {
title: "原料磨", title: "生料工序",
icon: "el-icon-menu", icon: "el-icon-menu",
type: "menu", type: "menu",
perms: ["enm_rm"], perms: ["enm_rm"],
@ -476,7 +476,7 @@ const routes = [
name: "enm_coal", name: "enm_coal",
path: "/enm_coal", path: "/enm_coal",
meta: { meta: {
title: "煤磨", title: "煤磨工序",
icon: "el-icon-menu", icon: "el-icon-menu",
type: "menu", type: "menu",
perms: ["enm_coal"], perms: ["enm_coal"],
@ -602,7 +602,7 @@ const routes = [
name: "enm_kiln", name: "enm_kiln",
path: "/enm_kiln", path: "/enm_kiln",
meta: { meta: {
title: "回转窑", title: "烧成工序",
icon: "el-icon-menu", icon: "el-icon-menu",
type: "menu", type: "menu",
perms: ["enm_kiln"], perms: ["enm_kiln"],
@ -791,7 +791,7 @@ const routes = [
name: "enm_mill", name: "enm_mill",
path: "/enm_mill", path: "/enm_mill",
meta: { meta: {
title: "水泥磨", title: "水泥工序",
icon: "el-icon-menu", icon: "el-icon-menu",
type: "menu", type: "menu",
perms: ["enm_mill"], perms: ["enm_mill"],
@ -854,7 +854,7 @@ const routes = [
name: "enm_pack", name: "enm_pack",
path: "/enm_pack", path: "/enm_pack",
meta: { meta: {
title: "水泥包装", title: "水泥包装工序",
icon: "el-icon-menu", icon: "el-icon-menu",
type: "menu", type: "menu",
perms: ["enm_pack"], perms: ["enm_pack"],
@ -1000,32 +1000,32 @@ const routes = [
name: "hourBase", name: "hourBase",
path: "/enm_energy/hourBase", path: "/enm_energy/hourBase",
meta: { meta: {
title: "电量消耗逐时报表", title: "电量消耗报表",
// icon: "el-icon-grid", // icon: "el-icon-grid",
perms: ["hour_base"], perms: ["hour_base"],
}, },
component: "enm_energy/hour_base", component: "enm_energy/hour_base",
}, },
{ // {
name: "dayBase", // name: "dayBase",
path: "/enm_energy/dayBase", // path: "/enm_energy/dayBase",
meta: { // meta: {
title: "电量消耗日报表", // title: "电量消耗日报表",
// icon: "el-icon-grid", // // icon: "el-icon-grid",
perms: ["day_base"], // perms: ["day_base"],
}, // },
component: "enm_energy/day_base", // component: "enm_energy/day_base",
}, // },
{ // {
name: "monthBase", // name: "monthBase",
path: "/enm_energy/monthBase", // path: "/enm_energy/monthBase",
meta: { // meta: {
title: "电量消耗月报表", // title: "电量消耗月报表",
// icon: "el-icon-grid", // // icon: "el-icon-grid",
perms: ["month_base"], // perms: ["month_base"],
}, // },
component: "enm_energy/month_base", // component: "enm_energy/month_base",
}, // },
{ {
name: "energyPicture", name: "energyPicture",
path: "/enm_energy/energyPicture", path: "/enm_energy/energyPicture",
@ -2476,7 +2476,7 @@ const routes = [
name: "equipment", name: "equipment",
path: "/em/equipment", path: "/em/equipment",
meta: { meta: {
title: "生产设备", title: "主要用能设备",
// icon: "el-icon-cellphone", // icon: "el-icon-cellphone",
perms: ["equipment"], perms: ["equipment"],
}, },

View File

@ -159,7 +159,7 @@
<div class="flexItem"> <div class="flexItem">
<div class="itemTitle"> <div class="itemTitle">
<div class="itemTitleIcon"></div> <div class="itemTitleIcon"></div>
<div>主机设备电耗电耗</div> <div>主机设备电耗</div>
</div> </div>
<div class="itemBody itemBodyFlex"> <div class="itemBody itemBodyFlex">
<div id="radar" style="height: 100%"></div> <div id="radar" style="height: 100%"></div>
@ -340,9 +340,9 @@ export default {
SMData: [], SMData: [],
IMData: [], IMData: [],
factoryName: "", factoryName: "",
initialAlpha: -Math.PI / 4.5, initialAlpha: 2.73,
initialBeta: Math.PI / 2, initialBeta: 1.24,
initialRadius: 2.5, initialRadius: 8,
initialTarget: null, initialTarget: null,
resizeTimeout: null, resizeTimeout: null,
loadedPercent: 0, loadedPercent: 0,
@ -378,11 +378,11 @@ export default {
new echarts.graphic.LinearGradient(0, 0, 0, 1, [ new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ {
offset: 0, offset: 0,
color: "rgb(128, 255, 165)", color: "rgb(255, 255, 0)",
}, },
{ {
offset: 1, offset: 1,
color: "rgb(1, 191, 236)", color: "rgb(255, 255, 0)",
}, },
]), ]),
@ -399,7 +399,7 @@ export default {
new echarts.graphic.LinearGradient(0, 0, 0, 1, [ new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ {
offset: 0, offset: 0,
color: "rgb(55, 162, 255)", color: "rgb(255, 162, 255)",
}, },
{ {
offset: 1, offset: 1,
@ -467,7 +467,7 @@ export default {
tableData: [], tableData: [],
tezhongData: [], tezhongData: [],
option: { option: {
color: ["#80FFA5", "#00DDFF", "#37A2FF", "#FF0087", "#FFBF00"], // color: ["#80FFA5", "#00DDFF", "#37A2FF", "#FF0087", "#FFBF00"],
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
axisPointer: { axisPointer: {
@ -476,6 +476,10 @@ export default {
backgroundColor: "#6a7985", backgroundColor: "#6a7985",
}, },
}, },
textStyle: {
color: "#02f5f2",
},
backgroundColor: "rgba(255,255,255,0.3)",
}, },
legend: { legend: {
icon: "stack", icon: "stack",
@ -758,11 +762,14 @@ export default {
}; };
return this.$API.enm.enstat.req(query); return this.$API.enm.enstat.req(query);
}).then((response) => { }).then((response) => {
let maxId;
response.forEach((item) => { response.forEach((item) => {
let ind = item.day_s - 1; let ind = item.day_s - 1;
maxId = ind;
seriesData2[ind] = item.total_production || 0; seriesData2[ind] = item.total_production || 0;
}); });
// //
option1.color = ['#FFFF00','#CC00FF', '#FFBF00']
option1.legend.data = [ option1.legend.data = [
{ {
name: "熟料", name: "熟料",
@ -781,7 +788,7 @@ export default {
}, },
borderRadius: 2, borderRadius: 2,
itemStyle: { itemStyle: {
color: that.linearGradientColors[1], color: that.linearGradientColors[2],
}, },
}, },
{ {
@ -791,7 +798,7 @@ export default {
}, },
borderRadius: 2, borderRadius: 2,
itemStyle: { itemStyle: {
color: that.linearGradientColors[2], color: that.linearGradientColors[4],
}, },
}, },
]; ];
@ -823,7 +830,7 @@ export default {
showSymbol: false, showSymbol: false,
areaStyle: { areaStyle: {
opacity: 0.8, opacity: 0.8,
color: that.linearGradientColors[1], color: that.linearGradientColors[2],
}, },
emphasis: { emphasis: {
focus: "series", focus: "series",
@ -840,7 +847,7 @@ export default {
showSymbol: false, showSymbol: false,
areaStyle: { areaStyle: {
opacity: 0.8, opacity: 0.8,
color: that.linearGradientColors[2], color: that.linearGradientColors[4],
}, },
emphasis: { emphasis: {
focus: "series", focus: "series",
@ -849,6 +856,29 @@ export default {
}, },
]; ];
myChart.setOption(option1); myChart.setOption(option1);
let index2 = 0;
intervalId = setInterval(function () {
if (index2 <= maxId) {
myChart.dispatchAction({
type: "downplay",
seriesIndex: 0,
});
myChart.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex: index2,
});
myChart.dispatchAction({
type: "showTip",
seriesIndex: 0,
dataIndex: index2,
});
index2++;
} else {
index2 = 0;
clearInterval(intervalId);
}
}, 1000);
}); });
}, },
getMonthData() { getMonthData() {
@ -969,6 +999,7 @@ export default {
} }
}); });
// //
option3.color = ['#FFBF00','#6495ED', '#CC00FF']
option3.legend.data = [ option3.legend.data = [
{ {
name: "原料车间用水", name: "原料车间用水",
@ -1005,18 +1036,27 @@ export default {
{ {
name: '原料车间用水', name: '原料车间用水',
type: 'line', type: 'line',
data: seriesData1 data: seriesData1,
lineStyle: {
color: that.linearGradientColors[0],
},
}, },
{ {
name: '烧成车间用水', name: '烧成车间用水',
type: 'line', type: 'line',
data: seriesData3 data: seriesData3,
lineStyle: {
color: that.linearGradientColors[1],
},
}, },
{ {
name: '水泥车间用水', name: '水泥车间用水',
type: 'line', type: 'line',
data: seriesData5 data: seriesData5,
} lineStyle: {
color: that.linearGradientColors[2]
},
},
] ]
myChart.setOption(option3); // myChart.setOption(option3); //
}); });
@ -1061,7 +1101,7 @@ export default {
}); });
}); });
}, },
//& //&
generation() { generation() {
let that = this; let that = this;
this.$API.mtm.mgroup.list this.$API.mtm.mgroup.list
@ -1191,7 +1231,7 @@ export default {
radarChart.setOption(that.radarOption); radarChart.setOption(that.radarOption);
}); });
}, },
//--- //
qualAnalys() { qualAnalys() {
let that = this; let that = this;
// option2 // option2
@ -1238,6 +1278,7 @@ export default {
} }
}); });
// //
option5.color = ["#80FFA5", "#00DDFF", "#37A2FF", "#FF0087", "#FFBF00"],
option5.legend.data = [ option5.legend.data = [
{ {
name: "f-CaO", name: "f-CaO",
@ -1246,7 +1287,7 @@ export default {
}, },
borderRadius: 2, borderRadius: 2,
itemStyle: { itemStyle: {
color: that.linearGradientColors[0], color: "#80FFA5",
}, },
}, },
{ {
@ -1256,7 +1297,7 @@ export default {
}, },
borderRadius: 2, borderRadius: 2,
itemStyle: { itemStyle: {
color: that.linearGradientColors[1], color: "#00DDFF",
}, },
}, },
{ {
@ -1266,7 +1307,7 @@ export default {
}, },
borderRadius: 2, borderRadius: 2,
itemStyle: { itemStyle: {
color: that.linearGradientColors[2], color: "#37A2FF",
}, },
}, },
{ {
@ -1276,7 +1317,7 @@ export default {
}, },
borderRadius: 2, borderRadius: 2,
itemStyle: { itemStyle: {
color: that.linearGradientColors[3], color: "#FF0087",
}, },
}, },
{ {
@ -1286,7 +1327,7 @@ export default {
}, },
borderRadius: 2, borderRadius: 2,
itemStyle: { itemStyle: {
color: that.linearGradientColors[4], color: "#FFBF00",
}, },
}, },
]; ];
@ -1527,7 +1568,7 @@ export default {
that.initialAlpha, that.initialAlpha,
that.initialBeta, that.initialBeta,
that.initialRadius, that.initialRadius,
new BABYLON.Vector3(0, 0, 1.2) new BABYLON.Vector3(-0.45, 1.588, 1.93)
); );
that.camera = camera; that.camera = camera;
that.initialTarget = camera.getTarget(); that.initialTarget = camera.getTarget();
@ -1692,6 +1733,10 @@ export default {
dataView.isVisible = false; dataView.isVisible = false;
} }
} }
console.log("Camera Alpha:", camera.alpha);
console.log("Camera Beta:", camera.beta);
console.log("Camera Radius:", camera.radius);
console.log("Camera Radius:", camera.target);
}); });
control_main.addControl(checkbox1); control_main.addControl(checkbox1);
var header1 = new BABYLON_GUI.TextBlock(); var header1 = new BABYLON_GUI.TextBlock();

View File

@ -26,13 +26,13 @@
<el-table-column type="selection" width="50" /> <el-table-column type="selection" width="50" />
<el-table-column label="设备名称" prop="name" width="200" show-overflow-tooltip> <el-table-column label="设备名称" prop="name" width="200" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column label="设备号" prop="number"> <el-table-column label="设备号" prop="number">
</el-table-column> </el-table-column>
<el-table-column label="型号规格" prop="model"> <el-table-column label="型号规格" prop="model">
</el-table-column> </el-table-column>
<el-table-column label="生产厂" prop="factory" show-overflow-tooltip> <el-table-column label="生产厂" prop="factory" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column label="生产日期" prop="production_date"> <el-table-column label="设备重要性" prop="importance">
</el-table-column> </el-table-column>
<el-table-column label="购置日期" prop="buy_date"> <el-table-column label="购置日期" prop="buy_date">
</el-table-column> </el-table-column>
@ -70,7 +70,7 @@
<el-table-column label="存放位置" show-overflow-tooltip> <el-table-column label="存放位置" show-overflow-tooltip>
<template #default="scope">{{ scope.row.place }}</template> <template #default="scope">{{ scope.row.place }}</template>
</el-table-column> </el-table-column>
<el-table-column label="备注" show-overflow-tooltip> <el-table-column label="维修记录" show-overflow-tooltip>
<template #default="scope">{{ scope.row.description }}</template> <template #default="scope">{{ scope.row.description }}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="180"> <el-table-column label="操作" fixed="right" align="left" width="180">
@ -93,8 +93,9 @@
</el-container> </el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" :eqtype="10" <save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" :eqtype="10"
@closed="dialog.save = false"></save-dialog> @closed="dialog.save = false"></save-dialog>
<check-dialog v-if="dialog.check" ref="checkDialog" :eqms="selectiones" @success="handleCheckSuccess" <check-dialog v-if="dialog.check" ref="checkDialog" :eqms="selectiones" @success="handleCheckSuccess"
@closed="dialog.save = false"></check-dialog> @closed="dialog.check = false"></check-dialog>
<el-drawer title="巡检记录" v-model="visibleRecord" :size="1000" destroy-on-close @closed="visibleRecord = false"> <el-drawer title="巡检记录" v-model="visibleRecord" :size="1000" destroy-on-close @closed="visibleRecord = false">
<el-container v-loading="loading"> <el-container v-loading="loading">
<el-button type="primary" icon="el-icon-plus" @click="record_create" v-auth="'einspect.create'" <el-button type="primary" icon="el-icon-plus" @click="record_create" v-auth="'einspect.create'"
@ -183,8 +184,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="备注"> <el-form-item label="维修记录">
<el-input v-model="form.note" placeholder="备注" /> <el-input v-model="form.note" placeholder="维修记录" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -100,10 +100,11 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="生产日期"> <el-form-item label="设备重要性">
<el-date-picker v-model="form.production_date" type="date" placeholder="选择日期" value-format="YYYY-MM-DD" <el-select style="width: 100%" v-model="form.importance" placeholder="请选择">
style="width:100%"> <el-option v-for="item in importace" :key="item.label" :label="item.label" :value="item.value">
</el-date-picker> </el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
@ -153,8 +154,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="备注"> <el-form-item label="维修记录">
<el-input type="textarea" :rows="3" v-model="form.description" placeholder="备注" /> <el-input type="textarea" :rows="3" v-model="form.description" placeholder="维修记录" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -263,6 +264,18 @@ export default {
value: 40, value: 40,
label: '禁用' label: '禁用'
}], }],
importace: [
{
value: 10,
label: 'A'
},{
value: 20,
label: 'B'
},{
value: 30,
label: 'C'
},
],
parameter_json: [ parameter_json: [
{ key: '', value: '' } { key: '', value: '' }
], ],

View File

@ -65,7 +65,7 @@
<td>{{ item.elec_consume_unit }}</td> <td>{{ item.elec_consume_unit }}</td>
<td>{{ item.celec_consume_unit }}</td> <td>{{ item.celec_consume_unit }}</td>
<td>{{ item.coal_consume_unit }}</td> <td>{{ item.coal_consume_unit }}</td>
<td>{{ item.en_consume_unit }}</td> <td>{{ item.cen_consume_unit }}</td>
</tr> </tr>
</table> </table>
</div> </div>
@ -130,7 +130,7 @@
<td>{{ item.elec_consume_unit }}</td> <td>{{ item.elec_consume_unit }}</td>
<td>{{ item.celec_consume_unit }}</td> <td>{{ item.celec_consume_unit }}</td>
<td>{{ item.coal_consume_unit }}</td> <td>{{ item.coal_consume_unit }}</td>
<td>{{ item.en_consume_unit }}</td> <td>{{ item.cen_consume_unit }}</td>
</tr> </tr>
</table> </table>
</div> </div>
@ -152,6 +152,18 @@
:value="item" :value="item"
></el-option> ></el-option>
</el-select> </el-select>
<el-select
v-model="mgDataName"
placeholder="指标"
@change="mgroupChange"
>
<el-option
v-for="(item, index) in mgData"
:key="index"
:label="item"
:value="item"
></el-option>
</el-select>
<div id="myChart" style="width: 1200px; height: 400px"></div> <div id="myChart" style="width: 1200px; height: 400px"></div>
</el-dialog> </el-dialog>
</el-container> </el-container>
@ -165,11 +177,13 @@ export default {
data() { data() {
return { return {
mgroupName: "", mgroupName: "",
mgDataName:"",
timeStamp: 0, timeStamp: 0,
mockData: mockData, mockData: mockData,
mockData2: mockData2, mockData2: mockData2,
query: { query: {
searchData: "", searchData: "",
searchData2: "",
page: 0, page: 0,
type: "month_st", type: "month_st",
mgroup: "", mgroup: "",
@ -179,6 +193,15 @@ export default {
chartData1: {}, chartData1: {},
chartData2: {}, chartData2: {},
mgroups: [], mgroups: [],
mgData: [ "总产量",
"台时产量",
"运转时间",
"运转率",
"单位产品电耗",
"单位产品综合电耗",
"单位产品标煤耗",
"单位产品综合能耗",
],
searchData: [], searchData: [],
searchData2: [], searchData2: [],
exportLoading: false, exportLoading: false,
@ -211,21 +234,13 @@ export default {
inside: true, inside: true,
}, },
data: [ data: [
"总产量",
"台时产量",
"运转时间",
"运转率",
"单位产品电耗",
"单位产品综合电耗",
"单位产品标煤耗",
"单位产品综合能耗",
"吨熟料发电量",
], ],
}, },
yAxis: [ yAxis: [
{ {
type: "value", type: "value",
name: "电量 (KW·h)", name: "",
position: "left", position: "left",
alignTicks: true, alignTicks: true,
axisLine: { axisLine: {
@ -244,61 +259,64 @@ export default {
name: "时段一", name: "时段一",
type: "bar", type: "bar",
yAxisIndex: 0, yAxisIndex: 0,
data: [0, 0, 0, 0, 0, 0, 0, 0, 0], data: [],
}, },
{ {
name: "时段二", name: "时段二",
type: "bar", type: "bar",
yAxisIndex: 0, yAxisIndex: 0,
data: [0, 0, 0, 0, 0, 0, 0, 0, 0], data: [],
}, },
], ],
}, },
myChart: null, myChart: null,
}; };
}, },
mounted() { // mounted() {
this.useMock(); // this.useMock();
}, // },
methods: { methods: {
useMock() { // useMock() {
let that = this; // let that = this;
// that.tableDatas1 = that.mockData; // // that.tableDatas1 = that.mockData;
that.mockData.forEach((item) => { // that.mockData.forEach((item) => {
that.mgroups.push(item.mgroup_name); // that.mgroups.push(item.mgroup_name);
that.chartData1[item.mgroup_name] = []; // that.chartData1[item.mgroup_name] = [];
let arr = []; // let arr = [];
arr[0] = item.total_production; // arr[0] = item.total_production;
arr[1] = item.production_hour; // arr[1] = item.production_hour;
arr[2] = item.run_hour; // arr[2] = item.run_hour;
arr[3] = item.run_rate; // arr[3] = item.run_rate;
arr[4] = item.elec_consume_unit; // arr[4] = item.elec_consume_unit;
arr[5] = item.celec_consume_unit; // arr[5] = item.celec_consume_unit;
arr[6] = item.coal_consume_unit; // arr[6] = item.coal_consume_unit;
arr[7] = item.cen_consume_unit; // arr[7] = item.cccen_consume_unit;
arr[8] = item.production_elec_unit; // arr[8] = item.production_elec_unit;
that.chartData1[item.mgroup_name] = arr; // that.chartData1[item.mgroup_name] = arr;
}); // });
that.tableDatas2 = that.mockData2; // that.tableDatas2 = that.mockData2;
that.mockData2.forEach((item) => { // that.mockData2.forEach((item) => {
that.chartData2[item.mgroup_name] = []; // that.chartData2[item.mgroup_name] = [];
let arr = []; // let arr = [];
arr[0] = item.total_production; // arr[0] = item.total_production;
arr[1] = item.production_hour; // arr[1] = item.production_hour;
arr[2] = item.run_hour; // arr[2] = item.run_hour;
arr[3] = item.run_rate; // arr[3] = item.run_rate;
arr[4] = item.elec_consume_unit; // arr[4] = item.elec_consume_unit;
arr[5] = item.celec_consume_unit; // arr[5] = item.celec_consume_unit;
arr[6] = item.coal_consume_unit; // arr[6] = item.coal_consume_unit;
arr[7] = item.cen_consume_unit; // arr[7] = item.cccen_consume_unit;
arr[8] = item.production_elec_unit; // arr[8] = item.production_elec_unit;
that.chartData2[item.mgroup_name] = arr; // that.chartData2[item.mgroup_name] = arr;
}); // });
}, // },
getList1(val) { getList1(val) {
let that = this; let that = this;
if (!val || val.length == 0) {
return;
}
let start_date = val[0]; let start_date = val[0];
let end_date = val[1]; let end_date = val[1];
this.$API.enm.analyze this.$API.enm.analyze
@ -320,13 +338,15 @@ export default {
arr[5] = item.celec_consume_unit; arr[5] = item.celec_consume_unit;
arr[6] = item.coal_consume_unit; arr[6] = item.coal_consume_unit;
arr[7] = item.cen_consume_unit; arr[7] = item.cen_consume_unit;
arr[8] = item.production_elec_unit;
that.chartData1[item.mgroup_name] = arr; that.chartData1[item.mgroup_name] = arr;
}); });
}); });
}, },
getList2(val) { getList2(val) {
let that = this; let that = this;
if (!val || val.length == 0) {
return;
}
let start_date = val[0]; let start_date = val[0];
let end_date = val[1]; let end_date = val[1];
this.$API.enm.analyze this.$API.enm.analyze
@ -347,7 +367,6 @@ export default {
arr[5] = item.celec_consume_unit; arr[5] = item.celec_consume_unit;
arr[6] = item.coal_consume_unit; arr[6] = item.coal_consume_unit;
arr[7] = item.cen_consume_unit; arr[7] = item.cen_consume_unit;
arr[8] = item.production_elec_unit;
that.chartData2[item.mgroup_name] = arr; that.chartData2[item.mgroup_name] = arr;
}); });
}); });
@ -368,10 +387,56 @@ export default {
}, 100); }, 100);
() => {}; () => {};
}, },
mgroupChange(val) { mgroupChange() {
let that = this; let that = this;
that.options.series[0].data = this.chartData1[val]; let val = that.mgroupName;
that.options.series[1].data = this.chartData2[val]; let mgData = that.mgDataName;
console.log("---------",val, mgData)
if(!val){
return;
}
if(mgData == "总产量"){
that.options.xAxis.data = ["总产量"]
that.options.yAxis[0].name = "(t)"
that.options.series[0].data = [this.chartData1[val][0]];
that.options.series[1].data = [this.chartData2[val][0]];
} else if(mgData == "台时产量"){
that.options.xAxis.data = ["台时产量"]
that.options.yAxis[0].name = "(t/h)"
that.options.series[0].data = [this.chartData1[val][1]];
that.options.series[1].data = [this.chartData2[val][1]];
} else if(mgData == "运转时间"){
that.options.xAxis.data = ["运转时间"]
that.options.yAxis[0].name = "(h)"
that.options.series[0].data = [this.chartData1[val][2]];
that.options.series[1].data = [this.chartData2[val][2]];
} else if(mgData == "运转率"){
that.options.xAxis.data = ["运转率"]
that.options.yAxis[0].name = "(%)"
that.options.series[0].data = [this.chartData1[val][3]];
that.options.series[1].data = [this.chartData2[val][3]];
} else if(mgData == "单位产品电耗"){
that.options.xAxis.data = ["单位产品电耗"]
that.options.yAxis[0].name = "(kW/h)"
that.options.series[0].data = [this.chartData1[val][4]];
that.options.series[1].data = [this.chartData2[val][4]];
} else if(mgData == "单位产品综合电耗"){
that.options.xAxis.data = ["单位产品综合电耗"]
that.options.yAxis[0].name = "(kW/h)"
that.options.series[0].data = [this.chartData1[val][5]];
that.options.series[1].data = [this.chartData2[val][5]];
} else if(mgData == "单位产品标煤耗"){
that.options.xAxis.data = ["单位产品标煤耗"]
that.options.yAxis[0].name = "(t)"
that.options.series[0].data = [this.chartData1[val][6]];
that.options.series[1].data = [this.chartData2[val][6]];
} else if(mgData == "单位产品综合能耗"){
console.log(this.chartData1[val][7])
that.options.xAxis.data = ["单位产品综合能耗"]
that.options.yAxis[0].name = "(kW/h)"
that.options.series[0].data = [this.chartData1[val][7]];
that.options.series[1].data = [this.chartData2[val][7]];
}
that.myChart.clear(); that.myChart.clear();
that.myChart.setOption(that.options); that.myChart.setOption(that.options);
}, },

View File

@ -158,12 +158,12 @@
</template> </template>
<script> <script>
const colors = [ const colors = [
"#647bfe",
"#8698fe", "#8698fe",
"#a9b6fe", "#a9b6fe",
"#cbd3fe", "#cbd3fe",
"#91CC75", "#91CC75",
"#EE6666", "#EE6666",
"#647bfe",
]; ];
let tooltip = { let tooltip = {
show: true, show: true,
@ -374,12 +374,7 @@ export default {
obj.ordering = "report_sortstr"; obj.ordering = "report_sortstr";
obj.material__code__in = "elec,elec_0"; obj.material__code__in = "elec,elec_0";
this.$API.enm.mpoint.list.req(obj).then((res) => { this.$API.enm.mpoint.list.req(obj).then((res) => {
console.log("mpoints", res); const arr = res.filter(item => item.name !== "烧成车间合计").map(item => item.name)
let arr = [];
res.forEach((item) => {
arr.push(item.name);
});
console.log("arr", arr);
that.mpoints = arr; that.mpoints = arr;
}); });
}, },
@ -429,6 +424,9 @@ export default {
.then((res) => { .then((res) => {
that.tableData = res; that.tableData = res;
res.forEach((item) => { res.forEach((item) => {
if (item.mpoint_name === "烧成车间合计") {
return;
}
let index = that.mpoints.indexOf(item.mpoint_name); let index = that.mpoints.indexOf(item.mpoint_name);
let obj = []; let obj = [];
obj[0] = item.mpoint_nickname?item.mpoint_nickname:item.mpoint_name;; obj[0] = item.mpoint_nickname?item.mpoint_nickname:item.mpoint_name;;
@ -529,6 +527,9 @@ export default {
} }
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
if (item.mpoint_name === "烧成车间合计") {
return;
}
let index = that.mpoints.indexOf(item.mpoint_name); //mpoint let index = that.mpoints.indexOf(item.mpoint_name); //mpoint
if(index==-1){ if(index==-1){
return; return;
@ -573,6 +574,9 @@ export default {
} }
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
if (item.mpoint_name === "烧成车间合计") {
return;
}
let index = that.mpoints.indexOf(item.mpoint_name); //mpoint let index = that.mpoints.indexOf(item.mpoint_name); //mpoint
if(index==-1){ if(index==-1){
return; return;
@ -617,6 +621,9 @@ export default {
} }
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
if (item.mpoint_name === "烧成车间合计") {
return;
}
let ind = item.month_s - 1; let ind = item.month_s - 1;
let index = that.mpoints.indexOf(item.mpoint_name); //mpoint let index = that.mpoints.indexOf(item.mpoint_name); //mpoint
if(index==-1){ if(index==-1){

View File

@ -42,14 +42,12 @@
<tr v-for="(item, index) in tableDatas" :key="item"> <tr v-for="(item, index) in tableDatas" :key="item">
<td <td
class="numCell" class="numCell"
v-if="index == 0 || index == 2" v-if="index == 0 || index == 2 || index == 4"
rowspan="2" rowspan="2"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td class="numCell" v-else-if="index == 4">
{{ item[0] }}
</td>
<td class="numCell">{{ item[1] }}</td> <td class="numCell">{{ item[1] }}</td>
<td <td
class="numCell hoursItem" class="numCell hoursItem"
@ -242,6 +240,7 @@ let yAxis = [
}, },
]; ];
import scEcharts from "@/components/scEcharts"; import scEcharts from "@/components/scEcharts";
import { th } from "element-plus/es/locales.mjs";
import { defineAsyncComponent } from "vue"; import { defineAsyncComponent } from "vue";
export default { export default {
components: { components: {
@ -272,6 +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]
], ],
tableName: "生产报告", tableName: "生产报告",
modelValue: true, modelValue: true,
@ -495,6 +495,7 @@ export default {
that.tableDatas[2][3] = data3.run_hour; that.tableDatas[2][3] = data3.run_hour;
that.tableDatas[3][3] = data3.run_rate; that.tableDatas[3][3] = data3.run_rate;
that.tableDatas[4][3] = data3.elec_consume_unit; that.tableDatas[4][3] = data3.elec_consume_unit;
that.tableDatas[5][3] = data3.elec_consume;
} }
}); });
// //
@ -511,6 +512,7 @@ export default {
let data4 = res4[0]; let data4 = res4[0];
that.tableDatas[0][2] = data4.total_production; that.tableDatas[0][2] = data4.total_production;
that.tableDatas[4][2] = data4.elec_consume_unit; that.tableDatas[4][2] = data4.elec_consume_unit;
that.tableDatas[5][2] = data4.elec_consume;
} }
}); });
// //
@ -583,6 +585,7 @@ export default {
that.tableDatas[3][8] that.tableDatas[3][8]
); );
that.tableDatas[4][5] = data1.elec_consume_unit; that.tableDatas[4][5] = data1.elec_consume_unit;
that.tableDatas[5][5] = data1.elec_consume;
that.tableDatas[4][9] = precen( that.tableDatas[4][9] = precen(
(that.tableDatas[4][5]-that.tableDatas[4][8]), (that.tableDatas[4][5]-that.tableDatas[4][8]),
that.tableDatas[4][8] that.tableDatas[4][8]
@ -621,6 +624,7 @@ export default {
that.tableDatas[3][6] that.tableDatas[3][6]
); );
that.tableDatas[4][4] = data2.elec_consume_unit; that.tableDatas[4][4] = data2.elec_consume_unit;
that.tableDatas[5][4] = data2.elec_consume;
that.tableDatas[4][7] = precen( that.tableDatas[4][7] = precen(
(that.tableDatas[4][4]-that.tableDatas[4][6]), (that.tableDatas[4][4]-that.tableDatas[4][6]),
that.tableDatas[4][6] that.tableDatas[4][6]
@ -728,7 +732,7 @@ export default {
options.series[2].data = seriesData2; options.series[2].data = seriesData2;
options.series[3].data = seriesData3; options.series[3].data = seriesData3;
let dayXAxis = []; let dayXAxis = [];
for (let i = 1; i <= that.days; i++) { for (let i = 1; i <= data.length; i++) {
let item = i + "日"; let item = i + "日";
dayXAxis.push(item); dayXAxis.push(item);
} }

View File

@ -92,7 +92,7 @@ export default {
let year = myDate.getFullYear(); let year = myDate.getFullYear();
that.query.year_s = year; that.query.year_s = year;
that.$API.mtm.mgroup.list that.$API.mtm.mgroup.list
.req({ page: 0, search: "煤磨" }) .req({ page: 0, name: "煤磨" })
.then((res) => { .then((res) => {
console.log("煤磨", res); console.log("煤磨", res);
that.query.mgroup = res[0].id; that.query.mgroup = res[0].id;

View File

@ -118,7 +118,7 @@ export default {
let year = myDate.getFullYear(); let year = myDate.getFullYear();
that.query.year_s = year; that.query.year_s = year;
that.$API.mtm.mgroup.list that.$API.mtm.mgroup.list
.req({ page: 0, search: "煤磨" }) .req({ page: 0, name: "煤磨" })
.then((res) => { .then((res) => {
console.log("煤磨", res); console.log("煤磨", res);
that.query.mgroup = res[0].id; that.query.mgroup = res[0].id;

View File

@ -306,7 +306,7 @@ export default {
let year = myDate.getFullYear(); let year = myDate.getFullYear();
that.query.year_s = year; that.query.year_s = year;
that.$API.mtm.mgroup.list that.$API.mtm.mgroup.list
.req({ page: 0, search: "余热发电" }) .req({ page: 0, name: "余热发电" })
.then((res) => { .then((res) => {
console.log("余热发电", res); console.log("余热发电", res);
that.query.mgroup = res[0].id; that.query.mgroup = res[0].id;

View File

@ -90,19 +90,19 @@
<th colspan="4">电石渣</th> <th colspan="4">电石渣</th>
<th colspan="4">原料磨</th> <th colspan="4">原料磨</th>
<th rowspan="2">压缩空气m3</th> <th rowspan="2">压缩空气m3</th>
<th rowspan="2">车间用水t</th> <th rowspan="2">单位压缩空气m3/t</th>
</tr> </tr>
<tr v-if="deptName=='烧成车间'"> <tr v-if="deptName=='烧成车间'">
<th colspan="10">回转窑</th> <th colspan="10">回转窑</th>
<th colspan="4">煤磨</th> <th colspan="4">煤磨</th>
<th rowspan="2">压缩空气m3</th> <th rowspan="2">压缩空气m3</th>
<th rowspan="2">车间用水t</th> <th rowspan="2">单位压缩空气m3/t</th>
</tr> </tr>
<tr v-if="deptName=='水泥车间'"> <tr v-if="deptName=='水泥车间'">
<th colspan="4">水泥磨</th> <th colspan="4">水泥磨</th>
<th colspan="4">包装</th> <th colspan="4">包装</th>
<th rowspan="2">压缩空气m3</th> <th rowspan="2">压缩空气m3</th>
<th rowspan="2">车间用水t</th> <th rowspan="2">单位压缩空气m3/t</th>
</tr> </tr>
<tr> <tr>
<th>电量KW.h</th> <th>电量KW.h</th>
@ -238,7 +238,6 @@
wrapArr[ind][1]=item wrapArr[ind][1]=item
}else if(item.mgroup_name=='原料压缩空气'){ }else if(item.mgroup_name=='原料压缩空气'){
wrapArr[ind][2]=item wrapArr[ind][2]=item
}else if(item.mgroup_name=='原料车间用水'){
wrapArr[ind][3]=item wrapArr[ind][3]=item
} }
}else if(that.deptName=='烧成车间'){ }else if(that.deptName=='烧成车间'){
@ -246,8 +245,6 @@
wrapArr[ind][0]=item wrapArr[ind][0]=item
}else if (item.mgroup_name=='烧成压缩空气') { }else if (item.mgroup_name=='烧成压缩空气') {
wrapArr[ind][2]=item wrapArr[ind][2]=item
}
else if (item.mgroup_name=='烧成车间用水') {
wrapArr[ind][3]=item wrapArr[ind][3]=item
}else{ }else{
wrapArr[ind][1]=item wrapArr[ind][1]=item
@ -257,7 +254,6 @@
wrapArr[ind][0]=item wrapArr[ind][0]=item
}else if(item.mgroup_name=='水泥压缩空气'){ }else if(item.mgroup_name=='水泥压缩空气'){
wrapArr[ind][2]=item wrapArr[ind][2]=item
}else if(item.mgroup_name=='水泥车间用水'){
wrapArr[ind][3]=item wrapArr[ind][3]=item
}else if(item.mgroup_name=='水泥包装'){ }else if(item.mgroup_name=='水泥包装'){
wrapArr[ind][1]=item wrapArr[ind][1]=item
@ -318,11 +314,21 @@
}else{ }else{
itemArr.push( 0) itemArr.push( 0)
} }
if(item1 &&item1[3]){ if(item1[0].mgroup_name == '水泥磨' || item1[0].mgroup_name == '回转窑'){
itemArr.push(item1[3].water_consume)// if (item1[0].total_production !=0 && item1[3]){
itemArr.push((item1[3].cair_consume/item1[0].total_production).toFixed(2))//
}else{ }else{
itemArr.push(0) itemArr.push(0)
} }
}else{
if(parseFloat(item1[1].total_production) != 0 && item1[3]){
itemArr.push((item1[3].cair_consume/item1[1].total_production).toFixed(2))//
}else{
itemArr.push(0)
}
}
innerArr.push(itemArr) innerArr.push(itemArr)
} }
}) })

View File

@ -3,14 +3,46 @@
<div class="app-container" id="app-container" style="height: 100%"> <div class="app-container" id="app-container" style="height: 100%">
<el-header id="app-header"> <el-header id="app-header">
<div class="left-panel"> <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 <el-date-picker
v-model="search_date" v-model="query.day"
type="date" type="date"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
format="YYYY-MM-DD" format="YYYY-MM-DD"
placeholder="天" placeholder="天"
v-if="query.type==0"
style="margin-right: 6px" style="margin-right: 6px"
@change="dateChange" />
<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 <el-button
type="primary" type="primary"
@ -29,95 +61,9 @@
<el-main> <el-main>
<el-card> <el-card>
<div> <div>
<!-- <div ref="print" id="myReport" class="printContainer"> -->
<div ref="print" id="myReport" class="printContainer"> <div ref="print" id="myReport" class="printContainer">
<!-- <table
border="1"
width="2700"
cellspacing="0"
:key="timeStamp"
id="myTable"
class="myTable"
>
<thead class="myTableHead">
<tr>
<th colspan="28">电量消耗小时报表</th>
</tr>
<tr>
<th>工段</th>
<th>设备</th>
<th>单位</th>
<th v-for="item in 24" :key="item">
{{ item - 1 }}
</th>
<th>本日合计</th>
</tr>
</thead>
<tr v-for="(item, index) in tableDatas" :key="index">
<td class="numCell" v-if="index == 0" rowspan="4">
{{ item[0] }}
</td>
<td
class="numCell"
v-else-if="index == 4"
rowspan="5"
>
{{ item[0] }}
</td>
<td
class="numCell"
v-else-if="index == 9"
rowspan="5"
>
{{ item[0] }}
</td>
<td
class="numCell"
v-else-if="index == 14"
rowspan="4"
>
{{ item[0] }}
</td>
<td
class="numCell"
v-else-if="index == 18"
rowspan="3"
>
{{ item[0] }}
</td>
<td
class="numCell"
v-else-if="index == 21"
rowspan="5"
>
{{ item[0] }}
</td>
<td
class="numCell"
v-else-if="
index == 26 ||
index == 27 ||
index == 28 ||
index == 29
"
>
{{ item[0] }}
</td>
<td class="numCell">{{ item[1] }}</td>
<td class="numCell">{{ item[2] }}</td>
<td
class="numCell"
v-for="hour_item in hours"
:key="hour_item"
@click="itemClick(item, index)"
>
{{ item[2 + hour_item] }}
</td>
<td class="numCell">{{ item[27] }}</td>
</tr>
</table> -->
<el-table <el-table
v-if="query.type==0"
id="hourBaseTable" id="hourBaseTable"
:data="tableDatas2" :data="tableDatas2"
style="width: 100%" style="width: 100%"
@ -158,6 +104,90 @@
> >
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-table
v-if="query.type==1"
id="hourBaseTable"
:data="tableDatas_day"
style="width: 100%"
border
:height="tableHeight"
:span-method="objectSpanMethod"
@cell-click="handleCellClick1"
>
<el-table-column
label="工段"
prop="mgroupName"
width="100"
fixed
>
</el-table-column>
<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"
:span-method="objectSpanMethod"
@cell-click="handleCellClick_month"
>
<el-table-column
label="工段"
prop="mgroupName"
width="100"
fixed
>
</el-table-column>
<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>
</div> </div>
</div> </div>
</el-card> </el-card>
@ -182,15 +212,31 @@ export default {
}, },
data() { data() {
return { return {
days: 30,
day: "", day: "",
year: "", year: "",
month: "", month: "",
search_date: "", search_date: "",
query:{
type:0,
day:'',
year:'',
month:'',
yearStart:'',
},
mgroupObj: {}, mgroupObj: {},
indexList: [], indexList: [],
mpointList: [], mpointList: [],
tableDatas: [], tableDatas: [],
options: [
{id:0,name:'日统计'},
{id:1,name:'月统计'},
{id:2,name:'年统计'},
],
tableDatas2: [], tableDatas2: [],
tableDatas_day:[],
tableDatas_month:[],
months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
hours: [ hours: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 19, 20, 21, 22, 23, 24,
@ -304,6 +350,8 @@ export default {
], ],
}, },
xAxisData: [], xAxisData: [],
xAxisData_day: [],
xAxisData_month: [],
}; };
}, },
mounted() { mounted() {
@ -313,22 +361,22 @@ export default {
let month = nowDate.getMonth() + 1; let month = nowDate.getMonth() + 1;
let day = nowDate.getDate(); let day = nowDate.getDate();
that.timeStamp = nowDate.getTime(); that.timeStamp = nowDate.getTime();
let month_s = month > 9 ? month : "0" + month; that.days = new Date(year, month, 0).getDate();
let day_s = day > 9 ? day : "0" + day;
that.day = day; that.day = day;
that.year = year; that.year = year;
that.month = month; that.month = month;
that.search_date = year + "-" + month_s + "-" + day_s;
// for (let i = 0; i < that.tableDatas.length; i++) {
// for (let j = 0; j < 24; j++) {
// let k = 3 + j;
// that.tableDatas[i][k] = 0;
// this.$forceUpdate();
// }
// }
for (let n = 0; n < 24; n++) { for (let n = 0; n < 24; n++) {
that.xAxisData.push(n + "时"); that.xAxisData.push(n + "时");
} }
that.timeStamp = nowDate.getTime();
that.headerLength = that.days + 4;
that.tableWidth = that.headerLength * 100 + "";
for (let n = 1; n <= that.days; n++) {
that.xAxisData_day.push(n + "日");
}
for (let n = 1; n < 13; n++) {
that.xAxisData_month.push(n + "月");
}
this.getMPoints(); this.getMPoints();
let heightContainer = let heightContainer =
document.getElementById("app-container").clientHeight; document.getElementById("app-container").clientHeight;
@ -354,24 +402,28 @@ export default {
} }
} }
}, },
dateChange(e) { dateChange() {
let that = this; let that = this;
that.tableDatas = []; that.tableDatas = [];
let arr = that.search_date.split("-"); let arr = [];
if(that.query.type==0){//
arr = that.query.day.split('-');
that.year = Number(arr[0]); that.year = Number(arr[0]);
that.month = Number(arr[1]); that.month = Number(arr[1]);
that.day = Number(arr[2]); that.day = Number(arr[2]);
// for (let i = 0; i < that.tableDatas.length; i++) { that.dataLoop();
// for (let j = 0; j < 25; j++) { }else if(that.query.type==1){//
// let k = 3 + j; let arr = that.query.month.split('-');
// that.tableDatas[i][k] = 0; that.year = Number(arr[0]);
// this.$forceUpdate(); that.month = Number(arr[1]);
// } that.dataLoop1();
// } }else if (that.query.type==2){
that.year = that.query.year;
that.dataLoop_month();
}
let nowDate = new Date(); let nowDate = new Date();
that.timeStamp = nowDate.getTime(); that.timeStamp = nowDate.getTime();
// that.getLengthData(); // that.getLengthData();
that.dataLoop();
}, },
getMPoints() { getMPoints() {
let that = this; let that = this;
@ -472,32 +524,152 @@ export default {
that.$forceUpdate(); that.$forceUpdate();
}); });
}, },
getHourData() { dataLoop1() {
let that = this; let that = this;
let m = 0; that.tableDatas = [];
let date = new Date(); that.tableDatas_day = [];
let year = date.getFullYear(); let _mgroup = [],
let month = date.getMonth() + 1; _nameLength = [],
let day = date.getDate(); indexList = [];
let hour = date.getHours(); let mgroupObj = {};
let minute = date.getMinutes(); that.mpointList.forEach((item, index) => {
let second = date.getSeconds(); let indexs = _mgroup.indexOf(item.mgroup_name);
}, if (indexs > -1) {
getTableData() { _nameLength[indexs] += 1;
for (let i = 0; i < this.tableDatas.length; i++) {
let k = 0;
if (i == 0 || i == 2 || i == 9 || i == 23 || i == 27) {
k = 3;
} else if (i == 49) {
k = 1;
} else { } else {
k = 2; _mgroup.push(item.mgroup_name);
_nameLength.push(1);
indexList.push(index);
} }
for (let j = k; j < this.tableDatas[i].length; j++) {
this.tableDatas[i][j] = 0; 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 + 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_day.push(obj);
that.getData1(item.id, index);
});
that.mgroupObj = mgroupObj;
that.indexList = indexList;
}, },
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;
});
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.mgroupObj = mgroupObj;
that.indexList = indexList;
},
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) => {
console.log(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;
});
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) { handleCellClick(row, column, cell, event) {
let that = this; let that = this;
console.log("row", row); console.log("row", row);
@ -510,11 +682,23 @@ export default {
that.option.series[0].data = lineData; that.option.series[0].data = lineData;
this.itemVisible = true; this.itemVisible = true;
}, },
itemClick(item, index) { handleCellClick1(row, column, cell, event) {
let that = this; let that = this;
let index = that.tableDatas_day.indexOf(row);
console.log('row', row)
that.tableName = `${row.nickname}-电量日统计` that.tableName = `${row.nickname}-电量日统计`
let lineData = that.tableDatas[index].slice(3, that.headerLength); let lineData = that.tableDatas[index].slice(3, that.days + 3);
that.option.xAxis.data = that.xAxisData; 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(3, 14);
that.option.xAxis.data = that.xAxisData_month;
that.option.series[0].data = lineData; that.option.series[0].data = lineData;
this.itemVisible = true; this.itemVisible = true;
}, },

View File

@ -53,11 +53,11 @@
<td <td
class="numCell" class="numCell"
v-else-if="index == 4" v-else-if="index == 4"
rowspan="4" rowspan="5"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td class="numCell" v-else-if="index == 8"> <td class="numCell" v-else-if="index == 9">
{{ item[0] }} {{ item[0] }}
</td> </td>
<td class="numCell">{{ item[1] }}</td> <td class="numCell">{{ item[1] }}</td>
@ -437,6 +437,7 @@ 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],
["成本", "单位产品成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0], ["成本", "单位产品成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0],
], ],
tableName: "生产报告", tableName: "生产报告",
@ -664,7 +665,7 @@ export default {
let days_h = hourDate.getDate(); let days_h = hourDate.getDate();
let hours_h = hourDate.getHours(); let hours_h = hourDate.getHours();
that.$API.mtm.mgroup.list that.$API.mtm.mgroup.list
.req({ page: 0, search: "回转窑" }) .req({ page: 0, name: "回转窑" })
.then((res) => { .then((res) => {
console.log("回转窑", res); console.log("回转窑", res);
that.query.mgroup = res[0].id; that.query.mgroup = res[0].id;
@ -687,7 +688,8 @@ export default {
that.tableDatas[5][3] = data3.celec_consume_unit; that.tableDatas[5][3] = data3.celec_consume_unit;
that.tableDatas[6][3] = data3.coal_consume_unit; that.tableDatas[6][3] = data3.coal_consume_unit;
that.tableDatas[7][3] = data3.cen_consume_unit; that.tableDatas[7][3] = data3.cen_consume_unit;
that.tableDatas[8][3] = data3.production_cost_unit; that.tableDatas[8][3] = data3.elec_consume;
that.tableDatas[9][3] = data3.production_cost_unit;
} }
}); });
// //
@ -707,7 +709,8 @@ export default {
that.tableDatas[5][2] = data4.celec_consume_unit; that.tableDatas[5][2] = data4.celec_consume_unit;
that.tableDatas[6][2] = data4.coal_consume_unit; that.tableDatas[6][2] = data4.coal_consume_unit;
that.tableDatas[7][2] = data4.cen_consume_unit; that.tableDatas[7][2] = data4.cen_consume_unit;
that.tableDatas[8][2] = data4.production_cost_unit; that.tableDatas[8][2] = data4.elec_consume;
that.tableDatas[9][2] = data4.production_cost_unit;
} }
}); });
let params5 = {}; let params5 = {};
@ -766,8 +769,8 @@ export default {
item5.goal_cate_name == item5.goal_cate_name ==
"单位产品成本(元/吨)" "单位产品成本(元/吨)"
) { ) {
that.tableDatas[8][6] = item5[str]; that.tableDatas[9][6] = item5[str];
that.tableDatas[8][8] = item5.goal_val; that.tableDatas[9][8] = item5.goal_val;
} }
}); });
} }
@ -823,11 +826,12 @@ export default {
(that.tableDatas[7][5]-that.tableDatas[7][8]), (that.tableDatas[7][5]-that.tableDatas[7][8]),
that.tableDatas[7][8] that.tableDatas[7][8]
); );
that.tableDatas[8][5] = that.tableDatas[8][5] = data1.elec_consume;
that.tableDatas[9][5] =
data1.production_cost_unit; data1.production_cost_unit;
that.tableDatas[8][9] = precen( that.tableDatas[9][9] = precen(
(that.tableDatas[8][5]-that.tableDatas[8][8]), (that.tableDatas[9][5]-that.tableDatas[9][8]),
that.tableDatas[8][8] that.tableDatas[9][9]
); );
} else { } else {
} }
@ -883,11 +887,12 @@ export default {
that.tableDatas[7][4]-that.tableDatas[7][6], that.tableDatas[7][4]-that.tableDatas[7][6],
that.tableDatas[7][6] that.tableDatas[7][6]
); );
that.tableDatas[8][4] = that.tableDatas[8][4] = data2.elec_consume;
that.tableDatas[9][4] =
data2.production_cost_unit; data2.production_cost_unit;
that.tableDatas[8][7] = precen( that.tableDatas[9][7] = precen(
that.tableDatas[8][4]-that.tableDatas[8][6], that.tableDatas[9][4]-that.tableDatas[9][6],
that.tableDatas[8][6] that.tableDatas[9][6]
); );
} }
}); });
@ -1004,7 +1009,7 @@ export default {
options.series[4].data = seriesData4; options.series[4].data = seriesData4;
options.series[5].data = seriesData5; options.series[5].data = seriesData5;
let dayXAxis = []; let dayXAxis = [];
for (let i = 1; i <= that.days; i++) { for (let i = 1; i <= data.length; i++) {
let item = i + "日"; let item = i + "日";
dayXAxis.push(item); dayXAxis.push(item);
} }

View File

@ -655,7 +655,7 @@ export default {
let days_h = hourDate.getDate(); let days_h = hourDate.getDate();
let hours_h = hourDate.getHours(); let hours_h = hourDate.getHours();
that.$API.mtm.mgroup.list that.$API.mtm.mgroup.list
.req({ page: 0, search: "回转窑" }) .req({ page: 0, name: "回转窑" })
.then((res) => { .then((res) => {
console.log("回转窑", res); console.log("回转窑", res);
that.query.mgroup = res[0].id; that.query.mgroup = res[0].id;

View File

@ -308,7 +308,7 @@ export default {
that.query.year_s = year; that.query.year_s = year;
that.timeStamp = myDate.getTime(); that.timeStamp = myDate.getTime();
that.$API.mtm.mgroup.list that.$API.mtm.mgroup.list
.req({ page: 0, search: "回转窑" }) .req({ page: 0, name: "回转窑" })
.then((res) => { .then((res) => {
console.log("回转窑", res); console.log("回转窑", res);
that.query.mgroup = res[0].id; that.query.mgroup = res[0].id;

View File

@ -43,13 +43,16 @@
<td <td
class="numCell" class="numCell"
v-if=" v-if="
index == 0 || index == 2 || index == 4 index == 0 || index == 2
" "
rowspan="2" rowspan="2"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td class="numCell" v-else-if="index == 6"> <td class="numCell" v-else-if="index == 4"
rowspan="3"
>{{ item[0] }}</td>
<td class="numCell" v-else-if="index == 7">
{{ item[0] }} {{ item[0] }}
</td> </td>
<td class="numCell">{{ item[1] }}</td> <td class="numCell">{{ item[1] }}</td>
@ -404,6 +407,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],
["成本", "单位产品成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0], ["成本", "单位产品成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0],
], ],
tableName: "生产报告", tableName: "生产报告",
@ -633,7 +637,8 @@ export default {
that.tableDatas[3][3] = data3.run_rate; that.tableDatas[3][3] = data3.run_rate;
that.tableDatas[4][3] = data3.elec_consume_unit; that.tableDatas[4][3] = data3.elec_consume_unit;
that.tableDatas[5][3] = data3.cen_consume_unit; that.tableDatas[5][3] = data3.cen_consume_unit;
that.tableDatas[6][3] = data3.production_cost_unit; that.tableDatas[6][3] = data3.elec_consume;
that.tableDatas[7][3] = data3.production_cost_unit;
} }
}); });
// //
@ -651,7 +656,8 @@ export default {
that.tableDatas[0][2] = data4.total_production; that.tableDatas[0][2] = data4.total_production;
that.tableDatas[4][2] = data4.elec_consume_unit; that.tableDatas[4][2] = data4.elec_consume_unit;
that.tableDatas[5][2] = data4.cen_consume_unit; that.tableDatas[5][2] = data4.cen_consume_unit;
that.tableDatas[6][2] = data4.production_cost_unit; that.tableDatas[6][2] = data4.elec_consume;
that.tableDatas[7][2] = data4.production_cost_unit;
} }
}); });
// //
@ -699,8 +705,8 @@ export default {
item5.goal_cate_name == item5.goal_cate_name ==
"单位产品成本(元/吨)" "单位产品成本(元/吨)"
) { ) {
that.tableDatas[6][6] = item5[str]; that.tableDatas[7][6] = item5[str];
that.tableDatas[6][8] = item5.goal_val; that.tableDatas[7][8] = item5.goal_val;
} }
}); });
} }
@ -745,11 +751,12 @@ export default {
that.tableDatas[5][5]-that.tableDatas[5][8], that.tableDatas[5][5]-that.tableDatas[5][8],
that.tableDatas[5][8] that.tableDatas[5][8]
); );
that.tableDatas[6][5] = that.tableDatas[6][5] = data1.elec_consume;
that.tableDatas[7][5] =
data1.production_cost_unit; data1.production_cost_unit;
that.tableDatas[6][9] = precen( that.tableDatas[7][9] = precen(
that.tableDatas[6][5]-that.tableDatas[6][8], that.tableDatas[7][5]-that.tableDatas[7][8],
that.tableDatas[6][8] that.tableDatas[7][8]
); );
} else { } else {
} }
@ -794,11 +801,12 @@ export default {
that.tableDatas[5][4]-that.tableDatas[5][6], that.tableDatas[5][4]-that.tableDatas[5][6],
that.tableDatas[5][6] that.tableDatas[5][6]
); );
that.tableDatas[6][4] = that.tableDatas[7][4] =
data2.production_cost_unit; data2.production_cost_unit;
that.tableDatas[6][7] = precen( that.tableDatas[6][4] = data2.elec_consume;
that.tableDatas[6][4]-that.tableDatas[6][6], that.tableDatas[7][7] = precen(
that.tableDatas[6][6] that.tableDatas[7][4]-that.tableDatas[7][6],
that.tableDatas[7][6]
); );
} }
}); });
@ -909,7 +917,7 @@ export default {
options.series[3].data = seriesData3; options.series[3].data = seriesData3;
options.series[4].data = seriesData4; options.series[4].data = seriesData4;
let dayXAxis = []; let dayXAxis = [];
for (let i = 1; i <= that.days; i++) { for (let i = 1; i <= data.length; i++) {
let item = i + "日"; let item = i + "日";
dayXAxis.push(item); dayXAxis.push(item);
} }

View File

@ -40,7 +40,10 @@
<tbody> <tbody>
<tr v-for="(item, index) in tableDatas" :key="item"> <tr v-for="(item, index) in tableDatas" :key="item">
<td rowspan="8" v-if="index == 0" class="numCell">{{ item[0] }}</td> <td rowspan="8" v-if="index == 0" class="numCell">{{ item[0] }}</td>
<td v-else-if="index==8||index==9" class="numCell">{{ item[0] }}</td> <td v-else-if="index==8" class="numCell">{{ item[0] }}</td>
<td v-else-if="index==9" class="numCell"
rowspan="2"
>{{ item[0] }}</td>
<td class="numCell">{{ item[1] }}</td> <td class="numCell">{{ item[1] }}</td>
<td <td
class="numCell hoursItem" class="numCell hoursItem"
@ -337,6 +340,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],
], ],
tableName: "生产报告", tableName: "生产报告",
@ -568,6 +572,7 @@ export default {
that.tableDatas[8][4] = item.val; that.tableDatas[8][4] = item.val;
}else if (item.mpoint_name == "包装进线") { }else if (item.mpoint_name == "包装进线") {
that.tableDatas[9][4] = item.elec_consume_unit; that.tableDatas[9][4] = item.elec_consume_unit;
that.tableDatas[10][4] = item.val;
} }
} }
)} )}
@ -602,6 +607,7 @@ export default {
that.tableDatas[8][3] = item.val; that.tableDatas[8][3] = item.val;
}else if (item.mpoint_name == "包装进线") { }else if (item.mpoint_name == "包装进线") {
that.tableDatas[9][3] = item.elec_consume_unit; that.tableDatas[9][3] = item.elec_consume_unit;
that.tableDatas[10][3] = item.val;
} }
} }
) )
@ -683,6 +689,7 @@ export default {
that.tableDatas[8][2] = item.val; that.tableDatas[8][2] = item.val;
}else if (item.mpoint_name == "包装进线") { }else if (item.mpoint_name == "包装进线") {
that.tableDatas[9][2] = item.elec_consume_unit; that.tableDatas[9][2] = item.elec_consume_unit;
that.tableDatas[10][2] = item.val;
} }
} }
) )

View File

@ -40,36 +40,25 @@
<th rowspan="3">实际产量t</th> <th rowspan="3">实际产量t</th>
<!-- <th rowspan="3">总成本</th> --> <!-- <th rowspan="3">总成本</th> -->
<th rowspan="3">单位成本/</th> <th rowspan="3">单位成本/</th>
<th :colspan="materialList.length">直接材料</th> <!-- <th :colspan="materialList.length">直接材料</th> -->
<th colspan="10">制造费用</th>
</tr> </tr>
<tr> <tr>
<th v-if="data1 > 0" :colspan="data1">原材料</th> <th v-if="data1 > 0" :colspan="data1">原材料</th>
<th v-if="data3 > 0" :colspan="data3">辅助材料</th> <th v-if="data3 > 0" :colspan="data3">辅助材料</th>
<th v-if="data2 > 0" :colspan="data2">/</th> <th v-if="data2 > 0" :colspan="data2">/</th>
<th>摊销</th> <th colspan="7">制造费用</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> <th>装卸费</th>
<th>修理费</th> <th>修理费</th>
<th>材料出库</th> <th>材料出库</th>
<th>倒运费用</th>
<th>直接人工</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>
<th>单位成本/</th>
</tr> </tr>
</thead> </thead>
<tr v-for="(item, index) in tableData1" :key="index"> <tr v-for="(item, index) in tableData1" :key="index">
@ -303,6 +292,9 @@ export default {
} }
let otherdata = itemData.other_cost_data; let otherdata = itemData.other_cost_data;
for (let j = 0; j < otherdata.length; j++) { for (let j = 0; j < otherdata.length; j++) {
if (otherdata[j].cate == '其他费用' ||otherdata[j].cate == '倒运费用') {
continue;
}
dataArr.push((otherdata[j].cost_unit).toFixed(2)) dataArr.push((otherdata[j].cost_unit).toFixed(2))
} }
that.tableData1.push(dataArr) that.tableData1.push(dataArr)

View File

@ -142,6 +142,7 @@
], ],
year:'', year:'',
month:'', month:'',
tableName:'',
day:'', day:'',
hours:'', hours:'',
timeDate:'', timeDate:'',
@ -196,6 +197,7 @@
params.month_s = that.month; params.month_s = that.month;
params.day_s = that.day; params.day_s = that.day;
params.type = 'day_s'; params.type = 'day_s';
that.tableName = that.year+'-'+that.month+'-'+that.day+'-生产日报表';
this.$API.enm.enstat.req(params).then((res) => { this.$API.enm.enstat.req(params).then((res) => {
let dataList = {}; let dataList = {};
if(res.length <= 0){ if(res.length <= 0){
@ -318,6 +320,11 @@
handlePrint() { handlePrint() {
this.$PRINT('#myReport'); this.$PRINT('#myReport');
}, },
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myReport', this.tableName)
this.exportLoading = false;
},
} }
}; };
</script> </script>

View File

@ -119,6 +119,7 @@
month_t:'', month_t:'',
dataList:{}, dataList:{},
nowData:[], nowData:[],
tableName:'',
}; };
}, },
mounted() { mounted() {
@ -157,6 +158,7 @@
params.page = 0; params.page = 0;
params.year_s = that.year; params.year_s = that.year;
params.month_s = that.month; params.month_s = that.month;
that.tableName = that.year + '_' + that.month+'-生产月报表';
params.type = 'month_s'; params.type = 'month_s';
let m_goal_val = "goal_val_" + that.month let m_goal_val = "goal_val_" + that.month
this.$API.enm.enstat.req(params).then((res) => { this.$API.enm.enstat.req(params).then((res) => {
@ -463,6 +465,11 @@
handlePrint() { handlePrint() {
this.$PRINT('#myReport'); this.$PRINT('#myReport');
}, },
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myReport', this.tableName)
this.exportLoading = false;
},
} }
}; };
</script> </script>

View File

@ -158,12 +158,13 @@
</template> </template>
<script> <script>
const colors = [ const colors = [
"#647bfe", "#cbd3fe",
"#8698fe", "#8698fe",
"#EE6666",
"#a9b6fe", "#a9b6fe",
"#cbd3fe", "#cbd3fe",
"#91CC75", "#91CC75",
"#EE6666", "#647bfe",
]; ];
let tooltip = { let tooltip = {
show: true, show: true,
@ -423,10 +424,7 @@ export default {
obj.ordering = "report_sortstr"; obj.ordering = "report_sortstr";
obj.material__code__in = "elec,elec_0"; obj.material__code__in = "elec,elec_0";
this.$API.enm.mpoint.list.req(obj).then((res) => { this.$API.enm.mpoint.list.req(obj).then((res) => {
let arr = []; const arr = res.filter(item => item.name !== "原料车间合计").map(item => item.name)
res.forEach((item) => {
arr.push(item.name);
});
console.log("arr", arr); console.log("arr", arr);
that.mpoints = arr; that.mpoints = arr;
}); });
@ -478,6 +476,9 @@ export default {
that.tableData = res; that.tableData = res;
console.log("getTableHourData", res); console.log("getTableHourData", res);
res.forEach((item) => { res.forEach((item) => {
if (item.mpoint_name === "原料车间合计") {
return;
}
let index = that.mpoints.indexOf(item.mpoint_name); let index = that.mpoints.indexOf(item.mpoint_name);
let obj = []; let obj = [];
obj[0] = item.mpoint_nickname?item.mpoint_nickname:item.mpoint_name;; obj[0] = item.mpoint_nickname?item.mpoint_nickname:item.mpoint_name;;
@ -538,6 +539,9 @@ export default {
this.$API.enm.mpoint.stat.req(obj_m).then((res) => { this.$API.enm.mpoint.stat.req(obj_m).then((res) => {
console.log("getTableHourData", res); console.log("getTableHourData", res);
res.forEach((item, index) => { res.forEach((item, index) => {
if (item.mpoint_name === "原料车间合计"){
return;
}
let index_m = that.mpoints.indexOf( let index_m = that.mpoints.indexOf(
item.mpoint_name item.mpoint_name
); );
@ -579,6 +583,9 @@ export default {
} }
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
if (item.mpoint_name === "原料车间合计") {
return;
}
let index = that.mpoints.indexOf(item.mpoint_name); //mpoint let index = that.mpoints.indexOf(item.mpoint_name); //mpoint
if(index==-1){ if(index==-1){
return; return;
@ -623,6 +630,9 @@ export default {
} }
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
if (item.mpoint_name === "原料车间合计") {
return;
}
let index = that.mpoints.indexOf(item.mpoint_name); //mpoint let index = that.mpoints.indexOf(item.mpoint_name); //mpoint
if(index==-1){ if(index==-1){
return; return;
@ -669,6 +679,9 @@ export default {
} }
let data = response; let data = response;
data.forEach((item) => { data.forEach((item) => {
if (item.mpoint_name === "原料车间合计") {
return;
}
let ind = item.month_s - 1; let ind = item.month_s - 1;
let index = that.mpoints.indexOf(item.mpoint_name); //mpoint let index = that.mpoints.indexOf(item.mpoint_name); //mpoint
if(index==-1){ if(index==-1){

View File

@ -42,14 +42,14 @@
<tr v-for="(item, index) in tableDatas" :key="item"> <tr v-for="(item, index) in tableDatas" :key="item">
<td <td
class="numCell" class="numCell"
v-if="index == 0 || index == 2" v-if="index == 0 || index == 2 || index == 4"
rowspan="2" rowspan="2"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-if="index == 4 || index == 5" v-else-if="index == 6"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
@ -407,6 +407,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],
["成本", "生料成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0], ["成本", "生料成本(元/吨)", 0, 0, 0, 0, 0, 0, 0, 0],
], ],
tableName: "生产报告", tableName: "生产报告",
@ -830,7 +831,8 @@ export default {
that.tableDatas[2][3] = data3.run_hour; that.tableDatas[2][3] = data3.run_hour;
that.tableDatas[3][3] = data3.run_rate; that.tableDatas[3][3] = data3.run_rate;
that.tableDatas[4][3] = data3.elec_consume_unit; that.tableDatas[4][3] = data3.elec_consume_unit;
that.tableDatas[5][3] = data3.production_cost_unit; that.tableDatas[5][3] = data3.elec_consume;
that.tableDatas[6][3] = data3.production_cost_unit;
} }
}); });
// //
@ -847,7 +849,8 @@ export default {
let data4 = res4[0]; let data4 = res4[0];
that.tableDatas[0][2] = data4.total_production < 1 ? 0 : data4.total_production; that.tableDatas[0][2] = data4.total_production < 1 ? 0 : data4.total_production;
that.tableDatas[4][2] = data4.elec_consume_unit; that.tableDatas[4][2] = data4.elec_consume_unit;
that.tableDatas[5][2] = data4.production_cost_unit; that.tableDatas[5][2] = data4.elec_consume;
that.tableDatas[6][2] = data4.production_cost_unit;
} }
}); });
// //
@ -893,8 +896,8 @@ export default {
item5.goal_cate_name == item5.goal_cate_name ==
"单位产品成本(元/吨)" "单位产品成本(元/吨)"
) { ) {
that.tableDatas[5][6] = item5[str]; that.tableDatas[6][6] = item5[str];
that.tableDatas[5][8] = item5.goal_val; that.tableDatas[6][8] = item5.goal_val;
} }
}); });
} }
@ -937,11 +940,12 @@ export default {
(that.tableDatas[4][5]-that.tableDatas[4][8]), (that.tableDatas[4][5]-that.tableDatas[4][8]),
that.tableDatas[4][8] that.tableDatas[4][8]
); );
that.tableDatas[5][5] = that.tableDatas[5][5] = data1.elec_consume;
that.tableDatas[6][5] =
data1.production_cost_unit; data1.production_cost_unit;
that.tableDatas[5][9] = precen( that.tableDatas[6][9] = precen(
(that.tableDatas[5][5]-that.tableDatas[5][8]), (that.tableDatas[6][5]-that.tableDatas[6][8]),
that.tableDatas[5][8] that.tableDatas[6][8]
); );
} else { } else {
} }
@ -990,11 +994,12 @@ export default {
(that.tableDatas[4][4]-that.tableDatas[4][6]), (that.tableDatas[4][4]-that.tableDatas[4][6]),
that.tableDatas[4][6] that.tableDatas[4][6]
); );
that.tableDatas[5][4] = that.tableDatas[5][4] = data2.elec_consume;
that.tableDatas[6][4] =
data2.production_cost_unit; data2.production_cost_unit;
that.tableDatas[5][7] = precen( that.tableDatas[6][7] = precen(
(that.tableDatas[5][4]-that.tableDatas[5][6]), (that.tableDatas[6][4]-that.tableDatas[6][6]),
that.tableDatas[5][6] that.tableDatas[6][6]
); );
} }
}); });
@ -1107,7 +1112,7 @@ export default {
options.series[3].data = seriesData3; options.series[3].data = seriesData3;
options.series[4].data = seriesData4; options.series[4].data = seriesData4;
let dayXAxis = []; let dayXAxis = [];
for (let i = 1; i <= that.days; i++) { for (let i = 1; i <= data.length; i++) {
let item = i + "日"; let item = i + "日";
dayXAxis.push(item); dayXAxis.push(item);
} }

View File

@ -120,7 +120,7 @@ export default {
that.query.year_s = year; that.query.year_s = year;
that.timeStamp = myDate.getTime(); that.timeStamp = myDate.getTime();
that.$API.mtm.mgroup.list that.$API.mtm.mgroup.list
.req({ page: 0, search: "原料磨" }) .req({ page: 0, name: "原料磨" })
.then((res) => { .then((res) => {
console.log("原料磨", res); console.log("原料磨", res);
that.query.mgroup = res[0].id; that.query.mgroup = res[0].id;

View File

@ -120,7 +120,7 @@ export default {
that.query.year_s = year; that.query.year_s = year;
that.timeStamp = myDate.getTime(); that.timeStamp = myDate.getTime();
that.$API.mtm.mgroup.list that.$API.mtm.mgroup.list
.req({ page: 0, search: "原料磨" }) .req({ page: 0, name: "原料磨" })
.then((res) => { .then((res) => {
console.log("原料磨", res); console.log("原料磨", res);
that.query.mgroup = res[0].id; that.query.mgroup = res[0].id;

View File

@ -38,8 +38,15 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="item in tableDatas" :key="item"> <tr v-for="(item, index) in tableDatas" :key="item">
<td class="numCell" <td class="numCell"
v-if="index == 1 ||index == 4"
rowspan="2"
>
{{ item[0] }}
</td>
<td class="numCell"
v-else-if="index == 0 ||index == 3"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
@ -390,7 +397,7 @@ 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/t", 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, 0, 0, 0, 0, 0, 0, 0], ["湿电石渣", "进厂", 0, 0, 0, 0, 0, 0, 0, 0],
@ -561,7 +568,6 @@ export default {
let data3 = res3[0]; let data3 = res3[0];
that.tableDatas[0][2] = data3.total_production; that.tableDatas[0][2] = data3.total_production;
that.tableDatas[1][2] = data3.elec_consume_unit; that.tableDatas[1][2] = data3.elec_consume_unit;
console.log(data3.elec_consume);
that.tableDatas[2][2] = data3.elec_consume; that.tableDatas[2][2] = data3.elec_consume;
that.tableDatas[3][2] = data3.production_cost_unit; that.tableDatas[3][2] = data3.production_cost_unit;
if (data3.imaterial_data.length > 0) { if (data3.imaterial_data.length > 0) {
@ -751,7 +757,7 @@ export default {
options.series[4].data = seriesData4; options.series[4].data = seriesData4;
options.series[5].data = seriesData5; options.series[5].data = seriesData5;
let dayXAxis = []; let dayXAxis = [];
for (let i = 1; i <= that.days; i++) { for (let i = 1; i <= data.length; i++) {
let item = i + "日"; let item = i + "日";
dayXAxis.push(item); dayXAxis.push(item);
} }

View File

@ -20,7 +20,7 @@
<el-select <el-select
v-model="query.type" v-model="query.type"
placeholder="类型" placeholder="类型"
style="margin: 0 6px; width: 120px" style="margin: 0 6px; width: 160px"
@change="handleQuery" @change="handleQuery"
> >
<el-option <el-option
@ -57,27 +57,28 @@
@row-click="rowClick" @row-click="rowClick"
@dataChange="dataChange" @dataChange="dataChange"
> >
<el-table-column type="index" width="50" /> <el-table-column label="测点" prop="mpoint_name" min-width="100">
<el-table-column label="测点" prop="mpoint_name">
</el-table-column> </el-table-column>
<el-table-column label="所属集合" prop="mgroup_name"> <el-table-column label="所属集合" prop="mgroup_name">
</el-table-column> </el-table-column>
<el-table-column label="类型" prop="type" width="80"> </el-table-column> <el-table-column label="类型" prop="type" width="70"> </el-table-column>
<el-table-column label="年" prop="year" width="80"> </el-table-column> <el-table-column label="年" prop="year" width="60"> </el-table-column>
<el-table-column label="班年" prop="year_s" width="80"> </el-table-column> <el-table-column label="班年" prop="year_s" width="60"> </el-table-column>
<el-table-column label="月" prop="month" width="50"> </el-table-column> <el-table-column label="月" prop="month" width="50"> </el-table-column>
<el-table-column label="班月" prop="month_s" width="50"> </el-table-column> <el-table-column label="班月" prop="month_s" width="50"> </el-table-column>
<el-table-column label="日" prop="day" width="50"> </el-table-column> <el-table-column label="日" prop="day" width="50"> </el-table-column>
<el-table-column label="班日" prop="day_s" width="50"> </el-table-column> <el-table-column label="班日" prop="day_s" width="50"> </el-table-column>
<el-table-column label="时" prop="hour" width="50"> </el-table-column> <el-table-column label="时" prop="hour" width="50"> </el-table-column>
<el-table-column label="当前值" prop="val"></el-table-column> <el-table-column label="当前值" prop="val" min-width="100"></el-table-column>
<el-table-column <el-table-column
label="校正值" label="校正值"
prop="val_correct" prop="val_correct"
min-width="100"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="原始计算值" label="原始计算值"
prop="val_origin" prop="val_origin"
min-width="100"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
@ -161,16 +162,18 @@ export default {
data() { data() {
return { return {
apiObj: this.$API.enm.mpoint.stat, apiObj: this.$API.enm.mpoint.stat,
params: {}, params: {
type: "day_s",
},
query: { query: {
mpoint: null, mpoint: null,
type: "hour", type: "day_s",
start_time: null, start_time: null,
end_time: null end_time: null
}, },
chartOption: { chartOption: {
title: { title: {
text: 'Stacked Line' text: '趋势图'
}, },
color: ["#191970"], color: ["#191970"],
tooltip: { tooltip: {
@ -212,11 +215,11 @@ export default {
series: [], series: [],
}, },
options: [ options: [
{ label: "天校正", value: "day_s" },
{ label: "月校正", value: "month_s" },
{ label: "小时", value: "hour"}, { label: "小时", value: "hour"},
{ label: "天", value: "day" }, { label: "天", value: "day" },
{ label: "月", value: "month"}, { label: "月", value: "month"},
{ label: "班天", value: "day_s" },
{ label: "班月", value: "month_s" },
], ],
form: { form: {
id: "", id: "",

View File

@ -138,7 +138,7 @@ export default {
mounted() { mounted() {
let that = this; let that = this;
that.$API.mtm.mgroup.list that.$API.mtm.mgroup.list
.req({ page: 0, search: that.mgroupName }) .req({ page: 0, name: that.mgroupName })
.then((res) => { .then((res) => {
if (res.length < 1) { if (res.length < 1) {
that.$message.error("获取工段错误"); that.$message.error("获取工段错误");

View File

@ -308,7 +308,7 @@ export default {
}else{// }else{//
that.printer_name = localStorage.getItem("printer_name"); that.printer_name = localStorage.getItem("printer_name");
that.$API.mtm.mgroup.list that.$API.mtm.mgroup.list
.req({ page: 0, search: that.mgroupName }) .req({ page: 0, name: that.mgroupName })
.then((res) => { .then((res) => {
if (res.length < 1) { if (res.length < 1) {
that.$message.error("获取工段错误"); that.$message.error("获取工段错误");

View File

@ -269,7 +269,7 @@ export default {
}) })
}else{ }else{
that.$API.mtm.mgroup.list that.$API.mtm.mgroup.list
.req({ page: 0, search: that.mgroupName }) .req({ page: 0, name: that.mgroupName })
.then((res) => { .then((res) => {
if (res.length < 1) { if (res.length < 1) {
that.$message.error("获取工段错误"); that.$message.error("获取工段错误");

View File

@ -220,7 +220,7 @@ export default {
mounted() { mounted() {
let that = this; let that = this;
that.$nextTick(() => { that.$nextTick(() => {
that.$API.mtm.mgroup.list.req({ page: 0, search: that.mgroupName }).then((res) => { that.$API.mtm.mgroup.list.req({ page: 0, name: that.mgroupName }).then((res) => {
if (res.length < 1) { if (res.length < 1) {
that.$message.error("获取工段错误"); that.$message.error("获取工段错误");
return; return;

View File

@ -198,7 +198,7 @@ export default {
mounted() { mounted() {
let that = this; let that = this;
that.$API.mtm.mgroup.list that.$API.mtm.mgroup.list
.req({ page: 0, search: that.mgroupName }) .req({ page: 0, name: that.mgroupName })
.then((res) => { .then((res) => {
if (res.length < 1) { if (res.length < 1) {
that.$message.error("获取工段错误"); that.$message.error("获取工段错误");

View File

@ -108,7 +108,7 @@ export default {
mounted() { mounted() {
let that = this; let that = this;
that.$API.mtm.mgroup.list that.$API.mtm.mgroup.list
.req({ page: 0, search: that.mgroupName }) .req({ page: 0, name: that.mgroupName })
.then((res) => { .then((res) => {
if(res.length != 1){ if(res.length != 1){
that.$message.error("获取工段错误"); that.$message.error("获取工段错误");