Browse Source

2024/1/19 返工返修记录

master
zelian_wu 2 years ago
parent
commit
15ef5fcdb6
  1. 1
      src/api/production/generateReport.js
  2. 58
      src/views/modules/production/generateReport.vue
  3. 38
      src/views/modules/production/reworkRecord.vue

1
src/api/production/generateReport.js

@ -59,4 +59,5 @@ export const selectToolingHist = data =>createAPI(`dailyPlan/selectToolingHist`,
export const startRework = data =>createAPI(`/dailyPlan/startRework`,'post',data) export const startRework = data =>createAPI(`/dailyPlan/startRework`,'post',data)
export const selectRework = data =>createAPI(`/dailyPlan/selectRework`,'post',data) export const selectRework = data =>createAPI(`/dailyPlan/selectRework`,'post',data)
export const saveRework = data =>createAPI(`/dailyPlan/saveRework`,'post',data) export const saveRework = data =>createAPI(`/dailyPlan/saveRework`,'post',data)
export const getRework = data =>createAPI(`/dailyPlan/getRework`,'post',data)

58
src/views/modules/production/generateReport.vue

@ -867,8 +867,6 @@
} }
this.saveHeaderData.reportWeight=Number(this.KGApprove)-boxWeightKG+Number(this.KGReported) this.saveHeaderData.reportWeight=Number(this.KGApprove)-boxWeightKG+Number(this.KGReported)
} }
this.setUp.saveButton=true;
if(this.saveHeaderData.scrapQty==null||this.saveHeaderData.scrapQty==''){ if(this.saveHeaderData.scrapQty==null||this.saveHeaderData.scrapQty==''){
this.saveHeaderData.scrapQty=0 this.saveHeaderData.scrapQty=0
} }
@ -889,37 +887,39 @@
return new Decimal(prev).add(new Decimal(cur.finishQty)).toNumber() return new Decimal(prev).add(new Decimal(cur.finishQty)).toNumber()
},0) },0)
} }
this.setUp.saveButton=true; this.setUp.saveButton=true;
saveGenerateReportForSchedule(this.saveHeaderData).then(({data}) => { saveGenerateReportForSchedule(this.saveHeaderData).then(({data}) => {
this.setUp.saveButton = false
if (data.code == 0) {
this.$message.success(data.msg)
this.setUp.reviewFlag = false
// this.search()
let inList=[];
if(data.transData!=null){
//2
inList.push(data.transData)
inList.push(data.transData)
}
if(data.badData!=null){
inList.push(data.badData)
}
if(this.saveHeaderData.printQty>0){
for (let i = 0; i <this.saveHeaderData.printQty ; i++) {
inList.push(this.currentRow)
this.setUp.saveButton = false
if (data.code == 0) {
this.$message.success(data.msg)
this.setUp.reviewFlag = false
// this.search()
let inList=[];
if(data.transData!=null){
//2
inList.push(data.transData)
inList.push(data.transData)
} }
if(data.badData!=null){
inList.push(data.badData)
}
if(this.saveHeaderData.printQty>0){
for (let i = 0; i <this.saveHeaderData.printQty ; i++) {
inList.push(this.currentRow)
}
}
if(inList.length>0){
printTransNoLabel(inList);
}
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
this.setUp.saveButton = false
} }
if(inList.length>0){
printTransNoLabel(inList);
}
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).error((error)=>{
this.setUp.saveButton = false
})
}, },
// S // S
getBaseList (val, type) { getBaseList (val, type) {

38
src/views/modules/production/reworkRecord.vue

@ -1,6 +1,6 @@
<script> <script>
import chooseList from '../common/Chooselist.vue' import chooseList from '../common/Chooselist.vue'
import {selectRework,startRework,saveRework} from '../../../api/production/generateReport'
import {selectRework,startRework,saveRework,getRework} from '../../../api/production/generateReport'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import decimal, {Decimal} from 'decimal.js' import decimal, {Decimal} from 'decimal.js'
export default { export default {
@ -33,6 +33,7 @@ export default {
reportWorkDialog:false, reportWorkDialog:false,
saveType:undefined, saveType:undefined,
numberOrWeight:undefined,//01 numberOrWeight:undefined,//01
seqNoReworkRecordDialog:false,
} }
}, },
methods:{ methods:{
@ -199,6 +200,23 @@ export default {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
}) })
},
getRework(){
getRework(this.saveRework).then(({data})=>{
if (data && data.code === 0){
this.saveRework = data.row;
this.seqNoReworkRecordDialog = false;
this.reportWorkDialog = true
}else {
this.$alert(data.msg, '错误信息', {
confirmButtonText: '确定'
})
}
}).error((error)=>{
this.$alert(error, '错误信息', {
confirmButtonText: '确定'
})
})
} }
}, },
created () { created () {
@ -210,10 +228,10 @@ export default {
<template> <template>
<div> <div>
<choose-list ref="baseList" @getBaseData="getBaseData"></choose-list> <choose-list ref="baseList" @getBaseData="getBaseData"></choose-list>
<el-dialog title="开始返修" @close="closeStartReworkRecordDialog" :visible.sync="startReworkRecordDialog" :close-on-click-modal="false" width="10%">
<el-form :model="saveRework" label-position="top">
<el-dialog title="开始返修" @close="closeStartReworkRecordDialog" :visible.sync="startReworkRecordDialog" :close-on-click-modal="false" width="13%">
<el-form :model="saveRework" label-position="top" @submit.native.prevent>
<el-form-item label="派工单号" prop="seqNo"> <el-form-item label="派工单号" prop="seqNo">
<el-input type="number" v-model="saveRework.seqNo"></el-input>
<el-input type="number" v-model="saveRework.seqNo" @keydown.native.enter="startRework"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center"> <el-footer style="height:40px;margin-top: 20px;text-align:center">
@ -221,6 +239,17 @@ export default {
<el-button type="primary" @click="startReworkRecordDialog = false">取消</el-button> <el-button type="primary" @click="startReworkRecordDialog = false">取消</el-button>
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<el-dialog title="派工单返修" @close="closeStartReworkRecordDialog" :visible.sync="seqNoReworkRecordDialog" :close-on-click-modal="false" width="13%">
<el-form :model="saveRework" label-position="top" @submit.native.prevent>
<el-form-item label="派工单号" prop="seqNo">
<el-input type="number" v-model="saveRework.seqNo" @keydown.native.enter="getRework"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="getRework">确定</el-button>
<el-button type="primary" @click="seqNoReworkRecordDialog = false">取消</el-button>
</el-footer>
</el-dialog>
<el-dialog title="返工信息" @close="closeStartReworkRecordDialog" top="15vh" :close-on-click-modal="false" :visible.sync="reportWorkDialog" width="40%"> <el-dialog title="返工信息" @close="closeStartReworkRecordDialog" top="15vh" :close-on-click-modal="false" :visible.sync="reportWorkDialog" width="40%">
<el-form :model="saveRework" style="padding: 5px" label-position="top"> <el-form :model="saveRework" style="padding: 5px" label-position="top">
<el-row :gutter="20"> <el-row :gutter="20">
@ -477,6 +506,7 @@ export default {
</el-form> </el-form>
<div style="margin: 8px 0"> <div style="margin: 8px 0">
<el-button size="small" icon="el-icon-edit" type="primary" @click="startReworkRecordDialog = true"> </el-button> <el-button size="small" icon="el-icon-edit" type="primary" @click="startReworkRecordDialog = true"> </el-button>
<el-button size="small" type="primary" @click="seqNoReworkRecordDialog = true">派工单返修</el-button>
</div> </div>
<el-table <el-table
height="76vh" height="76vh"

Loading…
Cancel
Save