You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
3.8 KiB

1 year ago
  1. <template>
  2. <div style="overflow-y: auto;width:100%;height:465px;">
  3. <el-table :data="tableData" border height="465" row-key="id" size="small" highlight-current-row ref="imageTextReport">
  4. <el-table-column prop="registerCheckAsbitemName" label="检查项目" min-width="80" />
  5. <el-table-column prop="checkPictureUrls" label="检查项目" min-width="680">
  6. <template slot-scope="scope">
  7. <div style="overflow-x: auto;width:680px;">
  8. <div style="display: flex;">
  9. <div class="demo-image__preview" v-for="(item, index) in scope.row.checkPictureUrls" :key="item.id"
  10. style="display: inline-block; padding: 0 0 0 2px">
  11. <div style="margin-top: 5px">
  12. <el-image style="width: 80px; height: 80px; border-radius: 5px" :src="item.indexOf('http') > -1
  13. ? item
  14. : sysConfig.apiurl + item
  15. " :preview-src-list="previewSrcList(scope.row.checkPictureUrls, item)">
  16. </el-image>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. </el-table-column>
  23. </el-table>
  24. </div>
  25. </template>
  26. <script>
  27. import { mapState } from 'vuex';
  28. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  29. import { arrayExistObj, getColorStr } from '@/utlis/proFunc';
  30. export default {
  31. components: {},
  32. props: ["patientRegisterId", "tabChoosed"],
  33. data() {
  34. return {
  35. sysConfig: {},
  36. tableData: [],
  37. };
  38. },
  39. created() {
  40. this.sysConfig = JSON.parse(window.sessionStorage.getItem('sysConfig'))
  41. },
  42. //挂载完成
  43. mounted() {
  44. this.CheckDetails(this.dataTransOpts.tableS.patient_register.id);
  45. },
  46. computed: {
  47. ...mapState(['window', 'dict', 'dataTransOpts', 'doctorCheck', 'sumDoctorCheck']),
  48. },
  49. methods: {
  50. getColorStr,
  51. //获取结果明细
  52. CheckDetails(patientRegisterId) {
  53. if (!patientRegisterId) {
  54. this.tableData = []
  55. return
  56. }
  57. postapi('/api/app/OccupationalDisease/GetRegisterCheckPictureByPatientRegisterId', { patientRegisterId })
  58. .then((res) => {
  59. console.log("获取图文报告 CheckDetails", res.data);
  60. if (res.code != -1) {
  61. this.tableData = res.data;
  62. }
  63. })
  64. .catch((err) => {
  65. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  66. });
  67. },
  68. // 生成 图片预览列表
  69. previewSrcList(oriList, curImag) {
  70. let srcList = []
  71. let image = curImag.indexOf('http') > -1 ? curImag : this.sysConfig.apiurl + curImag;
  72. srcList.push(image)
  73. let lfind = arrayExistObj(oriList, 'id', curImag.id)
  74. if (lfind > -1) {
  75. for (let i = lfind + 1; i < oriList.length; i++) {
  76. let e = oriList[i];
  77. image = e.indexOf('http') > -1 ? e : this.sysConfig.apiurl + e;
  78. srcList.push(image)
  79. }
  80. for (let index = 0; index < lfind; index++) {
  81. let e = oriList[index];
  82. image = e.indexOf('http') > -1 ? e : this.sysConfig.apiurl + e;
  83. srcList.push(image)
  84. }
  85. }
  86. return srcList
  87. },
  88. },
  89. //监听事件
  90. watch: {
  91. // 虚拟表 触发强制刷新 sumDoctor.M 合并包含:综述、建议、对比、历史等,不包含总检诊断)
  92. "dataTransOpts.plus.OccDisease": {
  93. // immediate:true,
  94. handler(newVal, oldVal) {
  95. console.log(`watch 总检--检查明细结果 newVal: ${newVal}, oldVal: ${oldVal} patientRegisterId: ${this.dataTransOpts.tableS.patient_register.id}`);
  96. if (newVal != oldVal) this.CheckDetails(this.dataTransOpts.tableS.patient_register.id);
  97. }
  98. },
  99. },
  100. };
  101. </script>
  102. <style scoped>
  103. .tdCellClass {
  104. padding: 0 5px;
  105. }
  106. ::v-deep .el-table td.el-table__cell,
  107. .el-table th.el-table__cell.is-leaf {
  108. padding: 0;
  109. }
  110. </style>