From 03c894b105bff46879625b67cdebc8c2d947d29f Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期四, 22 八月 2024 11:31:24 +0800
Subject: [PATCH] 修改流程卡打印样式,根据线路添加在磨边队列查不到时查所有线队列数据

---
 UI-Project/src/views/UnLoadGlass/loadmachinerack.vue |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
index a0ecc55..513c5a5 100644
--- a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
+++ b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
@@ -42,6 +42,7 @@
 const printLayer = ref('')
 const now = new Date();
 const timeRange = ref([])
+const browser=ref(false)
 
 const handleChange = async () => {
   console.log("瑙﹀彂寮�鍏�")
@@ -64,7 +65,15 @@
     console.error(error);
   }
 }
-
+const confirmBrowser = () =>{
+  if (/chrome|chromium/i.test(navigator.userAgent) && !/edg/i.test(navigator.userAgent)) {
+    browser.value=true
+} else if (/edg/i.test(navigator.userAgent)) {
+  browser.value=false
+} else {
+  browser.value=false
+}
+}
 
 const handleInputChangea = (value, rowId) => {
   // 鏇存柊瀵瑰簲琛岀殑 select 鍊�
@@ -201,8 +210,8 @@
     autoPrint.value = data.autoPrint[0];
   }
 
-  
-  if (fullFlowCard.value == ""&&autoPrint.value==true) {
+  //鑷姩鎵撳嵃
+  if (fullFlowCard.value == ""&&autoPrint.value==true&&browser.value==true) {
     for (let i = 0; i < tableData.length; i++) {
       if (tableData[i].totalQuantity != 0) {
         if (tableData[i].totalQuantity == tableData[i].racksNumber + tableData[i].otherNumber && fullFlowCard.value != tableData[i].flowCardId) {
@@ -224,6 +233,7 @@
 };
 // 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
 onMounted(() => {
+  confirmBrowser();//鑾峰彇娴忚鍣�
   fetchFlowCardId();
   fetchTableData(); // 鑾峰彇鏁版嵁
   socket = initializeWebSocket(socketUrl, handleMessage);
@@ -294,9 +304,9 @@
   printLayer.value = row.layer
   dialogTableVisible.value = true;
   setTimeout(() => {
-    printFlowCard(); // 鏇挎崲鎴愪綘瑕佹墽琛岀殑鍑芥暟鍚�
-    //dialogTableVisible.value = false;
-  }, 1000);
+    printFlowCard(); 
+    dialogTableVisible.value = false;
+  }, 2000);
 }
 const open1 = async (row) => {
 
@@ -304,7 +314,7 @@
 printLayer.value = row.layer
 dialogTableVisible1.value = true;
 setTimeout(() => {
-  printFlowCard1(); // 鏇挎崲鎴愪綘瑕佹墽琛岀殑鍑芥暟鍚�
+  printFlowCard1(); 
   //dialogTableVisible1.value = false;
 }, 1000);
 }
@@ -320,7 +330,7 @@
   let content = doc.createElement("div");
   content.id = printId;
 
-  alert(/Chrome/.test(userAgent) && !/Edge/.test(userAgent));
+  // alert(/Chrome/.test(userAgent) && !/Edge/.test(userAgent));
 
   // 鏍峰紡鎺у埗涓庢墦鍗版棤鍏崇殑鍏冪礌闅愯棌
   let style = doc.createElement("style");

--
Gitblit v1.8.0