feat:统计

This commit is contained in:
shijing 2023-07-14 17:03:27 +08:00
parent d195b260fa
commit f95918bda3
19 changed files with 1295 additions and 358 deletions

View File

@ -136,7 +136,7 @@ const routes = [
}, },
{ {
"name": "power", "name": "power",
"path": "/rm/power", "path": "/rm_enm/power",
"meta": { "meta": {
"title": "单位产品电耗", "title": "单位产品电耗",
"icon": "el-icon-grid", "icon": "el-icon-grid",
@ -841,7 +841,8 @@ const routes = [
"perms": ["dataset"] "perms": ["dataset"]
}, },
"component": "ungrouped/priceset" "component": "ungrouped/priceset"
},{ },
{
"name": "feeset", "name": "feeset",
"path": "/ungrouped/feeset", "path": "/ungrouped/feeset",
"meta": { "meta": {
@ -851,6 +852,26 @@ const routes = [
}, },
"component": "ungrouped/feeset" "component": "ungrouped/feeset"
}, },
{
"name": "stflog",
"path": "/ungrouped/stflog",
"meta": {
"title": "停机记录",
"icon": "el-icon-grid",
"perms": ["dataset"]
},
"component": "ungrouped/stflog"
},
{
"name": "costing",
"path": "/ungrouped/costing",
"meta": {
"title": "成本计算",
"icon": "el-icon-grid",
"perms": ["dataset"]
},
"component": "ungrouped/costing"
},
{ {
"name": "goalSetting", "name": "goalSetting",
"path": "/ungrouped/goalSetting", "path": "/ungrouped/goalSetting",
@ -867,7 +888,7 @@ const routes = [
"meta": { "meta": {
"title": "质量报表", "title": "质量报表",
"icon": "el-icon-grid", "icon": "el-icon-grid",
"perms": ["bi"] "perms": ["dataset"]
}, },
"component": "ungrouped/quality" "component": "ungrouped/quality"
}, },
@ -877,7 +898,7 @@ const routes = [
"meta": { "meta": {
"title": "能源统计", "title": "能源统计",
"icon": "el-icon-grid", "icon": "el-icon-grid",
"perms": ["bi"] "perms": ["dataset"]
}, },
"component": "ungrouped/energy" "component": "ungrouped/energy"
}, },
@ -887,10 +908,20 @@ const routes = [
"meta": { "meta": {
"title": "全厂电量统计", "title": "全厂电量统计",
"icon": "el-icon-grid", "icon": "el-icon-grid",
"perms": ["bi"] "perms": ["dataset"]
}, },
"component": "ungrouped/electric" "component": "ungrouped/electric"
} }
,{
"name": "reportAll",
"path": "/ungrouped/report",
"meta": {
"title": "全厂报表",
"icon": "el-icon-grid",
"perms": ["dataset"]
},
"component": "ungrouped/report"
}
] ]
}, },
{ {

View File

@ -88,6 +88,7 @@
// border-top: 1px solid var(--el-border-color-light); // border-top: 1px solid var(--el-border-color-light);
padding: 13px 15px; padding: 13px 15px;
height: 51px; height: 51px;
text-align: right;
} }
.el-main { .el-main {

View File

@ -76,7 +76,7 @@
</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-number v-model="form.power_kw" placeholder="用电功率"/> <el-input-number v-model="form.power_kw" :precision="2" :min="0" controls-position="right" placeholder="用电功率"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -65,23 +65,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24">
<el-form-item label="所在集合" prop="mgroup">
<el-select
v-model="form.mgroup"
placeholder="所在集合"
clearable
style="width: 100%;"
>
<el-option
v-for="item in mgroupOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="计量物料"> <el-form-item label="计量物料">
<el-select <el-select
@ -104,6 +87,69 @@
<el-switch v-model="form.is_auto"/> <el-switch v-model="form.is_auto"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" style="position: relative;">
<el-form-item label="系数分配">
<el-switch v-model="form.is_all"/>
</el-form-item>
<el-button
v-if="form.is_all"
type="primary"
icon="el-icon-plus"
style="position: absolute;right: 0;top:0"
@click="addAllocate"
></el-button>
</el-col>
<el-col :md="12" :sm="24" v-if="!form.is_all">
<el-form-item label="所属工段" prop="mgroup">
<el-select
v-model="form.mgroup"
placeholder="所属工段"
clearable
style="width: 100%;"
>
<el-option
v-for="item in mgroupOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="form.is_all">
<template v-for="(item,$index) in form.mgroups_allocate" :key="$index">
<el-col :md="11" :sm="24">
<el-form-item label="所属工段" prop="mgroup">
<el-select
v-model="item.mgroup"
placeholder="所属工段"
clearable
style="width: 100%;"
>
<el-option
v-for="item in mgroupOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="11" :sm="24">
<el-form-item label="分配比例" prop="rate">
<el-input-number precision="2" v-model="item.ratio" step="0.1" min="0" max="1" clearable controls-position="right"></el-input-number>
</el-form-item>
</el-col>
<el-col :md="2" :sm="24" v-if="$index!==0">
<el-button
v-if="$index!==0"
type="primary"
icon="el-icon-delete"
@click="delAllocate($index)"
></el-button>
</el-col>
</template>
</el-row> </el-row>
</el-form> </el-form>
</el-main> </el-main>
@ -116,7 +162,6 @@
</template> </template>
<script> <script>
import {genTree} from "@/utils/verificate";
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],
data() { data() {
@ -129,7 +174,10 @@ export default {
show: "查看", show: "查看",
}, },
form: { form: {
is_auto:true is_auto:true,
belong_dept:null,
mgroup:'',
mgroups_allocate:[{mgroup:'',ratio:0}],
}, },
rules: { rules: {
name: [{required: true, message: '请输入测点名称'}], name: [{required: true, message: '请输入测点名称'}],
@ -183,6 +231,12 @@ export default {
this.visible = true; this.visible = true;
return this; return this;
}, },
addAllocate(){
this.form.mgroups_allocate.push({mgroup:'',ratio:0});
},
delAllocate(index){
this.form.mgroups_allocate.splice(index,1)
},
// //
submit() { submit() {
this.$refs.dialogForm.validate(async (valid) => { this.$refs.dialogForm.validate(async (valid) => {
@ -194,6 +248,8 @@ export default {
this.$emit("success", this.form, this.mode); this.$emit("success", this.form, this.mode);
this.visible = false; this.visible = false;
this.$message.success("操作成功"); this.$message.success("操作成功");
}).catch(res=>{
this.isSaveing = false;
}) })
} else if (this.mode == "edit") { } else if (this.mode == "edit") {
this.$API.enm.mpoint.update.req(this.form.id,this.form).then(res=>{ this.$API.enm.mpoint.update.req(this.form.id,this.form).then(res=>{
@ -201,6 +257,8 @@ export default {
this.$emit("success", this.form, this.mode); this.$emit("success", this.form, this.mode);
this.visible = false; this.visible = false;
this.$message.success("操作成功"); this.$message.success("操作成功");
}).catch(res=>{
this.isSaveing = false;
}) })
} }
} }
@ -208,7 +266,13 @@ export default {
}, },
// //
setData(data) { setData(data) {
debugger;
console.log(data)
if(data.mgroups_allocate.length>1){
this.form.is_all = true
}
Object.assign(this.form, data); Object.assign(this.form, data);
}, },
// //
setFilters(filters) { setFilters(filters) {

View File

@ -222,6 +222,10 @@ export default {
that.getList(); that.getList();
that.getManCount(); that.getManCount();
},60000) },60000)
//this.$once vue3
// this.$once('hook:beforeUnmount', () => {
// clearInterval(aggTimer);
// })
}, },
methods: { methods: {
toTicket() { toTicket() {
@ -387,13 +391,14 @@ export default {
this.dutyAgg = res.details; this.dutyAgg = res.details;
}, },
}, },
unmounted(){ // unmounted(){
// clearInterval(this.aggTimer);
// this.aggTimer = null;
// },
beforeUnmount() {
clearInterval(this.aggTimer); clearInterval(this.aggTimer);
this.aggTimer = null; this.aggTimer = null;
// console.log(this.aggTimer) }
// console.log('00000')
},
}; };
</script> </script>

