单耗统计功能、打印修改。

yangwl
Yangwl 5 months ago
parent 404992e28a
commit 994c31a4e1

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询unitPrice列表
export function listOrderEnergy(query) {
return request({
url: '/energy/report/analysis/OrderEnergyReport',
method: 'get',
params: query
});
}
// 查询unitPrice详细
export function getUnitPrice(picId) {
return request({
url: '/mes/unitPrice/' + picId,
method: 'get'
});
}
// 新增unitPrice
export function addUnitPrice(data) {
return request({
url: '/mes/unitPrice',
method: 'post',
data: data
});
}
// 修改unitPrice
export function updateUnitPrice(data) {
return request({
url: '/mes/unitPrice',
method: 'put',
data: data
});
}
// 删除unitPrice
export function delUnitPrice(picId) {
return request({
url: '/mes/unitPrice/' + picId,
method: 'delete'
});
}

@ -0,0 +1,253 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="产线编码" prop="lineCode">
<el-input
v-model="queryParams.workorderName"
placeholder="请输入产线编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产线名称" prop="lineName">
<el-input
v-model="queryParams.equipmentName"
placeholder="请输入产线名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="电表编号" prop="electricityNo">
<el-input
v-model="queryParams.electricityNo"
placeholder="请输入电表编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="订单生产日期" label-width="100px">
<el-date-picker
v-model="dateRange"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['energy:orderenergy:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="OrderEnergyList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="订单号" align="center" prop="workorderCode" />
<el-table-column label="产线编码" align="center" width="100" prop="workorderName" />
<el-table-column label="产线名称" align="center" width="150"prop="equipmentName" />
<el-table-column label="生产日期" align="center" width="150"prop="productDate" />
<el-table-column label="电表编号" align="center" prop="electricityNo" />
<el-table-column label="产品编码" align="center" width="200" prop="productCode" />
<el-table-column label="产品描述" align="center" width="300" prop="productName" />
<el-table-column label="生产数量(箱)" align="center" prop="totalQuantityFeedback" />
<el-table-column label="开始值" align="center" prop="startKW" />
<el-table-column label="结束值" align="center" prop="endKW" />
<el-table-column label="倍率" align="center" prop="multiplier" />
<el-table-column label="能耗KW·h" align="center" prop="kw" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { getToken } from "@/utils/auth";
import { listOrderEnergy} from "@/api/energy/powerUse/OrderEnergy";
import { getProductByCode} from "@/api/wms/product";
import { listChildprocessall} from "@/api/mes/childprocess";
export default {
name: "OrderEnergy",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
OrderEnergyList: [],
//
title: "",
//
open: false,
//
dateRange: [],
value: '',
upload: {
loading: false,
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: {poolName: localStorage.getItem("USER_POOL_NAME_CURRENT"), Authorization: "Bearer " + getToken()},
//
url: process.env.VUE_APP_BASE_API + "/mes/unitPrice/importData"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
factoryId: null,
productCode: null,
productName: null,
workorderName: null,
equipmentName: null,
electricityNo: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
},
productQueryParams:{
productCode: null,
productName: null,
},
//
form: {},
//
rules: {
productCode: [
{ required: true, message: "产品编码不能为空", trigger: "blur" },
],
lineName: [
{ required: true, message: "产线不能为空", trigger: "blur" },
],
attr1: [
{ required: true, message: "单价不能为空", trigger: "blur" },
],
},
productCodeList: [],
state: '',
timeout: null,
productCode:'',
tableData: [],
processOptions: [
{ value: 'Process 1', label: '工序1' },
{ value: 'Process 2', label: '工序2' },
],
nextID: 1,
inputType: 'text'
};
},
created() {
this.getList();
// this.fetchProcessOptions();
},
methods: {
/** 查询unitPrice列表 */
getList() {
this.loading = true;
listOrderEnergy(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.OrderEnergyList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
picId: null,
factoryId: null,
productCode: null,
productName: null,
lineCode: null,
lineName: null,
childprocessId: null,
childprocessCode: null,
childprocessName: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
this.tableData = [];
this.nextID=1;
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.picId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 导出按钮操作 */
handleExport() {
this.download('energy/report/analysis/orderenergy/export', {
...this.queryParams
}, `单耗分析_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -250,14 +250,15 @@
v-if="refreshNewWorkerTable" v-loading="newWorkerLoading"class="my-print-table":data="printData.workTable" v-if="refreshNewWorkerTable" v-loading="newWorkerLoading"class="my-print-table":data="printData.workTable"
border style="width: 100%"> border style="width: 100%">
<el-table-column type="index" label="序号" width="50"></el-table-column> <el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column prop="materialCode" label="料号" width="130" :formatter="productCodeFormate"></el-table-column> <el-table-column prop="materialCode" label="料号" width="120" :formatter="productCodeFormate"></el-table-column>
<el-table-column prop="materialName" label="物料描述" width="320"></el-table-column> <el-table-column prop="materialName" label="物料描述" width="320"></el-table-column>
<el-table-column prop="unit" width="50" label="单位"></el-table-column> <el-table-column prop="unit" width="50" label="单位"></el-table-column>
<el-table-column v-if="showWorkorderCode" prop="workorderCode" width="100" label="生产订单" :formatter="orderCodeFormate"></el-table-column> <el-table-column v-if="showWorkorderCode" prop="workorderCode" width="100" label="生产订单" :formatter="orderCodeFormate"></el-table-column>
<el-table-column prop="quantity" label="请领数量"></el-table-column> <el-table-column prop="quantity" label="请领数量"></el-table-column>
<el-table-column prop="fundQuanlity" label="欠领数量"></el-table-column> <!-- <el-table-column prop="fundQuanlity" label="欠领数量"></el-table-column>-->
<el-table-column prop="routeCode" width="80" label="实发数量"></el-table-column> <el-table-column prop="routeCode" width="80" label="实发数量"></el-table-column>
<el-table-column prop="recoil" label="反冲物料"></el-table-column> <el-table-column prop="routeCode" width="90" label="实发数量2"></el-table-column>
<!-- <el-table-column prop="recoil" label="反冲物料"></el-table-column>-->
</el-table> </el-table>
<br/> <br/>
<!-- 底部 --> <!-- 底部 -->
@ -605,8 +606,9 @@ export default {
} }
@media print { @media print {
#printFrom{ #printFrom{
font-family: Microsoft YaHei !important; font-family: "SimSun", "宋体" !important;
color: #000 !important; color: #000 !important;
font-size: 14pt !important; /* 调整字体大小 */
} }
} }
</style> </style>

Loading…
Cancel
Save