From bb806e4fb408e5a2af729eb454a914b67f40bd4b Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 1 Jul 2025 15:23:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=85=89=E8=8A=AF=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=8F=AF=E9=80=89=E6=8B=A9=E5=B7=A5=E8=89=BA=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wpm_gx/f_mlogs_form.vue | 130 ++++++++++++++++++++---------- src/views/wpm_gx/fmlog_detail.vue | 8 +- src/views/wpm_gx/mlog_detail.vue | 13 ++- src/views/wpm_gx/mlog_form.vue | 3 +- src/views/wpm_gx/mlogb_form.vue | 117 ++++++++++++++++----------- src/views/wpm_gx/mlogs.vue | 50 ++++++------ 6 files changed, 201 insertions(+), 120 deletions(-) diff --git a/src/views/wpm_gx/f_mlogs_form.vue b/src/views/wpm_gx/f_mlogs_form.vue index c87f9ce0..81d9263d 100644 --- a/src/views/wpm_gx/f_mlogs_form.vue +++ b/src/views/wpm_gx/f_mlogs_form.vue @@ -17,6 +17,27 @@ style="padding: 0" > + + + + + [{{ item.routepack_name }}]{{ item.name }} + + + + { + // that.routeOptions = res; + // }); + // }, + changeRoute(){ + let that = this; + that.routeOptions.forEach(item=>{ + if(item.id==that.form.route){ + console.log('item',item) + that.getdefects(item.id,item.material_in,item.material_out); + } + }) + }, getTeam() { let that = this; let form = {}; @@ -475,9 +511,11 @@ export default { that.getUserList(); }); }, - getdefects(){ + getdefects(route,material_in,material_out){ let that = this; - if(that.is_fix){ + console.log('getdefects') + if(that.is_fix&&that.materialFix!==null&&that.materialFix!==''){ + console.log('that.materialFix',that.materialFix) that.$API.qm.qct.getQct.req({material: that.materialFix,tag:'process'}).then((res) => { res.qct_defects.forEach((item) => { that.defectform[item.defect_name] = 0; @@ -494,37 +532,42 @@ export default { } }) }else{ - that.$API.qm.qct.getQct.req({material: that.material_in,tag:'process'}).then((res) => { - res.qct_defects.forEach((item) => { - that.defectinform[item.defect_name] = 0; - }) - that.qct_indefects=res.qct_defects; - if(that.mlogindefect.length>0){ - that.qct_indefects.forEach(item => { - that.mlogindefect.forEach(item2=>{ - if(item.defect==item2.defect){ - that.defectinform[item.defect_name] = item2.count; - } - }) + console.log('route',route) + if(route!==null){ + console.log('material_in',material_in) + console.log('material_out',material_out) + that.$API.qm.qct.getQct.req({material:material_in,tag:'process'}).then((res) => { + res.qct_defects.forEach((item) => { + that.defectinform[item.defect_name] = 0; }) - } - }) - //material_out - that.$API.qm.qct.getQct.req({material: that.material_out,tag:'process'}).then((res) => { - res.qct_defects.forEach((item) => { - that.defectform[item.defect_name] = 0; - }) - that.qct_defects=res.qct_defects; - if(that.mlogdefect.length>0){ - that.qct_defects.forEach(item => { - that.mlogdefect.forEach(item2=>{ - if(item.defect==item2.defect){ - that.defectform[item.defect_name] = item2.count; - } + that.qct_indefects=res.qct_defects; + if(that.mlogindefect.length>0){ + that.qct_indefects.forEach(item => { + that.mlogindefect.forEach(item2=>{ + if(item.defect==item2.defect){ + that.defectinform[item.defect_name] = item2.count; + } + }) }) + } + }) + //material_out + that.$API.qm.qct.getQct.req({material:material_out,tag:'process'}).then((res) => { + res.qct_defects.forEach((item) => { + that.defectform[item.defect_name] = 0; }) - } - }) + that.qct_defects=res.qct_defects; + if(that.mlogdefect.length>0){ + that.qct_defects.forEach(item => { + that.mlogdefect.forEach(item2=>{ + if(item.defect==item2.defect){ + that.defectform[item.defect_name] = item2.count; + } + }) + }) + } + }) + } } }, getEquipment() { @@ -542,18 +585,23 @@ export default { getRoute() { let that = this; if(!that.is_fix){//正常生产 - that.$API.mtm.route.item.req(that.route).then(res=>{ - that.material_in = res.material_in; - that.material_out = that.form.material_out = res.material_out; - if(that.mlogId){ - that.getMlogObj(); - }else{ - that.getdefects(); - } - - }); + if(that.route==null){ + that.$API.mtm.route.list.req({ process: that.process, page: 0, routepack__state: 30 }).then((res) => { + that.routeOptions = res; + }); + }else{ + that.$API.mtm.route.item.req(that.route).then(res=>{ + that.material_in = res.material_in; + that.material_out = that.form.material_out = res.material_out; + }); + } + if(that.mlogId){ + that.getMlogObj(); + } }else{ - // that.getdefects(); + that.$API.mtm.route.list.req({ process: that.process, page: 0, routepack__state: 30 }).then((res) => { + that.routeOptions = res; + }); } }, //获取工段人员 diff --git a/src/views/wpm_gx/fmlog_detail.vue b/src/views/wpm_gx/fmlog_detail.vue index c80029da..b0880946 100644 --- a/src/views/wpm_gx/fmlog_detail.vue +++ b/src/views/wpm_gx/fmlog_detail.vue @@ -11,7 +11,7 @@ 打印 - {{ + {{ fmlogItem.route_name }} {{ @@ -29,8 +29,7 @@ v-if="fmlogItem.submit_time == null" icon="el-icon-plus" @click="table_add" - >新增 + >新增 打印 - {{ - mlogItem.routepack_name - }} + + 返工 + {{mlogItem.material_in_name}}-> + {{mlogItem.material_out_name}} + {{ mlogItem.material_in_name }} @@ -344,6 +346,8 @@ :mgroupName = "mgroupName" :codeText = "codeText" :materialIn="materialIn" + :process = "process" + :hasRoute = "hasRoute" @success="handleSaveSuccess" @closed="dialog.save = false" > @@ -603,6 +607,9 @@ export default { let that = this; that.$API.wpm.mlog.item.req(that.mlogId).then((res) => { that.mlogItem = res; + if(res.route!==null){ + this.hasRoute = true; + } that.mgroupName = res.mgroup_name; if(res.test_file!==null){ that.fileList = [{name:res.test_file,url:res.test_file}]; diff --git a/src/views/wpm_gx/mlog_form.vue b/src/views/wpm_gx/mlog_form.vue index 7bd1c45a..4c13d8b0 100644 --- a/src/views/wpm_gx/mlog_form.vue +++ b/src/views/wpm_gx/mlog_form.vue @@ -57,7 +57,7 @@ - + + [{{ item.routepack_name }}]{{ item.name }} diff --git a/src/views/wpm_gx/mlogb_form.vue b/src/views/wpm_gx/mlogb_form.vue index 8e5cec68..5219d286 100644 --- a/src/views/wpm_gx/mlogb_form.vue +++ b/src/views/wpm_gx/mlogb_form.vue @@ -16,6 +16,28 @@ label-width="100px" > + + + + + [{{ item.routepack_name }}]{{ item.name }} + + + + {{ scope.row.defect_name }} - + + - @@ -100,7 +96,8 @@