diff --git a/src/views/wpm_gx/f_mlogs_form.vue b/src/views/wpm_gx/f_mlogs_form.vue index 8abc0e4f..c87f9ce0 100644 --- a/src/views/wpm_gx/f_mlogs_form.vue +++ b/src/views/wpm_gx/f_mlogs_form.vue @@ -259,7 +259,21 @@ - + + 不良记录 + + + + + + + 加工前不良 @@ -381,6 +395,7 @@ export default { codeBatch:'', route_code:'', mgroupName:'', + materialFix:'', materialCount:1,//领料批次现有库存数 material_in:'', material_out:'', @@ -462,38 +477,55 @@ export default { }, getdefects(){ let that = this; - // material_in - 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; - } - }) + if(that.is_fix){ + that.$API.qm.qct.getQct.req({material: that.materialFix,tag:'process'}).then((res) => { + res.qct_defects.forEach((item) => { + that.defectform[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_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; + } + }) }) + } + }) + }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; + } + }) + }) + } + }) + //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; + } + }) + }) + } + }) + } }, getEquipment() { let that = this; @@ -509,17 +541,20 @@ export default { }, getRoute() { let that = this; - 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; - console.log('that.mlogId',that.mlogId) - if(that.mlogId){ - that.getMlogObj(); - }else{ - that.getdefects(); - } - - }); + 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(); + } + + }); + }else{ + // that.getdefects(); + } }, //获取工段人员 getUserList() { @@ -542,17 +577,20 @@ export default { }); }, //获取车间物料 + // 10: "合格" + // 20: "不合格" + // 30: "返工" getMaterial() { let that = this; let params = {}; params.mtaskx = that.mtask; params.mgroup = that.mgroup; - params.tag = 'todo'; params.page = 0; - if(that.is_fix){ - params.state = 30; + if(that.is_fix){//来料未完成的返修品&&出料已完成的返修品和不合格品 + params.tag = 'canfix'; }else{ - params.state = 10; + params.tag = 'todo'; + params.state = 10;//合格 params.material = that.material_in; } that.$API.wpm.wmaterial.list.req(params).then((res) => { @@ -577,9 +615,11 @@ export default { that.defectform[item.defect_name] = 0; that.defectinform[item.defect_name] = 0; }) + that.materialFix = item.material; that.materialCount = that.form.count_use = that.form.count_real = that.form.count_ok = item.count; that.form.count_real = item.count-that.form.count_pn_jgqbl; + that.getdefects(); } }) }, diff --git a/src/views/wpm_gx/fmlog_detail.vue b/src/views/wpm_gx/fmlog_detail.vue index bbcf81d5..c80029da 100644 --- a/src/views/wpm_gx/fmlog_detail.vue +++ b/src/views/wpm_gx/fmlog_detail.vue @@ -47,7 +47,6 @@ :data="tableData" row-key="id" hideDo - hidePagination @row-click="table_detail" > @@ -99,7 +98,7 @@ - + { that.batchContains+= item.batch + " "; }) - that.paramsWm.search = that.batchContains; - that.apiObjWm = that.$API.wpm.wmaterial.list; + // that.paramsWm.search = that.batchContains; + // that.apiObjWm = that.$API.wpm.wmaterial.list; }else{} }); }, diff --git a/src/views/wpm_gx/index2.vue b/src/views/wpm_gx/index2.vue index 3daa06f3..aa9e7496 100644 --- a/src/views/wpm_gx/index2.vue +++ b/src/views/wpm_gx/index2.vue @@ -28,6 +28,16 @@ :mgroupcode="mgroup_code" style="height: 40%" > + + - + { that.batchContains+= item.batch + " "; }) - that.paramsWm.search = that.batchContains; - that.apiObjWm = that.$API.wpm.wmaterial.list; + // that.paramsWm.search = that.batchContains; + // that.apiObjWm = that.$API.wpm.wmaterial.list; } }) }); diff --git a/src/views/wpm_gx/mlogb_check.vue b/src/views/wpm_gx/mlogb_check.vue index 23cb7572..b26501e8 100644 --- a/src/views/wpm_gx/mlogb_check.vue +++ b/src/views/wpm_gx/mlogb_check.vue @@ -436,7 +436,24 @@ export default { getdefects(){ let that = this; if(that.mlogbItem.qct!==null){ - that.$API.qm.qct.item.req(that.mlogbItem.qct).then((res) => { + that.$API.qm.qct.getQct.req(that.mlogbItem.qct).then((res) => { + res.qct_defects.forEach((item) => { + that.defectform[item.defect_name] = 0; + }) + that.max_defect_rate =res.max_defect_rate?Number(res.max_defect_rate):null; + that.qct_defects=res.qct_defects; + if(that.mlogboutdefect.length>0){ + that.qct_defects.forEach(item => { + that.mlogboutdefect.forEach(item2=>{ + if(item.defect==item2.defect){ + that.defectform[item.defect_name] = item2.count; + } + }) + }) + } + }) + }else{ + 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; }) diff --git a/src/views/wpm_gx/mlogb_form.vue b/src/views/wpm_gx/mlogb_form.vue index 91b12c0f..1f63aaf8 100644 --- a/src/views/wpm_gx/mlogb_form.vue +++ b/src/views/wpm_gx/mlogb_form.vue @@ -32,12 +32,7 @@ :label="item.batch" :value="item.id" > -
+
{{ item.batch }}({{ item.material_name }}) {{ item.defect_name }} @@ -243,11 +238,9 @@ export default { }, ], }, - // cells:0,//层数 batch_count:null, - // count_cell:0,//每层数量 - // cell_start:1,//开始层数 codeBatch:"", + materialFix:"", options: [], cellsList:[], qct_defects:[], @@ -271,8 +264,9 @@ export default { }else{ that.getMaterial(); } - this.getdefects(); - // this.getMtask(); + if(that.is_fix){}else{ + this.getdefects(); + } }, methods: { open(mode="add",data) { @@ -299,8 +293,10 @@ export default { obj.mtaskx =that.form.mtask; obj.mgroup = that.mgroup; obj.page =0; - if(that.is_fix){ - obj.state =30; + if(that.is_fix){//来料未完成的返修品&&出料已完成的返修品和不合格品 + params.tag = 'canfix'; + // obj.state = 20; + // obj.state =30; }else{ obj.material =that.materialIn; obj.state =10; @@ -325,7 +321,8 @@ export default { }, getdefects(){ let that = this; - that.$API.qm.qct.getQct.req({material: that.materialIn,tag:'process'}).then((res) => { + let material = that.is_fix?that.materialFix:that.materialIn; + that.$API.qm.qct.getQct.req({material: material,tag:'process'}).then((res) => { res.qct_defects.forEach((item) => { that.defectform[item.defect_name] = 0; }) @@ -350,6 +347,8 @@ export default { that.form.batch = item.batch; that.form.count_use = item.count; that.batch_count = item.count; + that.materialFix = item.material; + that.getdefects(); } }); },