From 3964129d1a6bc31d61a37e0cefdb86635c4eb60b Mon Sep 17 00:00:00 2001
From: lichuanyang <1176537920@qq.com>
Date: Fri, 16 Aug 2024 12:24:01 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=91=8A=E6=89=93=E5=8D=B0=E7=BB=9F?=
 =?UTF-8?q?=E8=AE=A1=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../reportPrintStatistics/index.vue           | 200 +++++++++++++++---
 1 file changed, 174 insertions(+), 26 deletions(-)

diff --git a/src/views/applyregistration/reportPrintStatistics/index.vue b/src/views/applyregistration/reportPrintStatistics/index.vue
index d28ac52f..c8f9987b 100644
--- a/src/views/applyregistration/reportPrintStatistics/index.vue
+++ b/src/views/applyregistration/reportPrintStatistics/index.vue
@@ -102,7 +102,7 @@
                   <el-button @click="handleQuery">
                     <Icon icon="ep:search" class="mr-2px" /> 搜索
                   </el-button>
-                  <el-button type="primary" plain>
+                  <el-button type="primary" plain v-if="false">
                     <Icon icon="ep:printer" class="mr-2px" /> 打印
                   </el-button>
                 </div>
@@ -116,7 +116,7 @@
             :stripe="true"
             :show-overflow-tooltip="true"
             :data="list_infos"
-            height="max(30vh,294px)"
+            height="max(calc(100vh - 460px),280px)"
             @row-click="handleRowClick"
           >
             <el-table-column type="index" label="序号" align="center" width="54px" />
@@ -318,19 +318,24 @@
             </el-form>
           </el-tab-pane>
           <el-tab-pane label="报告单" name="reportInfo">
-            <div class="flex-center" id="printMe" style="height: calc(100% - 15px)">
+            <div
+              class="flex-center"
+              id="printMe"
+              style="min-height: calc(100% - 15px)"
+              v-if="reportInfoType == 'us'"
+            >
               <div class="ultrasound-report" id="PDF">
                 <h2>超声检查报告单</h2>
                 <hr />
                 <div class="patient-info">
-                  <p class="info-item">姓名:{{ infoParams.pname }}</p>
-                  <p class="info-item">送检科室:{{ infoParams.billDoctorDepartment }}</p>
                   <p class="info-item">门诊号:{{ infoParams.regId }}</p>
+                  <p class="info-item">姓名:{{ infoParams.pname }}</p>
                   <p class="info-item">性别:{{ infoParams.gender }}</p>
-                  <p class="info-item">年龄:{{ age }}</p>
-                  <p class="info-item">设备:{{ infoParams.deviceName }}</p>
+                  <p class="info-item">年龄:{{ age }}岁</p>
                   <p class="info-item">检查号:{{ infoParams.examId }}</p>
                   <p class="info-item">检查类型:{{ infoParams.examItemName }}</p>
+                  <p class="info-item">设备:{{ infoParams.deviceName }}</p>
+                  <p class="info-item">送检科室:{{ infoParams.billDoctorDepartment }}</p>
                 </div>
                 <hr />
                 <h3>超声图像:</h3>
@@ -361,12 +366,99 @@
                   <p>{{ infoParams.diagResults }}</p>
                 </div>
                 <div style="position: absolute; bottom: 20px; right: 20px">
