|
@@ -4,7 +4,7 @@
|
|
|
<SearchBoxVue :data="searchData" @search="handleSearch" @reset="handleReset" />
|
|
|
<div style="margin-top: -22px;">
|
|
|
<el-divider></el-divider>
|
|
|
- <TableBoxVue :data="tableData" @sort="handleSort" />
|
|
|
+ <TableBoxVue :data="tableData" @sort="handleSort" @export="handleExport" />
|
|
|
<Pagination :page="paginationData.page" :limit="paginationData.page_size" :total="paginationData.total" @pagination="handlePagination" />
|
|
|
</div>
|
|
|
</div>
|
|
@@ -15,6 +15,7 @@
|
|
|
import SearchBoxVue from './components/doctorBl/SearchBox.vue'
|
|
|
import TableBoxVue from './components/doctorBl/TableBox.vue'
|
|
|
import Pagination from '@/components/Pagination'
|
|
|
+import { bmyDoctorRankingBlExport } from '@/api/excel'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -115,6 +116,36 @@ export default {
|
|
|
handleSort(val) {
|
|
|
this.searchData.sort = val
|
|
|
this.getList()
|
|
|
+ },
|
|
|
+ handleExport() {
|
|
|
+ const { time } = this.searchData
|
|
|
+ const params = {
|
|
|
+ is_export: 1,
|
|
|
+ ...this.searchData
|
|
|
+ }
|
|
|
+ if (time && time.length) {
|
|
|
+ params.start_time = time[0]
|
|
|
+ params.end_time = time[1]
|
|
|
+ }
|
|
|
+ bmyDoctorRankingBlExport(params).then(res => {
|
|
|
+ const content = res.data; // 后台返回二进制数据
|
|
|
+ const blob = new Blob([content]);
|
|
|
+ const fileName = `首页质控(编码员)-医生病历总数.csv`;
|
|
|
+ if ('download' in document.createElement('a')) {
|
|
|
+ // 非IE下载
|
|
|
+ const elink = document.createElement('a');
|
|
|
+ elink.download = fileName;
|
|
|
+ elink.style.display = 'none';
|
|
|
+ elink.href = URL.createObjectURL(blob);
|
|
|
+ document.body.appendChild(elink);
|
|
|
+ elink.click();
|
|
|
+ URL.revokeObjectURL(elink.href); // 释放URL 对象
|
|
|
+ document.body.removeChild(elink);
|
|
|
+ } else {
|
|
|
+ // IE10+下载
|
|
|
+ navigator.msSaveBlob(blob, fileName);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|