ReportSecondPage.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <page-layer>
  3. <template #header>
  4. <div style="text-align: center">
  5. 统计日期:
  6. <span v-if="kssj2" style="color: #fc6c34;">
  7. {{ kssj2 }} 至 {{ jssj2 }}
  8. </span>
  9. <span v-else style="color: #fc6c34;">当前</span>
  10. 统计机构名称:<span style="color: #fc6c34;">长沙泰和医院</span>
  11. 指标名称: <span style="color: #fc6c34;">{{ reportInfo2.reportName }}</span>
  12. 统计结果描述: <span style="color: #fc6c34;">{{ reportInfo2.overview }}{{ reportInfo2.unit }}</span>
  13. 其中<span style="color: #3742fa;">&nbsp;{{ reportInfo2.fstName }}: </span>
  14. <span style="color: #fc6c34;">{{ reportInfo2.fstValue }}{{ reportInfo2.unit }}</span>
  15. </div>
  16. </template>
  17. <template #aside>
  18. <el-table :data="reportData" :height="tableHeight" highlight-current-row row-key="childKey" stripe border
  19. @row-dblclick="reportThirdInfo">
  20. <el-table-column prop="x" :label="x2Name" width="120"></el-table-column>
  21. <el-table-column prop="y" :label="y2Name"></el-table-column>
  22. </el-table>
  23. </template>
  24. <template #main>
  25. <div style="width: 80%; height: 400px; margin-bottom: 5px;" id="secondPie"></div>
  26. <div style="width: 80%; height: 400px" id="secondDst"></div>
  27. </template>
  28. </page-layer>
  29. <el-dialog v-if="props.reportSecond.tableInfo.trdGroup !== 'patient'" :title="titleChart" v-model="thirdDrawer"
  30. fullscreen destroy-on-close>
  31. <ReportThirdPage :reportThird="reportThird" />
  32. </el-dialog>
  33. <el-dialog v-else :title="titleChart" v-model="patientDrawer" width="80%" height="80%" top="40px" draggable destroy-on-close>
  34. <ReportPatientPage :reportPatient="reportPatient" />
  35. </el-dialog>
  36. </template>
  37. <script setup name="ReportFirst">
  38. import { ref } from "vue"
  39. import { useStore } from 'vuex'
  40. import { clone } from '@/utils/clone'
  41. import PageLayer from '@/layout/PageLayer.vue'
  42. import { highBarUtils, highPieUtils } from '@/utils/high-charts'
  43. import { selectReportGroup } from '@/api/reports/high-report'
  44. import ReportThirdPage from '@/components/operate-monitoring/ReportThirdPage.vue'
  45. import ReportPatientPage from '@/components/operate-monitoring/ReportPatientPage.vue'
  46. const storeU = useStore()
  47. const windowSize = storeU.state.app.windowSize
  48. const tableHeight = windowSize.h - 105
  49. const props = defineProps({
  50. reportSecond: {
  51. type: Object,
  52. default: {}
  53. }
  54. })
  55. nextTick(() => {
  56. showSecondPst()
  57. })
  58. // 报表基本信息
  59. const reportInfo2 = ref({})
  60. // 报表展示值
  61. const reportData = ref({})
  62. // 表格展示信息
  63. const tableData = ref({})
  64. // 查询信息
  65. const param2 = ref({})
  66. const x2Name = ref('')
  67. const y2Name = ref('')
  68. const kssj2 = ref('')
  69. const jssj2 = ref('')
  70. reportData.value = props.reportSecond.data
  71. reportInfo2.value = props.reportSecond.row
  72. tableData.value = props.reportSecond.tableInfo
  73. param2.value = props.reportSecond.params
  74. kssj2.value = props.reportSecond.kssj
  75. jssj2.value = props.reportSecond.jssj
  76. const showSecondPst = () => {
  77. let barTitle = reportInfo2.value.reportName
  78. let yAxisName = '单位:' + reportInfo2.value.unit
  79. let tipUnit = reportInfo2.value.unit
  80. let xdata = []
  81. let ydata = []
  82. let pieData = []
  83. x2Name.value = tableData.value.sndName
  84. y2Name.value = reportInfo2.value.unit
  85. reportData.value.forEach((item) => {
  86. let pieInfo = {}
  87. pieInfo.value = item.y
  88. pieInfo.name = item.x
  89. pieInfo.unit = reportInfo2.value.unit
  90. xdata.push(item.x)
  91. ydata.push(item.y)
  92. pieData.push(pieInfo)
  93. })
  94. highBarUtils(secondDst, barTitle, xdata, ydata, barTitle, yAxisName, tipUnit, 1)
  95. highPieUtils(secondPie, barTitle, pieData)
  96. }
  97. // 钻取的查询结果
  98. const thirdDrawer = ref(false)
  99. const reportThird = ref({})
  100. const patientDrawer = ref(false)
  101. const reportPatient = ref({})
  102. const titleChart = ref('')
  103. const reportThirdInfo = (row) => {
  104. reportInfo2.value.sndName = row.x
  105. reportInfo2.value.sndValue = row.y
  106. let params = clone(param2.value)
  107. params.sndName = row.x
  108. // 下一级是病人,则走最后固定的病人明细展示页面
  109. let trdGroup = tableData.value.trdGroup
  110. if (trdGroup === 'patient') {
  111. titleChart.value = reportInfo2.value.reportName
  112. patientDrawer.value = true
  113. reportPatient.value.row = reportInfo2.value
  114. reportPatient.value.params = clone(params)
  115. } else {
  116. selectReportGroup(params).then((res) => {
  117. reportThird.value = res
  118. titleChart.value = res.title
  119. thirdDrawer.value = true
  120. reportThird.value.row = reportInfo2.value
  121. reportThird.value.kssj = kssj2.value
  122. reportThird.value.jssj = jssj2.value
  123. reportThird.value.params = clone(params)
  124. })
  125. }
  126. }
  127. </script>