123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>个人基本信息表</title>
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <meta name="viewport" content="width=device-width,initial-scale=1.0" />
- <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
- <style>
- * {
- margin: 0;
- padding: 0;
- font-size: 12px;
- }
- table {
- border-collapse: collapse;
- margin: 10px auto;
- }
- th,
- tr,
- td {
- border: 1px solid #000;
- border-collapse: collapse;
- padding: 6px 5px;
- page-break-inside: avoid;
- }
- h3 {
- font-size: 24px;
- }
- thead {
- border: none;
- }
- thead tr {
- border: none;
- }
- thead tr th {
- border: none;
- border-collapse: separate;
- }
- .textAlign,
- th {
- text-align: center;
- }
- .textRight {
- display: flex;
- justify-content: flex-end;
- }
- h3 {
- font-size: 24px;
- }
- .boxPosition {
- display: inline-flex;
- float: inline-end;
- }
- .checkBox {
- display: flex;
- /* justify-content: end; */
- }
- .box {
- width: 16px;
- height: 16px;
- display: inline-block;
- border: 1px solid black;
- text-align: center;
- line-height: 16px;
- margin-right: 15px;
- position: relative;
- }
- .box:not(:last-child)::after {
- content: "/";
- position: absolute;
- top: 50%;
- left: 100%;
- transform: translateY(-50%);
- padding: 0 5px;
- }
- @page {
- margin-top: 1.4cm;
- /* 设置其他页的上边距为2cm */
- margin-bottom: 1.2cm;
- /* 设置其他页的下边距为2cm */
- }
- @page :first {
- margin-top: 0;
- margin-bottom: 10mm;
- /* 设置第一页的下边距为2cm */
- }
- input {
- border-bottom: 1px solid #000;
- border-top: 0px;
- border-left: 0px;
- border-right: 0px;
- outline: none;
- width: 80px;
- text-indent: 1em;
- color: #000;
- }
- .boxDiagnosisTime {
- width: 16px;
- height: 16px;
- display: inline-flex;
- border: 1px solid black;
- text-align: center;
- line-height: 16px;
- margin-right: 15px;
- position: relative;
- }
- .slash {
- display: inline;
- }
- </style>
- </head>
- <body>
- <div>
- <h3 class="textAlign" style="font-weight:bold;">老年人中医药健康管理服务记录表</h3>
- <p>
- <span style="font-weight: bold;">姓名:<span style="font-weight: bold;" id="patientName"></span></span>
- </p>
- <table>
- <tbody id="tableId">
- <tr>
- <td colspan="4">请根据近一年的体验和感觉,回答以下问题</td>
- <td>没有(根本不/从来没有)</td>
- <td>很少(有一点/偶尔)</td>
- <td>有时(有些/少数时间)</td>
- <td>经常(相当/多数时间)</td>
- <td>总是(非常/每天)</td>
- <td>结果</td>
- </tr>
- </tbody>
- </table>
- </div>
- <script>
- var fromConfigData = window.parent.fromConfig
- var tableData = window.parent.tableData[0];
- const table = document.getElementById('tableId');
- document.getElementById("patientName").innerHTML = tableData["PatientName"];
- fromConfigData[0].children.forEach(element => {
- const newRow = document.createElement('tr');
- const cellLabel = document.createElement('td');
- cellLabel.textContent = element.label;
- cellLabel.colSpan = 4;
- const cell1 = document.createElement('td');
- cell1.textContent = '1';
- const cell2 = document.createElement('td');
- cell2.textContent = '2';
- const cell3 = document.createElement('td');
- cell3.textContent = '3';
- const cell4 = document.createElement('td');
- cell4.textContent = '4';
- const cell5 = document.createElement('td');
- cell5.textContent = '5';
- const cellResult = document.createElement('td');
- cellResult.textContent = tableData[element.key];
- newRow.appendChild(cellLabel);
- newRow.appendChild(cell1);
- newRow.appendChild(cell2);
- newRow.appendChild(cell3);
- newRow.appendChild(cell4);
- newRow.appendChild(cell5);
- newRow.appendChild(cellResult);
- table.appendChild(newRow);
- });
- const constitutiontitleRow = document.createElement('tr');
- const constitutionResultRow = document.createElement('tr');
- const constitutionGuidanceRow = document.createElement('tr');
- const cellLabel = document.createElement('td');
- cellLabel.textContent = '体质类型';
- constitutiontitleRow.appendChild(cellLabel);
- const cellResult = document.createElement('td');
- cellResult.textContent = "体质辨识"
- constitutionResultRow.appendChild(cellResult);
- const cellGuidance = document.createElement('td');
- cellGuidance.textContent = "中医药保健指导"
- constitutionGuidanceRow.appendChild(cellGuidance);
- debugger
- fromConfigData[1].children.forEach(element => {
- const cell = document.createElement('td');
- cell.textContent = element.label;
- constitutiontitleRow.appendChild(cell);
- const cellScore = document.createElement('td');
- var score = tableData[element.groupKeys[0]];
- cellScore.innerHTML = "得分:" + score + "<br>" + getJudgmentResult(score, element.groupKeys[0]);
- constitutionResultRow.appendChild(cellScore);
- const cellGuidance1 = document.createElement('td');
- cellGuidance1.innerHTML = tableData[element.key] != undefined ? element.options.map(function (o) {
- if (tableData[element.key].includes(o.value))
- return o.value + "." + o.label;
- }).filter(Boolean).join("<br>") : '';
- constitutionGuidanceRow.appendChild(cellGuidance1);
- });
- table.appendChild(constitutiontitleRow);
- table.appendChild(constitutionResultRow);
- table.appendChild(constitutionGuidanceRow);
- const constitutionInfoRow = document.createElement('tr');
- const cellDateTimeLabel = document.createElement('td');
- cellDateTimeLabel.textContent = "填表日期";
- cellDateTimeLabel.colSpan = 2;
- constitutionInfoRow.appendChild(cellDateTimeLabel);
- const cellDateTime = document.createElement('td');
- cellDateTime.textContent = tableData['Follow_Time'];
- cellDateTime.colSpan = 3;
- constitutionInfoRow.appendChild(cellDateTime);
- const cellSignatureLabel = document.createElement('td');
- cellSignatureLabel.textContent = "医生签名";
- cellSignatureLabel.colSpan = 2;
- constitutionInfoRow.appendChild(cellSignatureLabel);
- const cellSignature = document.createElement('td');
- cellSignature.textContent = "";
- cellSignature.colSpan = 3;
- constitutionInfoRow.appendChild(cellSignature);
- table.appendChild(constitutionInfoRow);
- function getJudgmentResult(score, storeKey) {
- if (storeKey === 'Ping_Score') {
- if (score >= 17) {
- let is8 = true;
- let is10 = true;
- for (let e of fromConfigData[1].children) {
- if (tableData[e.groupKeys[0]] !== null && e !== 'Ping_Score') {
- var otherScore = tableData[e];
- if (otherScore > 8) {
- if (is8) {
- is8 = false;
- }
- if (otherScore > 10) {
- is10 = false;
- }
- }
- if (!is10) {
- break;
- }
- }
- }
- if (is8) {
- return '是';
- } else if (is10) {
- return '基本是';
- }
- }
- return '否';
- } else {
- if (score >= 11) {
- return '是';
- } else if (score === 9 || score === 10) {
- return '倾向是';
- } else {
- return '否';
- }
- }
- }
- </script>
- </body>
- </html>
|