- 지급대행, 자금이체 상세 페이지 입금확인서 이미지 다운로드 추가

This commit is contained in:
HyeonJongKim
2025-11-10 15:32:05 +09:00
parent 7a396b330b
commit 842aaf3613
3 changed files with 55 additions and 16 deletions

View File

@@ -15,6 +15,7 @@ import { DetailMotionDuration, DetailMotionStyle, DetailMotionVariants } from '@
import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
import { showAlert } from '@/widgets/show-alert';
import { snackBar } from '@/shared/lib';
import { TaxInvoiceSample } from '@/entities/common/ui/tax-invoice-sample';
export interface FundAccountResultDetailProps {
detailOn: boolean;
@@ -33,6 +34,7 @@ export const FundAccountResultDetail = ({
const [detail, setDetail] = useState<ExtensionFundAccountResultDetailResponse>();
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
const [taxInvoiceOn, setTaxInvoiceOn] = useState<boolean>(false);
const { mutateAsync: extensionFundAccountResultDetail } = useExtensionFundAccountResultDetailMutation();
const { mutateAsync: extensionFundAccountDownlaodReceipt } = useExtensionFundAccountDownloadReceiptMutation();
@@ -59,26 +61,44 @@ export const FundAccountResultDetail = ({
};
const onRequestDownload = (
selectedMode: DownloadSelectedMode,
userEmail?: string
) => {
if(selectedMode === DownloadSelectedMode.EMAIL
selectedMode: DownloadSelectedMode,
userEmail?: string
) => {
if (selectedMode === DownloadSelectedMode.EMAIL
&& userEmail
){
) {
let params: ExtensionFundAccountDownloadReceiptParams = {
mid: mid,
tid: tid,
//requestType: selectedMode,
email: userEmail
};
extensionFundAccountDownlaodReceipt(params).then((rs: ExtensionFundAccountDownloadReceiptResponse) => {
console.log('Receipt Download Status:', rs);
}).catch((e: any) => {
if(e.response?.data?.error?.message){
if (e.response?.data?.error?.message) {
snackBar(e.response?.data?.error?.message);
return;
}
});
}
else if (selectedMode === DownloadSelectedMode.IMAGE) {
const params: ExtensionFundAccountDownloadReceiptParams = {
mid: mid,
tid: tid,
//requestType: selectedMode,
email: ''
};
extensionFundAccountDownlaodReceipt(params).then((rs: ExtensionFundAccountDownloadReceiptResponse) => {
if (selectedMode === DownloadSelectedMode.IMAGE) {
setTaxInvoiceOn(true)
} else if (selectedMode === DownloadSelectedMode.EMAIL) {
snackBar('입금확인서 다운 성공')
}
}).catch((error) => {
console.error('Certificate Download Failed:', error);
});
}
};
const onClickToClose = () => {
@@ -128,7 +148,7 @@ export const FundAccountResultDetail = ({
<button
type="button"
className="receipt-btn"
onClick={ onClickToOpenDownloadBottomSheet }
onClick={onClickToOpenDownloadBottomSheet}
>
<span className="icon-24 download"></span>
<span>{t('additionalService.fundAccount.depositCertificate')}</span>
@@ -182,15 +202,21 @@ export const FundAccountResultDetail = ({
</ul>
</div>
</div>
{!!downloadBottomSheetOn &&
<DownloadBottomSheet
bottomSheetOn={downloadBottomSheetOn}
setBottomSheetOn={setDownloadBottomSheetOn}
imageMode={true}
emailMode={true}
sendRequest={onRequestDownload}
></DownloadBottomSheet>
}
</motion.div>
{ !!downloadBottomSheetOn &&
<DownloadBottomSheet
bottomSheetOn={ downloadBottomSheetOn }
setBottomSheetOn={ setDownloadBottomSheetOn }
imageMode={ false }
emailMode={ true }
sendRequest={ onRequestDownload }
></DownloadBottomSheet>
{
<TaxInvoiceSample
taxInvoiceOn={taxInvoiceOn}
setTaxInvoiceOn={setTaxInvoiceOn}
></TaxInvoiceSample>
}
</>
);

View File

@@ -11,6 +11,7 @@ import { DownloadBottomSheet, DownloadSelectedMode } from '@/entities/common/ui/
import { showAlert } from '@/widgets/show-alert';
import { checkGrant } from '@/shared/lib/check-grant';
import { snackBar } from '@/shared/lib';
import { TaxInvoiceSample } from '@/entities/common/ui/tax-invoice-sample';
export interface PayoutDetailProps {
detailOn: boolean;
@@ -30,6 +31,7 @@ export const PayoutDetail = ({
const [detail, setDetail] = useState<ExtensionPayoutDetailResponse>();
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
const [taxInvoiceOn, setTaxInvoiceOn] = useState<boolean>(false);
const { mutateAsync: extensionPayoutDetail } = useExtensionPayoutDetailMutation();
const { mutateAsync: extensionPayoutDetailDownloadCertification } = useExtensionPayoutDetailDownloadCertificateMutation();
@@ -70,6 +72,11 @@ export const PayoutDetail = ({
};
extensionPayoutDetailDownloadCertification(params).then((rs: ExtensionPayoutDetailDownloadCertificateResponse) => {
console.log('Certificate Download Status:', rs);
if(selectedMode === DownloadSelectedMode.IMAGE) {
setTaxInvoiceOn(true)
} else if(selectedMode === DownloadSelectedMode.EMAIL) {
snackBar('입금확인서 다운 성공')
}
}).catch((error) => {
console.error('Certificate Download Failed:', error);
});
@@ -197,6 +204,12 @@ export const PayoutDetail = ({
/>
}
</motion.div>
{
<TaxInvoiceSample
taxInvoiceOn={taxInvoiceOn}
setTaxInvoiceOn={setTaxInvoiceOn}
></TaxInvoiceSample>
}
</>
);
};

View File

@@ -817,7 +817,7 @@
"title": "부가서비스 소개",
"activeServices": "사용중인 서비스",
"availableServices": "신청 가능한 서비스",
"notActiveServiceMessage": "이용 중이지 않은 서비스입니다.",
"notActiveServiceMessage": "이용 중이지 않은 서비스입니다.",
"contactSalesMessage": "가입 문의는 영업 담당자 또는 고객센터로 문의해 주세요.",
"common": {
"success": "성공",