ソースを参照

检验检查类别扩充

lighter 1 年間 前
コミット
a9f178898d
2 ファイル変更394 行追加205 行削除
  1. 16 0
      src/api/inspections/index.js
  2. 378 205
      src/views/examination/InspectionReportIndex.vue

+ 16 - 0
src/api/inspections/index.js

@@ -1,5 +1,13 @@
 import request from '../../utils/request'
 
+export function checkIndexByCategory(data) {
+  return request({
+    url: '/inspections/checkIndexByCategory',
+    method: 'post',
+    data,
+  })
+}
+
 export function checkExamIndex(data) {
   return request({
     url: '/inspections/checkExamIndex',
@@ -16,6 +24,14 @@ export function checkExamDetail(data) {
   })
 }
 
+export function checkTestDetail(data) {
+  return request({
+    url: '/inspections/checkTestDetail',
+    method: 'post',
+    data,
+  })
+}
+
 export function adiconLogin() {
   return request({
     url: '/adicon/login',

+ 378 - 205
src/views/examination/InspectionReportIndex.vue

@@ -1,10 +1,37 @@
 <template>
   <div class="layout_container">
     <header class="round-header">
-      <el-select v-model="patType" style="width: 100px">
-        <el-option v-for="item in types" :key="item.code" :value="item.code" :label="item.name"></el-option>
+      <el-select
+          v-model="reportCategory"
+          @change="onCategoryChange"
+          style="width: 100px" >
+        <el-option-group
+            v-for="group in reportTypes"
+            :key="group.label"
+            :label="group.label"
+        >
+          <el-option
+              v-for="item in group.options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+          ></el-option>
+        </el-option-group>
+      </el-select>
+      <el-select v-model="patType" style="width: 80px">
+        <el-option
+            v-for="item in patientTypes"
+            :key="item.code"
+            :value="item.code"
+            :label="item.name"
+        ></el-option>
       </el-select>
-      <el-input v-model="patNo" style="width: 170px" clearable :placeholder="placeHolder"></el-input>
+      <el-input
+          v-model="patNo"
+          clearable
+          :placeholder="placeHolder"
+          style="width: 120px"
+      ></el-input>
       <el-date-picker
           v-model="datePeriod"
           type="daterange"
@@ -14,201 +41,261 @@
           :shortcuts="shortcuts"
           style="width: 260px"
       ></el-date-picker>
-      <el-button type="primary" icon="Search" style="margin-left: 20px" @click="queryIndex">查询</el-button>
-      <el-button type="primary" icon="Printer" @click="doPrint">打印</el-button>
+      <el-button
+          type="primary"
+          icon="Search"
+          @click="queryIndex"
+          :disabled="inPrintProcess"
+          style="margin-left: 20px"
+      >
+        查询
+      </el-button>
+      <el-button
+          type="primary"
+          icon="Printer"
+          :disabled="inPrintProcess"
+          @click="beforePrint"
+          v-if="reportCategory === 'JY'"
+      >
+        打印
+      </el-button>
     </header>
     <div class="layout_main layout_container layout-horizontal">
       <aside class="layout_el-table">
         <el-table
+            ref="tableRef"
             :data="inspectionIndex"
             stripe highlight-current-row
-            @row-click="queryDetail"
+            @row-click="beforeQueryDetail"
         >
+          <el-table-column type="selection" width="30"></el-table-column>
           <el-table-column prop="trscDate" label="报告时间" width="130"></el-table-column>
           <el-table-column prop="examPurpose" label="检验名称" width="170"></el-table-column>
-          <el-table-column prop="reportType" label="报告类别" width="70"></el-table-column>
+          <el-table-column v-if="reportCategory === 'JY'" prop="reportType" label="报告类别" width="70"></el-table-column>
         </el-table>
       </aside>
       <div id="reportDetail" class="layout_main"
-           style="position: relative; width: 90%; height: max-content; min-height: 96%; padding: 0 30px; background-color: white">
-        <h3 style="width: 100%; text-align: center; font-weight: bold; height: 30px; line-height: 30px">
-          长沙泰和医院检查报告单</h3>
-        <div style="display: flex">
-          <div style="width: 25%">姓名:{{ inspectionDetail.order.ptntName }}</div>
-          <div style="width: 25%">性别:{{ filterSex(inspectionDetail.order.ptntSex) }}</div>
-          <div style="width: 25%">
-            年龄:{{ inspectionDetail.order.ptntAge }}
-            {{ filterAgeUnit(inspectionDetail.order.ptntAgeUnit) }}
-          </div>
-          <div style="width: 25%">
-            {{ ptntType }}:
-            {{ inspectionDetail.order.ptntNo }}
-          </div>
-        </div>
-        <div style="display: flex">
-          <div style="width: 25%">科室:{{ inspectionDetail.order.deptName }}</div>
-          <div style="width: 25%">床号:{{ inspectionDetail.order.ptntBedNo }}</div>
-          <div style="width: 25%">标本类型:{{ inspectionDetail.order.smplName }}</div>
-          <div style="width: 25%">
-            <div>申请项目:{{ inspectionDetail.order.aplyCntn.substring(0, 13) }}</div>
-            <div>{{ inspectionDetail.order.aplyCntn.substring(13) }}</div>
-          </div>
-        </div>
-        <div style="margin: 5px 0; border-top: 1px solid gray"></div>
-        <div v-if="reportType === '普通' || reportType === '外送'" >
-          <div style="display: inline-block; width: 49.7%; vertical-align: top">
-            <div style="display: flex">
-              <div style="width: 25%">检验项目</div>
-              <div style="width: 16.66%">结果</div>
-              <div style="width: 16.66%">单位</div>
-              <div style="width: 16.66%">说明</div>
-              <div style="width: 25%">参考值</div>
-            </div>
-            <div style="margin: 5px 0; border-top: 1px solid gray"></div>
-            <div v-for="(item, index) in inspectionDetail.items.slice(0, halfSize)"
-                 :key="index"
-                 style="display: flex">
-              <div style="width: 25%">
-                <div>{{ item.itmName.substring(0, 6) }}</div>
-                <div>{{ item.itmName.substring(6) }}</div>
-              </div>
-              <div style="width: 16.66%">
-                <div>{{ item.itmValue.substring(0, 6) }}</div>
-                <div>{{ item.itmValue.substring(6) }}</div>
-                <div>{{ item.itmStrValue.substring(0, 6) }}</div>
-                <div>{{ item.itmStrValue.substring(6) }}</div>
-              </div>
-              <div style="width: 16.66%">{{ item.itmUnit }}</div>
-              <div style="width: 16.66%">
-                <span v-html="getItemAlert(item.itmAlert, item.itmStrValue, item.itmValue)"></span>
-              </div>
-              <div style="width: 25%">{{ item.range }}</div>
-            </div>
-          </div>
-          <div style="display: inline-block; width: 49.7%; vertical-align: top">
-            <div style="display: flex">
-              <div style="width: 25%">检验项目</div>
-              <div style="width: 16.66%">结果</div>
-              <div style="width: 16.66%">单位</div>
-              <div style="width: 16.66%">说明</div>
-              <div style="width: 25%">参考值</div>
+           style="position: relative; width: 90%;
+           min-height: 96%; padding: 0 30px;
+           background-color: white; overflow-y: auto">
+        <div v-if="reportCategory === 'JY'">
+          <h3 style="width: 100%; text-align: center; font-weight: bold; height: 30px; line-height: 30px">
+            长沙泰和医院检验报告单</h3>
+          <div style="display: flex">
+            <div style="width: 25%">姓名:{{ inspectionDetail.order.ptntName }}</div>
+            <div style="width: 25%">性别:{{ filterSex(inspectionDetail.order.ptntSex) }}</div>
+            <div style="width: 25%">
+              年龄:{{ inspectionDetail.order.ptntAge }}
+              {{ filterAgeUnit(inspectionDetail.order.ptntAgeUnit) }}
             </div>
-            <div style="margin: 5px 0; border-top: 1px solid gray"></div>
-            <div v-for="(item, index) in inspectionDetail.items.slice(halfSize)" :key="index"
-                 style="display: flex">
-              <div style="width: 25%">
-                <div>{{ item.itmName.substring(0, 6) }}</div>
-                <div>{{ item.itmName.substring(6) }}</div>
-              </div>
-              <div style="width: 16.66%">
-                <div>{{ item.itmValue.substring(0, 6) }}</div>
-                <div>{{ item.itmValue.substring(6) }}</div>
-                <div>{{ item.itmStrValue.substring(0, 6) }}</div>
-                <div>{{ item.itmStrValue.substring(6) }}</div>
-              </div>
-              <div style="width: 16.66%">{{ item.itmUnit }}</div>
-              <div style="width: 16.66%">
-                <span v-html="getItemAlert(item.itmAlert, item.itmStrValue, item.itmValue)"></span>
-              </div>
-              <div style="width: 25%">{{ item.range }}</div>
+            <div style="width: 25%">
+              {{ ptntType }}:
+              {{ inspectionDetail.order.ptntNo }}
             </div>
           </div>
-        </div>
-        <div v-if="reportType === '细菌'">
           <div style="display: flex">
-            <div style="width: 25%">检验项目</div>
-            <div style="width: 75%">结果</div>
+            <div style="width: 25%">科室:{{ inspectionDetail.order.deptName }}</div>
+            <div style="width: 25%">床号:{{ inspectionDetail.order.ptntBedNo }}</div>
+            <div style="width: 25%">标本类型:{{ inspectionDetail.order.smplName }}</div>
+            <div style="width: 25%">
+              <div>申请项目:{{ inspectionDetail.order.aplyCntn.substring(0, 13) }}</div>
+              <div>{{ inspectionDetail.order.aplyCntn.substring(13) }}</div>
+            </div>
           </div>
           <div style="margin: 5px 0; border-top: 1px solid gray"></div>
-          <div style="margin: 0 30px; padding-bottom: 5px;" v-if="bacterias.length > 0"
-               v-for="(antibioticItem,index) in bacterias"
-               :style="index > 0 ? {borderTop: '1px dashed gray'} : {}">
-            <div style="display: flex;width: 49.7%;margin: 8px 0 4px 0">
-              <div style="width: 33.33%">{{ antibioticItem.type }}</div>
-              <div style="width: 60%">{{ antibioticItem.germName }}</div>
-            </div>
+          <div v-if="reportType === '普通' || reportType === '外送'" >
             <div style="display: inline-block; width: 49.7%; vertical-align: top">
               <div style="display: flex">
-                <div style="width: 33.33%">抗菌药物</div>
-                <div style="width: 33.33%">抗菌药物编码</div>
-                <div style="width: 16.66%">MIC值</div>
-                <div style="width: 16.66%">敏感性</div>
+                <div style="width: 25%">检验项目</div>
+                <div style="width: 16.66%">结果</div>
+                <div style="width: 16.66%">单位</div>
+                <div style="width: 16.66%">说明</div>
+                <div style="width: 25%">参考值</div>
               </div>
               <div style="margin: 5px 0; border-top: 1px solid gray"></div>
-              <div style="display: flex"
-                   v-for="(bac, index) in antibioticItem.antiList.slice(0, antibioticItem.halfBacSize)"
-                   :key="index">
-                <div style="width: 33.33%">
-                  <div>{{ bac.antiNameCn.substring(0, 6) }}</div>
-                  <div>{{ bac.antiNameCn.substring(6) }}</div>
+              <div v-for="(item, index) in inspectionDetail.items.slice(0, halfSize)"
+                   :key="index"
+                   style="display: flex">
+                <div style="width: 25%">
+                  <div>{{ item.itmName.substring(0, 6) }}</div>
+                  <div>{{ item.itmName.substring(6) }}</div>
+                </div>
+                <div style="width: 16.66%">
+                  <div>{{ item.itmValue.substring(0, 6) }}</div>
+                  <div>{{ item.itmValue.substring(6) }}</div>
+                  <div>{{ item.itmStrValue.substring(0, 6) }}</div>
+                  <div>{{ item.itmStrValue.substring(6) }}</div>
                 </div>
-                <div style="width: 33.33%">{{ bac.antiAbb }}</div>
-                <div style="width: 16.66%">{{ bac.antiMic }}</div>
-                <div style="width: 16.66%">{{ bac.antiValue }}</div>
+                <div style="width: 16.66%">{{ item.itmUnit }}</div>
+                <div style="width: 16.66%">
+                  <span v-html="getItemAlert(item.itmAlert, item.itmStrValue, item.itmValue)"></span>
+                </div>
+                <div style="width: 25%">{{ item.range }}</div>
               </div>
             </div>
-            <div style="display: inline-block; width: 47%; vertical-align: top">
+            <div style="display: inline-block; width: 49.7%; vertical-align: top">
               <div style="display: flex">
-                <div style="width: 33.33%">抗菌药物</div>
-                <div style="width: 33.33%">抗菌药物编码</div>
-                <div style="width: 16.66%">MIC值</div>
-                <div style="width: 16.66%">敏感性</div>
+                <div style="width: 25%">检验项目</div>
+                <div style="width: 16.66%">结果</div>
+                <div style="width: 16.66%">单位</div>
+                <div style="width: 16.66%">说明</div>
+                <div style="width: 25%">参考值</div>
               </div>
               <div style="margin: 5px 0; border-top: 1px solid gray"></div>
-              <div style="display: flex"
-                   v-for="(bac, index) in antibioticItem.antiList.slice(antibioticItem.halfBacSize)"
-                   :key="index">
-                <div style="width: 33.33%">
-                  <div>{{ bac.antiNameCn.substring(0, 6) }}</div>
-                  <div>{{ bac.antiNameCn.substring(6) }}</div>
+              <div v-for="(item, index) in inspectionDetail.items.slice(halfSize)" :key="index"
+                   style="display: flex">
+                <div style="width: 25%">
+                  <div>{{ item.itmName.substring(0, 6) }}</div>
+                  <div>{{ item.itmName.substring(6) }}</div>
                 </div>
-                <div style="width: 33.33%">{{ bac.antiAbb }}</div>
-                <div style="width: 16.66%">{{ bac.antiMic }}</div>
-                <div style="width: 16.66%">{{ bac.antiValue }}</div>
+                <div style="width: 16.66%">
+                  <div>{{ item.itmValue.substring(0, 6) }}</div>
+                  <div>{{ item.itmValue.substring(6) }}</div>
+                  <div>{{ item.itmStrValue.substring(0, 6) }}</div>
+                  <div>{{ item.itmStrValue.substring(6) }}</div>
+                </div>
+                <div style="width: 16.66%">{{ item.itmUnit }}</div>
+                <div style="width: 16.66%">
+                  <span v-html="getItemAlert(item.itmAlert, item.itmStrValue, item.itmValue)"></span>
+                </div>
+                <div style="width: 25%">{{ item.range }}</div>
               </div>
             </div>
           </div>
-          <div v-else>
-            <div v-for="item in inspectionDetail.items" style="display: flex">
-              <div style="width: 25%">{{ item.itmName }}</div>
-              <div style="width: 75%">{{ item.itmStrValue }}</div>
+          <div v-if="reportType === '细菌'">
+            <div style="display: flex">
+              <div style="width: 25%">检验项目</div>
+              <div style="width: 75%">结果</div>
+            </div>
+            <div style="margin: 5px 0; border-top: 1px solid gray"></div>
+            <div style="margin: 0 30px; padding-bottom: 5px;" v-if="bacterias.length > 0"
+                 v-for="(antibioticItem,index) in bacterias"
+                 :style="index > 0 ? {borderTop: '1px dashed gray'} : {}">
+              <div style="display: flex;width: 49.7%;margin: 8px 0 4px 0">
+                <div style="width: 33.33%">{{ antibioticItem.type }}</div>
+                <div style="width: 60%">{{ antibioticItem.germName }}</div>
+              </div>
+              <div style="display: inline-block; width: 49.7%; vertical-align: top">
+                <div style="display: flex">
+                  <div style="width: 33.33%">抗菌药物</div>
+                  <div style="width: 33.33%">抗菌药物编码</div>
+                  <div style="width: 16.66%">MIC值</div>
+                  <div style="width: 16.66%">敏感性</div>
+                </div>
+                <div style="margin: 5px 0; border-top: 1px solid gray"></div>
+                <div style="display: flex"
+                     v-for="(bac, index) in antibioticItem.antiList.slice(0, antibioticItem.halfBacSize)"
+                     :key="index">
+                  <div style="width: 33.33%">
+                    <div>{{ bac.antiNameCn.substring(0, 6) }}</div>
+                    <div>{{ bac.antiNameCn.substring(6) }}</div>
+                  </div>
+                  <div style="width: 33.33%">{{ bac.antiAbb }}</div>
+                  <div style="width: 16.66%">{{ bac.antiMic }}</div>
+                  <div style="width: 16.66%">{{ bac.antiValue }}</div>
+                </div>
+              </div>
+              <div style="display: inline-block; width: 47%; vertical-align: top">
+                <div style="display: flex">
+                  <div style="width: 33.33%">抗菌药物</div>
+                  <div style="width: 33.33%">抗菌药物编码</div>
+                  <div style="width: 16.66%">MIC值</div>
+                  <div style="width: 16.66%">敏感性</div>
+                </div>
+                <div style="margin: 5px 0; border-top: 1px solid gray"></div>
+                <div style="display: flex"
+                     v-for="(bac, index) in antibioticItem.antiList.slice(antibioticItem.halfBacSize)"
+                     :key="index">
+                  <div style="width: 33.33%">
+                    <div>{{ bac.antiNameCn.substring(0, 6) }}</div>
+                    <div>{{ bac.antiNameCn.substring(6) }}</div>
+                  </div>
+                  <div style="width: 33.33%">{{ bac.antiAbb }}</div>
+                  <div style="width: 16.66%">{{ bac.antiMic }}</div>
+                  <div style="width: 16.66%">{{ bac.antiValue }}</div>
+                </div>
+              </div>
+            </div>
+            <div v-else>
+              <div v-for="item in inspectionDetail.items" style="display: flex">
+                <div style="width: 25%">{{ item.itmName }}</div>
+                <div style="width: 75%">{{ item.itmStrValue }}</div>
+              </div>
             </div>
           </div>
-        </div>
-        <div style="position: absolute; bottom: 0; left: 0; right: 0">
-          <div style="margin: 5px 0; border-top: 1px solid gray"></div>
-          <div style="display: flex">
-            <div style="width: 33.33%">接收时间:{{ inspectionDetail.order.aplyDate }}</div>
-            <div style="width: 33.33%">
-              检验时间:{{inspectionDetail.order.ordrCreateDate }}
+          <div style="position: absolute; bottom: 0; left: 0; right: 0">
+            <div style="margin: 5px 0; border-top: 1px solid gray"></div>
+            <div style="display: flex">
+              <div style="width: 33.33%">接收时间:{{ inspectionDetail.order.aplyDate }}</div>
+              <div style="width: 33.33%">
+                检验时间:{{inspectionDetail.order.ordrCreateDate }}
+              </div>
+              <div style="width: 33.33%">报告时间:{{ inspectionDetail.order.audtTime }}</div>
+            </div>
+            <div style="display: flex">
+              <div style="width: 33.33%">送检医生:{{ inspectionDetail.order.testUsrName }}</div>
+              <div style="width: 33.33%">检验人:{{ inspectionDetail.order.ordrUsrName }}</div>
+              <div style="width: 33.33%">审核人:{{ inspectionDetail.order.audtUsrName }}</div>
+            </div>
+            <div style="margin: 5px 0; border-top: 1px solid gray"></div>
+            <div style="width: 100%; text-align: center; font-weight: bold; height: 30px; font-size: 12px">
+              ***此结果仅对所检测的标本负责***
+              <span style="margin-left: 10px; font-size: 12px">备注:升高(↑),降低(↓),阳性(+),阴性(-)</span>
             </div>
-            <div style="width: 33.33%">报告时间:{{ inspectionDetail.order.audtTime }}</div>
           </div>
-          <div style="display: flex">
-            <div style="width: 33.33%">送检医生:{{ inspectionDetail.order.testUsrName }}</div>
-            <div style="width: 33.33%">检验人:{{ inspectionDetail.order.ordrUsrName }}</div>
-            <div style="width: 33.33%">审核人:{{ inspectionDetail.order.audtUsrName }}</div>
+        </div>
+        <div v-if="reportCategory === 'JC'">
+          <div v-if="jcbg.reportUrl">
+            <el-image :src="jcbg.reportUrl"></el-image>
           </div>
-          <div style="margin: 5px 0; border-top: 1px solid gray"></div>
-          <div style="width: 100%; text-align: center; font-weight: bold; height: 30px; font-size: 12px">
-            ***此结果仅对所检测的标本负责***
-            <span style="margin-left: 10px; font-size: 12px">备注:升高(↑),降低(↓),阳性(+),阴性(-)</span>
+          <div v-else>
+            <h3 style="width: 100%; text-align: center; font-weight: bold; height: 30px; line-height: 30px">
+              长沙泰和医院检查报告单
+            </h3>
+            <div style="display: flex">
+              <div style="width: 32%">姓名:{{ jcbg.patientName }}</div>
+              <div style="width: 32%">
+                {{ ptntType }}:
+                {{ jcbg.patNo }}
+              </div>
+              <div style="width: 32%">
+                <div>申请项目:{{ jcbg.examPurpose.substring(0, 13) }}</div>
+                <div>{{ jcbg.examPurpose.substring(13) }}</div>
+              </div>
+            </div>
+            <div style="display: flex">
+              <div style="width: 32%">医生姓名:{{ jcbg.doctorName }}</div>
+              <div style="width: 32%">检查时间:{{ jcbg.reportTime }}</div>
+              <div style="width: 32%">报告时间:{{ jcbg.trscDate }}</div>
+            </div>
+            <el-divider content-position="left">检查所见</el-divider>
+            <div v-html="jcbg.examinationSee"></div>
+            <el-divider content-position="left">检查结论</el-divider>
+            <div v-html="jcbg.examinationreSult"></div>
+            <div v-if="jcbg.reportUrl" style="margin-top: 30px">
+              <el-button type="primary" size="large" link @click="showJcImage">查看图像</el-button>
+            </div>
           </div>
+
+        </div>
+        <div v-if="reportCategory === 'BL' || reportCategory === 'XD'" >
+          <el-image :src="blxdUrl" style="width: 100%" fit="contain" />
         </div>
       </div>
     </div>
   </div>
-
 </template>
 
 <script setup lang="ts">
 import {computed, onActivated, reactive, ref, onMounted} from 'vue'
 import {shortcuts} from '@/data/shortcuts'
-import {checkExamDetail, checkExamIndex} from '@/api/inspections'
+import {checkExamDetail, checkIndexByCategory, checkTestDetail} from '@/api/inspections'
 import router from '@/router'
 import {ElMessage} from 'element-plus'
 import {initLodop, getLodop} from '@/utils/c-lodop'
 import {getDateRangeFormatDate} from "@/utils/date";
+import Sleep from "@/utils/sleep";
+import {CyMessageBox} from "@/components/cy/message-box";
 
 const props = defineProps({
   patNo: {
@@ -222,9 +309,9 @@ const props = defineProps({
     type: String
   }
 })
-
+const tableRef = ref(null)
 const patType = ref('InPatient')
-const types = initTypes()
+const reportCategory = ref('JY')
 const patNo = ref(null)
 const datePeriod = ref([])
 const placeHolder = computed(() => {
@@ -248,26 +335,9 @@ const inspectionDetail = reactive({
 })
 const halfSize = ref(0)
 
-onMounted(() => {
-  if (props.patNo && props.start && props.end) {
-    patType.value = 'InPatient'
-    patNo.value = props.patNo
-    datePeriod.value[0] = props.start
-    datePeriod.value[1] = props.end
-    queryIndex()
-  }
-})
-
-onActivated(() => {
-  const params = router.currentRoute.value.params
-  if (params.patNo && params.start && params.end) {
-    patType.value = 'InPatient'
-    patNo.value = params.patNo
-    datePeriod.value[0] = params.start
-    datePeriod.value[1] = params.end
-    queryIndex()
-  }
-})
+function onCategoryChange(val) {
+  inspectionIndex.value = []
+}
 
 const queryIndex = () => {
   if (!patNo.value) {
@@ -291,58 +361,161 @@ const queryIndex = () => {
   let {startTime, endTime} = getDateRangeFormatDate(datePeriod.value)
   const params = {
     patType: patType.value,
+    reportCategory: reportCategory.value,
     patNo: patNo.value,
     reqStartTime: startTime,
     reqEndTime: endTime,
   }
-  checkExamIndex(params).then((res) => {
+  checkIndexByCategory(params).then((res) => {
     inspectionIndex.value = res
   })
 }
 
 const reportType = ref('普通')
-const queryDetail = (row) => {
-  bacterias.value = []
-  checkExamDetail({
-    reportId: row.reportId
-  }).then((res) => {
-    halfSize.value = Math.ceil(res.items.length / 2)
-    inspectionDetail.order = res.order
-    inspectionDetail.items = res.items
-    reportType.value = row.reportType
-    if (res.bacterias && res.bacterias.length > 0) {
-      res.bacterias.forEach(bac => {
-        const bacSize = Math.ceil(bac.antiList.length / 2)
-        const tempBacResult = {
-          halfBacSize: bacSize,
-          germName: bac.bacNameCn,
-          antiList: bac.antiList,
-          type: bac.itmName
-        }
-        bacterias.value.push(tempBacResult)
-      })
-    }
+const blxdUrl = ref('')
+
+function beforeQueryDetail(row) {
+  if (reportCategory.value === 'JY') {
+    queryJyDetail(row)
+  } else if (reportCategory.value === 'JC') {
+    queryJcDetail(row);
+  } else {
+    blxdUrl.value = row.reportUrl
+  }
+}
+
+const jcbg = ref({
+  examPurpose: ''
+})
+function queryJcDetail(row) {
+  checkTestDetail({
+    reportId: row.patientUid
+  }).then(res => {
+    jcbg.value = res
   })
 }
 
-const doPrint = () => {
-  initLodop()
-  const printarea = document.getElementById('reportDetail').innerHTML
-  const LODOP = getLodop()
-  LODOP.PRINT_INIT('')
-  LODOP.SET_PRINT_MODE('FULL_WIDTH_FOR_OVERFLOW', true) //宽度溢出缩放
-  LODOP.SET_PRINT_PAGESIZE(3, 0, 20, 'A4')
-  LODOP.ADD_PRINT_HTM(0, 0, '210mm', '267mm', printarea)
-  LODOP.PREVIEW()
+const queryJyDetail = (row) => {
+  return new Promise((resolve, reject) => {
+    bacterias.value = []
+    checkExamDetail({
+      reportId: row.reportId
+    }).then((res) => {
+      halfSize.value = Math.ceil(res.items.length / 2)
+      inspectionDetail.order = res.order
+      inspectionDetail.items = res.items
+      reportType.value = row.reportType
+      if (res.bacterias && res.bacterias.length > 0) {
+        res.bacterias.forEach(bac => {
+          const bacSize = Math.ceil(bac.antiList.length / 2)
+          const tempBacResult = {
+            halfBacSize: bacSize,
+            germName: bac.bacNameCn,
+            antiList: bac.antiList,
+            type: bac.itmName
+          }
+          bacterias.value.push(tempBacResult)
+        })
+      }
+      resolve()
+    })
+  })
 }
 
-function initTypes() {
-  return [
-    {code: 'InPatient', name: '住院号'},
-    {code: 'OutPatient', name: '门诊号'},
-  ]
+const inPrintProcess = ref(false)
+const beforePrint = async () => {
+  inPrintProcess.value = true
+  const selection = tableRef.value.getSelectionRows()
+  if (selection && selection.length > 0) {
+    for (let i = 0; i<selection.length; i++) {
+      await queryJyDetail(selection[i])
+      await Sleep(1000)
+      await doPrint()
+    }
+    await CyMessageBox.alert({
+      type: 'success',
+      message: '打印进程发起完毕,请耐心等候打印机工作完成。',
+      showIcon: false
+    }).then(() => {
+      inPrintProcess.value = false
+    })
+  } else {
+    await doPrint()
+    inPrintProcess.value = false
+  }
 }
 
+onMounted(() => {
+  initLodop()
+  if (props.patNo && props.start && props.end) {
+    patType.value = 'InPatient'
+    patNo.value = props.patNo
+    datePeriod.value[0] = props.start
+    datePeriod.value[1] = props.end
+    queryIndex()
+  }
+})
+
+onActivated(() => {
+  const params = router.currentRoute.value.params
+  if (params.patNo && params.start && params.end) {
+    patType.value = params.patNo.indexOf('-') === -1 ?
+        'InPatient' : 'OutPatient'
+    patNo.value = params.patNo
+    datePeriod.value[0] = params.start
+    datePeriod.value[1] = params.end
+    queryIndex()
+  }
+})
+
+function doPrint() {
+  return new Promise((resolve) => {
+    const printarea = document.getElementById('reportDetail').innerHTML
+    const LODOP = getLodop()
+    LODOP.PRINT_INIT('jyjc')
+    LODOP.SET_PRINT_PAGESIZE(3, 0, 0, 'A4');
+    LODOP.SET_PRINT_MODE('FULL_WIDTH_FOR_OVERFLOW', true) //宽度溢出缩放
+    LODOP.ADD_PRINT_HTM(0, 0, '210mm', '267mm', printarea);
+    LODOP.PRINT()
+    resolve()
+  })
+}
+
+const patientTypes = [
+  {code: 'InPatient', name: '住院号'},
+  {code: 'OutPatient', name: '门诊号'},
+]
+
+const reportTypes = [
+  {
+    label: '检验',
+    options: [
+      {
+        label: '检验报告',
+        value: 'JY',
+      }
+    ]
+  },
+  {
+    label: '检查',
+    options: [
+      {
+        label: '检查报告',
+        value: 'JC',
+      },
+      {
+        label: '病理报告',
+        value: 'BL',
+      },
+
+      {
+        label: '心电报告',
+        value: 'XD',
+      },
+    ]
+  }
+]
+
 function filterSex(val) {
   switch (val) {
     case 0: