doctorBlKf.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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/doctorBlKf/SearchBox.vue'
  15. import TableBoxVue from './components/doctorBlKf/TableBox.vue'
  16. import Pagination from '@/components/Pagination'
  17. import { bmyDoctorRankingBlKfExport } from '@/api/excel'
  18. export default {
  19. components: {
  20. SearchBoxVue,
  21. TableBoxVue,
  22. Pagination
  23. },
  24. data() {
  25. return {
  26. searchData: {},
  27. tableData: [],
  28. paginationData: { page: 1, page_size: 10, total: 0 }
  29. }
  30. },
  31. created() {
  32. let query = this.$route.query;
  33. //时间范围
  34. let timeArray = [];
  35. timeArray[0] = query['start_time'];
  36. timeArray[1] = query['end_time'];
  37. //医师code
  38. let doctor_code = [];
  39. doctor_code[0] = query['doctor_code'];
  40. let params = {};
  41. params['time'] = timeArray;
  42. params['doctor_code'] = doctor_code;
  43. params['sf_type'] = query['sf_type']
  44. this.searchData = params;
  45. this.getList()
  46. },
  47. methods: {
  48. getList() {
  49. let params = Object.assign({},this.searchData, this.paginationData);
  50. this.$axios.post('/bmy/doctorErrorRanking', params).then(res => {
  51. this.tableData = res.data.data;
  52. this.paginationData.total = res.data.total;
  53. });
  54. },
  55. handleSearch() {
  56. this.paginationData.page = 1
  57. this.getList()
  58. },
  59. handleReset() {
  60. this.searchData = {
  61. time: [],
  62. doctor_name: [],
  63. AAC11N: '',
  64. sort: []
  65. }
  66. },
  67. handlePagination(val) {
  68. const { page, limit } = val
  69. this.paginationData.page = page
  70. this.paginationData.page_size = limit
  71. this.getList()
  72. },
  73. handleSort(val) {
  74. this.searchData.sort = val
  75. this.getList()
  76. },
  77. handleExport() {
  78. const { time } = this.searchData
  79. const params = {
  80. is_export: 1,
  81. ...this.searchData
  82. }
  83. if (time && time.length) {
  84. params.start_time = time[0]
  85. params.end_time = time[1]
  86. }
  87. bmyDoctorRankingBlKfExport(params).then(res => {
  88. const content = res.data; // 后台返回二进制数据
  89. const blob = new Blob([content]);
  90. const fileName = `首页质控(编码员)-医生病历扣分.csv`;
  91. if ('download' in document.createElement('a')) {
  92. // 非IE下载
  93. const elink = document.createElement('a');
  94. elink.download = fileName;
  95. elink.style.display = 'none';
  96. elink.href = URL.createObjectURL(blob);
  97. document.body.appendChild(elink);
  98. elink.click();
  99. URL.revokeObjectURL(elink.href); // 释放URL 对象
  100. document.body.removeChild(elink);
  101. } else {
  102. // IE10+下载
  103. navigator.msSaveBlob(blob, fileName);
  104. }
  105. });
  106. }
  107. }
  108. }
  109. </script>
  110. <style>
  111. </style>