生产日报表

yangwl
shaoyong 6 months ago
parent 026c444117
commit 578fa4c8ab

@ -68,6 +68,14 @@ export function getDailyReport(query) {
});
}
export function getDailyReportNew(query) {
return request({
url: '/mes/reportWork/getDailyReportNew',
method: 'get',
params: query
});
}
export function getWorkcenterList() {
return request({
url: '/mes/reportWork/getWorkcenterList',

@ -0,0 +1,271 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
<el-form-item label="工单日期:" prop="timeArray">
<el-date-picker
v-model="queryParams.timeArray"
format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable
@keyup.enter.native="handleQuery"
>
</el-date-picker>
</el-form-item>
<el-form-item label="产线名称" prop="sapName">
<el-input
v-model="queryParams.sapName"
placeholder="请输入产线名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工作中心">
<el-select v-model="queryParams.workCenter" filterable placeholder="请选择工作中心" clearable>
<el-option
v-for="item in options"
:key="item.factoryCode"
:label="item.factoryName"
:value="item.factoryCode"
@keyup.enter.native="handleQuery"
>
</el-option>
</el-select>
</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="['mes:dailyReportNew:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="prepareList"
:summary-method="getSummaries"
:header-cell-style="{'text-align':'center'}"
:cell-style="{'text-align':'center'}"
show-summary
>
<el-table-column prop="factoryCode" label="工厂" width="90"/>
<el-table-column prop="workshopCode" label="车间编码" width="90"/>
<el-table-column prop="workshopName" label="车间名称" width="90"/>
<el-table-column prop="productDate" label="日期" width="100"/>
<el-table-column prop="sapCode" label="产线编码" width="90"/>
<el-table-column prop="sapName" label="产线名称" width="160"/>
<el-table-column prop="equipmentName" label="组别" width="90"/>
<el-table-column prop="prodType" label="品类" width="80"/>
<el-table-column prop="teamLeaderName" label="组长" width="100"/>
<el-table-column prop="workorderCode" label="工单号" width="150"/>
<el-table-column prop="productCode" label="产品编码" width="120" :formatter="productCodeFormate"/>
<el-table-column prop="productName" label="产品名称" width="200"/>
<el-table-column prop="spec" label="规格" width="100"/>
<el-table-column prop="unit" label="单位(件)" width="80"/>
<el-table-column prop="quantitySplit" label="计划产量(件)" width="80"/>
<el-table-column prop="quantityFeedback" label="实际产量(件)" width="80"/>
<el-table-column prop="quantityAct" label="产量(PC)" width="80"/>
<el-table-column prop="completeRate" label="订单完成率(%)" width="80"/>
<el-table-column prop="efficiency" label="产线标准效率(PC/H)" width="100"/>
<el-table-column prop="manStandard" label="标准用人" width="80"/>
<el-table-column prop="useMan" label="实际用人" width="80"/>
<el-table-column
prop="workTimeStandard"
label="标准工时"
width="80">
</el-table-column>
<el-table-column
prop="workTime"
label="实际工时"
width="80">
</el-table-column>
<el-table-column
prop="productivity"
label="产线效率(%)"
width="80">
</el-table-column>
<el-table-column
prop="totalWorkTime"
label="总工时"
width="80">
</el-table-column>
<el-table-column
prop="manAvgStandard"
label="标准人均效率"
width="100">
</el-table-column>
<el-table-column
prop="manAvgActual"
label="实际人均效率"
width="100">
</el-table-column>
<el-table-column
prop="manAvgDo"
label="人均效率达成率"
width="120">
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { getDailyReportNew,getWorkcenterList} from "@/api/mes/reportWork";
import moment from 'moment';
export default {
name: "Prepare",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
prepareList: [],
//
title: "",
//
open: false,
//
queryParams: {
timeArray: [moment(new Date().toLocaleDateString().replace(/\//g, "-")).format('YYYY-MM-DD'),
moment(new Date().toLocaleDateString().replace(/\//g, "-")).format('YYYY-MM-DD')],
productDateStart: null,
productDateEnd: null,
sapName: null,
pageNum: 1,
pageSize: 10,
workCenter: null,
factoryCode: null
},
//
form: {},
//
rules: {},
options: null
};
},
created() {
this.getList();
this.getWorkcenterList();
},
methods: {
indexMethod(index){
return index+1 ;
},
/** 查询备料单列表 */
getList() {
this.loading = true;
if(this.queryParams.timeArray.length>0){
this.queryParams.productDateStart = moment(this.queryParams.timeArray[0]).format('YYYY-MM-DD');
this.queryParams.productDateEnd = moment(this.queryParams.timeArray[1]).format('YYYY-MM-DD');
}
getDailyReportNew(this.queryParams).then(response => {
this.prepareList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getWorkcenterList(){
getWorkcenterList().then(data => {
this.options = data;
});
this.queryParams.workCenter = this.options[0].factoryCode;
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
};
this.resetForm("form");
},
productCodeFormate(row, column, cellValue){
if(cellValue != null){
return cellValue.slice(7,18); //
}
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/reportWork/getDailyReportNewExport', {
...this.queryParams
}, `dailyReport_${new Date().getTime()}.xlsx`)
},
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '小计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += '';
if(index<6){
sums[index] = '';
}
} else {
sums[index] = '';//N/A
}
});
return sums;
}
}
};
</script>
Loading…
Cancel
Save