PrintCheckList.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <script setup lang="ts">
  2. import { printListReqNo } from "@/api/zhu-yuan-yi-sheng/jian-yan-jian-cha-shen-qing";
  3. import env from "@/utils/setting";
  4. import { cptSex } from "@/utils/computed";
  5. import JsBarcode from "jsbarcode";
  6. import { useVuePrint } from "@/utils/cy-use/useVuePrint";
  7. const data = ref([]);
  8. const [PrintTemplate, printFun] = useVuePrint({
  9. extraPageCss: `
  10. @page {
  11. size: A5 ;
  12. margin: 0;
  13. padding: 0 ;
  14. }
  15. body,
  16. html {
  17. font-size: 13px;
  18. }
  19. * {
  20. box-sizing: border-box;
  21. }
  22. `,
  23. });
  24. function handleQrCode() {
  25. data.value.forEach(item => {
  26. item.items.forEach(tmp => {
  27. const canvas = document.createElement("canvas");
  28. JsBarcode(canvas, tmp.reqNo, {
  29. lineColor: "#333",
  30. width: 2,
  31. height: 18,
  32. margin: 0,
  33. fontSize: 12,
  34. });
  35. tmp.qrCode = canvas.toDataURL("image/png");
  36. });
  37. });
  38. }
  39. defineExpose({
  40. async print(reqs: number[]) {
  41. data.value = await printListReqNo(reqs);
  42. handleQrCode();
  43. await nextTick();
  44. await printFun();
  45. },
  46. });
  47. </script>
  48. <template>
  49. <PrintTemplate>
  50. <div class="print_jc_list" v-for="item in data">
  51. <div
  52. style="
  53. font-size: 20pt;
  54. text-align: center;
  55. font-weight: bold;
  56. margin-bottom: 6pt;
  57. "
  58. >
  59. {{ env.VITE_HOSPITAL_NAME }}
  60. </div>
  61. <div style="text-align: center">
  62. {{ item.title }}
  63. </div>
  64. <div style="font-size: 11pt">病人身份:{{ item.responceTypeName }}</div>
  65. <div
  66. style="
  67. border-top: 0.75pt dashed black;
  68. border-bottom: 0.75pt solid black;
  69. width: 100%;
  70. margin-bottom: 2px;
  71. "
  72. >
  73. <table style="border: 0; width: 100%">
  74. <tr>
  75. <td>住院号:{{ item.inpatientNo }}</td>
  76. <td>姓名:{{ item.name }}</td>
  77. <td>性别:{{ cptSex(item.sex) }}</td>
  78. <td>年龄:{{ item.age }}</td>
  79. <td>床号:{{ item.bedNo }}</td>
  80. </tr>
  81. <tr>
  82. <td colspan="3">病人住址: {{ item.homeStreet }}</td>
  83. <td colspan="2" style="width: 90pt">联系电话:{{ item.homeTel }}</td>
  84. </tr>
  85. </table>
  86. </div>
  87. <div class="req_comment-from">
  88. <div class="req_comment-item">病室摘要:</div>
  89. <div>
  90. {{ item.reqComment }}
  91. </div>
  92. </div>
  93. <div class="req_comment-from">
  94. <div class="req_comment-item">体征:</div>
  95. <div>
  96. {{ item.reqTzComment }}
  97. </div>
  98. </div>
  99. <div class="req_comment-from">
  100. <div class="req_comment-item">相关辅检结果:</div>
  101. <div>
  102. {{ item.reqOtherResult }}
  103. </div>
  104. </div>
  105. <div class="req_comment-from">
  106. <div class="req_comment-item">临床诊断:</div>
  107. <div>
  108. {{ item.diagText }}
  109. </div>
  110. </div>
  111. <table class="items_table">
  112. <tbody>
  113. <tr v-for="tmpItem in item.items">
  114. <td style="height: 40px; width: 40%">
  115. <img :src="tmpItem.qrCode" style="height: 100%; width: 100%" />
  116. </td>
  117. <td>{{ tmpItem.itemName }}</td>
  118. </tr>
  119. </tbody>
  120. </table>
  121. <div>
  122. <pre>
  123. {{ item.precautions }}
  124. </pre
  125. >
  126. </div>
  127. </div>
  128. </PrintTemplate>
  129. </template>
  130. <style lang="scss">
  131. .print_jc_list {
  132. background: white;
  133. height: 210mm;
  134. width: 148mm;
  135. padding: 10px;
  136. overflow: hidden;
  137. .req_comment-from {
  138. display: flex;
  139. width: 100%;
  140. padding: 5px;
  141. }
  142. .req_comment-item {
  143. width: 20%;
  144. text-align: right;
  145. }
  146. .items_table {
  147. width: 100%;
  148. margin: 0;
  149. padding: 0;
  150. border-collapse: collapse;
  151. tr,
  152. td {
  153. margin: 0;
  154. padding: 5px;
  155. }
  156. }
  157. }
  158. </style>