traditionalChineseMedicineHealthTable.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>个人基本信息表</title>
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  7. <meta name="viewport" content="width=device-width,initial-scale=1.0" />
  8. <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
  9. <style>
  10. * {
  11. margin: 0;
  12. padding: 0;
  13. font-size: 12px;
  14. }
  15. table {
  16. border-collapse: collapse;
  17. margin: 10px auto;
  18. }
  19. th,
  20. tr,
  21. td {
  22. border: 1px solid #000;
  23. border-collapse: collapse;
  24. padding: 6px 5px;
  25. page-break-inside: avoid;
  26. }
  27. h3 {
  28. font-size: 24px;
  29. }
  30. thead {
  31. border: none;
  32. }
  33. thead tr {
  34. border: none;
  35. }
  36. thead tr th {
  37. border: none;
  38. border-collapse: separate;
  39. }
  40. .textAlign,
  41. th {
  42. text-align: center;
  43. }
  44. .textRight {
  45. display: flex;
  46. justify-content: flex-end;
  47. }
  48. h3 {
  49. font-size: 24px;
  50. }
  51. .boxPosition {
  52. display: inline-flex;
  53. float: inline-end;
  54. }
  55. .checkBox {
  56. display: flex;
  57. /* justify-content: end; */
  58. }
  59. .box {
  60. width: 16px;
  61. height: 16px;
  62. display: inline-block;
  63. border: 1px solid black;
  64. text-align: center;
  65. line-height: 16px;
  66. margin-right: 15px;
  67. position: relative;
  68. }
  69. .box:not(:last-child)::after {
  70. content: "/";
  71. position: absolute;
  72. top: 50%;
  73. left: 100%;
  74. transform: translateY(-50%);
  75. padding: 0 5px;
  76. }
  77. @page {
  78. margin-top: 1.4cm;
  79. /* 设置其他页的上边距为2cm */
  80. margin-bottom: 1.2cm;
  81. /* 设置其他页的下边距为2cm */
  82. }
  83. @page :first {
  84. margin-top: 0;
  85. margin-bottom: 10mm;
  86. /* 设置第一页的下边距为2cm */
  87. }
  88. input {
  89. border-bottom: 1px solid #000;
  90. border-top: 0px;
  91. border-left: 0px;
  92. border-right: 0px;
  93. outline: none;
  94. width: 80px;
  95. text-indent: 1em;
  96. color: #000;
  97. }
  98. .boxDiagnosisTime {
  99. width: 16px;
  100. height: 16px;
  101. display: inline-flex;
  102. border: 1px solid black;
  103. text-align: center;
  104. line-height: 16px;
  105. margin-right: 15px;
  106. position: relative;
  107. }
  108. .slash {
  109. display: inline;
  110. }
  111. </style>
  112. </head>
  113. <body>
  114. <div>
  115. <h3 class="textAlign" style="font-weight:bold;">老年人中医药健康管理服务记录表</h3>
  116. <p>
  117. <span style="font-weight: bold;">姓名:<span style="font-weight: bold;" id="patientName"></span></span>
  118. </p>
  119. <table>
  120. <tbody id="tableId">
  121. <tr>
  122. <td colspan="4">请根据近一年的体验和感觉,回答以下问题</td>
  123. <td>没有(根本不/从来没有)</td>
  124. <td>很少(有一点/偶尔)</td>
  125. <td>有时(有些/少数时间)</td>
  126. <td>经常(相当/多数时间)</td>
  127. <td>总是(非常/每天)</td>
  128. <td>结果</td>
  129. </tr>
  130. </tbody>
  131. </table>
  132. </div>
  133. <script>
  134. var fromConfigData = window.parent.fromConfig
  135. var tableData = window.parent.tableData[0];
  136. const table = document.getElementById('tableId');
  137. document.getElementById("patientName").innerHTML = tableData["PatientName"];
  138. fromConfigData[0].children.forEach(element => {
  139. const newRow = document.createElement('tr');
  140. const cellLabel = document.createElement('td');
  141. cellLabel.textContent = element.label;
  142. cellLabel.colSpan = 4;
  143. const cell1 = document.createElement('td');
  144. cell1.textContent = '1';
  145. const cell2 = document.createElement('td');
  146. cell2.textContent = '2';
  147. const cell3 = document.createElement('td');
  148. cell3.textContent = '3';
  149. const cell4 = document.createElement('td');
  150. cell4.textContent = '4';
  151. const cell5 = document.createElement('td');
  152. cell5.textContent = '5';
  153. const cellResult = document.createElement('td');
  154. cellResult.textContent = tableData[element.key];
  155. newRow.appendChild(cellLabel);
  156. newRow.appendChild(cell1);
  157. newRow.appendChild(cell2);
  158. newRow.appendChild(cell3);
  159. newRow.appendChild(cell4);
  160. newRow.appendChild(cell5);
  161. newRow.appendChild(cellResult);
  162. table.appendChild(newRow);
  163. });
  164. const constitutiontitleRow = document.createElement('tr');
  165. const constitutionResultRow = document.createElement('tr');
  166. const constitutionGuidanceRow = document.createElement('tr');
  167. const cellLabel = document.createElement('td');
  168. cellLabel.textContent = '体质类型';
  169. constitutiontitleRow.appendChild(cellLabel);
  170. const cellResult = document.createElement('td');
  171. cellResult.textContent = "体质辨识"
  172. constitutionResultRow.appendChild(cellResult);
  173. const cellGuidance = document.createElement('td');
  174. cellGuidance.textContent = "中医药保健指导"
  175. constitutionGuidanceRow.appendChild(cellGuidance);
  176. debugger
  177. fromConfigData[1].children.forEach(element => {
  178. const cell = document.createElement('td');
  179. cell.textContent = element.label;
  180. constitutiontitleRow.appendChild(cell);
  181. const cellScore = document.createElement('td');
  182. var score = tableData[element.groupKeys[0]];
  183. cellScore.innerHTML = "得分:" + score + "<br>" + getJudgmentResult(score, element.groupKeys[0]);
  184. constitutionResultRow.appendChild(cellScore);
  185. const cellGuidance1 = document.createElement('td');
  186. cellGuidance1.innerHTML = tableData[element.key] != undefined ? element.options.map(function (o) {
  187. if (tableData[element.key].includes(o.value))
  188. return o.value + "." + o.label;
  189. }).filter(Boolean).join("<br>") : '';
  190. constitutionGuidanceRow.appendChild(cellGuidance1);
  191. });
  192. table.appendChild(constitutiontitleRow);
  193. table.appendChild(constitutionResultRow);
  194. table.appendChild(constitutionGuidanceRow);
  195. const constitutionInfoRow = document.createElement('tr');
  196. const cellDateTimeLabel = document.createElement('td');
  197. cellDateTimeLabel.textContent = "填表日期";
  198. cellDateTimeLabel.colSpan = 2;
  199. constitutionInfoRow.appendChild(cellDateTimeLabel);
  200. const cellDateTime = document.createElement('td');
  201. cellDateTime.textContent = tableData['Follow_Time'];
  202. cellDateTime.colSpan = 3;
  203. constitutionInfoRow.appendChild(cellDateTime);
  204. const cellSignatureLabel = document.createElement('td');
  205. cellSignatureLabel.textContent = "医生签名";
  206. cellSignatureLabel.colSpan = 2;
  207. constitutionInfoRow.appendChild(cellSignatureLabel);
  208. const cellSignature = document.createElement('td');
  209. cellSignature.textContent = "";
  210. cellSignature.colSpan = 3;
  211. constitutionInfoRow.appendChild(cellSignature);
  212. table.appendChild(constitutionInfoRow);
  213. function getJudgmentResult(score, storeKey) {
  214. if (storeKey === 'Ping_Score') {
  215. if (score >= 17) {
  216. let is8 = true;
  217. let is10 = true;
  218. for (let e of fromConfigData[1].children) {
  219. if (tableData[e.groupKeys[0]] !== null && e !== 'Ping_Score') {
  220. var otherScore = tableData[e];
  221. if (otherScore > 8) {
  222. if (is8) {
  223. is8 = false;
  224. }
  225. if (otherScore > 10) {
  226. is10 = false;
  227. }
  228. }
  229. if (!is10) {
  230. break;
  231. }
  232. }
  233. }
  234. if (is8) {
  235. return '是';
  236. } else if (is10) {
  237. return '基本是';
  238. }
  239. }
  240. return '否';
  241. } else {
  242. if (score >= 11) {
  243. return '是';
  244. } else if (score === 9 || score === 10) {
  245. return '倾向是';
  246. } else {
  247. return '否';
  248. }
  249. }
  250. }
  251. </script>
  252. </body>
  253. </html>