downloadbottomsheet

This commit is contained in:
focp212@naver.com
2025-11-07 17:46:06 +09:00
parent 6b6d3cff0e
commit 1bbf90b98e
24 changed files with 485 additions and 368 deletions

View File

@@ -17,7 +17,7 @@ import {
import { useVatReturnListMutation } from '../api/use-vat-return-list-mutation';
import { ListDateGroup } from './list-date-group';
import { useStore } from '@/shared/model/store';
import { EmailBottomSheet } from '@/entities/common/ui/email-bottom-sheet';
import { DownloadBottomSheet, DownloadSelectedMode } from '@/entities/common/ui/download-bottom-sheet';
import useIntersectionObserver from '@/widgets/intersection-observer';
import { TaxInvoiceDetail } from './detail/tax-invoice-detail';
import { showAlert } from '@/widgets/show-alert';
@@ -40,7 +40,7 @@ export const ListWrap = () => {
const [receiptType, setReceiptType] = useState<VatReturnReceiptType>(VatReturnReceiptType.ALL);
const [targetType, setTargetType] = useState<VatReturnTargetType>(VatReturnTargetType.ALL);
const [emailBottomSheetOn, setEmailBottomSheetOn] = useState<boolean>(false);
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
const [detailOn, setDetailOn] = useState<boolean>(false);
const [detailTaxInvoiceNumber, setDetailTaxInvoiceNumber] = useState<string>('');
@@ -118,17 +118,20 @@ export const ListWrap = () => {
const onClickToSort = (sort: SortTypeKeys) => {
setSortType(sort);
};
const onClickToDownloadExcel = () => {
const onClickToOpenDownloadBottomSheet = () => {
if(checkGrant(menuId, 'D')){
setEmailBottomSheetOn(true);
setDownloadBottomSheetOn(true);
}
else{
showAlert(t('common.nopermission'));
}
};
const onRequestDownloadExcel = (userEmail?: string) => {
};
const onRequestDownloadExcel = (
selectedMode: DownloadSelectedMode,
userEmail?: string
) => {
};
useEffect(() => {
callList();
@@ -212,7 +215,7 @@ export const ListWrap = () => {
<img
src={ IMAGE_ROOT + '/ico_download.svg' }
alt={t('transaction.download')}
onClick={ onClickToDownloadExcel }
onClick={ onClickToOpenDownloadBottomSheet }
/>
</button>
</div>
@@ -247,14 +250,14 @@ export const ListWrap = () => {
taxInvoiceNumber={ detailTaxInvoiceNumber }
>
</TaxInvoiceDetail>
{ !!emailBottomSheetOn &&
<EmailBottomSheet
bottomSheetOn={ emailBottomSheetOn }
setBottomSheetOn={ setEmailBottomSheetOn }
{ !!downloadBottomSheetOn &&
<DownloadBottomSheet
bottomSheetOn={ downloadBottomSheetOn }
setBottomSheetOn={ setDownloadBottomSheetOn }
imageMode={ false }
emailMode={ true }
sendRequest={ onRequestDownloadExcel }
></EmailBottomSheet>
></DownloadBottomSheet>
}
</>
);

View File

@@ -6,7 +6,7 @@ import { NumericFormat } from 'react-number-format';
import SlideDown from 'react-slidedown';
import 'react-slidedown/lib/slidedown.css';
import { useState } from 'react';
import { EmailBottomSheet } from '@/entities/common/ui/email-bottom-sheet';
import { DownloadBottomSheet, DownloadSelectedMode } from '@/entities/common/ui/download-bottom-sheet';
export interface AmountSectionProps {
detail: VatReturnDetailResponse;
@@ -24,8 +24,11 @@ export const AmountSection = ({
setIsOpen(status);
};
const onRequestDownload = (userEmail?: string) => {
const onRequestDownload = (
selectedMode: DownloadSelectedMode,
userEmail?: string
) => {
};
const onClickToOpenDownloadBottomSheet = () => {
@@ -86,13 +89,13 @@ export const AmountSection = ({
</div>
</div>
{ !!downloadBottomSheetOn &&
<EmailBottomSheet
<DownloadBottomSheet
bottomSheetOn={ downloadBottomSheetOn }
setBottomSheetOn={ setDownloadBottomSheetOn }
imageMode={ true }
emailMode={ true }
sendRequest={ onRequestDownload }
></EmailBottomSheet>
></DownloadBottomSheet>
}
</>
);