feat:添加数字识别
This commit is contained in:
parent
1ee913c8cc
commit
a03f42f732
|
|
@ -126,6 +126,14 @@ export default {
|
||||||
data);
|
data);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
get_svs_char: {
|
||||||
|
name: "获取数据识别",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.get(
|
||||||
|
`${config.API_URL}/em/equipment/get_svs_char/`,
|
||||||
|
data);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//巡检记录
|
//巡检记录
|
||||||
einspect: {
|
einspect: {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,11 @@
|
||||||
<el-icon-brush :size="26"/>
|
<el-icon-brush :size="26"/>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="screen panel-item" @click="ocrSetting" title="数字识别设置">
|
||||||
|
<el-icon>
|
||||||
|
<el-icon-view :size="26"/>
|
||||||
|
</el-icon>
|
||||||
|
</div>
|
||||||
<scan-dialog ref="scanDialog" :type="'info'" @closed="scanClose"> </scan-dialog>
|
<scan-dialog ref="scanDialog" :type="'info'" @closed="scanClose"> </scan-dialog>
|
||||||
<div class="screen panel-item hidden-sm-and-down" @click="screen">
|
<div class="screen panel-item hidden-sm-and-down" @click="screen">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
|
|
@ -139,6 +144,22 @@
|
||||||
<el-button type="primary" @click="saveCoder">保存</el-button>
|
<el-button type="primary" @click="saveCoder">保存</el-button>
|
||||||
</el-footer>
|
</el-footer>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog title="数字识别设置" v-model="setOcrVisible" width="600px">
|
||||||
|
<el-form label-width="140px">
|
||||||
|
<el-form-item label="IP">
|
||||||
|
<el-input v-model="ocr_ip" placeholder="IP"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="Port">
|
||||||
|
<el-input v-model="ocr_port" placeholder="端口号"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="unit">
|
||||||
|
<el-input v-model="ocr_unit" placeholder="位号"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-footer>
|
||||||
|
<el-button type="primary" @click="saveOcr">保存</el-button>
|
||||||
|
</el-footer>
|
||||||
|
</el-dialog>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="searchVisible"
|
v-model="searchVisible"
|
||||||
:width="700"
|
:width="700"
|
||||||
|
|
@ -202,6 +223,7 @@ export default {
|
||||||
visible:false,
|
visible:false,
|
||||||
setNameVisible:false,
|
setNameVisible:false,
|
||||||
setCoderVisible:false,
|
setCoderVisible:false,
|
||||||
|
setOcrVisible:false,
|
||||||
searchVisible: false,
|
searchVisible: false,
|
||||||
msg: false,
|
msg: false,
|
||||||
msgList: {},
|
msgList: {},
|
||||||
|
|
@ -221,6 +243,9 @@ export default {
|
||||||
coder_field2:'',
|
coder_field2:'',
|
||||||
coder_jobname:'',
|
coder_jobname:'',
|
||||||
coder_jobname2:'',
|
coder_jobname2:'',
|
||||||
|
ocr_ip:'192.168.1.231',
|
||||||
|
ocr_port:'80',
|
||||||
|
ocr_unit:'',
|
||||||
scanVisible:false,
|
scanVisible:false,
|
||||||
addCoderVisible: false,
|
addCoderVisible: false,
|
||||||
addCoderSearch: '',
|
addCoderSearch: '',
|
||||||
|
|
@ -252,6 +277,9 @@ export default {
|
||||||
this.coder_field2 = localStorage.getItem("coder_field2") || "";
|
this.coder_field2 = localStorage.getItem("coder_field2") || "";
|
||||||
this.coder_jobname = localStorage.getItem("coder_jobname") || "";
|
this.coder_jobname = localStorage.getItem("coder_jobname") || "";
|
||||||
this.coder_jobname2 = localStorage.getItem("coder_jobname2") || "";
|
this.coder_jobname2 = localStorage.getItem("coder_jobname2") || "";
|
||||||
|
this.ocr_ip = localStorage.getItem("ocr_ip") || "";
|
||||||
|
this.ocr_port = localStorage.getItem("ocr_port") || "";
|
||||||
|
this.ocr_unit = localStorage.getItem("ocr_unit") || "";
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openBook() {
|
openBook() {
|
||||||
|
|
@ -365,6 +393,17 @@ export default {
|
||||||
});
|
});
|
||||||
this.setCoderVisible=false;
|
this.setCoderVisible=false;
|
||||||
},
|
},
|
||||||
|
ocrSetting(){
|
||||||
|
this.setOcrVisible=true;
|
||||||
|
},
|
||||||
|
saveOcr(){
|
||||||
|
this.$TOOL.setOcr({
|
||||||
|
"ocr_ip":this.ocr_ip,
|
||||||
|
"ocr_port":this.ocr_port,
|
||||||
|
"ocr_unit":this.ocr_unit
|
||||||
|
});
|
||||||
|
this.setOcrVisible=false;
|
||||||
|
},
|
||||||
//显示短消息
|
//显示短消息
|
||||||
showMsg() {
|
showMsg() {
|
||||||
this.msg = true;
|
this.msg = true;
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,11 @@ tool.setCoder = function (val) {
|
||||||
localStorage.setItem('coder_jobname', val.coder_jobname || '')
|
localStorage.setItem('coder_jobname', val.coder_jobname || '')
|
||||||
localStorage.setItem('coder_jobname2', val.coder_jobname2 || '')
|
localStorage.setItem('coder_jobname2', val.coder_jobname2 || '')
|
||||||
}
|
}
|
||||||
|
tool.setOcr = function (val) {
|
||||||
|
localStorage.setItem('ocr_ip', val.ocr_ip || '')
|
||||||
|
localStorage.setItem('ocr_port', val.ocr_port || '')
|
||||||
|
localStorage.setItem('ocr_unit', val.ocr_unit || '')
|
||||||
|
}
|
||||||
/* 复制对象 */
|
/* 复制对象 */
|
||||||
tool.objCopy = function (obj) {
|
tool.objCopy = function (obj) {
|
||||||
return JSON.parse(JSON.stringify(obj));
|
return JSON.parse(JSON.stringify(obj));
|
||||||
|
|
|
||||||
|
|
@ -392,7 +392,7 @@
|
||||||
style="width: 100%;height: 500px;"
|
style="width: 100%;height: 500px;"
|
||||||
></check-table>
|
></check-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
<div style="height: 200px;"></div>
|
<div style="height: 100px;"></div>
|
||||||
<save-dialog
|
<save-dialog
|
||||||
v-if="dialog.save"
|
v-if="dialog.save"
|
||||||
ref="saveDialog"
|
ref="saveDialog"
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
<el-button type="primary" v-if="!isSubmit&&processType=='20'" @click="check_start">检验</el-button>
|
<el-button type="primary" v-if="!isSubmit&&processType=='20'" @click="check_start">检验</el-button>
|
||||||
<el-button type="primary" v-if="multipleSet" @click="check_set" style="position: absolute;left: 210px;">批量操作</el-button>
|
<el-button type="primary" v-if="multipleSet" @click="check_set" style="position: absolute;left: 210px;">批量操作</el-button>
|
||||||
<el-input v-if="multipleSet" v-model="wprInputText" @change="wprinputChange" style="width:200px;position: absolute;left: 308px;"></el-input>
|
<el-input v-if="multipleSet" v-model="wprInputText" @change="wprinputChange" style="width:200px;position: absolute;left: 308px;"></el-input>
|
||||||
|
<el-button v-if="multipleSet" type="primary" @click="digital ">数字识别</el-button>
|
||||||
<div style="width:fit-content;position: absolute;right: 0;display: inline-block;">
|
<div style="width:fit-content;position: absolute;right: 0;display: inline-block;">
|
||||||
<div style="display: flex;align-items: center;gap: 8px;">
|
<div style="display: flex;align-items: center;gap: 8px;">
|
||||||
<el-link v-if="test_file!==''" :href="test_file" target="_blank">{{ test_file_name }}</el-linK>
|
<el-link v-if="test_file!==''" :href="test_file" target="_blank">{{ test_file_name }}</el-linK>
|
||||||
|
|
@ -1118,6 +1119,82 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
|
||||||
that.wprNumber = "";
|
that.wprNumber = "";
|
||||||
that.setVisible=true;
|
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(){
|
wprinputChange(){
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue