doctorBl.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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" :paginationData="paginationData" @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, doctor_name } = this.$route.query
  70. this.$set(this.searchData, 'time', [start_time, end_time])
  71. this.$set(this.searchData, 'doctor_name', [doctor_name])
  72. this.getList()
  73. },
  74. methods: {
  75. getList() {
  76. const {
  77. page,
  78. page_size
  79. } = this.paginationData
  80. const { time } = this.searchData
  81. const params = {
  82. is_export: 0,
  83. page,
  84. page_size,
  85. ...this.searchData
  86. }
  87. if (time && time.length) {
  88. params.start_time = time[0]
  89. params.end_time = time[1]
  90. }
  91. this.$axios.post('/bmy/doctorRankingBlList', params).then(res => {
  92. this.tableData = res.data.list
  93. this.paginationData.total = res.data.count
  94. });
  95. },
  96. handleSearch() {
  97. this.paginationData.page = 1
  98. this.getList()
  99. },
  100. handleReset() {
  101. this.searchData = {
  102. time: [],
  103. level: '',
  104. doctor_name: [],
  105. AAC11N: '',
  106. sort: []
  107. }
  108. },
  109. handlePagination(val) {
  110. const { page, limit } = val
  111. this.paginationData.page = page
  112. this.paginationData.page_size = limit
  113. this.getList()
  114. },
  115. handleSort(val) {
  116. this.searchData.sort = val
  117. this.getList()
  118. },
  119. handleExport() {
  120. const { time } = this.searchData
  121. const params = {
  122. is_export: 1,
  123. ...this.searchData
  124. }
  125. if (time && time.length) {
  126. params.start_time = time[0]
  127. params.end_time = time[1]
  128. }
  129. bmyDoctorRankingBlExport(params).then(res => {
  130. const content = res.data; // 后台返回二进制数据
  131. const blob = new Blob([content]);
  132. const fileName = `首页质控(编码员)-医生病历总数.csv`;
  133. if ('download' in document.createElement('a')) {
  134. // 非IE下载
  135. const elink = document.createElement('a');
  136. elink.download = fileName;
  137. elink.style.display = 'none';
  138. elink.href = URL.createObjectURL(blob);
  139. document.body.appendChild(elink);
  140. elink.click();
  141. URL.revokeObjectURL(elink.href); // 释放URL 对象
  142. document.body.removeChild(elink);
  143. } else {
  144. // IE10+下载
  145. navigator.msSaveBlob(blob, fileName);
  146. }
  147. });
  148. }
  149. }
  150. }
  151. </script>
  152. <style>
  153. </style>