Browse Source

会诊的电子签名

xiaochan 3 months ago
parent
commit
ee79946b5c
1 changed files with 156 additions and 116 deletions
  1. 156 116
      src/components/hui-zhen-da-ying/PrintTheConsultationForm.vue

+ 156 - 116
src/components/hui-zhen-da-ying/PrintTheConsultationForm.vue

@@ -1,78 +1,92 @@
 <template>
-  <el-button @click="printClick"
-             v-if="props.showPrintButton">
-    打印
-  </el-button>
-  <div style="width: 595.275pt;  height: 841.89pt; font-size: 6.75pt;
-   border: 0.75pt solid" ref="divRef" id="会诊记录单">
-    <div style="margin-left: 20mm; ">
-      <h1 style="text-align: center; font-size: 22.5pt;  margin-bottom: 3.75pt">{{ SYSTEM_CONFIG.HOSPITAL_NAME }}</h1>
-      <h4 style="text-align: center; font-size: 12.75pt; margin-top: 0">会 诊 记 录 单</h4>
-      <table style="width: 100%;border-bottom: 0.75pt solid #000">
+  <el-button @click="printClick" v-if="props.showPrintButton"> 打印</el-button>
+  <div
+    style="
+      width: 595.275pt;
+      height: 841.89pt;
+      font-size: 6.75pt;
+      border: 0.75pt solid;
+    "
+    ref="divRef"
+    id="会诊记录单"
+  >
+    <div style="margin-left: 20mm">
+      <h1 style="text-align: center; font-size: 22.5pt; margin-bottom: 3.75pt">
+        {{ SYSTEM_CONFIG.HOSPITAL_NAME }}
+      </h1>
+      <h4 style="text-align: center; font-size: 12.75pt; margin-top: 0">
+        会 诊 记 录 单
+      </h4>
+      <table style="width: 100%; border-bottom: 0.75pt solid #000">
         <tr>
-          <td>
-            住院号:{{ huanZheXinXi.inpatientNo }}
-          </td>
-          <td>
-            姓名:{{ huanZheXinXi.name }}
-          </td>
-          <td>
-            性别:{{ cptSex(huanZheXinXi.sex) }}
-          </td>
-          <td>
-            年龄:{{ huanZheXinXi.age }}
-          </td>
-          <td>
-            科室:{{ huanZheXinXi.deptCodeName }}
-          </td>
-          <td>
-            床号:{{ huanZheXinXi.bedNo }}
-          </td>
+          <td>住院号:{{ huanZheXinXi.inpatientNo }}</td>
+          <td>姓名:{{ huanZheXinXi.name }}</td>
+          <td>性别:{{ cptSex(huanZheXinXi.sex) }}</td>
+          <td>年龄:{{ huanZheXinXi.age }}</td>
+          <td>科室:{{ huanZheXinXi.deptCodeName }}</td>
+          <td>床号:{{ huanZheXinXi.bedNo }}</td>
         </tr>
       </table>
-      <div style="height: 3.75pt"/>
-      <div style="width: 100%; height: 15pt;">
-        <div style="width: 375pt;height: 100%;float: left">
+      <div style="height: 3.75pt" />
+      <div style="width: 100%; height: 15pt">
+        <div style="width: 375pt; height: 100%; float: left">
           <table>
             <tr>
-              <td>
-                请
-              </td>
-              <td style="width: 115pt;border-bottom: 0.75pt solid #000; ">
+              <td>请</td>
+              <td style="width: 115pt; border-bottom: 0.75pt solid #000">
                 {{ huanZheXinXi.reqDept1Name }}
               </td>
-              <td>
-                会诊
-              </td>
+              <td>会诊</td>
             </tr>
           </table>
         </div>
 
-        <div style=" width: 120pt;float: right">
+        <div style="width: 120pt; float: right">
           会诊类别: {{ huanZheXinXi.hzLevelName }}
         </div>
       </div>
-      <div style="width: 100%;padding: 7.5pt 7.5pt 0 7.5pt">
+      <div style="width: 100%; padding: 7.5pt 7.5pt 0 7.5pt">
         病情简介
-        <textarea v-model="huanZheXinXi.reqComment"
-                  readonly="readonly"
-                  style="height: 115.5pt;
-                margin: 3.75pt 0 0;width:522.75pt;border: none;overflow: hidden;
-                resize:none;"/>
-        <br>
+        <textarea
+          v-model="huanZheXinXi.reqComment"
+          readonly="readonly"
+          style="
+            height: 115.5pt;
+            margin: 3.75pt 0 0;
+            width: 522.75pt;
+            border: none;
+            overflow: hidden;
+            resize: none;
+          "
+        />
+        <br />
         目前主要诊断
