From a36b834b2957440a755652ff17d067b18f4e9250 Mon Sep 17 00:00:00 2001
From: 懒羊羊 <15939171744@163.com>
Date: 星期一, 29 一月 2024 16:55:05 +0800
Subject: [PATCH] 工位终端

---
 jcdm-ui/src/views/main/kb/stationTerminal/index.vue |   48 +++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 43 insertions(+), 5 deletions(-)

diff --git a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
index d0d7943..2383ad3 100644
--- a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -93,6 +93,9 @@
 
            </el-col>
          </el-row>
+         <el-row style="margin-top: 20px">
+             <el-button @click="Release" type="primary">鏀捐</el-button>
+         </el-row>
        </el-card>
 
      </el-col>
@@ -101,7 +104,7 @@
          <el-tab-pane name="first">
            <span slot="label"> <a class="el-icon-date"></a>棣栭〉</span>
            <el-col :span="8">
-             <el-table :data="formulaChildList">
+             <el-table :cell-style="rowStyle" :data="formulaChildList">
                <el-table-column label="鎺掑簭" width="60" align="center" prop="stepSort">
                </el-table-column>
                <el-table-column label="鎿嶄綔鍐呭" :show-overflow-tooltip='true' align="center" prop="operationSteps">
@@ -144,7 +147,7 @@
 <script>
 import {listWorkReport} from "@/api/main/om/workReport/workReport";
 import {listStationConf,getIpv4} from "@/api/main/sc/stationConf";
-import {listFormulaChild} from "@/api/main/bs/formulaChild/formulaChild";
+import {listFormulaChild, releaseCheck, updateResults} from "@/api/main/bs/formulaChild/formulaChild";
 
 export default {
   name: "stationTerminal",
@@ -195,7 +198,7 @@
       },
       content: '',
       activeName: 'first',
-      url: "ws://192.168.10.184:8080/websocket/message/",
+      url: "ws://192.168.11.60:8080/websocket/message/",
       message: "",
       text_content: "",
       ws: null,
@@ -216,8 +219,32 @@
 
   },
   methods: {
-    serialPortMethod(){
+    Release(){
+      releaseCheck().then(response => {
+        if(response.data === 0){
+          //鏀瑰彉鐘舵��
+          this.$message('鏀捐鎴愬姛锛�');
 
+        }else {
+          this.$message('姝ラ鏈畬鎴愪笉璁告斁琛岋紒');
+        }
+      });
+    },
+    serialPortMethod(){
+      let formulaChildParams = {
+        materialCode: this.serialPortContent
+      }
+      updateResults(formulaChildParams).then(response => {
+        this.getListFormulaChild()
+      });
+    },
+    rowStyle({ row }) {
+      if (row.results === 'OK') {
+        return 'background-color: PaleGreen';
+      } else if (row.results === 'NG') {
+        return 'background-color: LightSalmon';
+      }
+      return '';
     },
     /** 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭垪琛� */
     getListFormulaChild() {
@@ -238,7 +265,7 @@
       this.headContent.sfcCode = this.content
       this.queryParams.sfcCode = this.content
       this.getList()
-      // this.getListFormulaChild()
+      this.getListFormulaChild()
       this.cakeLamp.scanFinish = 1
       this.cakeLamp.startWork = 1
 
@@ -247,6 +274,7 @@
     async getList() {
       await listWorkReport(this.queryParams).then(response => {
         let rowsData = response.rows[0];
+        console.log(rowsData)
         this.workpieceInformation.workOrderCode = rowsData.workOrderCode;
         this.workpieceInformation.productCode = rowsData.productCode;
         this.workpieceInformation.productModel = rowsData.productModel;
@@ -345,6 +373,9 @@
           setTimeout(() => {
             this.resetting()
           }, 2000); // 寤舵椂2绉掕Е鍙�
+        }else if(event.data === 'TIGHTEN'){
+          console.log('寮�濮嬫嫥绱�')
+          self.getListFormulaChild()
         }
       };
     },
@@ -393,5 +424,12 @@
 span{
   font-size: 15px;
 }
+.el-table .warning-row {
+  background: oldlace;
+}
+
+.el-table .success-row {
+  background: #f0f9eb;
+}
 </style>
 

--
Gitblit v1.9.3