거래내역 엑셀 다운로드
This commit is contained in:
@@ -224,6 +224,7 @@ export const AllTransactionListPage = () => {
|
||||
};
|
||||
transactionDownloadExcel(params).then((rs: TransactionDownloadExcelResponse) => {
|
||||
console.log(rs);
|
||||
snackBar('이메일로 엑셀파일 요청이 완료되었습니다.');
|
||||
}).catch((e: any) => {
|
||||
if(e.response?.data?.error?.message){
|
||||
snackBar(e.response?.data?.error?.message);
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -16,7 +16,9 @@ import {
|
||||
CashReceiptSummaryParams,
|
||||
CashReceiptListResponse,
|
||||
CashReceiptSummaryResponse,
|
||||
DetailData
|
||||
DetailData,
|
||||
CashReceiptExcelDownloadParams,
|
||||
CashReceiptExcelDownloadResponse
|
||||
} from '@/entities/transaction/model/types';
|
||||
import { useCashReceiptListMutation } from '@/entities/transaction/api/use-cash-receipt-list-mutation';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
@@ -38,6 +40,7 @@ import { CashReceiptDetail } from '@/entities/transaction/ui/detail/cash-receit-
|
||||
import { checkGrant } from '@/shared/lib/check-grant';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
import { snackBar } from '@/shared/lib';
|
||||
import { useCashReceiptExcelDownloadMutation } from '@/entities/transaction/api/use-cash-receipt-excel-download-mutation';
|
||||
|
||||
/* 현금영수증 32 */
|
||||
const menuId = 32;
|
||||
@@ -80,6 +83,8 @@ export const CashReceiptListPage = () => {
|
||||
|
||||
const { mutateAsync: cashReceiptList } = useCashReceiptListMutation();
|
||||
const { mutateAsync: cashReceiptSummary } = useCashReceiptSummaryMutation();
|
||||
const { mutateAsync: cashReceiptExcelDownload } = useCashReceiptExcelDownloadMutation();
|
||||
|
||||
const onIntersect: IntersectionObserverCallback = (entries: Array<IntersectionObserverEntry>) => {
|
||||
entries.forEach((entry: IntersectionObserverEntry) => {
|
||||
if(entry.isIntersecting){
|
||||
@@ -176,7 +181,29 @@ export const CashReceiptListPage = () => {
|
||||
selectedMode: DownloadSelectedMode,
|
||||
userEmail?: string
|
||||
) => {
|
||||
|
||||
if(selectedMode === DownloadSelectedMode.EMAIL
|
||||
&& !!userEmail
|
||||
){
|
||||
let params: CashReceiptExcelDownloadParams = {
|
||||
email: userEmail,
|
||||
mid: mid,
|
||||
startDate: startDate,
|
||||
endDate: endDate,
|
||||
purposeType: purposeType,
|
||||
transactionType: transactionType,
|
||||
processResult: processResult
|
||||
};
|
||||
|
||||
cashReceiptExcelDownload(params).then((rs: CashReceiptExcelDownloadResponse) => {
|
||||
console.log(rs);
|
||||
snackBar('이메일로 엑셀파일 요청이 완료되었습니다.');
|
||||
}).catch((e: any) => {
|
||||
if(e.response?.data?.error?.message){
|
||||
snackBar(e.response?.data?.error?.message);
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ import {
|
||||
ListItemProps,
|
||||
EscrowListParams,
|
||||
EscrowListResponse,
|
||||
DetailData
|
||||
DetailData,
|
||||
EscrowDownloadExcelParams,
|
||||
EscrowDownloadExcelResponse
|
||||
} from '@/entities/transaction/model/types';
|
||||
import { useEscrowListMutation } from '@/entities/transaction/api/use-escrow-list-mutation';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
@@ -34,6 +36,7 @@ import { EscrowDetail } from '@/entities/transaction/ui/detail/escrow-detail';
|
||||
import { checkGrant } from '@/shared/lib/check-grant';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
import { snackBar } from '@/shared/lib';
|
||||
import { useEscrowDownloadExcelMutation } from '@/entities/transaction/api/use-escrow-download-excel-mutation';
|
||||
|
||||
/* 에스크로 33 */
|
||||
const menuId = 33;
|
||||
@@ -72,6 +75,8 @@ export const EscrowListPage = () => {
|
||||
useSetFooterMode(false);
|
||||
|
||||
const { mutateAsync: escrowList } = useEscrowListMutation();
|
||||
const { mutateAsync: escrowDownloadExcel } = useEscrowDownloadExcelMutation();
|
||||
|
||||
const onIntersect: IntersectionObserverCallback = (entries: Array<IntersectionObserverEntry>) => {
|
||||
entries.forEach((entry: IntersectionObserverEntry) => {
|
||||
if(entry.isIntersecting){
|
||||
@@ -162,7 +167,27 @@ export const EscrowListPage = () => {
|
||||
selectedMode: DownloadSelectedMode,
|
||||
userEmail?: string
|
||||
) => {
|
||||
|
||||
if(selectedMode === DownloadSelectedMode.EMAIL
|
||||
&& !!userEmail
|
||||
){
|
||||
let params: EscrowDownloadExcelParams = {
|
||||
email: userEmail,
|
||||
mid: mid,
|
||||
startDate: startDate,
|
||||
endDate: endDate,
|
||||
deliveryStatus: deliveryStatus,
|
||||
settlementStatus: settlementStatus
|
||||
};
|
||||
escrowDownloadExcel(params).then((rs: EscrowDownloadExcelResponse) => {
|
||||
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