ReportThirdPage.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <page-layer>
  3. <template #header>
  4. <div style="text-align: center">
  5. 统计日期:
  6. <span v-if="kssj3" style="color: #fc6c34;">
  7. {{ kssj3 }} 至 {{ jssj3 }}
  8. </span>
  9. <span v-else style="color: #fc6c34;">当前</span>
  10. 统计机构名称:<span style="color: #fc6c34;">长沙泰和医院</span>
  11. 指标名称: <span style="color: #fc6c34;">{{ reportInfo3.reportName }}</span>
  12. 统计结果描述: <span style="color: #fc6c34;">{{ reportInfo3.overview }}{{ reportInfo3.unit }}</span>
  13. 其中<span style="color: #3742fa;">&nbsp;{{ reportInfo3.fstName }}: </span>
  14. <span style="color: #fc6c34;">{{ reportInfo3.fstValue }}{{ reportInfo3.unit }}</span>
  15. <span style="color: #3742fa;">&nbsp;{{ reportInfo3.sndName }}: </span>
  16. <span style="color: #fc6c34;">{{ reportInfo3.sndValue }}{{ reportInfo3.unit }}</span>
  17. </div>
  18. <el-button type="primary" icon="Search" style="margin-left: 10px;">返回</el-button>
  19. </template>
  20. <template #aside>
  21. <el-table :data="reportData" :height="tableHeight" highlight-current-row row-key="childKey" stripe border
  22. @row-dblclick="dbClickPatient">
  23. <el-table-column prop="x" :label="x3Name" width="120"></el-table-column>
  24. <el-table-column prop="y" :label="y3Name"></el-table-column>
  25. </el-table>
  26. </template>
  27. <template #main>
  28. <div style="width: 80%; height: 400px; margin-bottom: 5px;" id="thirdPie"></div>
  29. <div style="width: 80%; height: 400px" id="thirdDst"></div>
  30. </template>
  31. </page-layer>
  32. <el-dialog :title="titleChart" v-model="patientDrawer" width="80%" height="80%" top="40px" draggable destroy-on-close>
  33. <ReportPatientPage :reportPatient="reportPatient" />
  34. </el-dialog>
  35. </template>
  36. <script setup name="ReportFirst">
  37. import { ref } from "vue"
  38. import { useStore } from 'vuex'
  39. import PageLayer from '@/layout/PageLayer.vue'
  40. import { highBarUtils, highPieUtils } from '@/utils/high-charts'
  41. import ReportPatientPage from '@/components/operate-monitoring/ReportPatientPage.vue'
  42. const storeU = useStore()
  43. const windowSize = storeU.state.app.windowSize
  44. const tableHeight = windowSize.h - 105
  45. const props = defineProps({
  46. reportThird: {
  47. type: Object,
  48. default: {}
  49. }
  50. })
  51. nextTick(() => {
  52. showSecondPst()
  53. })
  54. // 报表基本信息
  55. const reportInfo3 = ref({})
  56. // 报表展示值
  57. const reportData = ref({})
  58. // 表格展示信息
  59. const tableData = ref({})
  60. const x3Name = ref('')
  61. const y3Name = ref('')
  62. const kssj3 = ref('')
  63. const jssj3 = ref('')
  64. reportData.value = props.reportThird.data
  65. reportInfo3.value = props.reportThird.row
  66. kssj3.value = props.reportSecond.kssj
  67. jssj3.value = props.reportSecond.jssj
  68. tableData.value = props.reportThird.tableInfo
  69. const showSecondPst = () => {
  70. let barTitle = reportInfo3.value.reportName
  71. let yAxisName = '单位:' + reportInfo3.value.unit
  72. let tipUnit = reportInfo3.value.unit
  73. let xdata = []
  74. let ydata = []
  75. let pieData = []
  76. x3Name.value = tableData.value.trdName
  77. y3Name.value = reportInfo3.value.unit
  78. reportData.value.forEach((item) => {
  79. let pieInfo = {}
  80. pieInfo.value = item.y
  81. pieInfo.name = item.x
  82. pieInfo.unit = reportInfo3.value.unit
  83. xdata.push(item.x)
  84. ydata.push(item.y)
  85. pieData.push(pieInfo)
  86. })
  87. highBarUtils(thirdDst, barTitle, xdata, ydata, barTitle, yAxisName, tipUnit, 1)
  88. highPieUtils(thirdPie, barTitle, pieData)
  89. }
  90. // 钻取病人的查询结果(目前仅限钻取这一层之后必须是病人页)
  91. const patientDrawer = ref(false)
  92. const reportPatient = ref({})
  93. const titleChart = ref('')
  94. const dbClickPatient = (row) => {
  95. reportInfo3.value.trdName = row.x
  96. titleChart.value = reportInfo3.value.reportName
  97. reportPatient.value.row = reportInfo3.value
  98. patientDrawer.value = true
  99. }
  100. </script>