Prechádzať zdrojové kódy

调整合同打印页

unknown 2 týždňov pred
rodič
commit
4f8e1b3e76

+ 9 - 3
src/views/elderly/contracts/ContractManageForm.vue

@@ -424,16 +424,22 @@ const renderAttachmentContent = (key: string) => {
     background: #fff !important;
     box-shadow: none !important;
     box-sizing: border-box !important;
+    page-break-after: auto;
+    break-after: auto;
   }
 
-  /* 封面页保留完整 A4 高度 */
+  /* 封面页保留完整 A4 高度并强制分页(可打印区域 261mm) */
   .print-container .a4-page.cover-a4 {
-    min-height: 297mm !important;
+    min-height: 261mm !important;
+    page-break-after: always;
+    break-after: page;
   }
 
-  /* 其他页自适应高度 */
+  /* 其他页自适应高度,内容连续流动 */
   .print-container .a4-page:not(.cover-a4) {
     min-height: auto !important;
+    page-break-after: auto;
+    break-after: auto;
   }
 
   /* 4. 防止标题、列表项、签名区被分页切断 */

+ 16 - 6
src/views/elderly/contracts/components/ContractBody.vue

@@ -1651,7 +1651,7 @@ const displayDate = computed(() => {
 
 .a4-page {
   width: 210mm;
-  min-height: 297mm;
+  min-height: auto;
   margin: 4mm auto;
   padding: 10mm 14mm;
   background: #fff;
@@ -1660,6 +1660,16 @@ const displayDate = computed(() => {
   box-sizing: border-box;
 }
 
+/* 封面页保留完整 A4 高度 */
+.a4-page.cover-a4 {
+  min-height: 297mm;
+}
+
+/* 非封面页隐藏页眉(logo+页码) */
+.a4-page:not(.cover-a4) .page-header {
+  display: none;
+}
+
 .page-header {
   display: flex;
   justify-content: space-between;
@@ -1769,10 +1779,10 @@ const displayDate = computed(() => {
     width: 100%;
   }
 
-  /* 封面页:保留完整 A4 高度 */
+  /* 封面页:填满一整页(@page margin 18mm,可打印区域高度 = 297-36=261mm) */
   .a4-page.cover-a4 {
     width: 100% !important;
-    min-height: 297mm !important;
+    min-height: 261mm !important;
     margin: 0 !important;
     padding: 0 !important;
     background: #fff !important;
@@ -1782,7 +1792,7 @@ const displayDate = computed(() => {
     break-after: page;
   }
 
-  /* 其他页:自适应高度,由浏览器自动分页 */
+  /* 其他页:自适应高度,内容连续流动,由浏览器自动分页 */
   .a4-page:not(.cover-a4) {
     width: 100% !important;
     min-height: auto !important;
@@ -1791,8 +1801,8 @@ const displayDate = computed(() => {
     background: #fff !important;
     box-shadow: none !important;
     box-sizing: border-box !important;
-    page-break-after: always;
-    break-after: page;
+    page-break-after: auto;
+    break-after: auto;
   }
 
   .a4-page:last-child {