Просмотр исходного кода

feat: 在打印预览中添加样式表链接以改善打印效果

xieyong 2 дней назад
Родитель
Сommit
014c58080d

+ 3 - 0
src/views/saleManage/saleOrder/components/printTemplateHtStock.vue

@@ -178,6 +178,9 @@
         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>');

+ 3 - 0
src/views/saleManage/saleOrder/components/printTemplateSaleOrderSimple.vue

@@ -201,6 +201,9 @@
         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>');