From 7ae9a96783e5f7ed0f9b23e4e65d86b3158f2568 Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期三, 03 七月 2024 08:44:35 +0800
Subject: [PATCH] 页面刷新加载配方工单信息

---
 jcdm-ui/src/views/main/kb/stationTerminal/index.vue                                                |   28 +++++++++++++++++-----------
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java |   21 +++++++++++++++++++++
 jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js                                               |   10 ++++++++++
 3 files changed, 48 insertions(+), 11 deletions(-)

diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java
index c1676a3..0d8c164 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java
@@ -5,6 +5,7 @@
 import javax.servlet.http.HttpServletResponse;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.jcdm.main.constant.Constants;
 import com.kangaroohy.milo.model.ReadWriteEntity;
@@ -47,6 +48,26 @@
     /**
      * 鎵爜纭
      */
+    @GetMapping("/initializedData")
+    public AjaxResult initializedData(BsFormulaChildInfo bsFormulaChildInfo)
+    {
+        String productNum = "0RSPB001139E3AE5B0000035";
+        try {
+
+            String str = "PACK."+bsFormulaChildInfo.getProcessesCode()+".MStepNumber";
+            Object productNumObject = miloService.readFromOpcUa(str).getValue();
+            if(ObjectUtil.isNotNull(productNumObject)){
+                productNum = productNumObject.toString();
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        return AjaxResult.success(productNum);
+    }
+
+    /**
+     * 鎵爜纭
+     */
     @GetMapping("/fistSetpNumber")
     public AjaxResult fistSetpNumber(BsFormulaChildInfo bsFormulaChildInfo)
     {
diff --git a/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js b/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js
index 1abc42e..28432d8 100644
--- a/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js
+++ b/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js
@@ -38,6 +38,16 @@
 }
 
 // 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭垪琛�
+export function initializedData(query) {
+  return request({
+    url: '/bs/formulaChild/initializedData',
+    method: 'get',
+    params: query
+
+  })
+}
+
+// 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭垪琛�
 export function fistSetpNumber(query) {
   return request({
     url: '/bs/formulaChild/fistSetpNumber',
diff --git a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
index ae95f33..e55811e 100644
--- a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -308,7 +308,7 @@
 import {listStationConf,getIpv4} from "@/api/main/sc/stationConf";
 import {
   clearWorkpieceRelease,
-  fistSetpNumber,
+  fistSetpNumber, initializedData,
   listFormulaChild,
   noPageListFormulaChild,
   releaseCheck,
@@ -620,6 +620,21 @@
       });
     },
 
+    initializedData(){
+      const param = {
+        locationCode: this.headContent.processesCode,
+      }
+      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
+        }
+      });
+    },
+
     getCurrentTime() {
       const now = new Date();
       const year = now.getFullYear();
@@ -679,14 +694,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()
@@ -847,8 +855,6 @@
                 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

--
Gitblit v1.9.3