diff --git a/src/views/wpm_bx/mlogbw_check.vue b/src/views/wpm_bx/mlogbw_check.vue index 4b81d2ef..efde9617 100644 --- a/src/views/wpm_bx/mlogbw_check.vue +++ b/src/views/wpm_bx/mlogbw_check.vue @@ -580,7 +580,11 @@ export default { if(that.mode == 'outs'&&qct!==''&&qct!==null){//输出 that.getdefects(); }else{ - that.getList(); + that.$API.qm.qct.getQct.req({ material: that.material_out,type:'out',tag:'process' }).then((res) => { + console.log(res) + that.testdefectss(res); + }) + // that.getList(); } that.visible = true; setTimeout(() => { @@ -677,41 +681,45 @@ export default { if(that.qct!==''){ that.$API.qm.qct.item.req(that.qct).then((res) => { that.qct_defects = []; - res.qct_defects.forEach((item) => { - that.addTemplate[item.defect_name] = false; - let obj = Object.assign({}, item); - obj.canEdit = that.processType=='20'?false:true; - that.qct_defects.push(obj); - }) - that.qct_defects_origin = that.qct_defects; - that.qct_testitems = []; - res.qct_testitems.forEach((item2) => { - if(item2.testitem_type!=='20'){ - let obj2 = Object.assign({}, item2); - obj2.value = ''; - obj2.canEdit = that.processType=='20'?false:true; - - obj2.addto_wpr = item2.addto_wpr; - if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){ - obj2.value = null; - that.addTemplate[item2.testitem_name] = null; - } - if(item2.testitem_field_type=='select-text'||item2.testitem_field_type=='selects-text'){ - let str = obj2.testitem_choices.replace(/'/g, '"'); - let arr = JSON.parse(str); - obj2.testitem_choices = arr; - that.addTemplate[item2.testitem_name] = null; - } - that.qct_testitems.push(obj2); - } - }) - that.qct_testitems_origin = that.qct_testitems; - that.getList(); + that.testdefectss(res); }) }else{ that.getList(); } }, + testdefectss(res){ + let that = this; + res.qct_defects.forEach((item) => { + that.addTemplate[item.defect_name] = false; + let obj = Object.assign({}, item); + obj.canEdit = that.processType=='20'?false:true; + that.qct_defects.push(obj); + }) + that.qct_defects_origin = that.qct_defects; + that.qct_testitems = []; + res.qct_testitems.forEach((item2) => { + if(item2.testitem_type!=='20'){ + let obj2 = Object.assign({}, item2); + obj2.value = ''; + obj2.canEdit = that.processType=='20'?false:true; + + obj2.addto_wpr = item2.addto_wpr; + if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){ + obj2.value = null; + that.addTemplate[item2.testitem_name] = null; + } + if(item2.testitem_field_type=='select-text'||item2.testitem_field_type=='selects-text'){ + let str = obj2.testitem_choices.replace(/'/g, '"'); + let arr = JSON.parse(str); + obj2.testitem_choices = arr; + that.addTemplate[item2.testitem_name] = null; + } + that.qct_testitems.push(obj2); + } + }) + that.qct_testitems_origin = that.qct_testitems; + that.getList(); + }, getOptions(){ let that = this; that.$API.wpm.wpr.list.req({wm:that.wm,page:0,query:"{id,number}"}).then((res) => {