doctorBl.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div class="bg-box">
  3. <div class="bg-card">
  4. <SearchBoxVue :data="searchData" @search="handleSearch" @reset="handleReset" />
  5. <div style="margin-top: -22px;">
  6. <el-divider></el-divider>
  7. <TableBoxVue :data="tableData" @sort="handleSort" @export="handleExport" />
  8. <Pagination :page="paginationData.page" :limit="paginationData.page_size" :total="paginationData.total" @pagination="handlePagination" />
  9. </div>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. import SearchBoxVue from './components/doctorBl/SearchBox.vue'
  15. import TableBoxVue from './components/doctorBl/TableBox.vue'
  16. import Pagination from '@/components/Pagination'
  17. import { bmyDoctorRankingBlExport } from '@/api/excel'
  18. export default {
  19. components: {
  20. SearchBoxVue,
  21. TableBoxVue,
  22. Pagination
  23. },
  24. data() {
  25. return {
  26. searchData: {
  27. time: [],
  28. level: '',
  29. doctor_name: [],
  30. AAC11N: '',
  31. sort: []
  32. },
  33. tableData: [
  34. {
  35. "AAA28": "00045458",
  36. "ZYH": "805905",
  37. "AAC01": "2023-06-28 08:36:00",
  38. "AAC11N": "康复医学科",
  39. "KZRXM": "王德强",
  40. "ZHFZRYSXM": "王德强",
  41. "ZZYSXM": "孙芳菲",
  42. "ZYYSXM": "赵威东",
  43. "ZZYISXM": "",
  44. "home_bmy_score": 100,
  45. "bl_level": "甲级"
  46. },
  47. {
  48. "AAA28": "00047338",
  49. "ZYH": "805903",
  50. "AAC01": "2023-06-28 08:35:00",
  51. "AAC11N": "康复医学科",
  52. "KZRXM": "王德强",
  53. "ZHFZRYSXM": "王德强",
  54. "ZZYSXM": "孙芳菲",
  55. "ZYYSXM": "赵威东",
  56. "ZZYISXM": "",
  57. "home_bmy_score": 100,
  58. "bl_level": "甲级"
  59. }
  60. ],
  61. paginationData: {
  62. page: 1,
  63. page_size: 10,
  64. total: 0
  65. }
  66. }
  67. },
  68. created() {
  69. const { start_time, end_time } = this.$route.query
  70. this.$set(this.searchData, 'AAC01', [start_time, end_time])
  71. this.getList()
  72. },
  73. methods: {
  74. getList() {
  75. const {
  76. page,
  77. page_size
  78. } = this.paginationData
  79. const { time } = this.searchData
  80. const params = {
  81. is_export: 0,
  82. page,
  83. page_size,
  84. ...this.searchData
  85. }
  86. if (time && time.length) {
  87. params.start_time = time[0]
  88. params.end_time = time[1]
  89. }
  90. this.$axios.post('/bmy/doctorRankingBlList', params).then(res => {
  91. this.tableData = res.data.list
  92. this.paginationData.total = res.data.count
  93. });
  94. },
  95. handleSearch() {
  96. this.paginationData.page = 1
  97. this.getList()
  98. },
  99. handleReset() {
  100. this.searchData = {
  101. time: [],
  102. level: '',
  103. doctor_name: [],
  104. AAC11N: '',
  105. sort: []
  106. }
  107. },
  108. handlePagination(val) {
  109. const { page, limit } = val
  110. this.paginationData.page = page
  111. this.paginationData.page_size = limit
  112. this.getList()
  113. },
  114. handleSort(val) {
  115. this.searchData.sort = val
  116. this.getList()
  117. },
  118. handleExport() {
  119. const { time } = this.searchData
  120. const params = {
  121. is_export: 1,
  122. ...this.searchData
  123. }
  124. if (time && time.length) {
  125. params.start_time = time[0]
  126. params.end_time = time[1]
  127. }
  128. bmyDoctorRankingBlExport(params).then(res => {
  129. const content = res.data; // 后台返回二进制数据
  130. const blob = new Blob([content]);
  131. const fileName = `首页质控(编码员)-医生病历总数.csv`;
  132. if ('download' in document.createElement('a')) {
  133. // 非IE下载
  134. const elink = document.createElement('a');
  135. elink.download = fileName;
  136. elink.style.display = 'none';
  137. elink.href = URL.createObjectURL(blob);
  138. document.body.appendChild(elink);
  139. elink.click();
  140. URL.revokeObjectURL(elink.href); // 释放URL 对象
  141. document.body.removeChild(elink);
  142. } else {
  143. // IE10+下载
  144. navigator.msSaveBlob(blob, fileName);
  145. }
  146. });
  147. }
  148. }
  149. }
  150. </script>
  151. <style>
  152. </style>