diff --git a/src/views/wpm_bx/mlogbw_check_table.vue b/src/views/wpm_bx/mlogbw_check_table.vue index f864bcb9..8769d286 100644 --- a/src/views/wpm_bx/mlogbw_check_table.vue +++ b/src/views/wpm_bx/mlogbw_check_table.vue @@ -1136,11 +1136,10 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => { port: that.ocr_port, flow_unit: that.ocr_unit }).then((res) => { - console.log(res); if(res.char){ that.mlogbwlist.forEach((item,index) => { if(item.number==res.char){ - let obj = Object.assign({},item); + let obj = Object.assign({},item);S obj.isEdit = true; that.mlogbwlist.splice(index,1); that.wprInputText = ""; @@ -1155,7 +1154,8 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => { that.$API.em.cd.req({method:that.setForm.cd_req_addr}).then((res) => { that.qct_testitems.forEach(item0 => { if(item0.testitem_cd_expr!=null){ - that.mlogbwlist[index][item0.testitem_name]= eval(item0.testitem_cd_expr); + that.mlogbwlist[0][item0.testitem_name]= eval(item0.testitem_cd_expr); + item0.cd_expr = true; that.qct_defects.forEach(item => { if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){ let str = item.rule_expression.replace(/`/g, ''); @@ -1163,17 +1163,20 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => { let judge = false; try { judge = eval(str); - that.mlogbwlist[index][item.defect_name] = judge; + that.mlogbwlist[0][item.defect_name] = judge; }catch (error) { console.error(error); } }else{ - that.mlogbwlist[index][item.defect_name] = false; + that.mlogbwlist[0][item.defect_name] = false; } }); - that.formTableSave(); } }) + let arrs= that.qct_testitems.filter(item => item.testitem_cd_expr!=null) + if(arrs.length>0){ + that.seveAuto(0); + } }).catch((err) => { this.$notify.error({ title: '获取数据失败', @@ -1193,7 +1196,17 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => { return err; }); }, - + seveAuto(index){ + let that= this; + let arr2 = that.mlogbwlist.filter(item => item.cd_expr==true); + if(arr2.length>0){ + that.formTableSave(that.mlogbwlist[index],index); + }else{ + setTimeout(() => { + that.seveAuto(index); + }, 500); + } + }, //扫描物料将这一行放到第一行并编辑这一行 wprinputChange(){ @@ -1232,6 +1245,7 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => { that.qct_testitems.forEach(item0 => { if(item0.testitem_cd_expr!=null){ that.mlogbwlist[index][item0.testitem_name]= eval(item0.testitem_cd_expr); + that.mlogbwlist[index].cd_expr = true; that.qct_defects.forEach(item => { if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){ let str = item.rule_expression.replace(/`/g, ''); @@ -1247,9 +1261,12 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => { that.mlogbwlist[index][item.defect_name] = false; } }); - that.formTableSave(); } }) + let arrs= that.qct_testitems.filter(item => {return item.testitem_cd_expr!=null;}) + if(arrs.length>0){ + that.seveAuto(index); + } }).catch((err) => { this.$notify.error({ title: '获取数据失败',