From 45f4602070d7219fe00b098b6c0471ca42a8553f Mon Sep 17 00:00:00 2001 From: yyt <306727702@qq.com> Date: 星期四, 06 六月 2024 20:21:38 +0800 Subject: [PATCH] 380新产品,优化 --- jcdm-ui/src/views/main/cfkb/connectingRod/index.vue | 84 ++++++++++++++++++++------- jcdm-ui/src/views/main/cfkb/BalanceShaft/index.vue | 2 jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java | 70 ++++++++++++----------- 3 files changed, 99 insertions(+), 57 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java index 49742b7..3e1f834 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java +++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java @@ -99,31 +99,31 @@ logger.info("-------鐩戝惉鍒�,{}鐨勬壂鐮佹灙鎵爜鐨凜ODE_CHECK鐨勪俊鍙�",identifier); scannerGunMessage(); } - if (identifier.equals(OPCElement.OP060_HX_CODE_CHECK) && "1".equals(value.toString())){ - Object SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code1").getValue(); - if (null == SNCodeObject){ - SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code").getValue(); - } - if (null != SNCodeObject){ - String XT=""; - String CZ=""; - String SNCode = SNCodeObject.toString(); - DaParamCollection ParamCollection = new DaParamCollection(); - ParamCollection.setSfcCode(SNCode); - List<DaParamCollection> DaParamCollectionlist=daParamCollectionService.selectDaParamCollectionList(ParamCollection); - List<DaParamCollection> XTParamCollection = DaParamCollectionlist.stream().filter(x -> "绠变綋".equals(x.getParamName())).collect(Collectors.toList()); - if (CollUtil.isNotEmpty(XTParamCollection)){ - DaParamCollection lastOne = XTParamCollection.get(0); - XT = lastOne.getParamValue(); - } - List<DaParamCollection> CZParamCollection = DaParamCollectionlist.stream().filter(x -> "鏇茶酱".equals(x.getParamName())).collect(Collectors.toList()); - if (CollUtil.isNotEmpty(CZParamCollection)){ - DaParamCollection lastOne = CZParamCollection.get(0); - CZ = lastOne.getParamValue(); - } - passingStationCollectionServiceImpl.sendMessage(XT+"*"+CZ,"OP060"); - } - } +// if (identifier.equals(OPCElement.OP060_HX_CODE_CHECK) && "1".equals(value.toString())){ +// Object SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code1").getValue(); +// if (null == SNCodeObject){ +// SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code").getValue(); +// } +// if (null != SNCodeObject){ +// String XT=""; +// String CZ=""; +// String SNCode = SNCodeObject.toString(); +// DaParamCollection ParamCollection = new DaParamCollection(); +// ParamCollection.setSfcCode(SNCode); +// List<DaParamCollection> DaParamCollectionlist=daParamCollectionService.selectDaParamCollectionList(ParamCollection); +// List<DaParamCollection> XTParamCollection = DaParamCollectionlist.stream().filter(x -> "绠变綋".equals(x.getParamName())).collect(Collectors.toList()); +// if (CollUtil.isNotEmpty(XTParamCollection)){ +// DaParamCollection lastOne = XTParamCollection.get(0); +// XT = lastOne.getParamValue(); +// } +// List<DaParamCollection> CZParamCollection = DaParamCollectionlist.stream().filter(x -> "鏇茶酱".equals(x.getParamName())).collect(Collectors.toList()); +// if (CollUtil.isNotEmpty(CZParamCollection)){ +// DaParamCollection lastOne = CZParamCollection.get(0); +// CZ = lastOne.getParamValue(); +// } +// passingStationCollectionServiceImpl.sendMessage(XT+"*"+CZ,"OP060"); +// } +// } } if (collect2.contains(identifier)){ if ("1".equals(value.toString())){ @@ -180,20 +180,22 @@ DaPassingStationCollection PassingStationCollection=new DaPassingStationCollection(); PassingStationCollection.setSfcCode(SNCode); daPassingStationCollections = passingStationCollectionServiceImpl.selectDaPassingStationCollectionList(PassingStationCollection); - if (CollUtil.isNotEmpty(daPassingStationCollections)){ - DaPassingStationCollection lastOne = daPassingStationCollections.get(daPassingStationCollections.size() - 1); - String outRsSign = lastOne.getOutRsSign(); - if ("鍚堟牸".equals(outRsSign)){ - a = "1"; - }else { - a = "2"; - } - } +// if (CollUtil.isNotEmpty(daPassingStationCollections)){ +// DaPassingStationCollection lastOne = daPassingStationCollections.get(daPassingStationCollections.size() - 1); +// String outRsSign = lastOne.getOutRsSign(); +// if ("鍚堟牸".equals(outRsSign)){ +// a = "1"; +// }else { +// a = "2"; +// } +// } RmRepairRecord rmRepairRecord = new RmRepairRecord(); rmRepairRecord.setBoxCode(SNCode); rmRepairRecords = rmRepairRecordService.selectRmRepairRecordList(rmRepairRecord); if (CollUtil.isNotEmpty(rmRepairRecords)){ a = "1"; + }else { + a = "2"; } } logger.info("-----杩斿洖codeCheckFeed-----,{}",a); diff --git a/jcdm-ui/src/views/main/cfkb/BalanceShaft/index.vue b/jcdm-ui/src/views/main/cfkb/BalanceShaft/index.vue index 25d3719..e927079 100644 --- a/jcdm-ui/src/views/main/cfkb/BalanceShaft/index.vue +++ b/jcdm-ui/src/views/main/cfkb/BalanceShaft/index.vue @@ -158,9 +158,9 @@ setBarcode({barcode:this.from.scanObject2,locationCode:'HOP040'}).then(res =>{ console.log('res',res) this.from.scanObject1=res + this.handleQuery() }) } - this.handleQuery() } }, /** 鎼滅储鎸夐挳鎿嶄綔 */ diff --git a/jcdm-ui/src/views/main/cfkb/connectingRod/index.vue b/jcdm-ui/src/views/main/cfkb/connectingRod/index.vue index 80351c2..d7d5900 100644 --- a/jcdm-ui/src/views/main/cfkb/connectingRod/index.vue +++ b/jcdm-ui/src/views/main/cfkb/connectingRod/index.vue @@ -2,20 +2,27 @@ <div class="app-container"> <div style="width: 100%"> <el-card class="box-card" > - <el-form :model="from" size="large" :inline="true" label-width="68px" @submit.native.prevent> - <el-form-item label="鎵樼洏鐮�:" prop="scanObject1" > + <el-form :model="from" size="large" :inline="true" label-width="78px" @submit.native.prevent> + <el-form-item label="鏇茶酱鐮�:" prop="scanObject1" > <el-input style="width: 350px" v-model="from.scanObject1" - placeholder="璇疯緭鍏ユ墭鐩樼爜" + placeholder="璇疯緭鏇茶酱鐮�" clearable @keyup.enter.native="handleQuery" @input="handleQuery" /> </el-form-item> + <el-form-item label-width="200" label="鎵樼洏鐮�" :prop="from.scanObject3" style="align-content: center"> + <input v-model="from.scanObject3" + ref="inputdata2" + style="height: 39px; width: 300px" + placeholder="璇疯緭鍏ユ墭鐩樼爜" + /> + </el-form-item> <el-form-item label-width="200" label="杩炴潌鐮�" :prop="from.scanObject2" style="align-content: center"> <input v-model="from.scanObject2" - ref="inputdata" + ref="inputdata1" style="height: 39px; width: 300px" placeholder="璇疯緭鍏ヨ繛鏉嗙爜" /> @@ -30,7 +37,6 @@ :key="dict.value" :label="dict.label" :value="dict.value" - @keyup.enter.native="handleQuery" /> </el-select> </el-form-item> @@ -41,7 +47,6 @@ :key="dict.value" :label="dict.label" :value="dict.value" - @keyup.enter.native="handleQuery" /> </el-select> </el-form-item> @@ -58,6 +63,12 @@ <el-descriptions-item label="鏈哄瀷"> <span>{{queryParams.productSeries}}</span> </el-descriptions-item> + <el-descriptions-item label="鍙戝姩鏈虹紪鍙�"> + <span>{{queryParams.sfcCode}}</span> + </el-descriptions-item> + <el-descriptions-item label="鎵樼洏鐮�"> + <span>{{queryParams.scanObject3}}</span> + </el-descriptions-item> <el-descriptions-item label="鏇茶酱鐮�"> <span>{{queryParams.scanObject1}}</span> </el-descriptions-item> @@ -67,7 +78,7 @@ <el-descriptions-item label="鐡﹀悕绉�"> <span>{{queryParams.tileName}}</span> </el-descriptions-item> - <el-descriptions-item label="杩炴潌鐮�"> + <el-descriptions-item label="缂镐綋缂栧彿"> <span>{{queryParams.axisName}}</span> </el-descriptions-item> <el-descriptions-item label="閰嶇摝棰滆壊"> @@ -103,6 +114,7 @@ productSeries:'380Y', scanObject1: null, scanObject2: null, + scanObject3: null, axisName: null, neckName: null, tileName: '杩炴潌鐡�', @@ -122,6 +134,7 @@ productSeries: null, scanObject1: null, scanObject2: null, + scanObject3: null, axisName: null, neckName: null, tileName: null, @@ -134,29 +147,38 @@ updateUser: null, state: null, weight: null, + sfcCode:null, }, } }, mounted() { - this.setFocus() - this.$refs.inputdata.addEventListener('keydown',this.handleScannerInput) + this.setFocus1() + this.setFocus2() + this.$refs.inputdata1.addEventListener('keydown',this.handleScannerInput1) + this.$refs.inputdata2.addEventListener('keydown',this.handleScannerInput2) }, beforeDestroy() { - this.$refs.inputdata.removeEventListener('keydown',this.handleScannerInput) + this.$refs.inputdata1.removeEventListener('keydown',this.handleScannerInput1) + this.$refs.inputdata2.removeEventListener('keydown',this.handleScannerInput2) }, methods:{ refresh() { location.reload(); }, - setFocus(){ + setFocus1(){ this.$nextTick(()=>{ - this.$refs.inputdata.focus() + this.$refs.inputdata1.focus() }) }, - handleScannerInput(event){ + setFocus2(){ + this.$nextTick(()=>{ + this.$refs.inputdata2.focus() + }) + }, + handleScannerInput1(event){ if (this.scannerFlag){ this.from.scanObject2 = '' - this.$refs.inputdata.value = '' + this.$refs.inputdata1.value = '' this.scannerFlag = false } const input = event.target @@ -165,27 +187,44 @@ if (event.key === 'Enter'){ this.scannerFlag = true //console.log('鏉$爜锛�',this.from.scanObject2) + this.$refs.inputdata2.focus(); //鎵弿瀹屾垚 if (typeof this.from.scanObject2 !== 'undefined') { - setBarcode({barcode:this.from.scanObject2,locationCode:'HOP040'}).then(res =>{ + setBarcode({barcode:this.from.scanObject2,locationCode:this.from.scanObject3}).then(res =>{ console.log('res',res) - this.queryParams.productSeries=res.sfcCode; - this.queryParams.scanObject1=res.crankshaftNo; + this.queryParams.sfcCode=res.sfcCode; + this.from.scanObject1=res.crankshaftNo; this.queryParams.axisName=res.cylinder; - this.from.scanObject1=this.queryParams.scanObject1 - this.queryParams.tileName=this.from.tileName; - this.queryParams.scanObject2=this.from.scanObject2; - //this.from.scanObject1=res + this.handleQuery() + //this.from.scanObject2=this.from.scanObject2 + //this.queryParams.scanObject1=this.from.scanObject1 }) } this.handleQuery() + } + }, + handleScannerInput2(event){ + if (this.scannerFlag){ + this.from.scanObject3 = '' + this.$refs.inputdata2.value = '' + this.scannerFlag = false + } + const input = event.target + const inputValue = input.value + this.from.scanObject3= inputValue + if (event.key === 'Enter'){ + this.scannerFlag = true + console.log('鏉$爜2锛�',this.from.scanObject3) + this.$refs.inputdata1.focus(); + this.from.scanObject2 = '' + //鎵弿瀹屾垚 } }, /** 鎼滅储鎸夐挳鎿嶄綔 */ handleQuery() { this.clear(); - if(this.from.scanObject1 !== null && this.from.scanObject2 !== null + if(this.from.scanObject3 !== null && this.from.scanObject2 !== null && this.from.productSeries !== null && this.from.productSeries !== "") { this.axisValueextracted(); @@ -267,6 +306,7 @@ this.queryParams.tileName=this.from.tileName; this.queryParams.scanObject1=this.from.scanObject1; this.queryParams.scanObject2=this.from.scanObject2; + this.queryParams.scanObject3=this.from.scanObject3; } }, -- Gitblit v1.9.3