거래내역 엑셀 다운로드

This commit is contained in:
focp212@naver.com
2025-11-11 10:22:43 +09:00
parent 7c00077b6c
commit f72fcf0604
9 changed files with 150 additions and 16 deletions

View File

@@ -15,7 +15,8 @@ import {
ListItemProps,
BillingListParams,
BillingListResponse,
DetailData
DetailData,
BillingExcelParams
} from '@/entities/transaction/model/types';
import { useBillingListMutation } from '@/entities/transaction/api/use-billing-list-mutation';
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
@@ -35,6 +36,7 @@ import { BillingDetail } from '@/entities/transaction/ui/detail/billing-detail';
import { showAlert } from '@/widgets/show-alert';
import { checkGrant } from '@/shared/lib/check-grant';
import { snackBar } from '@/shared/lib';
import { useBillingExcelMutation } from '@/entities/transaction/api/use-billing-excel-mutation';
/* 빌링 34 */
const menuId = 34;
@@ -72,6 +74,8 @@ export const BillingListPage = () => {
useSetFooterMode(false);
const { mutateAsync: billingList } = useBillingListMutation();
const { mutateAsync: billingExcel } = useBillingExcelMutation();
const onIntersect: IntersectionObserverCallback = (entries: Array<IntersectionObserverEntry>) => {
entries.forEach((entry: IntersectionObserverEntry) => {
if(entry.isIntersecting){
@@ -179,7 +183,29 @@ export const BillingListPage = () => {
selectedMode: DownloadSelectedMode,
userEmail?: string
) => {
if(selectedMode === DownloadSelectedMode.EMAIL
&& !!userEmail
){
let params: BillingExcelParams = {
email: userEmail,
mid: mid,
searchType: searchType,
startDate: startDate,
endDate: endDate,
requestStatus: requestStatus,
processResult: processResult,
paymentMethod: paymentMethod
};
billingExcel(params).then((rs) => {
console.log(rs);
snackBar('이메일로 엑셀파일 요청이 완료되었습니다.');
}).catch((e: any) => {
if(e.response?.data?.error?.message){
snackBar(e.response?.data?.error?.message);
return;
}
});
}
};
const setDetailData = (detailData: DetailData) => {