-                  <p>医生签名:{{}}</p>
-                  <!-- <p>时间:xxx</p> -->
+                  <p>医生签名:{{ infoParams.reviewDoctor }}</p>
+                </div>
+              </div>
+              <el-divider />
+              <div>
+                <el-button
+                  type="primary"
+                  style="width: 100px; float: right"
+                  class="ignore-print"
+                  v-print="'printMe'"
+                  >打印</el-button
+                >
+              </div>
+            </div>
+            <div
+              class="flex-center"
+              id="printMe"
+              style="min-height: calc(100% - 15px)"
+              v-if="reportInfoType == 'ct'"
+            >
+              <div class="ultrasound-report2" id="PDF">
+                <el-row style="font-size: 14px">
+                  <el-col :span="12">
+                    <h2 class="ml-6px">科右前旗康立寿医院</h2>
+                  </el-col>
+                  <el-col :span="12">
+                    <h2 style="text-align: right" class="mr-6px">CT检查报告单</h2>
+                  </el-col>
+                </el-row>
+                <hr />
+                <el-row style="font-size: 14px">
+                  <el-col :span="24" class="mb-8px">
+                    <div class="ml-6px">患者编号:</div>
+                    <div class="ml-6px">{{ infoParams.regId }}</div>
+                  </el-col>
+                  <el-col :span="24">
+                    <div class="ml-6px">检查编号:</div>
+                    <div class="ml-6px">{{ infoParams.examId }}</div>
+                  </el-col>
+                </el-row>
+                <hr />
+                <div class="patient-info2">
+                  <p class="info-item" v-if="false">门诊号:{{ infoParams.regId }}</p>
+                  <p class="info-item">姓名:{{ infoParams.pname }}</p>
+                  <p class="info-item">性别:{{ infoParams.gender }}</p>
+                  <p class="info-item">年龄:{{ age }}岁</p>
+                  <p class="info-item" v-if="false">检查号:{{ infoParams.examId }}</p>
+                  <p class="info-item" v-if="false">检查类型:{{ infoParams.examItemName }}</p>
+                  <p class="info-item">设备:{{ infoParams.deviceName }}</p>
+                  <p class="info-item">送检科室:{{ infoParams.billDoctorDepartment }}</p>
+                </div>
+                <hr />
+                <div class="ultrasound-findings">
+                  <h3>检查项目:</h3>
+                  <p>{{ infoParams.examItemName }}</p>
+                </div>
+                <div class="ultrasound-findings">
+                  <h3>影像学表现:</h3>
+                  <p>{{ infoParams.examDescription }}</p>
+                </div>
+                <div class="ultrasound-recommendation">
+                  <h3>影像学诊断:</h3>
+                  <p>{{ infoParams.diagResults }}</p>
+                </div>
+                <div style="width: 94%; position: absolute; bottom: 20px; right: 20px">
+                  <hr />
+                  <el-row style="font-size: 14px">
+                    <el-col :span="6" class="pl-6px">报告医师:{{ infoParams.diagDoctor }}</el-col>
+                    <el-col :span="6"
+                      >报告日期:{{
+                        formatDate(infoParams.diagDate as unknown as Date, 'YYYY-MM-DD')
+                      }}</el-col
+                    >
+                    <el-col :span="6">审核医师:{{ infoParams.reviewDoctor }}</el-col>
+                    <el-col :span="6"
+                      >审核日期:{{
+                        formatDate(infoParams.reviewDate as unknown as Date, 'YYYY-MM-DD')
+                      }}</el-col
+                    >
+                  </el-row>
+                  <div
+                    style="
+                      font-size: 11px;
+                      text-align: center;
+                      margin-top: 12px;
+                      margin-bottom: -14px;
+                    "
+                  >
+                    本报告只作临床参考,不作证明材料
+                  </div>
                 </div>
               </div>
               <el-divider />
-              <!--功能区-->
               <div>
                 <el-button
                   type="primary"
@@ -376,7 +468,6 @@
                   >打印</el-button
                 >
               </div>
-              <div> </div>
             </div>
           </el-tab-pane>
         </el-tabs>
@@ -387,7 +478,7 @@
 </template>
 
 <script setup lang="ts">
-import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
+import { formatDate, dateFormatter, dateFormatter2 } from '@/utils/formatTime'
 import download from '@/utils/download'
 import { ReportPrintStatisticsApi } from '@/api/applyregistration/reportPrintStatistics'
 import { ultrasoniccomApi } from '@/api/ultrasoniccom'
@@ -407,6 +498,7 @@ const infoFormRef = ref()
 const message = useMessage()
 const { t } = useI18n()
 const activeTabName = ref('diagnosisInfo')
