|
|
@@ -155,11 +155,17 @@ export const getReportList = async (
|
|
|
export const downloadReportXlsx = async (
|
|
|
params: Pick<ReportQueryParams, 'start_time' | 'end_time'>
|
|
|
): Promise<Blob> => {
|
|
|
- const response = await axiosInstance.get('/auth/report/xls', {
|
|
|
- params,
|
|
|
- responseType: 'blob'
|
|
|
- });
|
|
|
- return response.data;
|
|
|
+ try {
|
|
|
+ const response = await axiosInstance.get('/auth/report/xls', {
|
|
|
+ params,
|
|
|
+ responseType: 'blob'
|
|
|
+ });
|
|
|
+ return response.data;
|
|
|
+ } catch (error) {
|
|
|
+ console.error('[ReportActions] downloadReportXlsx error:', error);
|
|
|
+ // 如果转换文本失败,抛出原始错误
|
|
|
+ throw new Error('下载报告失败,错误码是:' + error.code);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
@@ -174,6 +180,7 @@ export const previewReport = async (
|
|
|
});
|
|
|
return response.data;
|
|
|
};
|
|
|
+
|
|
|
// 获取申请科室列表
|
|
|
export const getDepartment = async (
|
|
|
params: { scope?: 'all' | 'mine' }
|