View File

@ -1,6 +1,4 @@
<template> <template>
<el-container>
<el-aside width="45%">
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
@ -81,30 +79,32 @@
<el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button> <el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button>
<el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button>
<el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button>
<el-button link size="small" @click="sflog_export(scope.row)" type="success">导出报表</el-button> <el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
</el-container> <el-drawer v-model="limitedExport" size="60%" :show-close="false">
</el-aside> <template #header="{ close, titleId, titleClass }">
<el-container> <h4 :id="titleId" :class="titleClass">交接班日志</h4>
<el-header> <el-button type="danger" @click="close">
<div class="left-panel"> <el-icon class="el-icon--left"><CircleCloseFilled /></el-icon>
<div style="margin-right: 20px"> 关闭
<span v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}{{ sflogItem.shift_name }}</span> </el-button>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span> </template>
交接班记录</div>
</div>
</el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<div ref="print" id="myReport" class="printContainer"> <div ref="print" id="myReport" class="printContainer">
<div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;">
<span v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}{{ sflogItem.shift_name }}</span>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录
</div>
<h3 style="text-align: center;display: flex;justify-content: space-around;"> <h3 style="text-align: center;display: flex;justify-content: space-around;">
<span>2023.06.21</span> <span>2023.06.21</span>
<span>白班</span> <span>白班</span>
<span>甲班</span> <span>甲班</span>
</h3> </h3>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="numTable"> <table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<tbody> <tbody>
<tr> <tr>
<td class="numCell">产量t</td> <td class="numCell">产量t</td>
@ -154,7 +154,7 @@
</table> </table>
</div> </div>
</el-main> </el-main>
</el-container> </el-drawer>
</el-container> </el-container>
<save-dialog <save-dialog
v-if="dialog.save" v-if="dialog.save"
@ -175,7 +175,6 @@
@closed="dialog.save = false" @closed="dialog.save = false"
></quastat-dialog> ></quastat-dialog>
</template> </template>
<script> <script>
import saveDialog from "./handover_form.vue"; import saveDialog from "./handover_form.vue";
import quastatDialog from "./quastat_form.vue"; import quastatDialog from "./quastat_form.vue";
@ -211,11 +210,14 @@ import otherDialog from "./other_form.vue";
asynDialog:false, asynDialog:false,
options:[], options:[],
optionsShift:[], optionsShift:[],
limitedExport:false,
}; };
}, },
methods: { methods: {
sflog_export(){
this.limitedExport = true;
},
rowClick(row) { rowClick(row) {
this.sflogId = row.id; this.sflogId = row.id;
this.sflogItem = row; this.sflogItem = row;
@ -292,6 +294,14 @@ import otherDialog from "./other_form.vue";
}) })
.catch(() => {}); .catch(() => {});
}, },
handlePrint() {
this.$PRINT('#myReport');
},
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
}, },
}; };
</script> </script>

View File

