CVT看板介面,新增SNCode写入功能,扫码功能更新.
| | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.jcdm.main.da.opcuaconfig.client.ClientHandler; |
| | | import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig; |
| | | import com.jcdm.main.da.opcuaconfig.domain.NodeEntity; |
| | | import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | { |
| | | return toAjax(daOpcuaConfigService.deleteDaOpcuaConfigByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * è·å交äºä¿¡å·é
置详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:opcuaconfig:query')") |
| | | @GetMapping(value = "/SNCode/{SNCode}/{locationCode}") |
| | | public AjaxResult setSNCode(@PathVariable("SNCode") String SNCode,@PathVariable("locationCode") String locationCode) { |
| | | NodeEntity node= NodeEntity.builder().index(2).identifier("CFL4CVT"+"."+locationCode+".SNCode").value(SNCode).type("string").build(); |
| | | Boolean out= null; |
| | | try { |
| | | out = ClientHandler.write(node); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | return toAjax(out); |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢äº¤äºä¿¡å·é
ç½®è¯¦ç» |
| | | export function setSNCode(SNCode,locationCode) { |
| | | return request({ |
| | | url: '/da/opcuaconfig/SNCode/' + SNCode+'/'+locationCode, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢äº¤äºä¿¡å·é
ç½® |
| | | export function addOpcuaconfig(data) { |
| | | return request({ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-input |
| | | οnkeyup="this.value=this.value.replace(/\D|/g,'')" |
| | | clearable |
| | | maxlength="116" |
| | | v-model="codeValue" |
| | | placeholder="请è¾å
¥æ¡å½¢ç " |
| | | /> |
| | | </template> |
| | | <script> |
| | | export default { |
| | | data(){ |
| | | return { |
| | | codeValue: "", |
| | | code: "", |
| | | lastTime: "", |
| | | nextTime: "", |
| | | lastCode: "", |
| | | nextCode: "", |
| | | dtmainId: "", |
| | | }; |
| | | }, |
| | | created() { |
| | | window.document.onkeypress = (e) => { |
| | | if (window.event) { |
| | | // IE |
| | | this.nextCode = e.keyCode; |
| | | } else if (e.which) { |
| | | // Netscape/Firefox/Opera |
| | | this.nextCode = e.which; |
| | | } |
| | | if (e.which === 13) { |
| | | // é®çå车äºä»¶ |
| | | if (this.code.length < 3) return; // æ«ç æªçé度å¾å¿«ï¼æå¨è¾å
¥çæ¶é´ä¸ä¼è®©codeçé¿åº¦å¤§äº2ï¼æ以è¿éä¸ä¼å¯¹æ«ç æªææ |
| | | |
| | | //console.log("æ«ç ç»æã"); |
| | | //console.log("æ¡å½¢ç ï¼", this.code); |
| | | this.parseQRCode(this.code); // è·åå°æ«ç æªè¾å
¥çå
容ï¼åå«çæä½ |
| | | this.lastCode = ""; |
| | | this.lastTime = ""; |
| | | return; |
| | | } |
| | | this.nextTime = new Date().getTime(); |
| | | if (!this.lastTime && !this.lastCode) { |
| | | this.code = ""; // æ¸
空ä¸æ¬¡çæ¡å½¢ç |
| | | this.code += e.key; |
| | | //console.log("æ«ç å¼å§---", this.code); |
| | | } |
| | | if (this.lastCode && this.lastTime && this.nextTime - this.lastTime > 500) { |
| | | // å½æ«ç åækeypressäºä»¶æ¶,é²æ¢é¦å缺失 |
| | | this.code = e.key; |
| | | //console.log("é²æ¢é¦å缺失ããã", this.code); |
| | | } else if (this.lastCode && this.lastTime) { |
| | | this.code += e.key; |
| | | //console.log("æ«ç ä¸ããã", this.code); |
| | | } |
| | | this.lastCode = this.nextCode; |
| | | this.lastTime = this.nextTime; |
| | | }; |
| | | }, |
| | | methods: { |
| | | parseQRCode(code) { |
| | | // if (code.length === 16) { |
| | | // console.log(code); |
| | | // } else if (code.length === 0) { |
| | | // console.log("请è¾å
¥æ¡ç ï¼"); |
| | | // } else { |
| | | // alert("æ¡ç ä¸åæ³ï¼" + code); |
| | | // } |
| | | this.codeValue = code; |
| | | // åéç½ç»è¯·æ± |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | |
| | | </style> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | <el-form ref="form" :model="form" label-width="25%" > |
| | | <el-form-item prop="engineNo" style="margin-top: 16px"> |
| | | <span slot="label" style="font-size:22px;color:black;"><strong>åå¨æºå·</strong></span> |
| | | <el-input style="font-size:20px" v-model="form.engineNo" placeholder="请è¾å
¥åå¨æºå·" clearable @keyup.enter.native="EngineNohandleChange"> |
| | | <el-input style="font-size:20px" v-model="form.engineNo" placeholder="请è¾å
¥åå¨æºå·" clearable @input="EngineNohandleChange"> |
| | | <el-button slot="append" plain type="info" @click="EngineNohandleChange" icon="el-icon-search"></el-button> |
| | | </el-input> |
| | | </el-form-item> |
| | |
| | | import { listOrderScheduling, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling } from "@/api/main/bs/orderScheduling/orderScheduling"; |
| | | import { listPassingStationCollection, getPassingStationCollection, delPassingStationCollection, addPassingStationCollection, updatePassingStationCollection } from "@/api/main/da/passingStationCollection/passingStationCollection"; |
| | | import {listLineInfo} from "@/api/main/bs/lineInfo/lineInfo"; |
| | | import { setSNCode } from "@/api/main/da/opcuaconfig/opcuaconfig"; |
| | | import {getIp, listStationConf} from "@/api/main/sc/stationConf"; |
| | | |
| | | export default { |
| | |
| | | buttondisabled:true, |
| | | locationCode: "æªé
ç½®", |
| | | locationName: "æªé
置工ä½", |
| | | |
| | | codeValue: "", |
| | | code: "", |
| | | lastTime: "", |
| | | nextTime: "", |
| | | lastCode: "", |
| | | nextCode: "", |
| | | dtmainId: "", |
| | | |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | |
| | | }, |
| | | computed: {}, |
| | | watch: {}, |
| | | created() {}, |
| | | created() { |
| | | window.document.onkeypress = (e) => { |
| | | if (window.event) { |
| | | this.nextCode = e.keyCode; |
| | | } else if (e.which) { |
| | | this.nextCode = e.which; |
| | | } |
| | | if (e.which === 13) { |
| | | // é®çå车äºä»¶ |
| | | if (this.code.length < 3) return; // æ«ç æªçé度å¾å¿«ï¼æå¨è¾å
¥çæ¶é´ä¸ä¼è®©codeçé¿åº¦å¤§äº2ï¼æ以è¿éä¸ä¼å¯¹æ«ç æªææ |
| | | this.parseQRCode(this.code); // è·åå°æ«ç æªè¾å
¥çå
容ï¼åå«çæä½ |
| | | this.lastCode = ""; |
| | | this.lastTime = ""; |
| | | return; |
| | | } |
| | | this.nextTime = new Date().getTime(); |
| | | if (!this.lastTime && !this.lastCode) { |
| | | this.code = ""; // æ¸
空ä¸æ¬¡çæ¡å½¢ç |
| | | this.code += e.key; |
| | | } |
| | | if (this.lastCode && this.lastTime && this.nextTime - this.lastTime > 500) { |
| | | // å½æ«ç åækeypressäºä»¶æ¶,é²æ¢é¦å缺失 |
| | | this.code = e.key; |
| | | } else if (this.lastCode && this.lastTime) { |
| | | this.code += e.key; |
| | | } |
| | | this.lastCode = this.nextCode; |
| | | this.lastTime = this.nextTime; |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.getStationConf(); |
| | | }, |
| | |
| | | }, |
| | | EngineNohandleChange(){ |
| | | if(this.form.engineNo !== null && this.form.engineNo !== undefined){ |
| | | let OrderSchedulingParam = {engineNo: null} |
| | | //let OrderSchedulingParam = {engineNo: null} |
| | | setSNCode(this.form.engineNo,this.locationCode) |
| | | //OrderSchedulingParam.engineNo = this.form.engineNo; |
| | | /* listOrderScheduling(OrderSchedulingParam).then(response => { |
| | | if(response.total === 1 ){ |
| | |
| | | } |
| | | }, |
| | | |
| | | |
| | | parseQRCode(code) { |
| | | this.form.engineNo = code; |
| | | }, |
| | | }, |
| | | } |
| | | |