diff --git a/src/api/model/em.js b/src/api/model/em.js index 405c35e0..17fc615b 100644 --- a/src/api/model/em.js +++ b/src/api/model/em.js @@ -126,6 +126,14 @@ export default { data); } }, + get_svs_char: { + name: "获取数据识别", + req: async function(data){ + return await http.get( + `${config.API_URL}/em/equipment/get_svs_char/`, + data); + } + } }, //巡检记录 einspect: { diff --git a/src/layout/components/userbar.vue b/src/layout/components/userbar.vue index 3e9c6c9e..049f4515 100644 --- a/src/layout/components/userbar.vue +++ b/src/layout/components/userbar.vue @@ -15,6 +15,11 @@ +
+ + + +
@@ -139,6 +144,22 @@ 保存 + + + + + + + + + + + + + + 保存 + + -
+
检验 批量操作 + 数字识别
{{ test_file_name }} @@ -1118,6 +1119,82 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => { that.wprNumber = ""; that.setVisible=true; }, + + + //扫描这里更新:添加数字化识别,调用一个接口,并且返回number和设备数据,然后根据number将这一行放到第一行并编辑这一行,并且把设备数据放到对应位置 + digital(){ + let that = this; + that.ocr_ip = localStorage.getItem("ocr_ip") || ""; + that.ocr_port = localStorage.getItem("ocr_port") || ""; + that.ocr_unit = localStorage.getItem("ocr_unit") || ""; + //第一步:调用接口获取数字识别设备返回的number + if(!that.ocr_ip || !that.ocr_port || !that.ocr_unit){ + that.$message.warning('请先在右上角"数字识别设置"配置IP、端口号和位号'); + return; + } + that.$API.em.equipment.get_svs_char.req({ + ip: that.ocr_ip, + port: that.ocr_port, + unit: that.ocr_unit + }).then((res) => { + alert(res); + // if(res.number){ + // that.mlogbwlist.forEach((item,index) => { + // if(item.number==res.number){ + // let obj = Object.assign({},item); + // obj.isEdit = true; + // that.mlogbwlist.splice(index,1); + // that.wprInputText = ""; + // that.mlogbwlist.unshift(obj); + // that.$nextTick(() => { + // that.selectedindexes.push(obj.id); + // that.selectWprList.push(item); + // }) + // //第二步:获取投影仪设备的监测数据 + // //先判断是否有需要检测设备的检测项,若有,赋值,若无,跳过 + // if(that.qct_testitems.length>0 && !!that.setForm.cd_req_addr){ + // 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.qct_defects.forEach(item => { + // if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){ + // let str = item.rule_expression.replace(/`/g, ''); + // str = str.replace(/\${(.*?)}/g, 'row.\$1'); + // let judge = false; + // try { + // judge = eval(str); + // that.mlogbwlist[index][item.defect_name] = judge; + // }catch (error) { + // console.error(error); + // } + // }else{ + // that.mlogbwlist[index][item.defect_name] = false; + // } + // }); + // } + // }) + // }).catch((err) => { + // this.$notify.error({ + // title: '获取数据失败', + // message: err.data + // }) + // return err; + // }); + // } + // } + // }) + // } + }).catch((err) => { + that.$notify.error({ + title: '数字识别获取失败', + message: err.data + }) + return err; + }); + }, + + //扫描物料将这一行放到第一行并编辑这一行 wprinputChange(){ let that = this;