From dd5d35a6047d6a44d798ef8689a09a49eefec528 Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期三, 31 七月 2024 18:02:05 +0800
Subject: [PATCH] 串口改usb扫码枪

---
 jcdm-ui/src/views/main/kb/stationTerminal/index.vue |   87 ++++++++++++-------------------------------
 1 files changed, 25 insertions(+), 62 deletions(-)

diff --git a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
index 6f7a94a..d0c9ec0 100644
--- a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -1,23 +1,17 @@
 <template>
   <div class="app-container">
    <el-row :gutter="5">
-     <el-col :span="7">
-       <el-card shadow="never">
-         <span class="head-font">宸ヤ綅缂栧彿 : {{headContent.processesCode}}</span>
+     <el-col  :span="7">
+       <el-card style="height: 71px" shadow="never">
+         <span style="margin-top: 200px" class="head-font">宸ヤ綅缂栧彿 : {{headContent.processesCode}}</span>
        </el-card>
      </el-col>
-     <el-col :span="7">
+     <el-col :span="17">
        <el-card shadow="never">
-         <span class="head-font">宸ヤ綅鍚嶇О : {{headContent.processesName}}</span>
-       </el-card>
-     </el-col>
-     <el-col :span="10">
-       <el-card shadow="never">
-         <span class="head-font">浜у搧搴忓垪鍙� : {{headContent.sfcCode}}</span>
-<!--         <el-input v-model="content" style="float: right;width: 150px;" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>-->
-<!--         <el-button @click="scanCompleted" style="float: right" type="primary">鎵爜瀹屾垚</el-button>-->
-         <el-button type="primary" style="float: right" icon="el-icon-search" size="mini" @click="serialLink">涓插彛杩炴帴</el-button>
-         <el-button @click="clearClick" style="float: right" type="danger" size="mini">娓呴櫎</el-button>
+         <span class="head-font">鐗╂枡缂栫爜 : </span>
+         <el-input style="width: 50%" v-model="materialCode" @change="handleEnter" placeholder="璇锋壂鎻忕墿鏂欑紪鐮�"></el-input>
+         <el-button type="primary" style="float: right" icon="el-icon-search"  @click="serialLink">涓插彛杩炴帴</el-button>
+         <el-button @click="clearClick" style="float: right" type="danger" >娓呴櫎</el-button>
        </el-card>
      </el-col>
 
@@ -30,6 +24,9 @@
            <span style="font-weight: bold">褰撳墠宸ヤ欢淇℃伅</span>
          </div>
          <el-descriptions :column="1" border :content-style="{'min-width': '140px'}">
+           <el-descriptions-item label="浜у搧搴忓垪鍙�">
+             <span>{{headContent.sfcCode}}</span>
+           </el-descriptions-item>
            <el-descriptions-item label="宸ュ崟缂栧彿">
                <span>{{workpieceInformation.workOrderNo}}</span>
            </el-descriptions-item>
@@ -83,17 +80,6 @@
          <el-row v-show="orderFlag" style="margin-top: 20px">
            <el-button @click="getWorkOrders" type="warning" size="mini">鎺ユ敹宸ュ崟</el-button>
          </el-row>
-<!--         <el-row v-show="showInput" style="margin-top: 20px">-->
-<!--           <el-button @click="bindYzSfc" type="primary">缁戝畾</el-button>-->
-<!--         </el-row>-->
-
-<!--         <el-row v-show="onLineBinDing" style="margin-top: 20px">-->
-<!--           <el-col></el-col>-->
-<!--           <span style="width: 130px;" class="head-font">灏忚溅鐮� : {{headContent.cardCode}}</span>-->
-<!--         </el-row>-->
-<!--         <el-row v-show="onLineBinDing" style="margin-top: 20px">-->
-<!--           <el-button @click="bindcardCode" type="primary">缁戝畾</el-button>-->
-<!--         </el-row>-->
        </el-card>
 
      </el-col>
@@ -103,16 +89,10 @@
            <span slot="label"> <a class="el-icon-date"></a>棣栭〉</span>
            <el-col :span="24">
              <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="鎷х揣姝ュ彿" width="80" align="center" prop="stepSort">
                </el-table-column>
                <el-table-column label="鎿嶄綔鍐呭" align="center" prop="operationSteps">
                </el-table-column>
