fix:设备数据自动保存
This commit is contained in:
parent
0c72ed66ed
commit
5ccb38272d
|
|
@ -1136,11 +1136,10 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
|
||||||
port: that.ocr_port,
|
port: that.ocr_port,
|
||||||
flow_unit: that.ocr_unit
|
flow_unit: that.ocr_unit
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(res);
|
|
||||||
if(res.char){
|
if(res.char){
|
||||||
that.mlogbwlist.forEach((item,index) => {
|
that.mlogbwlist.forEach((item,index) => {
|
||||||
if(item.number==res.char){
|
if(item.number==res.char){
|
||||||
let obj = Object.assign({},item);
|
let obj = Object.assign({},item);S
|
||||||
obj.isEdit = true;
|
obj.isEdit = true;
|
||||||
that.mlogbwlist.splice(index,1);
|
that.mlogbwlist.splice(index,1);
|
||||||
that.wprInputText = "";
|
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.$API.em.cd.req({method:that.setForm.cd_req_addr}).then((res) => {
|
||||||
that.qct_testitems.forEach(item0 => {
|
that.qct_testitems.forEach(item0 => {
|
||||||
if(item0.testitem_cd_expr!=null){
|
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 => {
|
that.qct_defects.forEach(item => {
|
||||||
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
|
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
|
||||||
let str = item.rule_expression.replace(/`/g, '');
|
let str = item.rule_expression.replace(/`/g, '');
|
||||||
|
|
@ -1163,17 +1163,20 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
|
||||||
let judge = false;
|
let judge = false;
|
||||||
try {
|
try {
|
||||||
judge = eval(str);
|
judge = eval(str);
|
||||||
that.mlogbwlist[index][item.defect_name] = judge;
|
that.mlogbwlist[0][item.defect_name] = judge;
|
||||||
}catch (error) {
|
}catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
}else{
|
}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) => {
|
}).catch((err) => {
|
||||||
this.$notify.error({
|
this.$notify.error({
|
||||||
title: '获取数据失败',
|
title: '获取数据失败',
|
||||||
|
|
@ -1193,7 +1196,17 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
|
||||||
return err;
|
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(){
|
wprinputChange(){
|
||||||
|
|
@ -1232,6 +1245,7 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
|
||||||
that.qct_testitems.forEach(item0 => {
|
that.qct_testitems.forEach(item0 => {
|
||||||
if(item0.testitem_cd_expr!=null){
|
if(item0.testitem_cd_expr!=null){
|
||||||
that.mlogbwlist[index][item0.testitem_name]= eval(item0.testitem_cd_expr);
|
that.mlogbwlist[index][item0.testitem_name]= eval(item0.testitem_cd_expr);
|
||||||
|
that.mlogbwlist[index].cd_expr = true;
|
||||||
that.qct_defects.forEach(item => {
|
that.qct_defects.forEach(item => {
|
||||||
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
|
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
|
||||||
let str = item.rule_expression.replace(/`/g, '');
|
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.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) => {
|
}).catch((err) => {
|
||||||
this.$notify.error({
|
this.$notify.error({
|
||||||
title: '获取数据失败',
|
title: '获取数据失败',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue