From 7e83dbeda4774213691f59f32b6ca97708b9f246 Mon Sep 17 00:00:00 2001
From: cl <418351270@qq.com>
Date: 星期一, 08 七月 2024 16:38:29 +0800
Subject: [PATCH] Merge branch 'master' of http://183.134.244.158:8442/r/Jcdm042-Mes-Module-One

---
 jcdm-ui/src/views/main/kb/stationTerminal/index.vue |  114 ++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 68 insertions(+), 46 deletions(-)

diff --git a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
index ae95f33..516fe58 100644
--- a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -86,11 +86,9 @@
              <span style="display: none">{{cakeLamp.release}}</span>
              <span>&nbsp;鍏佽鏀捐</span>
            </el-col>
-
          </el-row>
-         <el-row v-show="showInput" style="margin-top: 20px">
-           <el-col></el-col>
-             <span style="width: 130px;" class="head-font">棰勮鎬绘垚鍙� : {{headContent.yzSfcCode}}</span>
+         <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>-->
@@ -308,7 +306,7 @@
 import {listStationConf,getIpv4} from "@/api/main/sc/stationConf";
 import {
   clearWorkpieceRelease,
-  fistSetpNumber,
+  fistSetpNumber, initializedData,
   listFormulaChild,
   noPageListFormulaChild,
   releaseCheck,
@@ -322,7 +320,7 @@
   bindYzSfcFlag,
   checkCarCode, checkYzSfcCode,
   findBytrolleyYardGetOne,
-  listProductionOrde,
+  listProductionOrde, mozuReceivingWorkOrders,
   receivingWorkOrders,
   trolleyYardBinDing
 } from "@/api/main/om/productionOrde/productionOrde";
@@ -334,6 +332,7 @@
   saveCampaignTimeParameters,
   replaceAssemblyCode, checkRecordDataDone,
 } from "@/api/main/da/paramCollection/paramCollection";
+import {addFormula} from "@/api/main/bs/formula/formula";
 
 export default {
   name: "stationTerminal",
@@ -391,8 +390,8 @@
       },
       content: '',
       activeName: 'first',
-      url: "ws://10.103.210.248:8080/websocket/message/",
-      // url: "ws://192.168.2.76: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,
@@ -423,6 +422,7 @@
       originalArray: [],
       yzSfcFlag: 1,
       endYz: false,
+      orderFlag: true
     }
   },
   beforeDestroy() {
@@ -459,6 +459,23 @@
     },
   },
   methods: {
+    getWorkOrders(){
+      if(this.headContent.sfcCode === '' || this.headContent.sfcCode === null){
+        //鎺ユ敹宸ュ崟
+        const param = {
+          lineCode: this.headContent.processesCode
+        }
+        mozuReceivingWorkOrders(param).then(response => {
+          this.headContent.sfcCode = response.msg;
+          this.queryParams.productNum = response.msg;
+          this.getList()
+          this.cakeLamp.scanFinish = 1
+          this.cakeLamp.startWork = 1
+        });
+      }else {
+        this.$message.error("宸茬粡鏈夊伐鍗曚簡锛屼笉鑳芥帴鏀讹紒");
+      }
+    },
     bindcardCode(scanValue){
       // this.$message('缁戝畾鎴愬姛锛�');
       let param = {
@@ -610,13 +627,22 @@
         this.headContent.cardCode = rowsData.trolleyYard;
       });
       this.getListFormulaChild()
-      // this.addOverStationCollection()
       this.workpieceInformation.inboundTime = this.getCurrentTime()
+    },
+
+    initializedData(){
       const param = {
-        processesCode: this.headContent.processesCode,
+        locationCode: this.headContent.processesCode,
       }
-      fistSetpNumber(param).then(response => {
-        console.log("fistSetpNumber------"+response.msg)
+      initializedData(param).then(response => {
+        if(response.msg !== ''){
+          this.headContent.sfcCode = response.msg;
+          this.queryParams.productNum = response.msg;
+          this.getList()
+          this.cakeLamp.scanFinish = 1
+          this.cakeLamp.startWork = 1
+          this.cakeLamp.InPlace = 1
+        }
       });
     },
 
@@ -679,14 +705,7 @@
         }
         this.headContent.processesName = rows.processesName
         this.headContent.processesCode = rows.processesCode
-        if(this.headContent.processesCode === 'OP240'){
-          this.onLineBinDing = true
-        }
-        if(this.headContent.processesCode === 'OP260'){
-          // this.showInput = true
-        }
-
-        console.log('璁剧疆宸ヤ綅缂栫爜' + this.headContent.processesCode)
+        this.initializedData()
 
       });
       this.conCom()
