From 4280d7277bc0f9b5c3dfad6d59d833aa89294f69 Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期一, 12 八月 2024 10:16:22 +0800
Subject: [PATCH] 打印bug优化

---
 jcdm-ui/package.json                                                                               |    1 
 jcdm-ui/src/views/main/cfkb/Instructions/index.vue                                                 |   10 ++++-
 jcdm-ui/src/views/main/kb/stationTerminal/index.vue                                                |   47 ++++++++++++++---------
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java |   17 +++++---
 jcdm-ui/src/main.js                                                                                |    3 +
 5 files changed, 50 insertions(+), 28 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 bc9536a..0166ada 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
@@ -94,13 +94,16 @@
 //        }
         Integer stepNumber = 1;
         try {
-            List<BsFormulaChildInfo> op260 = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>().eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getProcessesCode()));
-            List<BsFormulaChildInfo> filteredList = op260.stream()
-                    .filter(obj -> obj.getResults() != null && !obj.getResults().isEmpty())
-                    .collect(Collectors.toList());
-            if(filteredList.size() > 0){
-                stepNumber = Integer.valueOf(filteredList.get(filteredList.size()-1).getStepSort())+1;
-            }
+//            List<BsFormulaChildInfo> op260 = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>()
+//                    .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getProcessesCode())
+//                    .eq(BsFormulaChildInfo::getOperationType, "1")
+//            );
+//            List<BsFormulaChildInfo> filteredList = op260.stream()
+//                    .filter(obj -> obj.getResults() != null && !obj.getResults().isEmpty())
+//                    .collect(Collectors.toList());
+//            if(filteredList.size() > 0){
+//                stepNumber = Integer.valueOf(filteredList.get(filteredList.size()-1).getStepSort())+1;
+//            }
 
             String thoroughfare = Constants.thoroughfareMap.get(bsFormulaChildInfo.getLocationCode());//鑾峰彇閫氶亾
             String str = thoroughfare+"."+bsFormulaChildInfo.getProcessesCode()+".MESScrew";
diff --git a/jcdm-ui/package.json b/jcdm-ui/package.json
index 01d45af..abf4562 100644
--- a/jcdm-ui/package.json
+++ b/jcdm-ui/package.json
@@ -57,6 +57,7 @@
     "vue-count-to": "1.0.13",
     "vue-cropper": "0.5.5",
     "vue-meta": "2.4.0",
+    "vue-print-nb": "^1.7.5",
     "vue-router": "3.4.9",
     "vuedraggable": "2.24.3",
     "vuex": "3.6.0"
diff --git a/jcdm-ui/src/main.js b/jcdm-ui/src/main.js
index aea3622..d258b78 100644
--- a/jcdm-ui/src/main.js
+++ b/jcdm-ui/src/main.js
@@ -38,6 +38,8 @@
 // 瀛楀吀鏁版嵁缁勪欢
 import DictData from '@/components/DictData'
 import './router/directives.js';
+import Print from 'vue-print-nb';
+
 
 // 鍏ㄥ眬鏂规硶鎸傝浇
 Vue.prototype.getDicts = getDicts
@@ -62,6 +64,7 @@
 Vue.use(directive)
 Vue.use(plugins)
 Vue.use(VueMeta)
+Vue.use(Print);
 DictData.install()
 
 /**
diff --git a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
index d409d75..3c1b742 100644
--- a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
+++ b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
@@ -14,7 +14,9 @@
       <el-col :span="10">
         <el-card shadow="never">
           <span class="head-font">浜у搧搴忓垪鍙� : {{headContent.sfcCode}}</span>
-          <el-button @click="print1">鎵撳嵃</el-button>
+<!--          <el-button @click="print1">鎵撳嵃</el-button>-->
+          <el-button id="print" v-print="'#printMe'" 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>
@@ -630,7 +632,11 @@
         this.$message('websocket杩炴帴鎴愬姛锛�');
       };
       this.ws.onmessage = function (event) {
-        if (event.data === "IN") {
+        if (event.data === "print") {
+          self.$message('postman璋冪敤鎵撳嵃鏂规硶鎵撳嵃锛�');
+          // self.print1()
+          document.getElementById('print').click();
+        }else if (event.data === "IN") {
           self.cakeLamp.InPlace = 1;
         } else if (event.data === "IN0") {
           self.cakeLamp.InPlace = 0;
diff --git a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
index cec655c..b07044a 100644
--- a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
+++ b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -77,7 +77,7 @@
            </el-col>
          </el-row>
          <el-row v-show="orderFlag" style="margin-top: 20px">
-           <el-button @click="getWorkOrders" type="warning" size="mini">鎺ユ敹宸ュ崟</el-button>
+<!--           <el-button @click="getWorkOrders" type="warning" size="mini">鎺ユ敹宸ュ崟</el-button>-->
          </el-row>
        </el-card>
 
@@ -239,24 +239,24 @@
       this.setFocus();
       this.materialCode="";
     },
-    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
-          this.cakeLamp.InPlace = 1
-        });
-      }else {
-        this.$message.error("宸茬粡鏈夊伐鍗曚簡锛屼笉鑳芥帴鏀讹紒");
-      }
-    },
+    // 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
+    //       this.cakeLamp.InPlace = 1
+    //     });
+    //   }else {
+    //     this.$message.error("宸茬粡鏈夊伐鍗曚簡锛屼笉鑳芥帴鏀讹紒");
+    //   }
+    // },
     serialLink() {
       this.open1 = true
     },
@@ -359,6 +359,7 @@
       });
       this.getListFormulaChild()
       this.workpieceInformation.inboundTime = this.getCurrentTime()
+
     },
 
     initializedData(){
@@ -478,6 +479,14 @@
           self.cakeLamp.startWork = 1
           self.cakeLamp.InPlace = 1
 
+          const param = {
+            processesCode: self.headContent.processesCode,
+            productCode: self.workpieceInformation.productCode
+          }
+          fistSetpNumber(param).then(response => {
+            console.log("fistSetpNumber------"+response.msg)
+          });
+
         }else if (event.data.includes("[")) {//鎷х揣
           let formulaChilds = "";
           self.formulaChildList.sort((a, b) => a.stepSort - b.stepSort);

--
Gitblit v1.9.3