695593266@qq.com пре 9 месеци
родитељ
комит
d7c9fcefeb

+ 7 - 1
src/config/setting.js

@@ -21,7 +21,13 @@ export const SYSTEM_NAME = 'mes';
 export const REPEATABLE_TABS = [];
 
 // 不需要登录的路由
-export const WHITE_LIST = ['/login', '/forget', '/singleLogin'];
+export const WHITE_LIST = [
+  '/login',
+  '/forget',
+  '/singleLogin',
+  '/printJuren',
+  '/printJuRenOne'
+];
 
 // 开启 KeepAlive 后仍然不需要缓存的路由地址
 export const KEEP_ALIVE_EXCLUDES = [];

+ 23 - 1
src/views/produce/components/jobBooking/components/batchSemiProductJobBom.vue

@@ -12,7 +12,8 @@
             item.currentTaskDiagram.type == 4 &&
             this.printStyle != 'notExist'
           "
-          ><el-button type="text" size="mini" @click="pritJuRen()"
+        >
+          <el-button type="text" size="mini" @click="pritJuRen()"
             >打印条码</el-button
           >
         </div>
@@ -1939,6 +1940,27 @@
         // }
 
         if (this.printStyle == 'juRen1') {
+          // const routeUrl = this.$router.resolve({
+          //   path: '/produce/components/juRenPackOne',
+          //   query: {
+          //     batchNo,
+          //     createDate,
+          //     enforceStandards,
+          //     layBy,
+          //     level,
+          //     netWeight,
+          //     notice,
+          //     productName,
+          //     purchaseOrigins,
+          //     specification,
+          //     warrantyPeriod,
+          //     warrantyPeriodUnit,
+          //     weightUnit,
+          //     workOrderId: this.item.workOrderId
+          //   }
+          // });
+          // window.open(routeUrl.href, '_blank');
+
           const query = `?batchNo=${batchNo}&createDate=${createDate}&enforceStandards=${enforceStandards}&layBy=${layBy}&level=${level}&netWeight=${netWeight}&notice=${notice}&productName=${productName}&purchaseOrigins=${purchaseOrigins}&specification=${specification}&warrantyPeriod=${warrantyPeriod}&warrantyPeriodUnit=${warrantyPeriodUnit}&weightUnit=${weightUnit}&workOrderId=${this.item.workOrderId}`;
           window.open('/printJuRenOne' + query, '_blank');
         }

+ 23 - 1
src/views/produce/components/juRenPackOne.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="label-container">
+  <div class="label-container" id="printSection">
     <div class="ju_ren_one_level">
       <span>{{ productName ? productName : ' ' }}</span>
       <span class="ju_ren_one_level_two">{{ '' }}</span>
@@ -90,6 +90,8 @@
         weightUnit,
         workOrderId
       } = this.$route.query;
+      console.log('123');
+
       this.productName = productName ? productName : '';
       this.batchNo = batchNo ? batchNo : '';
       this.createDate = createDate ? createDate : '';
@@ -129,6 +131,8 @@
         this.generateQRCodes();
         // window.print();
       });
+
+      // this.print();
     },
 
     methods: {
@@ -146,6 +150,24 @@
             });
         }
       }
+
+      // print() {
+      //   const printSection = document.getElementById('printSection');
+      //   // 创建打印任务
+      //   const printWindow = window.open('', '_blank');
+      //   printWindow.document.open();
+      //   printWindow.document.write('<html><head><title>打印预览</title>');
+      //   printWindow.document.write(
+      //     '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+      //   );
+      //   printWindow.document.write('</head><body>');
+      //   printWindow.document.write(printSection.innerHTML);
+      //   printWindow.document.write('</body></html>');
+      //   printWindow.document.close();
+      //   // printWindow.onload = function () {
+      //   //   printWindow.print();
+      //   // };
+      // }
     }
   };
 </script>