生产日报

yangwl
zhaoxiaolin 1 year ago
parent f0a6cdb12a
commit d3c219c0e8

@ -0,0 +1,303 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
<el-form-item size="small" label="工单日期: ">
<el-date-picker
v-model="queryParams.productDate"
value-format="yyyy-MM-dd"
type="date"
placeholder="工单日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="工作中心">
<el-input
v-model="queryParams.workCenter"
placeholder="请输入工作中心"
clearable
/>
</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:prepare: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="teamDesc"
label="组别"
width="100">
</el-table-column>
<el-table-column
prop="prodType"
label="分类"
width="100">
</el-table-column>
<el-table-column
prop="teamLeaderName"
label="组长"
width="100">
</el-table-column>
<el-table-column
prop="productCode"
label="产品编码"
width="100">
</el-table-column>
<el-table-column
prop="spec"
label="规格"
width="100">
</el-table-column>
<el-table-column
prop="productName"
label="产品名称"
width="150">
</el-table-column>
<el-table-column
prop="unit"
label="单位"
width="80">
</el-table-column>
<el-table-column label="本日产量">
<el-table-column
prop="quantity"
label="计划"
width="80">
</el-table-column>
<el-table-column
prop="quantityFeedback"
label="实际"
width="80">
</el-table-column>
<el-table-column
prop="quantityAct"
label="盒量"
width="80">
</el-table-column>
<el-table-column
prop="completeRate"
label="完成率"
width="80">
</el-table-column>
</el-table-column>
<el-table-column
prop="iei"
label="标准效率
PC/H"
width="80">
</el-table-column>
<el-table-column label="用人">
<el-table-column
prop="manStandar"
label="标准"
width="80">
</el-table-column>
<el-table-column
prop="useMan"
label="实际"
width="80">
</el-table-column>
</el-table-column>
<el-table-column label="工时">
<el-table-column
prop="workTimeStandar"
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>
<el-table-column label="人均效率">
<el-table-column
prop="manAvgStandar"
label="标准"
width="80">
</el-table-column>
<el-table-column
prop="manAvgActual"
label="实际"
width="80">
</el-table-column>
<el-table-column
prop="manAvgDo"
label="达成"
width="80">
</el-table-column>
</el-table-column>
<el-table-column
prop="actManHour"
label="实际人工时"
width="80">
</el-table-column>
<el-table-column
prop="name"
label="人均效率未达成原因分析"
width="150" v-if="false">
</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 { getDailyReport} 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: {
productDate: new Date().toLocaleDateString().replace(/\//g, "-"),
pageNum: 1,
pageSize: 10,
workCenter: null,
factoryCode: null
},
//
form: {},
//
rules: {}
};
},
created() {
this.getList();
},
methods: {
indexMethod(index){
return index+1 ;
},
/** 查询备料单列表 */
getList() {
if(this.queryParams.productDate == null){
this.$modal.msgSuccess("日期不能为空");
return
}
if(this.queryParams.workCenter == null){
this.$modal.msgSuccess("工作中心不能为空");
return
}
this.loading = true;
getDailyReport(this.queryParams).then(response => {
this.prepareList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/reportWork/productionExport', {
...this.queryParams
}, `prepare_${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(sums[index] > 1000000){
sums[index] = '';
}
} else {
sums[index] = '';//N/A
}
});
return sums;
}
}
};
</script>
Loading…
Cancel
Save