+const reportInfoType = ref('') //us、ct
 const diagnosisInfo_readonly = ref(true)
 const deviceList = ref<any[]>([])
 const reportimages = ref<any[]>([])
@@ -427,7 +519,7 @@ const queryParams = ref({
   examDate_ge: '',
   examDate_le: '',
   deviceName: '',
-  deviceType: '', //固定默认值
+  deviceType: '',
   pname: ''
 })
 const infoParams0 = ref({
@@ -446,7 +538,12 @@ const infoParams = ref({
   examDescription: '',
   diagResults: '',
   examItemName: '',
-  deviceName: ''
+  deviceName: '',
+  deviceType: '',
+  diagDoctor: '',
+  diagDate: '',
+  reviewDoctor: '',
+  reviewDate: ''
 })
 //表格核心
 const list_infos = ref<any[]>([])
@@ -490,9 +587,15 @@ const resetDiagnosisInfo = async () => {
     examDescription: '',
     diagResults: '',
     examItemName: '',
-    deviceName: ''
+    deviceName: '',
+    deviceType: '',
+    diagDoctor: '',
+    diagDate: '',
+    reviewDoctor: '',
+    reviewDate: ''
   }
   age.value = ''
+  reportInfoType.value = ''
   reportimages.value = []
   infoFormRef.value?.clearValidate()
 }
@@ -521,7 +624,10 @@ const handleRowClick = (row) => {
   if (row) {
     infoParams.value = row
     calculateAge(row.birthday)
-    loadimage(row.orgId, row.regId)
+    if (row.deviceType && row.deviceType.trim().toLowerCase() == 'us') {
+      reportInfoType.value = 'us'
+      loadimage(row.orgId, row.regId)
+    } else reportInfoType.value = 'ct'
   }
 }
 
@@ -547,7 +653,7 @@ console.log(infoParams0)
  * **/
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
 .el-form-item__label {
   white-space: nowrap;
 }
@@ -568,40 +674,82 @@ console.log(infoParams0)
   border: 1px solid #ececec;
 }
 
-/* 报告样式 */
+/**** 超声检查报告单 ****/
 .ultrasound-report {
   font-family: Arial, sans-serif;
-  width: 90%;
-  margin: 20px auto;
+  width: 94%;
+  margin: 6px auto;
   padding: 20px;
   border: 1px solid #ccc;
   border-radius: 8px;
   position: relative;
-  height: 800px;
+  min-height: 750px;
 }
 
 .ultrasound-report h1,
 .ultrasound-report h2 {
   text-align: center;
 }
-/* 报告的P标签 */
+
 .patient-info {
   display: flex;
   flex-wrap: wrap;
 }
-.patient-info p,
+
+.patient-info p {
+  font-size: 14px;
+  margin: 4px 6px;
+  min-width: calc(25% - 2 * 6px - 2px);
+}
+
+.ultrasound-recommendation {
+  margin-bottom: 90px;
+}
+
 .ultrasound-findings p,
 .ultrasound-recommendation p {
-  margin: 5px 0;
+  font-size: 16px;
+  margin: 5px 2px 5px 30px;
 }
 
 .ultrasound-findings h3,
 .ultrasound-recommendation h3 {
-  margin-top: 20px;
+  margin-top: 30px;
 }
+
 .image-gallery {
   display: flex;
   justify-content: space-around;
-  margin: 20px 0;
+  margin: 10px 0;
+}
+
+/* 不打印区域 */
+@media print {
+  .ignore-print {
+    display: none;
+  }
+}
+
+/**** CT报告单 ****/
+.ultrasound-report2 {
+  font-family: Arial, sans-serif;
+  width: 94%;
+  margin: 6px auto;
+  padding: 20px;
+  border: 1px solid #ccc;
+  border-radius: 8px;
+  position: relative;
+  min-height: 750px;
+}
+
+.patient-info2 {
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.patient-info2 p {
+  font-size: 14px;
+  margin: 4px 6px;
+  min-width: calc(33.33% - 2 * 6px - 2px);
 }
 </style>