mes报工优化

master
A0010407 1 year ago
parent f2ca16bb18
commit 2ffec45f92

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询生产报工物料消耗列表
export function listReportWorkConsume(query) {
return request({
url: '/mes/reportWorkConsume/list',
method: 'get',
params: query
});
}
// 查询生产报工物料消耗列表
export function listReportWorkConsumeById(query) {
return request({
url: '/mes/reportWorkConsume/consumeList',
method: 'get',
params: query
});
}
// 查询生产报工物料消耗详细
export function getReportWorkConsume(recordId) {
return request({
url: '/mes/reportWorkConsume/' + recordId,
method: 'get'
});
}
// 新增生产报工物料消耗
export function addReportWorkConsume(data) {
return request({
url: '/mes/reportWorkConsume',
method: 'post',
data: data
});
}
// 修改生产报工物料消耗
export function updateReportWorkConsume(data) {
return request({
url: '/mes/reportWorkConsume',
method: 'put',
data: data
});
}
// 删除生产报工物料消耗
export function delReportWorkConsume(recordId) {
return request({
url: '/mes/reportWorkConsume/' + recordId,
method: 'delete'
});
}

@ -79,7 +79,14 @@
<el-table v-loading="loading" :data="reportWorkList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="reportWorkList" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" /> <el-table-column type="selection" align="center" />
<el-table-column label="报工单编号" align="center" prop="reportCode" width="100"/> <el-table-column label="报工单编号" align="center" prop="reportCode" width="100">
<template slot-scope="scope">
<el-button
type="text"
@click="handleView(scope.row)"
>{{scope.row.reportCode}}</el-button>
</template>
</el-table-column>
<el-table-column label="报工类型" align="center" prop="reportType" /> <el-table-column label="报工类型" align="center" prop="reportType" />
<el-table-column label="生产工单编码" align="center" prop="workorderCode" width="100"/> <el-table-column label="生产工单编码" align="center" prop="workorderCode" width="100"/>
<el-table-column label="产品编码" align="center" prop="productCode" /> <el-table-column label="产品编码" align="center" prop="productCode" />
@ -88,8 +95,20 @@
<el-table-column label="单位" align="center" prop="unit" /> <el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="排产数量" align="center" prop="quantity" /> <el-table-column label="排产数量" align="center" prop="quantity" />
<el-table-column label="本次报工数量" align="center" prop="quantityFeedback" width="100"/> <el-table-column label="本次报工数量" align="center" prop="quantityFeedback" width="100"/>
<el-table-column label="合格数量" align="center" prop="quantityQualified" /> <el-table-column label="合格数量" align="center" prop="quantityQualified" :show-overflow-tooltip="true">
<el-table-column label="不合格数量" align="center" prop="quantityUnqualified" width="100"/> <template slot-scope="scope">
<div :style="{ color: scope.row.quantityQualified ? 'green' : 'green' }">
{{ scope.row.quantityQualified }}
</div>
</template>
</el-table-column>
<el-table-column label="不合格数量" align="center" prop="quantityUnqualified" width="100">
<template slot-scope="scope">
<div :style="{ color: scope.row.quantityUnqualified ? 'red' : 'red' }">
{{ scope.row.quantityUnqualified }}
</div>
</template>
</el-table-column>
<el-table-column label="报工人员" align="center" prop="userName" /> <el-table-column label="报工人员" align="center" prop="userName" />
<el-table-column label="人员名称" align="center" prop="nickName" /> <el-table-column label="人员名称" align="center" prop="nickName" />
<el-table-column label="报工途径" align="center" prop="feedbackChannel" /> <el-table-column label="报工途径" align="center" prop="feedbackChannel" />
@ -135,50 +154,91 @@
/> />
<!-- 添加或修改报工报表对话框 --> <!-- 添加或修改报工报表对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="报工单编号" prop="reportCode"> <el-form-item label="报工单编号" prop="reportCode">
<el-input v-model="form.reportCode" placeholder="请输入报工单编号" /> <el-input v-model="form.reportCode" placeholder="请输入报工单编号" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="报工类型" prop="reportType"> <el-form-item label="报工类型" prop="reportType">
<el-input v-model="form.reportType" placeholder="请输入报工类型" /> <el-select v-model="form.reportType" placeholder="请选择报工类型" @change="$forceUpdate()" clearable>
<el-option v-for="item in reportTypeOptions" :key="item.reportType" :label="item.label" :value="item.reportType"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="生产工单编码" prop="workorderCode"> <el-form-item label="生产工单编码" prop="workorderCode">
<el-input v-model="form.workorderCode" placeholder="请输入生产工单编码" /> <el-input v-model="form.workorderCode" placeholder="请输入生产工单编码" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="产品编码" prop="productCode"> <el-form-item label="产品编码" prop="productCode">
<el-input v-model="form.productCode" placeholder="请输入产品编码" /> <el-input v-model="form.productCode" placeholder="请输入产品编码" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="产品名称" prop="productName"> <el-form-item label="产品名称" prop="productName">
<el-input v-model="form.productName" placeholder="请输入产品名称" /> <el-input v-model="form.productName" placeholder="请输入产品名称" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="规格型号" prop="spec"> <el-form-item label="规格型号" prop="spec">
<el-input v-model="form.spec" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.spec" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="单位" prop="unit"> <el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" /> <el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="排产数量" prop="quantity"> <el-form-item label="排产数量" prop="quantity">
<el-input v-model="form.quantity" placeholder="请输入排产数量" /> <el-input v-model="form.quantity" placeholder="请输入排产数量" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="本次报工数量" prop="quantityFeedback"> <el-form-item label="本次报工数量" prop="quantityFeedback">
<el-input v-model="form.quantityFeedback" placeholder="请输入本次报工数量" /> <el-input v-model="form.quantityFeedback" placeholder="请输入本次报工数量" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="合格数量" prop="quantityQualified"> <el-form-item label="合格数量" prop="quantityQualified">
<el-input v-model="form.quantityQualified" placeholder="请输入合格数量" /> <el-input v-model="form.quantityQualified" placeholder="请输入合格数量" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="不合格数量" prop="quantityUnqualified"> <el-form-item label="不合格数量" prop="quantityUnqualified">
<el-input v-model="form.quantityUnqualified" placeholder="请输入不合格数量" /> <el-input v-model="form.quantityUnqualified" placeholder="请输入不合格数量" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="报工人员" prop="userName"> <el-form-item label="报工人员" prop="userName">
<el-input v-model="form.userName" placeholder="请输入报工人员" /> <el-input v-model="form.userName" placeholder="请输入报工人员" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="人员名称" prop="nickName"> <el-form-item label="人员名称" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入人员名称" /> <el-input v-model="form.nickName" placeholder="请输入人员名称" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="报工途径" prop="feedbackChannel"> <el-form-item label="报工途径" prop="feedbackChannel">
<el-input v-model="form.feedbackChannel" placeholder="请选择报工途径" /> <el-select v-model="form.feedbackChannel" placeholder="请选择报工类型" @change="$forceUpdate()" clearable>
<el-option v-for="item in feedbackChannelOptions" :key="item.feedbackChannel" :label="item.label" :value="item.feedbackChannel"></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="报工时间" prop="feedbackTime"> <el-form-item label="报工时间" prop="feedbackTime">
<el-date-picker clearable <el-date-picker clearable
v-model="form.feedbackTime" v-model="form.feedbackTime"
@ -187,43 +247,104 @@
placeholder="请选择报工时间"> placeholder="请选择报工时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="录入人员" prop="recordUser"> <el-form-item label="录入人员" prop="recordUser">
<el-input v-model="form.recordUser" placeholder="请输入录入人员" /> <el-input v-model="form.recordUser" placeholder="请输入录入人员" />
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> </el-col>
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> </el-row>
</el-form-item> <el-row>
<el-form-item label="工时" prop="workTime"> <el-col :span="6">
<el-input v-model="form.workTime" placeholder="请输入工时" />
</el-form-item>
<el-form-item label="线体编码" prop="machineCode"> <el-form-item label="线体编码" prop="machineCode">
<el-input v-model="form.machineCode" placeholder="请输入线体编码" /> <el-input v-model="form.machineCode" placeholder="请输入线体编码" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="线体名称" prop="machineName"> <el-form-item label="线体名称" prop="machineName">
<el-input v-model="form.machineName" placeholder="请输入线体名称" /> <el-input v-model="form.machineName" placeholder="请输入线体名称" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="班组编码" prop="teamCode"> <el-form-item label="班组编码" prop="teamCode">
<el-input v-model="form.teamCode" placeholder="请输入班组编码" /> <el-input v-model="form.teamCode" placeholder="请输入班组编码" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="班次编码" prop="shiftCode"> <el-form-item label="班次编码" prop="shiftCode">
<el-input v-model="form.shiftCode" placeholder="请输入班次编码" /> <el-input v-model="form.shiftCode" placeholder="请输入班次编码" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 添加或修改生产报工物料消耗对话框 -->
<el-dialog :title="title" :visible.sync="reportWorkConsunmOpen" width="1200px" append-to-body>
<el-table v-loading="loading" :data="reportWorkConsumeList">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="recordId" />
<el-table-column label="报工编码" align="center" prop="reportCode" />
<el-table-column label="工单编码" align="center" prop="workorderCode" />
<el-table-column label="物料编号" align="center" prop="materialCode" />
<el-table-column label="物料名称" align="center" prop="materialName" />
<el-table-column label="物料规格型号" align="center" prop="materialSpc" />
<el-table-column label="数量" align="center" prop="quantity" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="预留字段1" align="center" prop="attr1" />
<el-table-column label="预留字段2" align="center" prop="attr2" />
<el-table-column label="预留字段3" align="center" prop="attr3" />
<el-table-column label="预留字段4" align="center" prop="attr4" />
<el-table-column label="工厂编码" align="center" prop="factoryCode" />
</el-table>
<pagination
v-show="consumeTotal>0"
:total="consumeTotal"
:page.sync="consumeQueryParams.consumePageNum"
:limit.sync="consumeQueryParams.consumePageSize"
@pagination="getReportWorkConsumeList"
/>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listReportWork, getReportWork, delReportWork, addReportWork, updateReportWork } from "@/api/mes/reportWork"; import { listReportWork, getReportWork, delReportWork, addReportWork, updateReportWork } from "@/api/mes/reportWork";
import { listReportWorkConsume, getReportWorkConsume, delReportWorkConsume, addReportWorkConsume, updateReportWorkConsume ,listReportWorkConsumeById} from "@/api/mes/reportWorkConsume";
export default { export default {
name: "ReportWork", name: "ReportWork",
data() { data() {
return { return {
reportTypeOptions: [{
reportType: 'SELF自行报工',
label: 'SELF自行报工'
}, {
reportType: 'UNI统一报工',
label: 'UNI统一报工'
}],
feedbackChannelOptions: [{
feedbackChannel: 'PAD',
label: 'PAD'
}, {
feedbackChannel: 'MOBILE',
label: 'MOBILE'
}, {
feedbackChannel: 'PC',
label: 'PC'
}],
// //
loading: true, loading: true,
// //
@ -236,12 +357,20 @@ export default {
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
consumeTotal:0,
// //
reportWorkList: [], reportWorkList: [],
reportWorkConsumeList: [],
// //
title: "", title: "",
// //
open: false, open: false,
reportWorkConsunmOpen:false,
consumeQueryParams:{
consumePageNum:1,
consumePageSize:10,
reportCode:null,
},
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -296,6 +425,32 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询生产报工物料消耗列表 */
getReportWorkConsumeList() {
this.loading = true;
const id = row.id || this.id;
listReportWorkConsumeById(id).then(response => {
this.reportWorkConsumeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
handleView(row){
this.reset();
const reportCode = row.reportCode || this.reportCode;
console.log(row.reportCode,"后面",this.reportCode);
this.consumeQueryParams.reportCode = reportCode;
this.loading = true;
listReportWorkConsumeById(this.consumeQueryParams).then(response => {
this.reportWorkConsumeList = response.rows;
this.consumeTotal = response.total;
this.loading = false;
this.reportWorkConsunmOpen = true;
this.title = "查看生产报工物料损耗";
this.optType = "view";
});
},
/** 查询报工报表列表 */ /** 查询报工报表列表 */
getList() { getList() {
this.loading = true; this.loading = true;

Loading…
Cancel
Save