Преглед изворни кода

老年人中医药健康管理服务记录表

finlay пре 1 година
родитељ
комит
1fee8d65dc

+ 1 - 1
public/config.js

@@ -5,6 +5,6 @@
 exports.AppConfig = {
     //标题
     APP_NAME: "家医健康系统",
-    API_URL: "http://127.0.0.1:8400",
+    API_URL: "http://192.168.6.80:8400",
     APP_Port: "8408"
 }

+ 286 - 0
public/traditionalChineseMedicineHealthTable.html

@@ -0,0 +1,286 @@
+<!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>

+ 52 - 0
src/views/followUp/components/medicineHealthTable.vue

@@ -0,0 +1,52 @@
+
+<template>
+    <div>
+      <!-- 在这里显示HTML文件的内容 -->
+      <iframe
+        id="exam"
+        src="traditionalChineseMedicineHealthTable.html"
+        style="height: 70vh; width: 100%"
+        v-loading="loading"
+      ></iframe>
+    </div>
+  </template>
+  
+  <script>
+  import html2canvas from "html2canvas";
+  import jsPDF from "jspdf";
+  export default {
+    mounted() {},
+    data() {
+      return {
+        loading: true,
+        doc: null,
+        iframeContent: null,
+      };
+    },
+    created() {
+      this.initData();
+    },
+    props: {
+      patientInfo: Object,
+    },
+    methods: {
+      async initData() {
+        this.loading = false;
+      },
+  
+      // 导出pdf
+      handleExport() {
+        let el = document.getElementById("exam");
+        console.log("%c Line:168 🥓 el", "color:#93c0a4", el);
+        const iframeDocument = el.contentWindow;
+        //   var divp = document.getElementById("printdiv").innerHTML;
+        iframeDocument.print();
+      },
+    },
+  };
+  </script>
+  
+  <style >
+  </style>
+  
+  

+ 41 - 4
src/views/followUp/components/personalFollowUpRecord.vue

@@ -60,7 +60,7 @@
             align="center"
             width="200"
           ></el-table-column>
-          <el-table-column label="操作" width="150" align="center">
+          <el-table-column label="操作" width="180" align="center">
             <template #default="props">
               <div>
                 <el-button
@@ -149,6 +149,12 @@
             ref="childRef"
             v-if="patientInfo.key == 'TNB'"
           ></diabetesTable>
+          <medicineHealthTable
+            :patientInfo="patientInfo"
+            ref="childRef"
+            v-if="patientInfo.key == 'LNRZYYJKGLFWJL'"
+          >
+          </medicineHealthTable>
           <template #footer>
             <div>
               <el-button @click="openTableDialogVisible = false"
@@ -184,11 +190,16 @@ import configurationTitle from "@/views/components/configurationTitle.vue";
 import elderlyServiceRecordForm from "./elderlyServiceRecordForm.vue";
 import highBloodPressureTable from "@/views/healthCheck/components/highBloodPressureTable.vue";
 import diabetesTable from "@/views/healthCheck/components/diabetesTable.vue";
+import medicineHealthTable from "@/views/followUp/components/medicineHealthTable.vue";
 
-import { GetLastOneTemplateByKeyRequest } from "@/jsonrpc/services/template.m";
+import {
+  GetLastOneTemplateByKeyRequest,
+  GetTemplateRequest,
+} from "@/jsonrpc/services/template.m";
 import { GetFollowUpRecordListByYearRequest } from "@/jsonrpc/services/followUp.m";
 
 import { followUpKeyValue } from "../js/data.js";
+import medicineHealthTableVue from "./medicineHealthTable.vue";
 
 export default {
   components: {
@@ -197,6 +208,7 @@ export default {
     elderlyServiceRecordForm,
     highBloodPressureTable,
     diabetesTable,
+    medicineHealthTable,
   },
   props: {
     patientInfo: Object,
@@ -248,7 +260,7 @@ export default {
         key: this.patientInfo.key,
       }).toJson();
       var result = await this.$rpc.followUp.getFollowUpPageByKeyAsync(request);
-      debugger;
+      // debugger;
       this.total = result.dataCount;
       var index = (this.currentPage - 1) * this.pageSize + 1;
       this.tableData = result.pageData.map((item) => {
@@ -300,6 +312,7 @@ export default {
         tableData.push(
           Object.assign(
             {
+              PatientName: this.patientInfo.patientName,
               Follow_Time: moment(item.followUpTime).format("YYYY年MM月DD日"),
               Follow_Type: item.followUpMode + 1,
               Next_Follow_Up_Time: moment(item.nextFollowUpTime).format(
@@ -311,10 +324,35 @@ export default {
         );
       });
       window.tableData = tableData;
+      var fromConfig = await this.getTemplateDetail();
+      window.fromConfig = fromConfig;
       console.log("%c Line:303 🍇 tableData", "color:#465975", tableData);
       this.openTableDialogVisible = true;
     },
+    ///获取模板详情
+    async getTemplateDetail() {
+      if (this.configTemplateCode == "") {
+        await this.getLastOneTemplateByKey(this.patientInfo.key);
+      }
+      const getTemplateRequest = new GetTemplateRequest({
+        code: this.configTemplateCode,
+        token: store.state.userInfo.token,
+      }).toJson();
+      const result = await this.$rpc.template.getTemplateDetailAsync(
+        getTemplateRequest
+      );
+      console.log("%c Line:653 🍌 result", "color:#ed9ec7", result);
 
+      var tempData = JSON.parse(result.templateContent);
+      tempData.forEach((element) => {
+        element.children.forEach((e) => {
+          if (e.options.length == 0) {
+            e.options = element.options;
+          }
+        });
+      });
+      return tempData;
+    },
     async showfollowUpRecord(row) {
       console.log("%c Line:317 🌮 row", "color:#ea7e5c", row);
       console.log(
@@ -344,7 +382,6 @@ export default {
       );
       result.examData = result.followUpData;
       this.checkInfo = result;
-      debugger;
       if (this.checkInfo.key == "LNRZYYJKGLFWJL") {
         this.showDialogVisible = true;
       } else {