@ -1,9 +1,24 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-header>
<div class="left-panel">
<el-button
type="primary"
@click="exportExcel()"
:loading = "exportLoading"
>导出xlsx
</el-button>
<el-button
type="primary"
@click="handlePrint"
>打印
</el-button>
</div>
</el-header>
<el-card style="margin-top:5px"> <el-card style="margin-top:5px">
<div ref="print" id="myReport" class="printContainer"> <div ref="print" id="myReport" class="printContainer">
<h3 style="text-align: center;">主要设备100KW以上单位产品电耗数据表</h3> <h3 style="text-align: center;">主要设备100KW以上单位产品电耗数据表</h3>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="numTable"> <table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<thead style="background: #efefef;height: 40px;"> <thead style="background: #efefef;height: 40px;">
<tr> <tr>
<th>设备名称</th> <th>设备名称</th>
@ -98,7 +113,7 @@
></charts> ></charts>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import scEcharts from "@/components/scEcharts"; import scEcharts from "@/components/scEcharts";
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
@ -120,6 +135,7 @@
query:{ query:{
time:'' time:''
}, },
tableName:'主要设备100KW以上单位产品电耗数据表',
tableDatas:[ tableDatas:[
{name:'反击式破',number:'NM001',unit:'KW·h/t',hours:'',days:'',month:''}, {name:'反击式破',number:'NM001',unit:'KW·h/t',hours:'',days:'',month:''},
{name:'立磨主电',number:'NM002',unit:'KW·h/t',hours:'',days:'',month:''}, {name:'立磨主电',number:'NM002',unit:'KW·h/t',hours:'',days:'',month:''},
@ -159,6 +175,11 @@
handlePrint() { handlePrint() {
this.$PRINT('#myReport'); this.$PRINT('#myReport');
}, },
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
} }
}; };
</script> </script>
@ -175,6 +196,7 @@
} }
.numCell{ .numCell{
width: 80px; width: 80px;
height: 35px;
} }
.numCell.numCell_last{ .numCell.numCell_last{
width: 100px; width: 100px;

View File

@ -1,9 +1,24 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-header>
<div class="left-panel">
<el-button
type="primary"
@click="exportExcel()"
:loading = "exportLoading"
>导出xlsx
</el-button>
<el-button
type="primary"
@click="handlePrint"
>打印
</el-button>
</div>
</el-header>
<el-card style="margin-top:5px"> <el-card style="margin-top:5px">
<div ref="print" id="myReport" class="printContainer"> <div ref="print" id="myReport" class="printContainer">
<h3 style="text-align: center;">生产报告</h3> <h3 style="text-align: center;">生产报告</h3>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="numTable"> <table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<thead style="background: #efefef;height: 40px;"> <thead style="background: #efefef;height: 40px;">
<tr> <tr>
<th colspan="2">参数</th> <th colspan="2">参数</th>
@ -165,6 +180,7 @@
[5,5,5,5,5,5,5,5], [5,5,5,5,5,5,5,5],
[6,6,6,6,6,6,6,6] [6,6,6,6,6,6,6,6]
], ],
tableName:'生产报告',
modelValue:true, modelValue:true,
type:'hours', type:'hours',
title:'title', title:'title',
@ -196,6 +212,11 @@
handlePrint() { handlePrint() {
this.$PRINT('#myReport'); this.$PRINT('#myReport');
}, },
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
} }
}; };
</script> </script>

View File

@ -21,12 +21,23 @@
icon="el-icon-search" icon="el-icon-search"
@click="handleQuery" @click="handleQuery"
></el-button> ></el-button>
<el-button
type="primary"
@click="exportExcel()"
:loading = "exportLoading"
>导出xlsx
</el-button>
<el-button
type="primary"
@click="handlePrint"
>打印
</el-button>
</div> </div>
</el-header> </el-header>
<el-card style="margin-top:5px"> <el-card style="margin-top:5px">
<div ref="print" id="myReport" class="printContainer"> <div ref="print" id="myReport" class="printContainer">
<h3 style="text-align: center;">主要设备100KW以上单位产品电耗数据表</h3> <h3 style="text-align: center;">主要设备100KW以上单位产品电耗数据表</h3>
<table border="1" cellspacing="0" :key="timeStamp" id="numTable"> <table border="1" cellspacing="0" :key="timeStamp" id="myTable">
<thead style="background: #efefef;height: 40px;"> <thead style="background: #efefef;height: 40px;">
<tr> <tr>
<th rowspan="2">月份</th> <th rowspan="2">月份</th>
@ -125,6 +136,11 @@
handlePrint() { handlePrint() {
this.$PRINT('#myReport'); this.$PRINT('#myReport');
}, },
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
} }
}; };
</script> </script>

View File

@ -16,17 +16,23 @@
icon="el-icon-search" icon="el-icon-search"
@click="handleQuery" @click="handleQuery"
></el-button> ></el-button>
<el-link type="primary" icon="el-icon-plus" v-auth="'rparty.create'"></el-link> <el-button
</div> type="primary"
<div class="right-panel"> @click="exportExcel()"
<div class="right-panel-search"> :loading = "exportLoading"
</div> >导出xlsx
</el-button>
<el-button
type="primary"
@click="handlePrint"
>打印
</el-button>
</div> </div>
</el-header> </el-header>
<el-card style="margin-top:5px"> <el-card style="margin-top:5px">
<div ref="print" id="myReport" class="printContainer"> <div ref="print" id="myReport" class="printContainer">
<h3 style="text-align: center;">车间单位产品电耗月度分析表</h3> <h3 style="text-align: center;">车间单位产品电耗月度分析表</h3>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="numTable"> <table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<thead style="background: #efefef;height: 40px;"> <thead style="background: #efefef;height: 40px;">
<tr> <tr>
<th>月份</th> <th>月份</th>
@ -113,6 +119,11 @@
handlePrint() { handlePrint() {
this.$PRINT('#myReport'); this.$PRINT('#myReport');
}, },
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
} }
}; };
</script> </script>

View File