@@ -796,7 +815,14 @@
             });
           }
         }else if(event.data.includes("productNum")){
-            self.headContent.sfcCode = event.data.split(',')[1];
+          let productNum = event.data.split(',')[1];
+          self.headContent.sfcCode = productNum;
+          self.queryParams.productNum = productNum;
+          self.getList()
+          self.cakeLamp.scanFinish = 1
+          self.cakeLamp.startWork = 1
+          this.cakeLamp.InPlace = 1
+
         }
       };
     },
@@ -818,10 +844,6 @@
         console.log("sfc=--"+this.headContent.sfcCode+"--")
         if(this.headContent.sfcCode !== '' && this.headContent.sfcCode !== null
           && this.headContent.sfcCode !== undefined){
-          // if(scanValue.includes("P9900173252")){
-          //   this.headContent.yzSfcCode = scanValue
-          //   this.bindYzSfc();
-          // }else
           if(scanValue.includes("0RSP1TE") && this.headContent.processesCode === 'OP240'){
             this.headContent.cardCode = scanValue
             this.bindcardCode(scanValue);
@@ -832,32 +854,32 @@
             this.serialPortMethod(scanValue)
           }
         } else {
-          if(this.headContent.processesCode === 'OP240'){
+          // if(this.headContent.processesCode === 'OP240'){
             this.headContent.sfcCode = scanValue;
             this.queryParams.productNum = scanValue;
             this.getList()
             this.cakeLamp.scanFinish = 1
             this.cakeLamp.startWork = 1
-          }else {
-            let param = {
-              trolleyYard: scanValue
-            }
-            findBytrolleyYardGetOne(param).then(response => {
-              if(response.msg !== '2'){
-                this.headContent.sfcCode = response.msg;
-                this.queryParams.productNum = response.msg;
-                this.$message('鎵爜璇嗗埆浜у搧搴忓垪鍙�'+scanValue);
-                // this.headContent.sfcCode = scanValue;
-                // this.queryParams.productNum = scanValue;
-                this.getList()
-                this.cakeLamp.scanFinish = 1
-                this.cakeLamp.startWork = 1
-              }else {
-                this.$message('娌℃湁搴忓垪鍙�'+scanValue);
-                return
-              }
-            });
-          }
+            this.cakeLamp.InPlace = 1
+          // }else {
+          //   let param = {
+          //     trolleyYard: scanValue
+          //   }
+          //   findBytrolleyYardGetOne(param).then(response => {
+          //     if(response.msg !== '2'){
+          //       this.headContent.sfcCode = response.msg;
+          //       this.queryParams.productNum = response.msg;
+          //       this.$message('鎵爜璇嗗埆浜у搧搴忓垪鍙�'+scanValue);
+          //       this.getList()
+          //       this.cakeLamp.scanFinish = 1
+          //       this.cakeLamp.startWork = 1
+          //       this.cakeLamp.InPlace = 1
+          //     }else {
+          //       this.$message('娌℃湁搴忓垪鍙�'+scanValue);
+          //       return
+          //     }
+          //   });
+          // }
 
         }
 

--
Gitblit v1.9.3