TjReportInfo.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. <template>
  2. <el-container>
  3. <el-header>
  4. <el-input v-model="tjid" style="width: 260px" clearable placeholder="请输入患者体检编号"><template #prepend>体检号</template></el-input>
  5. <el-button type="primary" icon="Search" style="margin-left: 16px" @click="queryTjData">查询</el-button>
  6. </el-header>
  7. <el-main>
  8. <el-row :gutter="6">
  9. <el-col :span="6">
  10. <el-table :data="inspectionIndex" :height="tableHeight" stripe highlight-current-row @row-click="queryDetail">
  11. <el-table-column prop="time" label="报告日期" width="140"></el-table-column>
  12. <el-table-column prop="name" label="报告内容"></el-table-column>
  13. </el-table>
  14. </el-col>
  15. <el-col :span="18">
  16. <div id="reportDetail" style="width: 100%; height: 100%; padding: 0 2px; background-color: white">
  17. <div v-if="tjxm === '首页'">
  18. <div style="text-align: right; height: 77px; margin-bottom: 20px">
  19. <svg id="barcode" v-if="tjid"></svg>
  20. </div>
  21. <div style="text-align: right; margin-bottom: 200px">
  22. <h1 style="width: 100%; text-align: center; font-weight: bold; height: 30px; line-height: 30px">长&emsp;沙&emsp;泰&emsp;和&emsp;医&emsp;院</h1>
  23. <h1 style="width: 100%; text-align: center; font-weight: bold; height: 30px; line-height: 30px">体&emsp;检&emsp;报&emsp;告</h1>
  24. </div>
  25. <div style="width: 100%; font-size: 18px">
  26. <el-row :gutter="6">
  27. <el-col :span="6"></el-col>
  28. <el-col :span="6">体检编号:{{ tjReportDetail.reportHeader.条码号 }}</el-col>
  29. <el-col :span="6">
  30. <el-checkbox-group v-model="checkboxList"><el-checkbox label="个人"></el-checkbox><el-checkbox label="团体"></el-checkbox></el-checkbox-group>
  31. </el-col>
  32. <el-col :span="6"></el-col>
  33. </el-row>
  34. <el-row :gutter="6" style="margin-bottom: 8px">
  35. <el-col :span="6"></el-col>
  36. <el-col :span="4">姓&emsp;&emsp;名:{{ tjReportDetail.reportHeader.姓名 }}</el-col>
  37. <el-col :span="4">性&emsp;&emsp;别:{{ filterSex(tjReportDetail.reportHeader.性别) }}</el-col>
  38. <el-col :span="4">年&emsp;&emsp;龄:{{ tjReportDetail.reportHeader.年龄 }}</el-col>
  39. <el-col :span="6"></el-col>
  40. </el-row>
  41. <el-row :gutter="6" style="margin-bottom: 8px">
  42. <el-col :span="6"></el-col>
  43. <el-col :span="12">单&emsp;&emsp;位:{{ tjReportDetail.reportHeader.工作单位 }}</el-col>
  44. <el-col :span="6"></el-col>
  45. </el-row>
  46. <el-row :gutter="6" style="margin-bottom: 8px">
  47. <el-col :span="6"></el-col>
  48. <el-col :span="12">部&emsp;&emsp;门:{{ tjReportDetail.reportHeader.所在部门 }}</el-col>
  49. <el-col :span="6"></el-col>
  50. </el-row>
  51. <el-row :gutter="6" style="margin-bottom: 160px">
  52. <el-col :span="6"></el-col>
  53. <el-col :span="6">体检日期:{{ filterDate(tjReportDetail.reportHeader.登记日期) }}</el-col>
  54. <el-col :span="6">电&emsp;&emsp;话:{{ tjReportDetail.reportHeader.手机 }}</el-col>
  55. <el-col :span="6"></el-col>
  56. </el-row>
  57. <div style="margin: 5px 0; border-top: 1px solid gray"></div>
  58. <h5 style="width: 100%; text-align: center; height: 5px; line-height: 5px">长沙泰和医院</h5>
  59. <h5 style="width: 100%; text-align: center; height: 5px; line-height: 5px">咨询电话:0731-88518508</h5>
  60. <h4 style="width: 100%; text-align: center; font-weight: bold; height: 5px; line-height: 5px">本体检报告仅供临床参考,不作为诊断依据,谢谢你的光临!</h4>
  61. </div>
  62. </div>
  63. <div v-else-if="tjxm === '体检总结'">
  64. <el-row :gutter="6" style="text-align: center; padding-top: 10px">
  65. <el-col :span="6">条码号:{{ tjReportDetail.reportSummary.条码 }}</el-col>
  66. <el-col :span="6">姓名:{{ tjReportDetail.reportHeader.姓名 }}</el-col>
  67. <el-col :span="6">年龄:{{ tjReportDetail.reportHeader.年龄 }}</el-col>
  68. <el-col :span="6">日期:{{ filterDate(tjReportDetail.reportSummary.汇总日期) }}</el-col>
  69. </el-row>
  70. <div style="margin: 5px 0; border-top: 1px solid gray"></div>
  71. <el-row :gutter="6" style="padding-bottom: 6px; margin: 0 20px 0 20px">
  72. <span style="font-weight: bold">
  73. 尊敬的用户:<br />
  74. &emsp;&emsp;您好! 欢迎您莅临长沙泰和医院体检中心。身体健康是学习和工作的基础,注意健康是生活和事业发展的必须。世界卫生组织(WHO)提出:“健康是人的生
  75. 理、心里和社会的完美状态,而不仅仅是指无疾病或非体弱的状态”。通过体检,检查和发现影响健康的有关因素,成为促进您身心健康的重要措施和保证。为了
  76. 您的健康,我们真诚的建议您定期进行健康体检。
  77. </span>
  78. </el-row>
  79. <el-row :gutter="6" style="padding-bottom: 22px; margin: 0 20px 0 20px">
  80. <span style="font-weight: bold"> 祝您身体健康,工作顺利! </span>
  81. </el-row>
  82. <div style="margin: 5px 0; border-top: 1px solid gray"></div>
  83. <el-row :gutter="6" style="padding-bottom: 22px; margin: 0 20px 0 20px">
  84. <div>
  85. <span style="font-size: 18px"><b>一丶体检结论及健康建议</b></span>
  86. </div>
  87. </el-row>
  88. <el-row :gutter="6" style="padding-bottom: 240px; margin: 0 20px 0 40px">
  89. <el-col :span="24">
  90. <span style="font-size: 16px">
  91. <b>
  92. <p v-html="tjReportDetail.reportSummary.汇总建议"></p>
  93. </b>
  94. </span>
  95. </el-col>
  96. </el-row>
  97. <el-row :gutter="6" style="padding-bottom: 8px; margin: 0 20px 0 20px">
  98. <el-col :span="6"></el-col>
  99. <el-col :span="6"></el-col>
  100. <el-col :span="6"></el-col>
  101. <el-col :span="6"
  102. ><span style="font-size: 18px"
  103. ><b>汇总:{{ tjReportDetail.reportSummary.汇总医生 }}</b></span
  104. ></el-col
  105. >
  106. </el-row>
  107. <el-row :gutter="6" style="padding-bottom: 8px; margin: 0 20px 0 20px">
  108. <el-col :span="6"></el-col>
  109. <el-col :span="6"></el-col>
  110. <el-col :span="6"></el-col>
  111. <el-col :span="6"
  112. ><span style="font-size: 18px"
  113. ><b>主检:{{ tjReportDetail.reportSummary.审核医生 }}</b></span
  114. ></el-col
  115. >
  116. </el-row>
  117. </div>
  118. <div v-else>
  119. <el-row :gutter="6" style="text-align: center; padding-top: 10px">
  120. <el-col :span="6">条码号:{{ tjReportDetail.reportSummary.条码 }}</el-col>
  121. <el-col :span="6">姓名:{{ tjReportDetail.reportHeader.姓名 }}</el-col>
  122. <el-col :span="6">年龄:{{ tjReportDetail.reportHeader.年龄 }}</el-col>
  123. <el-col :span="6">日期:{{ filterDate(tjReportDetail.reportSummary.汇总日期) }}</el-col>
  124. </el-row>
  125. <div style="margin: 5px 0; border-top: 1px solid gray"></div>
  126. <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 20px">
  127. <div style="text-align: center">
  128. <h2>{{ tjxm }}</h2>
  129. </div>
  130. </el-row>
  131. <el-row :gutter="6" style="padding-bottom: 8px; margin: 0 20px 0 20px">
  132. <el-table :data="inspectionItems.slice(pageSize * (currentPage - 1), pageSize * currentPage)" :height="tableHeight1" stripe highlight-current-row>
  133. <el-table-column prop="no" label="序号" width="70px"></el-table-column>
  134. <el-table-column prop="item" label="体检项目"></el-table-column>
  135. <el-table-column label="体检结果">
  136. <template #default="scope">
  137. {{ scope.row.result }}
  138. <span style="color: #f56c6c; font-size: 18px">
  139. <b>{{ scope.row.diffset }} </b>
  140. </span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column prop="unit" label="单位"></el-table-column>
  144. <el-table-column prop="norm" label="参考值或范围"></el-table-column>
  145. </el-table>
  146. <el-pagination
  147. :current-page="currentPage"
  148. :page-size="pageSize"
  149. :page-sizes="[15, 30, 45, 60]"
  150. :total="inspectionItems.length"
  151. layout="total, sizes, prev, pager, next, jumper"
  152. style="margin-top: 5px"
  153. @size-change="handleSizeChange"
  154. @current-change="handleCurrentChange"
  155. ></el-pagination>
  156. </el-row>
  157. <div style="margin: 5px 0; border-top: 1px solid gray"></div>
  158. <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 20px" v-if="itemResult.诊断内容">
  159. <h3>
  160. 科室小结:<span style="color: blue">{{ itemResult.诊断内容 }}</span>
  161. </h3>
  162. </el-row>
  163. <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 20px">
  164. <el-col :span="6"></el-col>
  165. <el-col :span="6"></el-col>
  166. <el-col :span="6">检验:{{ itemResult.检查医生签名 }}</el-col>
  167. <el-col :span="6">审核:{{ itemResult.审核医生签名 }}</el-col>
  168. </el-row>
  169. <el-row :gutter="6" style="padding-bottom: 2px; margin: 0 20px 0 20px">
  170. <h5>注:此检验报告只对本次标本负责,如有疑问请七日内复查。</h5>
  171. </el-row>
  172. </div>
  173. </div>
  174. </el-col>
  175. </el-row>
  176. </el-main>
  177. </el-container>
  178. </template>
  179. <script>
  180. import { reactive, ref, onMounted } from 'vue'
  181. import store from '@/store'
  182. import { getTjReportData } from '@/api/tj-report/tj-report'
  183. import JsBarcode from 'jsbarcode'
  184. import { ElMessage } from 'element-plus'
  185. export default {
  186. setup() {
  187. const windowSize = store.state.app.windowSize
  188. const tableHeight = windowSize.h - 45
  189. const tableHeight1 = windowSize.h - 360
  190. const inspectionIndex = ref([])
  191. const inspectionItems = ref([])
  192. const itemResult = ref({})
  193. const barcodeValue = ref('')
  194. const tjid = ref('')
  195. const tjxm = ref('首页')
  196. const checkboxList = ref([])
  197. const pageSize = ref(30)
  198. const currentPage = ref(1)
  199. const handleSizeChange = (val) => {
  200. pageSize.value = val
  201. }
  202. const handleCurrentChange = (val) => {
  203. currentPage.value = val
  204. }
  205. const tjReportDetail = reactive({
  206. reportHeader: {},
  207. reportItems: [],
  208. reportSummary: {},
  209. })
  210. onMounted(() => {
  211. inspectionIndex.value = [{ name: '首页' }, { name: '体检总结' }]
  212. })
  213. const queryDetail = (row) => {
  214. let item = row.name
  215. tjxm.value = item
  216. if (tjxm.value && item === '首页') {
  217. nextTick(() => {
  218. JsBarcode('#barcode', tjid.value, {
  219. lineColor: '#333', //线条颜色
  220. width: 2, //线宽
  221. height: 35, //条码高度
  222. displayValue: true, //是否显示文字信息
  223. })
  224. })
  225. } else if (item != '首页' && item != '体检总结') {
  226. let items = []
  227. inspectionItems.value = []
  228. for (let i = 0; i < tjReportDetail.reportItems.length; i++) {
  229. if (tjReportDetail.reportItems[i][item]) {
  230. items = tjReportDetail.reportItems[i][item]
  231. }
  232. }
  233. // 解析获取的检查结果(过滤没有结果的检查等)
  234. let resultItems = []
  235. if (items) {
  236. let no = 1
  237. for (let i = 0; i < items.length; i++) {
  238. if (i == items.length - 1) {
  239. itemResult.value = items[i]
  240. }
  241. if (!items[i]['结果']) {
  242. continue
  243. }
  244. let _item = { no: '', item: '', result: '', unit: '', norm: '', diffset: '' }
  245. _item.no = no
  246. _item.item = items[i]['检查项目']
  247. _item.result = items[i]['结果']
  248. if (items[i]['阳性标识']) {
  249. _item.diffset = items[i]['阳性标识']
  250. }
  251. _item.unit = items[i]['单位']
  252. _item.norm = items[i]['参考范围显示效果']
  253. resultItems.push(_item)
  254. no = no + 1
  255. }
  256. }
  257. inspectionItems.value = resultItems
  258. }
  259. }
  260. const queryTjData = () => {
  261. if (!tjid.value) {
  262. ElMessage({
  263. message: '请输入患者体检编号。',
  264. type: 'warning',
  265. duration: 2000,
  266. showClose: true,
  267. })
  268. return
  269. }
  270. JsBarcode('#barcode', tjid.value, {
  271. lineColor: '#333', //线条颜色
  272. width: 2, //线宽
  273. height: 35, //条码高度
  274. displayValue: true, //是否显示文字信息
  275. })
  276. const param = {
  277. tjid: tjid.value,
  278. }
  279. getTjReportData(param)
  280. .then((res) => {
  281. if (!res || res.length == 0) {
  282. ElMessage({
  283. message: '没有体检报告数据',
  284. type: 'warning',
  285. duration: 2000,
  286. showClose: true,
  287. })
  288. return
  289. }
  290. inspectionIndex.value = [{ name: '首页' }, { name: '体检总结' }]
  291. for (const key in res) {
  292. if (res[key].reportHeader) {
  293. tjReportDetail.reportHeader = res[key].reportHeader
  294. } else if (res[key].reportItems) {
  295. inspectionIndex.value = inspectionIndex.value.concat(res[key].reportItems)
  296. } else if (res[key].reportSummary) {
  297. tjReportDetail.reportSummary = res[key].reportSummary
  298. } else {
  299. tjReportDetail.reportItems.push(res[key])
  300. }
  301. }
  302. barcodeValue.value = tjReportDetail.reportHeader.条码号
  303. tjid.value = tjReportDetail.reportHeader.条码号
  304. if (tjReportDetail.reportHeader.团体or个人 === '0') {
  305. checkboxList.value = ['团体']
  306. } else if (tjReportDetail.reportHeader.团体or个人 === '1') {
  307. checkboxList.value = ['个人']
  308. } else {
  309. checkboxList.value = []
  310. }
  311. })
  312. .catch((e) => {
  313. console.log(e)
  314. })
  315. }
  316. return {
  317. barcodeValue,
  318. tableHeight,
  319. tableHeight1,
  320. tjid,
  321. tjxm,
  322. checkboxList,
  323. tjReportDetail,
  324. inspectionIndex,
  325. inspectionItems,
  326. itemResult,
  327. pageSize,
  328. currentPage,
  329. queryDetail,
  330. queryTjData,
  331. filterSex,
  332. filterDate,
  333. handleCurrentChange,
  334. handleSizeChange,
  335. }
  336. },
  337. }
  338. function filterSex(val) {
  339. switch (val) {
  340. case '0':
  341. return '未填'
  342. case '1':
  343. return '男'
  344. case '2':
  345. return '女'
  346. case '3':
  347. return '未知'
  348. }
  349. return ''
  350. }
  351. // 根据时间戳返回年月日
  352. function filterDate(val) {
  353. if (val) {
  354. let date = new Date(val)
  355. if (!date) {
  356. return ''
  357. }
  358. let Y = date.getFullYear() + '-'
  359. let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
  360. let D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
  361. return Y + M + D
  362. } else {
  363. return ''
  364. }
  365. }
  366. </script>