-        <textarea v-model="huanZheXinXi.hzZd"
-                  readonly="readonly"
-                  style="height: 37.5pt;
-                margin: 3.75pt 0 0;width: 522.75pt;border: none;overflow: hidden;
-                resize:none;"/>
-        <br>
+        <textarea
+          v-model="huanZheXinXi.hzZd"
+          readonly="readonly"
+          style="
+            height: 37.5pt;
+            margin: 3.75pt 0 0;
+            width: 522.75pt;
+            border: none;
+            overflow: hidden;
+            resize: none;
+          "
+        />
+        <br />
         会诊目的
-        <textarea v-model="huanZheXinXi.hzMd"
-                  readonly="readonly"
-                  style="height: 37.5pt;
-                margin: 3.75pt 0 0;width: 522.75pt;border: none;overflow: hidden;
-                resize:none;"/>
+        <textarea
+          v-model="huanZheXinXi.hzMd"
+          readonly="readonly"
+          style="
+            height: 37.5pt;
+            margin: 3.75pt 0 0;
+            width: 522.75pt;
+            border: none;
+            overflow: hidden;
+            resize: none;
+          "
+        />
         <div style="float: right">
           <table>
             <tr>
@@ -80,26 +94,32 @@
                 请求会诊科室:{{ huanZheXinXi.deptCodeName }}
               </td>
               <td style="width: 165pt">
-                会诊申请医师:{{ huanZheXinXi.reqDoctor }}
+                会诊申请医师:
+                <component :is="getDoctorImage(huanZheXinXi.inputId)" />
               </td>
             </tr>
             <tr>
-              <td style="width: 165pt">
-                申请时间:{{ huanZheXinXi.reqDate }}
-              </td>
+              <td style="width: 165pt">申请时间:{{ huanZheXinXi.reqDate }}</td>
             </tr>
           </table>
         </div>
         <div style="clear: both"></div>
-        <hr>
+        <hr />
         会诊意见
-        <textarea v-model="huanZheXinXi.hzComment"
-                  maxlength="1100"
-                  :readonly="laiYuan === 2"
-                  onkeydown="if(event.keyCode === 13)event.returnValue = false;"
-                  style="height: 246.75pt;
-                margin: 3.75pt 0 0;width: 522.75pt;border: none;overflow: hidden;
-                resize:none;"/>
+        <textarea
+          v-model="huanZheXinXi.hzComment"
+          maxlength="1100"
+          :readonly="laiYuan === 2"
+          onkeydown="if(event.keyCode === 13)event.returnValue = false;"
+          style="
+            height: 246.75pt;
+            margin: 3.75pt 0 0;
+            width: 522.75pt;
+            border: none;
+            overflow: hidden;
+            resize: none;
+          "
+        />
         <div style="float: right">
           <table>
             <tr>
@@ -107,13 +127,20 @@
                 会诊科室:{{ huanZheXinXi.reqDept1Name }}
               </td>
               <td style="width: 165pt">
-                医师:{{ props.laiYuan === 2 ? huanZheXinXi.hzDoctor2Name : userInfo.name }}
+                医师:
+                <component
+                  :is="
+                    getDoctorImage(
+                      props.laiYuan === 2
+                        ? huanZheXinXi.hzDoctor2
+                        : userInfo.code
+                    )
+                  "
+                />
               </td>
             </tr>
             <tr>
-              <td style="width: 165pt">
-                会诊时间:{{ huanZheXinXi.hzDate }}
-              </td>
+              <td style="width: 165pt">会诊时间:{{ huanZheXinXi.hzDate }}</td>
             </tr>
           </table>
         </div>
@@ -122,13 +149,13 @@
   </div>
 </template>
 
-<script setup>
-import {onMounted} from "vue";
-import {getLodop, initLodop} from "@/utils/c-lodop";
-import {cptSex} from "@/utils/computed";
-import {getServerDateApi} from "@/api/public-api";
-import {SYSTEM_CONFIG} from '@/utils/public'
-import {useUserStore} from "@/pinia/user-store";
+<script setup lang="tsx">
+import { onMounted } from "vue";
+import { getLodop, initLodop } from "@/utils/c-lodop";
+import { cptSex } from "@/utils/computed";
+import { getServerDateApi } from "@/api/public-api";
+import { SYSTEM_CONFIG } from "@/utils/public";
+import { useUserStore } from "@/pinia/user-store";
 
 const props = defineProps({
   laiYuan: {
@@ -137,73 +164,86 @@ const props = defineProps({
   },
   showPrintButton: {
     type: Boolean,
-    default: true
-  }
-})
+    default: true,
+  },
+});
 
