From 0caf8761b4af8163a691ebb56723286926529ee4 Mon Sep 17 00:00:00 2001
From: 懒羊羊 <15939171744@163.com>
Date: 星期五, 29 三月 2024 15:29:38 +0800
Subject: [PATCH] -

---
 jcdm-ui/src/views/main/kb/stationTerminal/index.vue |   40 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
index 21e7cd1..cf056fe 100644
--- a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -106,7 +106,7 @@
          <el-tab-pane name="first">
            <span slot="label"> <a class="el-icon-date"></a>棣栭〉</span>
            <el-col :span="24">
-             <el-table :cell-style="rowStyle" :data="formulaChildList">
+             <el-table height="500" :cell-style="rowStyle" :data="formulaChildList">
                <el-table-column label="鎺掑簭" width="60" align="center" type="index">
                </el-table-column>
                <el-table-column label="鎿嶄綔鍐呭" :show-overflow-tooltip='true' align="center" prop="operationSteps">
@@ -294,6 +294,7 @@
 import {listStationConf,getIpv4} from "@/api/main/sc/stationConf";
 import {
   listFormulaChild,
+  noPageListFormulaChild,
   releaseCheck,
   updateResults,
   updateTighteningFormula,
@@ -360,7 +361,7 @@
       },
       content: '',
       activeName: 'first',
-      url: "ws://192.168.10.21:8080/websocket/message/",
+      url: "ws://192.168.11.6:8080/websocket/message/",
       message: "",
       text_content: "",
       ws: null,
@@ -494,11 +495,20 @@
       // this.formulaChildList = []
       this.formulaChildParams.productCode = this.workpieceInformation.productCode
       this.formulaChildParams.processesCode = this.headContent.processesCode
-      listFormulaChild(this.formulaChildParams).then(response => {
+      console.log(this.formulaChildParams)
+      noPageListFormulaChild(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);
     },
@@ -561,6 +571,7 @@
         alert("鏈繛鎺ュ埌鏈嶅姟鍣�");
       }
     },
+
     initStation: async function () {
       await getIpv4().then(response => {
         this.StationConfQueryParams.ipAddress = response.msg
@@ -577,6 +588,7 @@
         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);
@@ -600,6 +612,8 @@
             productBarcode: self.headContent.sfcCode,
           }
           saveCampaignTimeParameters(param).then(response => {});
+          self.cakeLamp.release = 1;
+          self.endClear()
 
         } else if (event.data.includes("[")) {
           let formulaChilds = "";
@@ -632,6 +646,8 @@
       };
     },
 
+
+
     //鎺ュ彈鏁版嵁鐨勫洖璋�
     callBack(value) {
       if (this.form1.isShowHistory) this.form1.desc = this.readLi().join("");
@@ -640,9 +656,11 @@
         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()
@@ -701,6 +719,22 @@
         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("涓插彛杩炴帴澶辫触锛佽妫�鏌ヤ覆鍙f槸鍚﹀凡琚崰鐢�");
+      }
+      if (this.myserialport.state.isOpen) {
+        this.$message.success("涓插彛杩炴帴鎴愬姛");
+      }
+    },
     //杩炴帴
     async connectBtn() {
       if (this.btnType === "primary") {

--
Gitblit v1.9.3