Browse Source

下载修改

master
“wangzihua” 4 months ago
parent
commit
bff4a30fc1
  1. 9
      src/api/business/service-applications/service-applications-api.js
  2. 43
      src/components/system/service-count/quarter-statistics.vue

9
src/api/business/service-applications/service-applications-api.js

@ -5,7 +5,7 @@
* @Date: 2025-12-20 14:44:06
* @Copyright 1.0
*/
import { postRequest, getRequest, getDownload } from '/@/lib/axios';
import { postRequest, getRequest,getDownload, postDownload } from '/@/lib/axios';
export const serviceApplicationsApi = {
@ -91,4 +91,11 @@ export const serviceApplicationsApi = {
statistics: (params) => {
return postRequest('/serviceApplications/statistics', params);
},
/**
* 导出律所统计信息 @author wzh
*/
exportLawyer: (params) => {
return postDownload('/serviceApplications/exportLawyer', params);
},
};

43
src/components/system/service-count/quarter-statistics.vue

@ -52,7 +52,7 @@
</a-card>
<!-- 统计表格 -->
<a-card title="季度服务统计" size="small" class="table-card">
<a-card title="季/年度服务统计" size="small" class="table-card">
<a-table
:columns="columns"
:dataSource="tableData"
@ -201,10 +201,43 @@ function handleReset() {
}
// Excel
function handleExport() {
message.info('导出功能开发中...');
// API
// await serviceApplicationsApi.exportQuarterStatistics(queryForm);
async function handleExport() {
try {
//
const exportParams = {
quarter: queryForm.quarter,
year: queryForm.year,
lawyerName: queryForm.lawyerName,
firmName: queryForm.firmName
};
//
const response = await serviceApplicationsApi.exportLawyer(exportParams);
//
if (response && response.data) {
//
const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' });
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
//
const fileName = `季度服务统计_${queryForm.year || '全部'}_${queryForm.quarter ? '第' + queryForm.quarter + '季度' : '全部'}.xlsx`;
link.download = fileName;
//
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(url);
message.success('导出成功');
}
} catch (error) {
message.error('导出失败');
console.error('导出失败:', error);
}
}
//

Loading…
Cancel
Save