-const userInfo = useUserStore().userInfo
+const userInfo = useUserStore().userInfo;
 
-const divRef = ref()
-const huanZheXinXi = ref({})
+const divRef = ref();
+const huanZheXinXi = ref({});
 
 async function shiJian() {
   if (props.laiYuan === 1) {
-    huanZheXinXi.value.hzDate = await getServerDateApi()
+    huanZheXinXi.value.hzDate = await getServerDateApi();
   }
 }
 
-const huiZhenXinXiXiangQing = async (val) => {
-  await shiJian()
-  huanZheXinXi.value = val
-}
+const huiZhenXinXiXiangQing = async val => {
+  await shiJian();
+  huanZheXinXi.value = val;
+};
 
 const printClick = async () => {
   if (props.laiYuan === 1) {
-    await shiJian()
+    await shiJian();
   }
-  const allTextArea = divRef.value.getElementsByTagName('textarea')
-  const textInput = divRef.value.getElementsByTagName('input')
+  const allTextArea = divRef.value.getElementsByTagName("textarea");
+  const textInput = divRef.value.getElementsByTagName("input");
   for (let i = 0; i < textInput.length; i++) {
-    textInput[i].setAttribute('value', textInput[i].value)
+    textInput[i].setAttribute("value", textInput[i].value);
   }
   for (let i = 0; i < allTextArea.length; i++) {
-    allTextArea[i].innerHTML = allTextArea[i].value
+    allTextArea[i].innerHTML = allTextArea[i].value;
   }
 
   let LODOP = getLodop();
-  const strFormHtml = '<body>' + divRef.value.innerHTML + '</body>'
-  LODOP.PRINT_INIT('会诊记录单') // 初始化打印机 名字
-  LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '') // 设置纸张大小  A4
-  LODOP.SET_PRINT_MODE('FULL_WIDTH_FOR_OVERFLOW', true) // 整宽不变形
-  LODOP.ADD_PRINT_HTM('2mm', '5mm', '100%', '100%', strFormHtml) //要打印的内容
-  LODOP.SET_PRINT_STYLE('ItemType', 3) //设置对象风格
-  LODOP.ADD_PRINT_TEXT('290mm', '190mm', '20mm', '2mm', '第#页/共&页') //增加纯文本项
-  LODOP.PREVIEW() // 关闭
-}
+  const strFormHtml = "<body>" + divRef.value.innerHTML + "</body>";
+  LODOP.PRINT_INIT("会诊记录单"); // 初始化打印机 名字
+  LODOP.SET_PRINT_PAGESIZE(1, "210mm", "297mm", ""); // 设置纸张大小  A4
+  LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW", true); // 整宽不变形
+  LODOP.ADD_PRINT_HTM("2mm", "5mm", "100%", "100%", strFormHtml); //要打印的内容
+  LODOP.SET_PRINT_STYLE("ItemType", 3); //设置对象风格
+  LODOP.ADD_PRINT_TEXT("290mm", "190mm", "20mm", "2mm", "第#页/共&页"); //增加纯文本项
+  LODOP.PREVIEW(); // 关闭
+};
 
-const populateTheComments = (val) => {
-  huanZheXinXi.value.hzComment = val
-}
+const populateTheComments = val => {
+  huanZheXinXi.value.hzComment = val;
+};
 
 const getPatientNo = () => {
-  return huanZheXinXi.value
-}
+  return huanZheXinXi.value;
+};
 
-const setHzStatusFlag = (val) => {
+const setHzStatusFlag = val => {
   huanZheXinXi.value.statusFlag = val;
-}
+};
+
+const getDoctorImage = (code: string) => {
+  if (code) {
+    return (
+      <img
+        src={`/doctorSignatureImage/${code}.png`}
+        alt={code}
+        style={{ width: "56px", height: "30px" }}
+      />
+    );
+  }
+  return null;
+};
 
 onMounted(() => {
-  initLodop()
-})
+  initLodop();
+});
 
 defineExpose({
   huiZhenXinXiXiangQing,
   printClick,
   populateTheComments,
   getPatientNo,
-  setHzStatusFlag
-})
+  setHzStatusFlag,
+});
 </script>
 
 <style lang="scss">