yusheng пре 9 месеци
родитељ
комит
2614521c52
1 измењених фајлова са 20 додато и 13 уклоњено
  1. 20 13
      src/views/saleManage/saleOrder/invoice/components/print-template-jr.vue

+ 20 - 13
src/views/saleManage/saleOrder/invoice/components/print-template-jr.vue

@@ -3,13 +3,12 @@
     <div id="printSection">
       <div
         class="print"
-        
         style="
           display: flex;
           align-items: center;
           justify-content: center;
           flex-direction: column;
-          width: 1141px;
+          width: 100%;
         "
       >
         <div
@@ -49,7 +48,7 @@
           </span>
           <span style="width: 17%">
             <span style="width: 60px; display: inline-block">发货日期</span>
-            2025-01-01  
+            2025-01-01
           </span>
           <span style="width: 17%">
             <span style="width: 60px; display: inline-block">总计金额</span>
@@ -86,7 +85,7 @@
             </tr>
             <tr
               align="center"
-              style="height:30px"
+              style="height: 30px"
               v-for="(item, index) in [{}, {}, {}, {}, {}, {}]"
             >
               <td> {{ item.productCode }} </td>
@@ -214,15 +213,23 @@
         printWindow.document.open();
         printWindow.document.write('<html><head><title>打印预览</title>');
         printWindow.document.write(`<style>
-    @media print {
-      .print{
-        page-break-before: always !important;
-        page-break-inside: avoid !important;
-      };
-       @page {
-      size: 31cm 11cm;
-        }
-       }
+@media print {
+  @page {
+    size: 30cm 11cm; /* 设置打印尺寸 */
+    margin: 0; /* 去除页边距 */
+  }
+  body {
+    width: 30cm;
+    height: 11cm;
+    padding: 0;
+    margin: 0;
+  }
+  #printSection {
+    width: 100%;
+    height: 100%;
+    display: block;
+  }
+}
   
   </style>`);