From be27214928a43cacff975265a7c67e2e2461fd0c Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期六, 28 十一月 2026 19:39:01 +0800
Subject: [PATCH] 打印小票

---
 src/components/DoctorPageLayout/src/DoctorPageLayout.vue |   58 ++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 48 insertions(+), 10 deletions(-)

diff --git a/src/components/DoctorPageLayout/src/DoctorPageLayout.vue b/src/components/DoctorPageLayout/src/DoctorPageLayout.vue
index e247bb5..87ba476 100644
--- a/src/components/DoctorPageLayout/src/DoctorPageLayout.vue
+++ b/src/components/DoctorPageLayout/src/DoctorPageLayout.vue
@@ -302,13 +302,34 @@
   if (!el || !parent) return
 
   const cs = getComputedStyle(parent)
-  const inner =
-    parent.clientHeight -
-    parseFloat(cs.paddingTop || '0') -
-    parseFloat(cs.paddingBottom || '0')
+  const pb = parseFloat(cs.paddingBottom || '0')
 
-  // 鐖剁骇楂樺害涓嶅彲娴嬶紙auto/0锛夋椂淇濈暀 CSS 鍥為��锛屼笉璁惧唴鑱旈珮搴�
-  measuredHeight.value = inner > 0 ? `${inner}px` : undefined
+  /*
+   * 銆�2026-11-28 淇路1600脳900 鐪嬩笉鍒板簳閮ㄦ寜閽紙鍙彿/杩囧彿/閲嶅彨/鏆傚仠/鍋滄鍊欒瘖锛夈��
+   *
+   * 鏃у疄鐜帮細鍙敤楂樺害 = parent.clientHeight 鈭� 鐖剁骇涓婁笅 padding銆�
+   * 浣嗙埗绾э紙AppView 鐨� <section>锛夐珮搴︽槸 **min-height + 鐢卞唴瀹规拺寮�**锛�
+   * 浜庢槸褰㈡垚寰幆渚濊禆锛氬唴瀹癸紙鍚� footer锛夋妸鐖剁骇鎾戦珮 鈫� 鎴戜滑鍐嶆妸鏍瑰厓绱犺鎴�"鐖剁骇閭d箞楂�"
+   * 鈬� 鏍瑰厓绱犳案杩� 鈮� 鍐呭楂樺害锛岄〉闈㈡瘮瑙嗗彛楂橈紝footer 琚帹鍒版姌鍙犵嚎浠ヤ笅锛�
+   * 鍖荤敓蹇呴』婊氬姩鎵嶈兘鐪嬪埌鎸夐挳锛堢揣鍑戞ā寮忎篃鏁戜笉浜嗭紝鍥犱负鍘嬬缉鐨勬槸鍐呭涓嶆槸鏍归珮搴︼級銆�
+   *
+   * 鐜板湪鏀逛负**浠ヨ鍙d负鍩哄噯**锛堜笌鐖剁骇褰撳墠楂樺害鏃犲叧锛屼笉寰幆锛夛細
+   *   鍙敤楂樺害 = window.innerHeight 鈭� 鏈〉鍦ㄦ枃妗d腑鐨勯《绔� 鈭� 鐖剁骇 padding-bottom
+   * 杩欐牱 1600脳900锛堟祻瑙堝櫒鍙楂樼害 780锛変篃涓�瀹氳兘鎶� footer 鏀捐繘灞忓箷鍐呫��
+   */
+  const rect = el.getBoundingClientRect()
+  const docTop = rect.top + (window.scrollY || document.documentElement.scrollTop || 0)
+
+  // 甯冨眬搴曢儴鐨勫簲鐢ㄩ〉鑴氾紙AppView 閲� <Footer> 涓庡唴瀹� section 鏄厔寮熻妭鐐癸級涔熶細鍗犻珮搴︼紝
+  // 涓嶆墸鎺夊氨浼氬鍑轰竴鏉� 20~40px 鐨勯〉闈㈡粴鍔紝鎶婃垜浠殑搴曢儴鎸夐挳鍘嬪埌鎶樺彔绾夸互涓嬨��
+  // 閫氳繃"鍐呭 section 鐨勪笅涓�涓厔寮�"鏉ヨ瘑鍒紝璇嗗埆涓嶅埌灏卞綋娌℃湁锛堜笉鎵o級銆�
+  const nextSibling = parent.nextElementSibling as HTMLElement | null
+  const hasFooter = !!nextSibling && /footer/i.test(nextSibling.className || '')
+  const footerH = hasFooter ? nextSibling!.getBoundingClientRect().height : 0
+
+  const available = window.innerHeight - docTop - pb - footerH
+  // 鏋佺灏忚鍙e厹搴� 240px锛堝啀灏忓氨娌℃湁鍙敤绌洪棿浜嗭級
+  measuredHeight.value = available > 0 ? `${Math.max(240, Math.round(available))}px` : undefined
 
   // 瀹藉害鍙樺寲锛堝惈绐楀彛缂╂斁锛夋椂閲嶆柊澶逛竴娆″彸鏍忓搴︼紝
   // 鍚﹀垯鎷栧鍚庢妸绐楀彛缂╁皬锛屽彸渚ф爮鍙兘鎶婂乏渚у唴瀹规尋娌°��
@@ -336,9 +357,13 @@
   if (parent && typeof ResizeObserver !== 'undefined') {
     ro = new ResizeObserver(scheduleMeasure)
     ro.observe(parent)
-  } else {
-    window.addEventListener('resize', scheduleMeasure)
   }
+  // 銆�2026-11-28銆戠獥鍙e昂瀵�/娴忚鍣ㄧ缉鏀惧彉鍖�**涓�瀹�**瑕侀噸绠楋細鐖剁骇楂樺害鍙兘娌″彉锛坢in-height 鎾戞弧锛夛紝
+  // 浣嗚鍙e彉浜� 鈫� 鍙敤楂樺害灏卞彉浜嗐�傛棫瀹炵幇鍙湪娌℃湁 ResizeObserver 鏃舵墠鐩戝惉 resize锛�
+  // 浜庢槸"鏈�澶у寲/杩樺師绐楀彛"鍚庨珮搴︿笉鍒锋柊锛宖ooter 鍙堣窇鍒板睆骞曞銆�
+  window.addEventListener('resize', scheduleMeasure)
+  // 渚ц竟鏍忔姌鍙�/灞曞紑锛堣彍鍗曞搴﹀彉鍖栵級鎴� TagsView 寮�鍏冲悓鏍蜂細鏀瑰彉鍙敤楂樺害
+  window.addEventListener('orientationchange', scheduleMeasure)
 })
 
 onBeforeUnmount(() => {
@@ -346,6 +371,7 @@
   ro?.disconnect()
   ro = undefined
   window.removeEventListener('resize', scheduleMeasure)
+  window.removeEventListener('orientationchange', scheduleMeasure)
 })
 </script>
 
@@ -705,7 +731,7 @@
   }
 
   .doctor-page__header {
-    height: 36px;
+    height: 32px;
   }
 
   .doctor-page__readonly-tip {
@@ -714,7 +740,19 @@
   }
 
   .doctor-page__footer {
-    padding: 2px 0 2px 8px;
+    padding: 1px 0 1px 8px;
+  }
+
+  /* 銆�2026-11-28銆戠揣鍑戞ā寮忎笅搴曢儴鎸夐挳鍐嶇煯涓�妗o細1600脳900 涓婃妸楂樺害杩樼粰鍐呭鍖� */
+  .doctor-page__footer :deep(.el-button),
+  .doctor-page__footer :deep(.el-button--small) {
+    height: 28px;
+    padding: 0 10px;
+    font-size: 14px;
+  }
+
+  .doctor-page__content {
+    padding: 4px 8px;
   }
 }
 </style>

--
Gitblit v1.9.3