-<!--               <el-table-column label="涓婇檺" width="60" align="center" prop="spareField3">-->
-<!--               </el-table-column>-->
-<!--               <el-table-column label="涓嬮檺" width="60" align="center" prop="spareField4">-->
-<!--               </el-table-column>-->
                <el-table-column label="浜у搧缂栧彿" width="80" align="center" prop="productCode">
                </el-table-column>
                <el-table-column label="鐗╂枡缂栫爜" width="110" align="center" prop="materialCode">
@@ -124,34 +104,7 @@
 
              </el-table>
            </el-col>
-<!--           <el-col :span="14">-->
-<!--             <el-image style="height: 520px;width: 100%" :src="imgSrc"></el-image>-->
-<!--           </el-col>-->
          </el-tab-pane>
-<!--         <el-tab-pane name="second">-->
-<!--           <span slot="label"> <b class="el-icon-date"></b>鐗╂枡BOM</span>-->
-<!--           <el-empty>-->
-<!--             <span slot="description">鏆傛棤鏁版嵁</span>-->
-<!--           </el-empty>-->
-<!--         </el-tab-pane>-->
-<!--         <el-tab-pane name="third">-->
-<!--           <span slot="label"> <b class="el-icon-date"></b>閲囬泦娓呭崟</span>-->
-<!--           <el-empty>-->
-<!--             <span slot="description">鏆傛棤鏁版嵁</span>-->
-<!--           </el-empty>-->
-<!--         </el-tab-pane>-->
-<!--         <el-tab-pane name="fourth">-->
-<!--           <span slot="label"> <b class="el-icon-date"></b>瀹夌伅鐘舵��</span>-->
-<!--           <el-empty>-->
-<!--             <span slot="description">鏆傛棤鏁版嵁</span>-->
-<!--           </el-empty>-->
-<!--         </el-tab-pane>-->
-<!--         <el-tab-pane name="fifth">-->
-<!--           <span slot="label"> <b class="el-icon-date"></b>宸ヨ壓閰嶆柟</span>-->
-<!--           <el-empty>-->
-<!--             <span slot="description">鏆傛棤鏁版嵁</span>-->
-<!--           </el-empty>-->
-<!--         </el-tab-pane>-->
        </el-tabs>
      </el-col>
    </el-row>
@@ -331,6 +284,7 @@
   name: "stationTerminal",
   data() {
     return {
+      materialCode: '', // 鐗╂枡缂栫爜
       carCode: '',
       showInput: false,
       onLineBinDing: false,
@@ -385,8 +339,8 @@
       },
       content: '',
       activeName: 'first',
-      // url: "ws://10.103.210.248:8080/websocket/message/",
-      url: "ws://192.168.10.100:8080/websocket/message/",
+      url: "ws://10.103.210.248:8080/websocket/message/",
+      // url: "ws://192.168.10.100:8080/websocket/message/",
       message: "",
       text_content: "",
       ws: null,
@@ -424,6 +378,12 @@
     this.exit();
   },
   created() {
+    document.onkeyup = e => {
+      if (e.keyCode === 13) {
+        // 璋冪敤鐧诲綍 楠岃瘉鏂规硶
+        this.submitForm()
+      }
+    }
     this.initStation();
     // this.getStationConfList();
     // setTimeout(() => {
@@ -454,6 +414,10 @@
     },
   },
   methods: {
+    handleEnter() {
+      this.serialPortMethod(this.materialCode)
+      this.$message("鎵弿鐗╂枡缂栫爜"+this.materialCode);
+    },
     getWorkOrders(){
       if(this.headContent.sfcCode === '' || this.headContent.sfcCode === null){
         //鎺ユ敹宸ュ崟
@@ -710,8 +674,7 @@
       this.ws = new WebSocket(wsuri);
       const self = this;
       this.ws.onopen = function (event) {
-        this.$message('websocket杩炴帴鎴愬姛锛�');
-
+        self.$message('websocket杩炴帴鎴愬姛锛�');
       };
 
 

--
Gitblit v1.9.3