-
懒羊羊
2024-03-28 1df825000b911e5f7b1ad33fc6d0de95793f071a
jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -360,7 +360,7 @@
      },
      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,
@@ -494,11 +494,20 @@
      // 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);
    },
@@ -561,6 +570,7 @@
        alert("未连接到服务器");
      }
    },
    initStation: async function () {
      await getIpv4().then(response => {
        this.StationConfQueryParams.ipAddress = response.msg
@@ -577,7 +587,7 @@
        console.log('设置工位编码' + this.headContent.processesCode)
      });
      // this.conCom()
      this.conCom()
      console.log('websocket连接工位为' + this.headContent.processesCode)
      const wsuri = this.url + this.headContent.processesCode;
      this.ws = new WebSocket(wsuri);
@@ -601,6 +611,8 @@
            productBarcode: self.headContent.sfcCode,
          }
          saveCampaignTimeParameters(param).then(response => {});
          self.cakeLamp.release = 1;
          self.endClear()
        } else if (event.data.includes("[")) {
          let formulaChilds = "";
@@ -633,6 +645,8 @@
      };
    },
    //接受数据的回调
    callBack(value) {
      if (this.form1.isShowHistory) this.form1.desc = this.readLi().join("");
@@ -641,9 +655,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()