TjReportInfo.vue 15 KB

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