@ -0,0 +1,413 @@
<!-- 成本分析 -->
<template>
<div class="app-container">
<el-header>
<div class="left-panel">
<el-select
v-model="query.type"
placeholder="查询类型"
clearable
@change="typeCange"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-date-picker
v-model="query.day"
type="date"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
placeholder="日"
v-if="query.type==0||query.type==1"
/>
<!-- 选择班次 -->
<el-select
v-if="query.type==0"
v-model="query.shift"
placeholder="班次"
clearable
style="margin-left: 2px; width: 120px"
>
<el-option
v-for="item in optionsShift"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-date-picker
v-model="query.month"
type="month"
value-format="YYYY-MM"
format="YYYY-MM"
placeholder="月份"
v-if="query.type==2"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="getTableData"
></el-button>
<el-button
type="primary"
@click="exportExcel()"
:loading = "exportLoading"
>导出xlsx
</el-button>
<el-button
type="primary"
@click="handlePrint"
>打印
</el-button>
</div>
</el-header>
<el-card style="margin-top:5px">
<div ref="print" id="myReport" class="printContainer">
<table border="1" cellspacing="0" :key="timeStamp" id="myTable">
<thead style="background: #efefef;height: 40px;">
<tr>
<th colspan="8">电石渣干粉核算</th>
</tr>
<tr>
<th>要素</th>
<th>类别</th>
<th>费用名称</th>
<th>实际产量</th>
<th>消耗量</th>
<th>单价</th>
<th>总成本</th>
<th>单位成本</th>
</tr>
</thead>
<tr v-for="(item,index) in tableDatas" :key="index">
<td class="numCell" v-if="index==0" rowspan="3">{{item[0]}}</td>
<td class="numCell" v-else-if="index==3" rowspan="2">{{item[0]}}</td>
<td class="numCell" v-else-if="index==5" rowspan="8">{{item[0]}}</td>
<td class="numCell" v-else-if="index==13" colspan="3">{{item[0]}}</td>
<td class="numCell" v-if="index==1||index==7" rowspan="2">{{item[1]}}</td>
<td class="numCell" v-else-if="index==3||index==4" colspan="2">{{item[1]}}</td>
<td class="numCell" v-else-if="index==13" colspan="4">{{item[1]}}</td>
<td class="numCell" style="display: none;" v-else-if="index==2||index==8">{{item[1]}}</td>
<td class="numCell" v-else>{{item[1]}}</td>
<td class="numCell">{{item[2]}}</td>
<td class="numCell" v-if="index!==13">{{item[3]}}</td>
<td class="numCell" v-if="index!==13">{{item[4]}}</td>
<td class="numCell" v-if="index!==13">{{item[5]}}</td>
<td class="numCell" v-if="index!==13">{{item[6]}}</td>
<td class="numCell" style="display: none;" v-if="index==3||index==4||index==13">{{item[7]}}</td>
<td class="numCell" v-else>{{item[7]}}</td>
</tr>
</table>
<table border="1" cellspacing="0" :key="timeStamp" id="myTable2">
<thead style="background: #efefef;height: 40px;">
<tr>
<th colspan="8">生料核算</th>
</tr>
<tr>
<th>要素</th>
<th>类别</th>
<th>费用名称</th>
<th>实际产量</th>
<th>消耗量</th>
<th>单价</th>
<th>总成本</th>
<th>单位成本</th>
</tr>
</thead>
<tr v-for="(item,index) in tableDatas2" :key="index">
<td class="numCell" v-if="index==0" rowspan="6">{{item[0]}}</td>
<td class="numCell" v-else-if="index==6" rowspan="2">{{item[0]}}</td>
<td class="numCell" v-else-if="index==8" rowspan="8">{{item[0]}}</td>
<td class="numCell" v-else-if="index==16" colspan="3">{{item[0]}}</td>
<td class="numCell" v-if="index==0" rowspan="4">{{item[1]}}</td>
<td class="numCell" v-else-if="index==4||index==10" rowspan="2">{{item[1]}}</td>
<td class="numCell" v-else-if="index==6||index==7" colspan="2">{{item[1]}}</td>
<td class="numCell" v-else-if="index==16" colspan="4">{{item[1]}}</td>
<td class="numCell" style="display: none;" v-else-if="index==1||index==2||index==3||index==5||index==11">{{item[1]}}</td>
<td class="numCell" v-else>{{item[1]}}</td>
<td class="numCell">{{item[2]}}</td>
<td class="numCell" v-if="index!==16">{{item[3]}}</td>
<td class="numCell" v-if="index!==16">{{item[4]}}</td>
<td class="numCell" v-if="index!==16">{{item[5]}}</td>
<td class="numCell" v-if="index!==16">{{item[6]}}</td>
<td class="numCell" style="display: none;" v-if="index==6||index==7||index==16">{{item[7]}}</td>
<td class="numCell" v-else>{{item[7]}}</td>
</tr>
</table>
<table border="1" cellspacing="0" :key="timeStamp" id="myTable3">
<thead style="background: #efefef;height: 40px;">
<tr>
<th colspan="8">熟料核算</th>
</tr>
<tr>
<th>要素</th>
<th>类别</th>
<th>费用名称</th>
<th>实际产量</th>
<th>消耗量</th>
<th>单价</th>
<th>总成本</th>
<th>单位成本</th>
</tr>
</thead>
<tr v-for="(item,index) in tableDatas3" :key="index">
<td class="numCell" v-if="index==0" rowspan="4">{{item[0]}}</td>
<td class="numCell" v-else-if="index==4" rowspan="2">{{item[0]}}</td>
<td class="numCell" v-else-if="index==6" rowspan="8">{{item[0]}}</td>
<td class="numCell" v-else-if="index==14" colspan="3">{{item[0]}}</td>
<td class="numCell" v-if="index==2||index==8" rowspan="2">{{item[1]}}</td>
<td class="numCell" v-else-if="index==4||index==5" colspan="2">{{item[1]}}</td>
<td class="numCell" v-else-if="index==14" colspan="4">{{item[1]}}</td>
<td class="numCell" style="display: none;" v-else-if="index==3||index==9">{{item[1]}}</td>
<td class="numCell" v-else>{{item[1]}}</td>
<td class="numCell">{{item[2]}}</td>
<td class="numCell" v-if="index!==14">{{item[3]}}</td>
<td class="numCell" v-if="index!==14">{{item[4]}}</td>
<td class="numCell" v-if="index!==14">{{item[5]}}</td>
<td class="numCell" v-if="index!==14">{{item[6]}}</td>
<td class="numCell" style="display: none;" v-if="index==4||index==5||index==14">{{item[7]}}</td>
<td class="numCell" v-else>{{item[7]}}</td>
</tr>
</table>
<table border="1" cellspacing="0" :key="timeStamp" id="myTable4">
<thead style="background: #efefef;height: 40px;">
<tr>
<th colspan="8">水泥核算</th>
</tr>
<tr>
<th>要素</th>
<th>类别</th>
<th>费用名称</th>
<th>实际产量</th>
<th>消耗量</th>
<th>单价</th>
<th>总成本</th>
<th>单位成本</th>
</tr>
</thead>
<tr v-for="(item,index) in tableDatas4" :key="index">
<td class="numCell" v-if="index==0" rowspan="10">{{item[0]}}</td>
<td class="numCell" v-else-if="index==10" rowspan="2">{{item[0]}}</td>
<td class="numCell" v-else-if="index==12" rowspan="8">{{item[0]}}</td>
<td class="numCell" v-else-if="index==20" colspan="3">{{item[0]}}</td>
<td class="numCell" v-if="index==1" rowspan="4">{{item[1]}}</td>
<td class="numCell" v-else-if="index==8||index==5" rowspan="2">{{item[1]}}</td>
<td class="numCell" v-else-if="index==10||index==11" colspan="2">{{item[1]}}</td>
<td class="numCell" v-else-if="index==20" colspan="4">{{item[1]}}</td>
<td class="numCell" style="display: none;" v-else-if="index==2||index==3||index==6||index==4||index==9">{{item[1]}}</td>
<td class="numCell" v-else>{{item[1]}}</td>
<td class="numCell">{{item[2]}}</td>
<td class="numCell" v-if="index!==20">{{item[3]}}</td>
<td class="numCell" v-if="index!==20">{{item[4]}}</td>
<td class="numCell" v-if="index!==20">{{item[5]}}</td>
<td class="numCell" v-if="index!==20">{{item[6]}}</td>
<td class="numCell" style="display: none;" v-if="index==10||index==11||index==20">{{item[7]}}</td>
<td class="numCell" v-else>{{item[7]}}</td>
</tr>
</table>
</div>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
query:{
type:0,
day:'',
month:'',
shift:'',
},
tableName:'班组成本计算',
options:[
{id:0,name:'班统计'},
{id:1,name:'日统计'},
{id:2,name:'月统计'},
],
tableHead:['车间','工段','能源分类','1号','2号','3号','4号','5号','6号','7号','8号'],
tableDatas:[
['直接材料','原材料','湿电石渣',1,2,3,4,5],
['直接材料','电、水','动力电',1,2,3,4,5],
['直接材料','电、水','工业水',1,2,3,4,5],
['直接人工','车间人员工资','/','/','/','/',5],
['直接人工','车间人员工资','/','/','/','/',5],
['制造费用','倒运费用','倒运费用','/','/','/','/',5],
['制造费用','材料出库','物料消耗','/','/','/','/',5],
['制造费用','维修费用','检修','/','/','/','/',5],
['制造费用','维修费用','外协施工费用','/','/','/','/',5],
['制造费用','装卸费','装卸费 ','/','/','/','/',5],
['制造费用','差旅费','差旅费','/','/','/','/',5],
['制造费用','折旧','折旧','/','/','/','/',5],
['制造费用','摊销','无形资产摊销','/','/','/','/',5],
['成本合计','',''],
],
tableDatas2:[
['直接材料','原材料','干粉',1,2,3,4,5],
['直接材料','原材料','辅料',1,2,3,4,5],
['直接材料','原材料','粉煤灰',1,2,3,4,5],
['直接材料','原材料','电石厂除尘灰',1,2,3,4,5],
['直接材料','电、水','动力电',1,2,3,4,5],
['直接材料','电、水','工业水',1,2,3,4,5],
['直接人工','车间人员工资','/','/','/','/',5],
['直接人工','车间人员工资','/','/','/','/',5],
['制造费用','倒运费用','倒运费用','/','/','/','/',5],
['制造费用','材料出库','物料消耗','/','/','/','/',5],
['制造费用','维修费用','检修','/','/','/','/',5],
['制造费用','维修费用','外协施工费用','/','/','/','/',5],
['制造费用','装卸费 ','装卸费 ','/','/','/','/',5],
['制造费用','差旅费','差旅费','/','/','/','/',5],
['制造费用','折旧','折旧','/','/','/','/',5],
['制造费用','摊销','无形资产摊销','/','/','/','/',5],
['成本合计','',''],
],
tableDatas3:[
['直接材料','原材料','生料',1,2,3,4,5],
['直接材料','辅助材料','原煤',1,2,3,4,5],
['直接材料','电、水','动力电',1,2,3,4,5],
['直接材料','电、水','工业水',1,2,3,4,5],
['直接人工','车间人员工资','/','/','/','/',5],
['直接人工','车间人员工资','/','/','/','/',5],
['制造费用','倒运费用','倒运费用','/','/','/','/',5],
['制造费用','材料出库','物料消耗','/','/','/','/',5],
['制造费用','维修费用','检修','/','/','/','/',5],
['制造费用','维修费用','外协施工费用','/','/','/','/',5],
['制造费用','装卸费 ','装卸费 ','/','/','/','/',5],
['制造费用','差旅费','差旅费','/','/','/','/',5],
['制造费用','折旧','折旧','/','/','/','/',5],
['制造费用','摊销','无形资产摊销','/','/','/','/',5],
['成本合计','',''],
],
tableDatas4:[
['直接材料','原材料','熟料',1,2,3,4,5],
['直接材料','辅助材料','废石灰石粉',1,2,3,4,5],
['直接材料','辅助材料','脱硫石膏',1,2,3,4,5],
['直接材料','辅助材料','粉煤灰',1,2,3,4,5],
['直接材料','辅助材料','矿粉',1,2,3,4,5],
['直接材料','助剂','助磨剂',1,2,3,4,5],
['直接材料','助剂','缓凝剂',1,2,3,4,5],
['直接材料','包装','包装袋',1,2,3,4,5],
['直接材料','电、水','动力电',1,2,3,4,5],
['直接材料','电、水','工业水',1,2,3,4,5],
['直接人工','车间人员工资','/','/','/','/',5],
['直接人工','车间人员工资','/','/','/','/',5],
['制造费用','倒运费用','倒运费用','/','/','/','/',5],
['制造费用','材料出库','物料消耗','/','/','/','/',5],
['制造费用','维修费用','检修','/','/','/','/',5],
['制造费用','维修费用','外协施工费用','/','/','/','/',5],
['制造费用','装卸费 ','装卸费 ','/','/','/','/',5],
['制造费用','差旅费','差旅费','/','/','/','/',5],
['制造费用','折旧','折旧','/','/','/','/',5],
['制造费用','摊销','无形资产摊销','/','/','/','/',5],
['成本合计','',''],
],
optionsShift:[],
sourceData:{}
};
},
mounted() {
var myDate = new Date();
let month = myDate.getMonth()+1;
if(month<10){
month = '0'+month;
}
this.query.month = myDate.getFullYear()+'-'+month;
// this.getData();
this.getShift();
},
methods: {
getShift(){
this.$API.mtm.shift.req({page:0}).then(res=>{
this.optionsShift = res;
})
},
typeCange(value){
if(value==1){
this.tableName = '班组成本计算'
}else if(value==1){
this.tableName = '日成本计算'
}else{
this.tableName = '月成本计算'
}
},
getData(){
let that = this;
let params = {query:{}};
let id = '';
let arr = [];
if(that.query.type==0){//
arr = that.query.month.split('-');
params.query.year_s = Number(arr[0]);
params.query.month_s = Number(arr[1]);
id='energy_day'
}else if(that.query.type==1){//
params.query.year_s = Number(that.query.year);
id='energy_month'
}else{//
params.query.year_s = Number(that.query.yearStart);
id='energy_year'
}
},
getTableData(){
this.getData();
},
handlePrint() {
this.$PRINT('#myReport');
},
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
}
};
</script>
<style>
.printContainer{
/* width: 1075px; */
}
#numTable{
margin-left: 37px;
}
#numTable td{
height: 32px;
padding-left: 5px;
}
.numCell{
width: 70px;
}
.numCell.numCell_last{
width: 80px;
}
.searchHead{
display:flex
}
.middleText{
height: 32px;
line-height: 32px;
margin: 0 5px;
display: inline-block;
}
.searchBtn{
margin-left: 5px;
}
#myTable,#myTable2,#myTable3,#myTable4{
display: inline-block;
}
</style>

