InspectionReportIndex.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. <template>
  2. <page-layer>
  3. <template #header>
  4. <el-select v-model="type" style="width: 100px">
  5. <el-option v-for="item in types" :key="item.code" :value="item.code" :label="item.name"></el-option>
  6. </el-select>
  7. <el-input v-model="content" style="width: 170px" clearable :placeholder="placeHolder"></el-input>
  8. <el-date-picker
  9. v-model="datePeriod"
  10. type="daterange"
  11. range-separator="至"
  12. start-placeholder="开始日期"
  13. end-placeholder="结束日期"
  14. :shortcuts="shortcuts"
  15. style="width: 260px"
  16. ></el-date-picker>
  17. <el-button type="primary" icon="Search" style="margin-left: 20px" @click="queryIndex">查询</el-button>
  18. <el-button type="primary" icon="Printer" @click="doPrint">打印</el-button>
  19. </template>
  20. <template #aside>
  21. <el-table :data="inspectionIndex" :height="tableHeight" stripe highlight-current-row @row-click="queryDetail">
  22. <el-table-column prop="ordr_CREATE_DATE" label="报告时间" width="130"></el-table-column>
  23. <el-table-column prop="aply_CTNT" label="检验名称" width="170"></el-table-column>
  24. </el-table>
  25. </template>
  26. <template #main>
  27. <div id="reportDetail"
  28. style="position: relative; width: 90%; height: 96%; padding: 0 30px; background-color: white">
  29. <h3 style="width: 100%; text-align: center; font-weight: bold; height: 30px; line-height: 30px">
  30. 长沙泰和医院检查报告单</h3>
  31. <div style="display: flex">
  32. <div style="width: 25%">姓名:{{ inspectionDetail.inspectionHeader.ptnt_NAME }}</div>
  33. <div style="width: 25%">性别:{{ filterSex(inspectionDetail.inspectionHeader.ptnt_SEX) }}</div>
  34. <div style="width: 25%">
  35. 年龄:{{ inspectionDetail.inspectionHeader.ptnt_AGE }}
  36. {{ filterAgeUnit(inspectionDetail.inspectionHeader.ptnt_AGE_UNIT) }}
  37. </div>
  38. <div style="width: 25%">
  39. {{ ptntType }}:
  40. {{ inspectionDetail.inspectionHeader.ptnt_NO }}
  41. </div>
  42. </div>
  43. <div style="display: flex">
  44. <div style="width: 25%">科室:{{ inspectionDetail.inspectionHeader.dept_NAME }}</div>
  45. <div style="width: 25%">床号:{{ inspectionDetail.inspectionHeader.ptnt_BED_NO }}</div>
  46. <div style="width: 25%">标本类型:{{ inspectionDetail.inspectionHeader.smpl_NAME }}</div>
  47. <div style="width: 25%">
  48. <div>申请项目:{{ inspectionDetail.inspectionHeader.aply_CNTN.substring(0, 13) }}</div>
  49. <div>{{ inspectionDetail.inspectionHeader.aply_CNTN.substring(13) }}</div>
  50. </div>
  51. </div>
  52. <div style="margin: 5px 0; border-top: 1px solid gray"></div>
  53. <div>
  54. <div v-if="inspectionDetail.inspectionHeader.info_TYPE === '1'">
  55. <div style="display: inline-block; width: 49.7%; vertical-align: top">
  56. <div style="display: flex">
  57. <div style="width: 25%">检验项目</div>
  58. <div style="width: 16.66%">结果</div>
  59. <div style="width: 16.66%">单位</div>
  60. <div style="width: 16.66%">说明</div>
  61. <div style="width: 25%">参考值</div>
  62. </div>
  63. <div style="margin: 5px 0; border-top: 1px solid gray"></div>
  64. <div v-for="(item, index) in inspectionDetail.inspectionItems.slice(0, halfSize)" :key="index"
  65. style="display: flex">
  66. <div style="width: 25%">
  67. <div>{{ item.itm_NAME.substring(0, 6) }}</div>
  68. <div>{{ item.itm_NAME.substring(6) }}</div>
  69. </div>
  70. <div style="width: 16.66%">
  71. <div>{{ item.itm_VALUE.substring(0, 6) }}</div>
  72. <div>{{ item.itm_VALUE.substring(6) }}</div>
  73. <div>{{ item.itm_STR_VALUE.substring(0, 6) }}</div>
  74. <div>{{ item.itm_STR_VALUE.substring(6) }}</div>
  75. </div>
  76. <div style="width: 16.66%">{{ item.itm_UNIT }}</div>
  77. <div style="width: 16.66%">
  78. <span v-html="getItemAlert(item.itm_ALERT, item.itm_STR_VALUE, item.itm_VALUE)"></span>
  79. </div>
  80. <div style="width: 25%">{{ item.range }}</div>
  81. </div>
  82. </div>
  83. <div style="display: inline-block; width: 49.7%; vertical-align: top">
  84. <div style="display: flex">
  85. <div style="width: 25%">检验项目</div>
  86. <div style="width: 16.66%">结果</div>
  87. <div style="width: 16.66%">单位</div>
  88. <div style="width: 16.66%">说明</div>
  89. <div style="width: 25%">参考值</div>
  90. </div>
  91. <div style="margin: 5px 0; border-top: 1px solid gray"></div>
  92. <div v-for="(item, index) in inspectionDetail.inspectionItems.slice(halfSize)" :key="index"
  93. style="display: flex">
  94. <div style="width: 25%">
  95. <div>{{ item.itm_NAME.substring(0, 6) }}</div>
  96. <div>{{ item.itm_NAME.substring(6) }}</div>
  97. </div>
  98. <div style="width: 16.66%">
  99. <div>{{ item.itm_VALUE.substring(0, 6) }}</div>
  100. <div>{{ item.itm_VALUE.substring(6) }}</div>
  101. <div>{{ item.itm_STR_VALUE.substring(0, 6) }}</div>
  102. <div>{{ item.itm_STR_VALUE.substring(6) }}</div>
  103. </div>
  104. <div style="width: 16.66%">{{ item.itm_UNIT }}</div>
  105. <div style="width: 16.66%">
  106. <span v-html="getItemAlert(item.itm_ALERT, item.itm_STR_VALUE, item.itm_VALUE)"></span>
  107. </div>
  108. <div style="width: 25%">{{ item.range }}</div>
  109. </div>
  110. </div>
  111. </div>
  112. <div v-if="inspectionDetail.inspectionHeader.info_TYPE === '2'">
  113. <div style="display: flex">
  114. <div style="width: 25%">检验项目</div>
  115. <div style="width: 75%">结果</div>
  116. </div>
  117. <div style="margin: 5px 0; border-top: 1px solid gray"></div>
  118. <div v-for="(item, index) in inspectionDetail.inspectionItems" :key="index" style="display: flex">
  119. <div style="width: 25%">{{ item.itm_NAME }}</div>
  120. <div style="width: 75%">{{ item.itm_STR_VALUE || item.itm_VALUE || bacName }}</div>
  121. </div>
  122. <div style="margin: 0 30px" v-if="halfBacSize > 0">
  123. <div style="display: inline-block; width: 49.7%; vertical-align: top">
  124. <div style="display: flex">
  125. <div style="width: 33.33%">抗菌药物</div>
  126. <div style="width: 33.33%">抗菌药物编码</div>
  127. <div style="width: 16.66%">MIC值</div>
  128. <div style="width: 16.66%">敏感性</div>
  129. </div>
  130. <div style="margin: 5px 0; border-top: 1px solid gray"></div>
  131. <div style="display: flex" v-for="(bac, index) in antibioticResults.slice(0, halfBacSize)" :key="index">
  132. <div style="width: 33.33%">
  133. <div>{{ bac.anti_NAME_CN.substring(0, 6) }}</div>
  134. <div>{{ bac.anti_NAME_CN.substring(6) }}</div>
  135. </div>
  136. <div style="width: 33.33%">{{ bac.anti_ABB }}</div>
  137. <div style="width: 16.66%">{{ bac.anti_MIC }}</div>
  138. <div style="width: 16.66%">{{ bac.anti_VALUE }}</div>
  139. </div>
  140. </div>
  141. <div style="display: inline-block; width: 47%; vertical-align: top">
  142. <div style="display: flex">
  143. <div style="width: 33.33%">抗菌药物</div>
  144. <div style="width: 33.33%">抗菌药物编码</div>
  145. <div style="width: 16.66%">MIC值</div>
  146. <div style="width: 16.66%">敏感性</div>
  147. </div>
  148. <div style="margin: 5px 0; border-top: 1px solid gray"></div>
  149. <div style="display: flex" v-for="(bac, index) in antibioticResults.slice(halfBacSize)" :key="index">
  150. <div style="width: 33.33%">
  151. <div>{{ bac.anti_NAME_CN.substring(0, 6) }}</div>
  152. <div>{{ bac.anti_NAME_CN.substring(6) }}</div>
  153. </div>
  154. <div style="width: 33.33%">{{ bac.anti_ABB }}</div>
  155. <div style="width: 16.66%">{{ bac.anti_MIC }}</div>
  156. <div style="width: 16.66%">{{ bac.anti_VALUE }}</div>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. <div style="position: absolute; left: 30px; right: 30px; bottom: 0">
  163. <div style="margin: 5px 0; border-top: 1px solid gray"></div>
  164. <div style="display: flex">
  165. <div style="width: 33.33%">接收时间:{{ inspectionDetail.inspectionHeader.aply_DATE }}</div>
  166. <div style="width: 33.33%">检验时间:{{ inspectionDetail.inspectionHeader.ordr_CREATE_DATE }}</div>
  167. <div style="width: 33.33%">报告时间:{{ inspectionDetail.inspectionHeader.audt_TIME }}</div>
  168. </div>
  169. <div style="display: flex">
  170. <div style="width: 33.33%">送检医生:{{ inspectionDetail.inspectionHeader.test_USR_NAME }}</div>
  171. <div style="width: 33.33%">检验人:{{ inspectionDetail.inspectionHeader.ordr_USR_NAME }}</div>
  172. <div style="width: 33.33%">审核人:{{ inspectionDetail.inspectionHeader.audt_USR_NAME }}</div>
  173. </div>
  174. <div style="margin: 5px 0; border-top: 1px solid gray"></div>
  175. <div style="width: 100%; text-align: center; font-weight: bold; height: 30px; font-size: 12px">
  176. ***此结果仅对所检测的标本负责***
  177. <span style="margin-left: 10px; font-size: 12px">备注:升高(↑),降低(↓),阳性(+),阴性(-)</span>
  178. </div>
  179. </div>
  180. </div>
  181. </template>
  182. </page-layer>
  183. </template>
  184. <script>
  185. import {computed, onActivated, reactive, ref} from 'vue'
  186. import {shortcuts} from '@/data/shortcuts'
  187. import {queryInspectionDetail, queryInspectionsIndex} from '@/api/inspections'
  188. import store from '@/store'
  189. import router from '@/router'
  190. import {ElMessage} from 'element-plus'
  191. import {initLodop, getLodop} from '@/utils/c-lodop'
  192. import PageLayer from "@/layout/PageLayer";
  193. export default {
  194. components: {PageLayer},
  195. props: {
  196. patNo: {
  197. type: String,
  198. default: null
  199. },
  200. start: {
  201. type: String
  202. },
  203. end: {
  204. type: String
  205. }
  206. },
  207. setup(props) {
  208. const type = ref(1)
  209. const types = initTypes()
  210. const content = ref(null)
  211. const datePeriod = ref([])
  212. const placeHolder = computed(() => {
  213. return '请输入' + ptntType.value
  214. })
  215. const ptntType = computed(() => {
  216. if (type.value === 1) {
  217. return '住院号'
  218. } else if (type.value === 0) {
  219. return '门诊号'
  220. } else if (type.value === 3) {
  221. return '体检号'
  222. }
  223. return ''
  224. })
  225. const windowSize = store.state.app.windowSize
  226. const tableHeight = windowSize.h - 45
  227. const inspectionIndex = ref([])
  228. const bacName = ref(null)
  229. const antibioticResults = ref([])
  230. const inspectionDetail = reactive({
  231. inspectionHeader: {
  232. aply_CNTN: '',
  233. },
  234. inspectionItems: [],
  235. })
  236. const halfSize = ref(0)
  237. const halfBacSize = ref(0)
  238. onMounted(() => {
  239. if (props.patNo && props.start && props.end) {
  240. type.value = 1
  241. content.value = props.patNo
  242. datePeriod.value[0] = props.start
  243. datePeriod.value[1] = props.end
  244. queryIndex()
  245. }
  246. })
  247. onActivated(() => {
  248. const params = router.currentRoute.value.params
  249. if (params.patNo && params.start && params.end) {
  250. type.value = 1
  251. content.value = params.patNo
  252. datePeriod.value[0] = params.start
  253. datePeriod.value[1] = params.end
  254. queryIndex()
  255. }
  256. })
  257. const queryIndex = () => {
  258. if (!content.value) {
  259. ElMessage({
  260. message: '请输入患者' + ptntType.value + '。',
  261. type: 'warning',
  262. duration: 2000,
  263. showClose: true,
  264. })
  265. return
  266. }
  267. if (!datePeriod.value) {
  268. ElMessage({
  269. message: '请选择日期范围。',
  270. type: 'warning',
  271. duration: 2000,
  272. showClose: true,
  273. })
  274. return
  275. }
  276. const param = {
  277. type: type.value,
  278. content: content.value,
  279. start: datePeriod.value[0],
  280. end: datePeriod.value[1],
  281. }
  282. queryInspectionsIndex(param).then((res) => {
  283. inspectionIndex.value = res
  284. })
  285. }
  286. // 531127-4
  287. const queryDetail = (row) => {
  288. queryInspectionDetail(row.ordr_ID).then((res) => {
  289. // console.log(res)
  290. halfSize.value = Math.ceil(res.inspectionItems.length / 2)
  291. inspectionDetail.inspectionHeader = res.inspectionHeader
  292. inspectionDetail.inspectionItems = res.inspectionItems
  293. if (res.inspectionItems.length > 0) {
  294. res.inspectionItems.forEach((item) => {
  295. if (item.itm_NAME.indexOf('培养') > -1) {
  296. bacName.value = item.itm_STR_VALUE
  297. }
  298. })
  299. }
  300. res.inspectionItems.forEach((item) => {
  301. if (item.bacteriaResults && item.bacteriaResults.length > 0) {
  302. if (item.bacteriaResults[0].antibioticResults != null) {
  303. const bacSize = Math.ceil(item.bacteriaResults[0].antibioticResults.length / 2)
  304. if (bacSize > halfBacSize.value) {
  305. halfBacSize.value = bacSize
  306. antibioticResults.value = item.bacteriaResults[0].antibioticResults
  307. }
  308. }
  309. }
  310. })
  311. })
  312. }
  313. const doPrint = () => {
  314. initLodop()
  315. const printarea = document.getElementById('reportDetail').innerHTML
  316. const LODOP = getLodop()
  317. LODOP.PRINT_INIT('')
  318. LODOP.SET_PRINT_MODE('FULL_WIDTH_FOR_OVERFLOW', true) //宽度溢出缩放
  319. LODOP.SET_PRINT_PAGESIZE(3, 0, 20, 'A4')
  320. LODOP.ADD_PRINT_HTM(0, 0, '210mm', '267mm', printarea)
  321. LODOP.PREVIEW()
  322. }
  323. return {
  324. type,
  325. types,
  326. content,
  327. ptntType,
  328. placeHolder,
  329. datePeriod,
  330. shortcuts,
  331. halfSize,
  332. halfBacSize,
  333. queryIndex,
  334. tableHeight,
  335. inspectionIndex,
  336. inspectionDetail,
  337. queryDetail,
  338. antibioticResults,
  339. filterSex,
  340. filterAgeUnit,
  341. bacName,
  342. getItemAlert,
  343. doPrint,
  344. }
  345. },
  346. }
  347. function initTypes() {
  348. return [
  349. {code: 1, name: '住院号'},
  350. {code: 0, name: '门诊号'},
  351. {code: 3, name: '体检号'},
  352. ]
  353. }
  354. function filterSex(val) {
  355. switch (val) {
  356. case '0':
  357. return '未填'
  358. case '1':
  359. return '男'
  360. case '2':
  361. return '女'
  362. case '3':
  363. return '未知'
  364. }
  365. return ''
  366. }
  367. function filterAgeUnit(val) {
  368. switch (val) {
  369. case '0':
  370. return '岁'
  371. case '1':
  372. return '月'
  373. case '2':
  374. return '天'
  375. case '3':
  376. return '时'
  377. }
  378. return ''
  379. }
  380. function getItemAlert(val, strValue, value) {
  381. if (strValue !== '' || value === '') return ''
  382. switch (val) {
  383. case 'L':
  384. return '<span style="color:#F56C6C;font-weight:bold">↓</span>'
  385. case 'H':
  386. return '<span style="color:#F56C6C;font-weight:bold">↑</span>'
  387. }
  388. return '<span style="color:#67C23A;font-weight:bold">正常</span>'
  389. }
  390. </script>