거래내역 엑셀 다운로드
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user