| | |
| | | }, |
| | | content: '', |
| | | activeName: 'first', |
| | | url: "ws://192.168.10.21:8080/websocket/message/", |
| | | url: "ws://192.168.10.198:8080/websocket/message/", |
| | | message: "", |
| | | text_content: "", |
| | | ws: null, |
| | |
| | | // this.formulaChildList = [] |
| | | this.formulaChildParams.productCode = this.workpieceInformation.productCode |
| | | this.formulaChildParams.processesCode = this.headContent.processesCode |
| | | console.log(this.formulaChildParams) |
| | | listFormulaChild(this.formulaChildParams).then(response => { |
| | | this.formulaChildList = response.rows; |
| | | }); |
| | | }, |
| | | endClear(){ |
| | | this.cakeLamp.InPlace= 0 //工件到位 |
| | | this.cakeLamp.scanFinish= 0 |
| | | this.cakeLamp.startWork= 0 |
| | | this.cakeLamp.release= 0 //允许放行 |
| | | |
| | | this.formulaChildList = [] |
| | | this.headContent.sfcCode = null |
| | | }, |
| | | changeMenu(tab, event) { |
| | | console.log(tab, event); |
| | | }, |
| | |
| | | alert("未连接到服务器"); |
| | | } |
| | | }, |
| | | |
| | | initStation: async function () { |
| | | await getIpv4().then(response => { |
| | | this.StationConfQueryParams.ipAddress = response.msg |
| | |
| | | console.log('设置工位编码' + this.headContent.processesCode) |
| | | |
| | | }); |
| | | this.conCom() |
| | | console.log('websocket连接工位为' + this.headContent.processesCode) |
| | | const wsuri = this.url + this.headContent.processesCode; |
| | | this.ws = new WebSocket(wsuri); |
| | |
| | | productBarcode: self.headContent.sfcCode, |
| | | } |
| | | saveCampaignTimeParameters(param).then(response => {}); |
| | | self.cakeLamp.release = 1; |
| | | self.endClear() |
| | | |
| | | } else if (event.data.includes("[")) { |
| | | let formulaChilds = ""; |
| | |
| | | }; |
| | | }, |
| | | |
| | | |
| | | |
| | | //接受数据的回调 |
| | | callBack(value) { |
| | | if (this.form1.isShowHistory) this.form1.desc = this.readLi().join(""); |
| | |
| | | console.log("串口收到数据-------------------"+scanValue) |
| | | // if(this.cakeLamp.InPlace=== 1){ |
| | | if(this.headContent.sfcCode !== ''){ |
| | | this.$message('扫描物料编码'+scanValue); |
| | | console.log(scanValue) |
| | | this.serialPortMethod(scanValue) |
| | | }else { |
| | | this.$message('扫码识别产品序列号'+scanValue); |
| | | this.headContent.sfcCode = scanValue; |
| | | this.queryParams.productNum = scanValue; |
| | | this.getList() |
| | |
| | | return body; |
| | | }); |
| | | }, |
| | | conCom(){ |
| | | try { |
| | | this.myserialport.state.baudRate = this.form1.baudRate; |
| | | this.myserialport.state.dataBits = this.form1.dataBits; |
| | | this.myserialport.state.stopBits = this.form1.stopBits; |
| | | this.myserialport.state.parity = this.form1.parity; |
| | | this.myserialport.state.flowControl = this.form1.flowControl; |
| | | this.myserialport.openPort(0, true, this.callBack); |
| | | console.log(this.form1.port) |
| | | } catch (error) { |
| | | this.$message.error("串口连接失败!请检查串口是否已被占用"); |
| | | } |
| | | if (this.myserialport.state.isOpen) { |
| | | this.$message.success("串口连接成功"); |
| | | } |
| | | }, |
| | | //连接 |
| | | async connectBtn() { |
| | | if (this.btnType === "primary") { |