View File

@ -61,7 +61,7 @@
<el-card style="margin-top:5px"> <el-card style="margin-top:5px">
<div ref="print" id="myReport" class="printContainer"> <div ref="print" id="myReport" class="printContainer">
<h3 style="text-align: center;">{{ tableName }}</h3> <h3 style="text-align: center;">{{ tableName }}</h3>
<table border="1" cellspacing="0" :key="timeStamp" id="numTable"> <table border="1" cellspacing="0" :key="timeStamp" id="myTable">
<thead style="background: #efefef;height: 40px;"> <thead style="background: #efefef;height: 40px;">
<tr> <tr>
<th rowspan="3">日期</th> <th rowspan="3">日期</th>
@ -282,7 +282,7 @@
}else{ }else{
innerArr[ind] = []; innerArr[ind] = [];
} }
debugger; // debugger;
if(item[roomInd]=="原料车间"){ if(item[roomInd]=="原料车间"){
if(item[mgroupInd]=="电石渣"){ if(item[mgroupInd]=="电石渣"){
if(item[mpointInd]=="动力电"){ if(item[mpointInd]=="动力电"){
@ -326,7 +326,7 @@
}else{ }else{
innerArr[ind][14] = Number(item[valueInd]).toFixed(2) innerArr[ind][14] = Number(item[valueInd]).toFixed(2)
} }
}else if(item[mgroupInd]=="包装"){ }else if(item[mgroupInd]=="水泥包装"){
if(item[mpointInd]=="动力电"){ if(item[mpointInd]=="动力电"){
innerArr[ind][15] = Number(item[valueInd]).toFixed(2) innerArr[ind][15] = Number(item[valueInd]).toFixed(2)
}else{ }else{
@ -413,6 +413,11 @@
handlePrint() { handlePrint() {
this.$PRINT('#myReport'); this.$PRINT('#myReport');
}, },
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
} }
}; };
</script> </script>

View File

@ -0,0 +1,108 @@
<!-- 质量检验 -->
<template>
<el-container>
<el-header>
<div class="left-panel">
<div style="margin-right: 20px">质量检验</div>
<el-date-picker
v-model="query.start_time__gte"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD HH:mm:ss"
placeholder="开始时间"
/>
<el-date-picker
v-model="query.end_time__day"
type="date"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
placeholder="结束时间"
/>
<el-select
v-model="query.shift"
placeholder="班次"
clearable
style="margin-left: 2px; width: 120px"
>
<el-option
v-for="item in optionsShift"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-select
v-model="query.team"
placeholder="班组"
clearable
style="margin-left: 2px; width: 120px"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main>
<el-row gutter="6">
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
</el-row>
</el-main>
</el-container>
</template>
<script>
export default {
name: "listSon",
data() {
return {
query: {
mgroup:'3346520558031773696',
},
options:[],
optionsShift:[],
};
},
mounted(){
this.getTeam();
this.getShift();
},
methods: {
getTeam(){
this.$API.mtm.team.list.req({page:0}).then(res=>{
this.options = res;
})
},
getShift(){
this.$API.mtm.shift.req({page:0}).then(res=>{
this.optionsShift = res;
})
},
//
sflog_check(row){
this.dialog.check = true;
this.$nextTick(() => {
this.$refs.checkDialog.open("edit").setData(row);
});
},
handleQuery(){
this.$API.wpm.sflog.list.req(this.query).then(res=>{
debugger;
console.log(res)
})
},
},
};
</script>

View File

@ -2,7 +2,7 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="roleAdd" v-auth="'role.create'"></el-button> <el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'role.create'"></el-button>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<div class="right-panel-search"> <div class="right-panel-search">
@ -29,7 +29,7 @@
</el-table-column> --> </el-table-column> -->
<el-table-column label="操作" fixed="right" align="center" width="140"> <el-table-column label="操作" fixed="right" align="center" width="140">
<template #default="scope"> <template #default="scope">
<el-button link size="small" @click="roleEdit(scope.row)" v-auth="'team.update'" type="primary">编辑</el-button> <el-button link size="small" @click="table_edit(scope.row)" v-auth="'team.update'" type="primary">编辑</el-button>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-popconfirm title="确定删除吗?" @confirm="roleDel(scope.row, scope.$index)"> <el-popconfirm title="确定删除吗?" @confirm="roleDel(scope.row, scope.$index)">
<template #reference> <template #reference>
@ -41,101 +41,32 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
<el-dialog :title="titleMap[type]" v-model="limitedVisible">
<el-form :model="form" :rules="rules" ref="addForm" label-width="80px" style="padding: 0 10px;"> <save-dialog
<el-form-item label="名称" prop="name"> v-if="dialog.save"
<el-input v-model="form.name" clearable></el-input> ref="saveDialog"
</el-form-item> @success="handleSaveSuccess"
<el-form-item label="标识"> @closed="dialog.save = false"
<el-input v-model="form.code" clearable></el-input> ></save-dialog>
</el-form-item>
<el-form-item label="类型">
<el-select
v-model="form.type"
placeholder="类型"
clearable
>
<el-option
v-for="item in typeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测项目">
<el-select
v-model="form.testitems"
placeholder="检测项目"
clearable
multiple
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="单位成本" prop="price_unit">
<el-input-number
v-model="form.sort"
:precision="0"
style="width: 100%;"
clearable>
</el-input-number>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="limitedVisible=false" > </el-button>
<el-button v-if="type!=='show'" type="primary" :loading="isSaving" @click="submitHandle()"> </el-button>
</template>
</el-dialog>
</template> </template>
<script> <script>
const defaultForm = { import saveDialog from "./material_form.vue";
id:"",
name: "",
code: "",
type: "",
sort:1,
testitems: [],
};
export default { export default {
name: 'dept', name: 'material',
components: {
saveDialog
},
data() { data() {
return { return {
apiObj: this.$API.mtm.material.list, apiObj: this.$API.mtm.material.list,
search: { search: {
keyword: null keyword: null
}, },
dialog: {
save: false,
},
query: {}, query: {},
isSaving: false,
limitedVisible : false,
type: "add",
titleMap: {
add: '新增产品',
edit: '编辑产品',
show: '查看产品'
},
//
form: defaultForm,
//
rules: {
name: [{required: true, message: '请输入产品名称'}],
},
options:[],
typeOptions:[
{label:'电/水/气',value:0},
{label:'成品',value:10},
{label:'半成品',value:20},
{label:'主要原料',value:30},
{label:'辅助材料',value:40},
{label:'加工工具',value:50},
{label:'辅助工装',value:60},
],
types_:{ types_:{
0:'电/水/气', 0:'电/水/气',
10:'成品', 10:'成品',
@ -147,53 +78,25 @@
}, },
} }
}, },
mounted() {
this.getTestItem();//
},
methods: { methods: {
handleChange(value) { handleChange(value) {
console.log(value); console.log(value);
console.log(this.form.belong_dept); console.log(this.form.belong_dept);
}, },
getTestItem(){ //
this.$API.qm.getTestItem.get({page:0}).then(res=>{ table_add() {
this.options = res; this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
}); });
}, },
// //
roleAdd(){ table_edit(row) {
this.limitedVisible = true; this.dialog.save = true;
this.type = "add"; this.$nextTick(() => {
this.form = Object.assign({}, defaultForm); this.$refs.saveDialog.open("edit").setData(row);
});
}, },
submitHandle(){
let that = this;
this.$refs.addForm.validate( (valid) => {
if (valid) {
this.isSaveing = true;
let res;
if(this.type==='add'){
res = this.$API.mtm.material.create.req(that.form);
}else{
res = this.$API.mtm.material.update.req(that.form.id,that.form);
}
if(res.err_msg){
this.$message.error(res.err_msg);
}else{
this.isSaveing = false;
this.limitedVisible = false;
this.$refs.table.refresh();
}
}
})
},
//
roleEdit(row){
this.type='edit';
this.form = Object.assign(defaultForm, row);
this.limitedVisible = true;
},
// //
async roleDel(row){ async roleDel(row){
var id = row.id; var id = row.id;

View File

@ -0,0 +1,174 @@
<template>
<el-dialog
:title="titleMap[mode]"
v-model="visible"
:size="1000"
destroy-on-close
@closed="$emit('closed')"
>
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-form
ref="dialogForm"
:model="form"
:rules="rules"
label-position="right"
label-width="80px"
style="padding: 0 10px;"
>
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" clearable></el-input>
</el-form-item>
<el-form-item label="标识">
<el-input v-model="form.code" clearable></el-input>
</el-form-item>
<el-form-item label="类型">
<el-select
v-model="form.type"
placeholder="类型"
clearable
style="width: 100%;"
>
<el-option
v-for="item in typeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测项目">
<el-select
v-model="form.testitems"
placeholder="检测项目"
clearable
multiple
style="width: 100%;"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="单位成本" prop="price_unit">
<el-input-number
v-model="form.sort"
:precision="0"
style="width: 100%;"
clearable>
</el-input-number>
</el-form-item> -->
</el-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
</el-dialog>
</template>
<script>
const defaultForm = {
id:"",
name: "",
code: "",
type: "",
// sort:1,
testitems: [],
};
export default {
emits: ["success", "closed"],
data() {
return {
loading: false,
mode: "add",
titleMap: {
add: '新增产品',
edit: '编辑产品',
show: '查看产品'
},
//
form: defaultForm,
//
rules: {
name: [{required: true, message: "请输入名称", trigger: "blur"}],
},
visible: false,
isSaveing: false,
options:[],
typeOptions:[
{label:'电/水/气',value:0},
{label:'成品',value:10},
{label:'半成品',value:20},
{label:'主要原料',value:30},
{label:'辅助材料',value:40},
{label:'加工工具',value:50},
{label:'辅助工装',value:60},
],
setFiltersVisible: false,
};
},
mounted() {
this.getTestItem();//
},
methods: {
getTestItem(){
this.$API.qm.getTestItem.get({page:0}).then(res=>{
this.options = res;
});
},
//
open(mode = "add") {
this.mode = mode;
this.visible = true;
return this;
},
//
setData(data) {
Object.assign(this.form,data);
},
//
submit() {
let that = this;
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
that.isSaveing = true;
if(that.type==='add'){
that.$API.mtm.material.create.req(that.form).then(res=>{
that.isSaveing = false;
that.$emit("success", that.form, that.mode);
that.visible = false;
that.$message.success("操作成功");
}).catch(res=>{
that.isSaveing = false;
})
}else{
res = that.$API.mtm.material.update.req(that.form.id,that.form).then(res=>{
that.isSaveing = false;
that.$emit("success", that.form, that.mode);
that.visible = false;
that.$message.success("操作成功");
}).catch(res=>{
that.isSaveing = false;
})
}
}
});
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style>
</style>

View File

@ -108,14 +108,14 @@
methods: { methods: {
// //
getMaterial(){ getMaterial(){
this.$API.mtm.material.list.req({page:0,type:10}).then(res=>{ this.$API.mtm.material.list.req({page:0}).then(res=>{
let data = []; // let data = [];
res.forEach(element => { // res.forEach(element => {
if(element.type!==0){ // if(element.type!==0){
data.push(element) // data.push(element)
} // }
}); // });
this.options = data; this.options = res;
}) })
}, },
// //

View File

@ -0,0 +1,157 @@
<!-- 全厂电量统计 -->
<template>
<div class="app-container">
<el-card style="margin-top:5px">
<div ref="print" id="myReport" class="printContainer">
<h3 style="text-align: center;">全厂报表</h3>
<table border="1" cellspacing="0" :key="timeStamp" id="numTable">
<thead style="background: #efefef;height: 40px;">
<tr>
<th>序号</th>
<th colspan="2">项目</th>
<th colspan="3"></th>
</tr>
</thead>
<tr v-for="(item,index) in tableDatas" :key="index">
<td class="numCell">{{item[0]}}</td>
<td class="numCell" v-if="index==0" rowspan="5">{{item[1]}}</td>
<td class="numCell" v-else-if="index==5" rowspan="9">{{item[1]}}</td>
<td class="numCell" v-else-if="index==14" rowspan="14">{{item[1]}}</td>
<td class="numCell" v-else-if="index==28" rowspan="5">{{item[1]}}</td>
<td class="numCell" v-else-if="index==33" rowspan="6">{{item[1]}}</td>
<td class="numCell" v-else-if="index>38">{{item[1]}}</td>
<td class="numCell" style="width:150px">{{item[2]}}</td>
<td class="numCell" v-if="index<39" colspan="3">{{item[3]}}</td>
<td class="numCell" v-else>{{item[3]}}</td>
<td class="numCell" v-if="index>38">{{item[4]}}</td>
<td class="numCell" v-if="index>38">{{item[5]}}</td>
</tr>
</table>
</div>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
query:{
year:'',
month:'',
days:'',
},
tableDatas:[
[1,'主机设备台产','立磨台产t/h',''],
[2,'主机设备台产','烘干破台产t/h'],
[3,'主机设备台产','煤磨台产t/h'],
[4,'主机设备台产','回转窑台产t/h'],
[5,'主机设备台产','水泥磨台产t/h'],
[6,'能耗','熟料日综合电耗kw.h/t'],
[7,'能耗','熟料日单位标煤耗(kgce/t)'],
[8,'能耗','熟料日综合能耗(kgce/t)'],
[9,'能耗','水泥日综合能耗(kgce/t)'],
[10,'能耗','日电石渣分布电耗kw.h/t'],
[11,'能耗','日生料分布电耗kw.h/t'],
[12,'能耗','日熟料分布电耗kw.h/t'],
[13,'能耗','日水泥粉磨分布电耗kw.h/t'],
[14,'能耗','日水泥包装分布电耗kw.h/t'],
[15,'产量','日电石渣产量(t)'],
[16,'产量','月电石渣产量完成率(%)'],
[17,'产量','日生料产量(t)'],
[18,'产量','月生料产量完成率(%)'],
[19,'产量','日熟料产量(t)'],
[20,'产量','月熟料产量完成率(%)'],
[21,'产量','日水泥产量(t)'],
[22,'产量','月水泥产量完成率(%)'],
[23,'产量','日熟料出厂量(t)'],
[24,'产量','月熟料累计出厂量(t)'],
[25,'产量','日散装水泥出厂量(t)'],
[26,'产量','月散装水泥出厂量(t)'],
[27,'产量','日袋装水泥出厂量(t)'],
[28,'产量','月袋装水泥出厂量(t)'],
[29,'成本','日电石渣成本(元/吨)'],
[30,'成本','日生料成本(元/吨)'],
[31,'成本','日熟料成本(元/吨)'],
[32,'成本','日水泥粉磨成本(元/吨)'],
[33,'成本','日水泥包装成本(元/吨)'],
[34,'耗电量','日电石渣耗电量kw.h'],
[35,'耗电量','日生料耗电量kw.h'],
[36,'耗电量','日熟料耗电量kw.h'],
[37,'耗电量','日水泥粉磨耗电量kw.h'],
[38,'耗电量','日水泥包装耗电量kw.h'],
[39,'耗电量','日生活区耗电量kw.h'],
['生产异常动态','工段','类别','原因','处置措施','处置人'],
['生产异常动态','电石渣'],
['生产异常动态','原料磨'],
['生产异常动态','回转窑'],
['生产异常动态','煤磨'],
['生产异常动态','水泥磨'],
],
sourceData:{}
};
},
mounted() {
// this.test(0)
// this.getData();
},
methods: {
test(index){
if(index!==8&&index==!22&&index==!26&&index==!37&&index==!38&&index!==48&&index!==49){
console.log(index)
}
},
getData(){
this.$API.bi.dataset.exec.req('3349203178834325504',).then((res) => {
let data0 = this.sourceData = res.data2.ds0;
// debugger;
console.log(this.sourceData)
});
},
handlePrint() {
this.$PRINT('#myReport');
},
}
};
</script>
<style>
.printContainer{
width: 1075px;
}
#numTable{
margin-left: 37px;
}
#numTable td{
height: 32px;
padding-left: 5px;
}
.numCell{
width: 80px;
}
.numCell.numCell_last{
width: 100px;
}
.searchHead{
display:flex
}
.middleText{
height: 32px;
line-height: 32px;
margin: 0 5px;
display: inline-block;
}
.searchBtn{
margin-left: 5px;
}
</style>

View File

@ -17,10 +17,6 @@
</el-select> </el-select>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div> </div>
<div class="right-panel">
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'role.create'"></el-button>
</div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" hidePagination> <scTable ref="table" :apiObj="apiObj" row-key="id" hidePagination>
@ -80,13 +76,13 @@
this.options = res; this.options = res;
}) })
}, },
// // //
table_add() { // table_add() {
this.dialog.save = true; // this.dialog.save = true;
this.$nextTick(() => { // this.$nextTick(() => {
this.$refs.saveDialog.open("add"); // this.$refs.saveDialog.open("add");
}); // });
}, // },
// //
table_edit(row) { table_edit(row) {
this.dialog.save = true; this.dialog.save = true;