From 4e91ae3c1ff41d0bf9f65d444c90c2583e69cdb7 Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期五, 27 九月 2024 17:16:10 +0800
Subject: [PATCH] 下线打印报告优化

---
 jcdm-ui/src/views/main/cfkb/Instructions/index.vue |   98 ++++++++++++++++---------------------------------
 1 files changed, 32 insertions(+), 66 deletions(-)

diff --git a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
index 830f4a9..81f23b2 100644
--- a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
+++ b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
@@ -3,17 +3,17 @@
     <el-row :gutter="5">
       <el-col :span="7">
         <el-card shadow="never">
-          <span class="head-font">宸ヤ綅缂栧彿 : {{headContent.processesCode}}</span>
+          <span class="head-font">宸ヤ綅缂栧彿锛歿{headContent.processesCode}}</span>
         </el-card>
       </el-col>
       <el-col :span="7">
         <el-card shadow="never">
-          <span class="head-font">宸ヤ綅鍚嶇О : {{headContent.processesName}}</span>
+          <span class="head-font">宸ヤ綅鍚嶇О锛歿{headContent.processesName}}</span>
         </el-card>
       </el-col>
       <el-col :span="10">
-        <el-card shadow="never">
-          <span class="head-font">浜у搧搴忓垪鍙� :</span>
+        <el-card shadow="never" body-style="padding: 10px;">
+          <span class="head-font">浜у搧搴忓垪鍙凤細</span>
           <el-input style="width: 50%;" v-model="headContent.sfcCode" placeholder="璇疯緭鍏ュ唴瀹�"></el-input>
 <!--          <el-button type="primary" id="print" v-print="'#printMe'">鎵撳嵃</el-button>-->
           <el-button type="primary" id="print" v-print="'#printMe'" style="display: none;">鎵撳嵃</el-button>
@@ -31,7 +31,7 @@
             <span slot="label"> <a class="el-icon-date"></a>棣栭〉</span>
             <el-col :span="24">
               <div>
-                <div id="printMe" class="print_hide">
+                <div id="printMe">
                   <offline-qualification-report :printParam="printParam"></offline-qualification-report>
                 </div>
               </div>
@@ -54,13 +54,14 @@
 import USBDevice from "@/utils/usb.json";
 import {addPassingStationCollection} from "@/api/main/da/passingStationCollection/passingStationCollection";
 import {
-  addTighteningParameters, enterWeighing,
+  addTighteningParameters, enterWeighing, getPrintOfflineReportInfo, listParamCollection,
   replaceAssemblyCode,
   saveCampaignTimeParameters,
   yzAddBasicParameters,
 } from "@/api/main/da/paramCollection/paramCollection";
 import QRCode from "qrcodejs2";
 import OfflineQualificationReport from "@/views/components/offlineQualificationReport.vue";
+import {listProductionOrde} from "@/api/main/om/productionOrde/productionOrde";
 
 export default {
   name: "stationTerminal",
@@ -68,8 +69,7 @@
   data() {
     return {
       printParam: {
-        key: '閫夐」1',
-        label: '榛勯噾绯�'
+
       },
       weightValue: '',
       showInput: true,
@@ -159,52 +159,7 @@
     //   this.connectWebsocket();
     // }, 3000);
   },
-  mounted() {
-    if ("serial" in navigator) {
-      this.myserialport = new MySerialPort();
-      this.getPorts();
-      navigator.serial.addEventListener("connect", (e) => {
-        this.$message.success("璁惧宸茶繛鎺�");
-        this.getPorts();
-      });
-      navigator.serial.addEventListener("disconnect", (e) => {
-        this.$message.error("璁惧宸叉柇寮�");
-      });
-      this.restaurants = this.loadAll();
-    } else {
-      this.$message.error(
-        "褰撳墠涓篐TTP妯″紡鎴栬�呮祻瑙堝櫒鐗堟湰杩囦綆锛屼笉鏀寔缃戦〉杩炴帴涓插彛"
-      );
-    }
-  },
-  computed: {
-    isDisable() {
-      return this.btnType === "danger";
-    },
-    printContent() {
-      return {
-        // id: '',
-        // id: '#printMe',
-        // preview: false,
-      }
-    }
-  },
   methods: {
-
-
-    enterWeighing(){
-      if(this.headContent.sfcCode ==='' || this.weightValue === '' ){
-        this.$message.error('鍙傛暟涓嶅叏锛�');
-      }else {
-        let param = {
-          sfcCode: this.headContent.sfcCode,
-          weightValue: this.weightValue,
-        }
-        enterWeighing(param).then(response => {
-          this.$message('褰曞叆瀹屾垚锛�');
-        });
-      }
-    },
     serialLink() {
       this.open1 = true
     },
@@ -222,17 +177,6 @@
       }
     },
 
-    Release(){
-      // this.$message('portsList锛�'+this.portsList.length);
-      if(this.btnType === "danger"){
-        this.$message('杩炴帴浜�!锛�');
-
-      }else {
-        this.$message('mei杩炴帴浜嗭紒');
-
-      }
-
-    },
     serialPortMethod(value){
       let formulaChildParams = {
         scanBarcode: value,
@@ -310,11 +254,22 @@
     },
     printBefore() {
       if (this.headContent.sfcCode !== '') {
-        document.getElementById('print').click();
+        listProductionOrde({productNum: this.headContent.sfcCode}).then(response => {
+          let rowsData = response.rows[0];
+          if(rowsData){
+            getPrintOfflineReportInfo({productNum: this.headContent.sfcCode}).then(response => {
+              this.printParam = response.data
+              document.getElementById('print').click();
+            });
+          }else {
+            this.$message.error('绯荤粺娌℃湁姝ゅ伐鍗曪紝璇烽噸鏂版壂鐮侊紒');
+          }
+        });
       } else {
-        alert('璇峰厛鎵爜');
+        this.$message.error('璇峰厛鎵爜!');
       }
     },
+
     // print1() {
     //   if(this.headContent.sfcCode !== ''){
     //     // 鏂板紑椤甸潰鎵撳嵃
@@ -721,5 +676,16 @@
 .el-table .success-row {
   background: #f0f9eb;
 }
+
+/*闅愯棌鎵撳嵃鍖哄煙*/
+/*#printMe {*/
+/*  display: none;*/
+/*}*/
+/*!*鎵撳嵃鏃舵樉绀烘墦鍗板尯鍩�*!*/
+/*@media print {*/
+/*  #printMe {*/
+/*    display: block;*/
+/*  }*/
+/*}*/
 </style>
 

--
Gitblit v1.9.3