email 자동 셋팅
This commit is contained in:
@@ -299,7 +299,7 @@ export const UserLoginAuthInfoWrap = ({
|
|||||||
removeMethods.push({
|
removeMethods.push({
|
||||||
usrid: usrid,
|
usrid: usrid,
|
||||||
systemAdminClassId: mid,
|
systemAdminClassId: mid,
|
||||||
idCl: idCL,
|
idCl: idCL || '',
|
||||||
authMethodType: "EMAIL",
|
authMethodType: "EMAIL",
|
||||||
sequence: email.sequence,
|
sequence: email.sequence,
|
||||||
content: email.content
|
content: email.content
|
||||||
@@ -318,7 +318,7 @@ export const UserLoginAuthInfoWrap = ({
|
|||||||
removeMethods.push({
|
removeMethods.push({
|
||||||
usrid: usrid,
|
usrid: usrid,
|
||||||
systemAdminClassId: mid,
|
systemAdminClassId: mid,
|
||||||
idCl: idCL,
|
idCl: idCL || '',
|
||||||
authMethodType: "PHONE",
|
authMethodType: "PHONE",
|
||||||
sequence: phone.sequence,
|
sequence: phone.sequence,
|
||||||
content: phone.content
|
content: phone.content
|
||||||
@@ -334,7 +334,7 @@ export const UserLoginAuthInfoWrap = ({
|
|||||||
addMethods.push({
|
addMethods.push({
|
||||||
usrid: usrid,
|
usrid: usrid,
|
||||||
systemAdminClassId: mid,
|
systemAdminClassId: mid,
|
||||||
idCl: idCL,
|
idCl: idCL || '',
|
||||||
authMethodType: "EMAIL",
|
authMethodType: "EMAIL",
|
||||||
sequence: existingEmailCount + index + 1,
|
sequence: existingEmailCount + index + 1,
|
||||||
content: email
|
content: email
|
||||||
@@ -348,7 +348,7 @@ export const UserLoginAuthInfoWrap = ({
|
|||||||
addMethods.push({
|
addMethods.push({
|
||||||
usrid: usrid,
|
usrid: usrid,
|
||||||
systemAdminClassId: mid,
|
systemAdminClassId: mid,
|
||||||
idCl: idCL,
|
idCl: idCL || '',
|
||||||
authMethodType: "PHONE",
|
authMethodType: "PHONE",
|
||||||
sequence: existingPhoneCount + index + 1,
|
sequence: existingPhoneCount + index + 1,
|
||||||
content: phone
|
content: phone
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { BottomSheetMotionDuration, BottomSheetMotionVaiants } from '@/entities/common/model/constant';
|
import { BottomSheetMotionDuration, BottomSheetMotionVaiants } from '@/entities/common/model/constant';
|
||||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||||
|
import { useStore } from '@/shared/model/store';
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import { ChangeEvent, useState } from 'react';
|
import { ChangeEvent, useState } from 'react';
|
||||||
|
|
||||||
@@ -18,12 +19,9 @@ export const EmailBottomSheet = ({
|
|||||||
sendEmail,
|
sendEmail,
|
||||||
sendRequest
|
sendRequest
|
||||||
}: EmailBottomSheetProps) => {
|
}: EmailBottomSheetProps) => {
|
||||||
const emailList = [
|
const optionsEmails = useStore.getState().UserStore.selectOptionsEmails;
|
||||||
{name: 'test1@nicepay.co.kr', value: 'test1@nicepay.co.kr'},
|
const email = useStore.getState().UserStore.email;
|
||||||
{name: 'test2@nicepay.co.kr', value: 'test2@nicepay.co.kr'},
|
const [userEmail, setUserEmail] = useState<string>(email);
|
||||||
{name: 'test3@nicepay.co.kr', value: 'test3@nicepay.co.kr'},
|
|
||||||
];
|
|
||||||
const [userEmail, setUserEmail] = useState<string>(emailList[0]?.value || '');
|
|
||||||
const onClickToClose = () => {
|
const onClickToClose = () => {
|
||||||
setBottomSheetOn(false);
|
setBottomSheetOn(false);
|
||||||
};
|
};
|
||||||
@@ -94,7 +92,7 @@ export const EmailBottomSheet = ({
|
|||||||
onChange={ (e: ChangeEvent<HTMLSelectElement>) => setUserEmail(e.target.value) }
|
onChange={ (e: ChangeEvent<HTMLSelectElement>) => setUserEmail(e.target.value) }
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
emailList.map((value, index) => (
|
optionsEmails.map((value, index) => (
|
||||||
<option value={ value.value }>{ value.value }</option>
|
<option value={ value.value }>{ value.value }</option>
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,11 +13,17 @@ export interface UserInfoState {
|
|||||||
userFavorite: Array<UserFavorite>;
|
userFavorite: Array<UserFavorite>;
|
||||||
setUserFavorite: (update: SetStateAction<Array<UserFavorite>>) => void;
|
setUserFavorite: (update: SetStateAction<Array<UserFavorite>>) => void;
|
||||||
userMids: Array<string>;
|
userMids: Array<string>;
|
||||||
|
userEmails: Array<string>;
|
||||||
setUserMids: (update: SetStateAction<Array<string>>) => void;
|
setUserMids: (update: SetStateAction<Array<string>>) => void;
|
||||||
|
setUserEmails: (update: SetStateAction<Array<string>>) => void;
|
||||||
selectOptionsMids: Array<Record<string, string>>;
|
selectOptionsMids: Array<Record<string, string>>;
|
||||||
setSelectOptionsMids: (update: SetStateAction<Array<Record<string, string>>>) => void;
|
setSelectOptionsMids: (update: SetStateAction<Array<Record<string, string>>>) => void;
|
||||||
|
selectOptionsEmails: Array<Record<string, string>>;
|
||||||
|
setSelectOptionsEmails: (update: SetStateAction<Array<Record<string, string>>>) => void;
|
||||||
mid: string;
|
mid: string;
|
||||||
setMid: (update: SetStateAction<string>) => void;
|
setMid: (update: SetStateAction<string>) => void;
|
||||||
|
email: string;
|
||||||
|
setEmail: (update: SetStateAction<string>) => void;
|
||||||
firstAccess: boolean;
|
firstAccess: boolean;
|
||||||
setFirstAccess: (update: SetStateAction<boolean>) => void;
|
setFirstAccess: (update: SetStateAction<boolean>) => void;
|
||||||
};
|
};
|
||||||
@@ -27,8 +33,11 @@ const initialUserInfoState = {
|
|||||||
businessInfo: {} as BusinessInfo,
|
businessInfo: {} as BusinessInfo,
|
||||||
userFavorite: [] as Array<UserFavorite>,
|
userFavorite: [] as Array<UserFavorite>,
|
||||||
userMids: [] as Array<string>,
|
userMids: [] as Array<string>,
|
||||||
|
userEmails: [] as Array<string>,
|
||||||
selectOptionsMids: [] as Array<Record<string, string>>,
|
selectOptionsMids: [] as Array<Record<string, string>>,
|
||||||
|
selectOptionsEmails: [] as Array<Record<string, string>>,
|
||||||
mid: '' as string,
|
mid: '' as string,
|
||||||
|
email: '' as string,
|
||||||
firstAccess: true as boolean,
|
firstAccess: true as boolean,
|
||||||
} as UserInfoState;
|
} as UserInfoState;
|
||||||
|
|
||||||
@@ -97,6 +106,19 @@ export const createUserInfoStore = lens<UserInfoState>((set, get) => ({
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
setUserEmails: (update) => {
|
||||||
|
set((state: UserInfoState) => {
|
||||||
|
const newUserEmails = (typeof update === 'function')
|
||||||
|
? update(state.userEmails): update;
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
userEmails: [
|
||||||
|
...state.userEmails,
|
||||||
|
...newUserEmails
|
||||||
|
],
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
setSelectOptionsMids: (update) => {
|
setSelectOptionsMids: (update) => {
|
||||||
set((state: UserInfoState) => {
|
set((state: UserInfoState) => {
|
||||||
const newSelectOptionsMids = (typeof update === 'function')
|
const newSelectOptionsMids = (typeof update === 'function')
|
||||||
@@ -109,6 +131,18 @@ export const createUserInfoStore = lens<UserInfoState>((set, get) => ({
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
setSelectOptionsEmails: (update) => {
|
||||||
|
set((state: UserInfoState) => {
|
||||||
|
const newSelectOptionsEmails = (typeof update === 'function')
|
||||||
|
? update(state.selectOptionsEmails): update;
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
selectOptionsEmails: [
|
||||||
|
...newSelectOptionsEmails
|
||||||
|
],
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
setMid: (update) => {
|
setMid: (update) => {
|
||||||
set((state: UserInfoState) => {
|
set((state: UserInfoState) => {
|
||||||
const newMid = (typeof update === 'function')
|
const newMid = (typeof update === 'function')
|
||||||
@@ -119,6 +153,16 @@ export const createUserInfoStore = lens<UserInfoState>((set, get) => ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
setEmail: (update) => {
|
||||||
|
set((state: UserInfoState) => {
|
||||||
|
const newEmail = (typeof update === 'function')
|
||||||
|
? update(state.email): update;
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
email: newEmail
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
setFirstAccess: (update) => {
|
setFirstAccess: (update) => {
|
||||||
set((state: UserInfoState) => {
|
set((state: UserInfoState) => {
|
||||||
const newFirstAccess = (typeof update === 'function')
|
const newFirstAccess = (typeof update === 'function')
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ export interface UserExistsUseridParams {
|
|||||||
export interface UserFindAuthMethodParams {
|
export interface UserFindAuthMethodParams {
|
||||||
mid: string;
|
mid: string;
|
||||||
usrid: string;
|
usrid: string;
|
||||||
idCL: string;
|
idCL?: string;
|
||||||
status: string;
|
status?: string;
|
||||||
page?: DefaultRequestPagination;
|
page?: DefaultRequestPagination;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -111,13 +111,13 @@ export interface VatReturnTaxInvoiceParams {
|
|||||||
taxInvoiceNumber: string;
|
taxInvoiceNumber: string;
|
||||||
}
|
}
|
||||||
export interface VatReturnTaxInvoiceResponse {
|
export interface VatReturnTaxInvoiceResponse {
|
||||||
supplierInfo: SupplierInfo;
|
supplierInfo?: SupplierInfo;
|
||||||
recipientInfo: RecipientInfo;
|
recipientInfo?: RecipientInfo;
|
||||||
issueDate: string;
|
issueDate?: string;
|
||||||
supplyAmount: number;
|
supplyAmount?: number;
|
||||||
taxAmount: number;
|
taxAmount?: number;
|
||||||
totalAmount: number;
|
totalAmount?: number;
|
||||||
transactionDetails: TransactionDetails;
|
transactionDetails?: TransactionDetails;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface SupplierInfo {
|
export interface SupplierInfo {
|
||||||
|
|||||||
139
src/entities/vat-return/ui/list-detail-bottom-sheet.tsx
Normal file
139
src/entities/vat-return/ui/list-detail-bottom-sheet.tsx
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
import { IMAGE_ROOT } from "@/shared/constants/common";
|
||||||
|
|
||||||
|
export interface VatReturnListDetailBottomSheetProps {
|
||||||
|
bottomSheetOn: boolean;
|
||||||
|
setBottomSheetOn: (bottomSheetOn: boolean) => void;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const VatReturnListDetailBottomSheet = ({
|
||||||
|
bottomSheetOn,
|
||||||
|
setBottomSheetOn
|
||||||
|
}: VatReturnListDetailBottomSheetProps) => {
|
||||||
|
|
||||||
|
const onClickToClose = () => {
|
||||||
|
setBottomSheetOn(false);
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="bg-dim"></div>
|
||||||
|
<div className="bottomsheet">
|
||||||
|
<div className="bottomsheet-header">
|
||||||
|
<div className="bottomsheet-title">
|
||||||
|
<h2>세부내역 조회</h2>
|
||||||
|
<button
|
||||||
|
className="close-btn"
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={ IMAGE_ROOT +'/ico_close.svg' }
|
||||||
|
alt="닫기"
|
||||||
|
onClick={ onClickToClose }
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bottomsheet-content expand">
|
||||||
|
<div className="tax-detail-accordion">
|
||||||
|
<div className="summary">
|
||||||
|
<div className="row">
|
||||||
|
<div className="label desc dot">거래금액 :</div>
|
||||||
|
<div className="value">1,000,000,000</div>
|
||||||
|
</div>
|
||||||
|
<div className="row">
|
||||||
|
<div className="label desc dot">공급가액 :</div>
|
||||||
|
<div className="value">43,758,520</div>
|
||||||
|
</div>
|
||||||
|
<div className="row">
|
||||||
|
<div className="label desc dot">VAT :</div>
|
||||||
|
<div className="value">4,366,850</div>
|
||||||
|
</div>
|
||||||
|
<div className="row">
|
||||||
|
<div className="label desc dot">합계금액 :</div>
|
||||||
|
<div className="value">48,125,100</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="list">
|
||||||
|
<div className="list-header">
|
||||||
|
<div className="head-date">거래일</div>
|
||||||
|
<div className="head-amount">합계금액</div>
|
||||||
|
</div>
|
||||||
|
<div className="item">
|
||||||
|
<span className="dot"></span>
|
||||||
|
<span className="date">2025/08/01</span>
|
||||||
|
<div className="amount">
|
||||||
|
<span className="text">8,125,100</span>
|
||||||
|
<img
|
||||||
|
className="arrow up"
|
||||||
|
src={ IMAGE_ROOT + '/ico_arrow.svg' }
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="item item-detail">
|
||||||
|
<div className="labels">
|
||||||
|
<span>거래금액</span>
|
||||||
|
<span>공급가액</span>
|
||||||
|
<span>VAT</span>
|
||||||
|
</div>
|
||||||
|
<div className="values">
|
||||||
|
<span>1,000,000</span>
|
||||||
|
<span>720,000</span>
|
||||||
|
<span>80,000</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="item">
|
||||||
|
<span className="dot"></span>
|
||||||
|
<span className="date">2025/08/01</span>
|
||||||
|
<div className="amount">
|
||||||
|
<span className="text">8,125,100</span>
|
||||||
|
<img
|
||||||
|
className="arrow down"
|
||||||
|
src={ IMAGE_ROOT + '/ico_arrow.svg' }
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="item">
|
||||||
|
<span className="dot"></span>
|
||||||
|
<span className="date">2025/08/01</span>
|
||||||
|
<div className="amount">
|
||||||
|
<span className="text">8,125,100</span>
|
||||||
|
<img
|
||||||
|
className="arrow down"
|
||||||
|
src={ IMAGE_ROOT + '/ico_arrow.svg' }
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="item">
|
||||||
|
<span className="dot"></span>
|
||||||
|
<span className="date">2025/08/01</span>
|
||||||
|
<div className="amount">
|
||||||
|
<span className="text">8,125,100</span>
|
||||||
|
<img
|
||||||
|
className="arrow down"
|
||||||
|
src={ IMAGE_ROOT + '/ico_arrow.svg' }
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="item">
|
||||||
|
<span className="dot"></span>
|
||||||
|
<span className="date">2025/08/01</span>
|
||||||
|
<div className="amount">
|
||||||
|
<span className="text">8,125,100</span>
|
||||||
|
<img
|
||||||
|
className="arrow down"
|
||||||
|
src={ IMAGE_ROOT + '/ico_arrow.svg' }
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -5,6 +5,7 @@ import { NumericFormat } from 'react-number-format';
|
|||||||
import SlideDown from 'react-slidedown';
|
import SlideDown from 'react-slidedown';
|
||||||
import 'react-slidedown/lib/slidedown.css';
|
import 'react-slidedown/lib/slidedown.css';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
import { EmailBottomSheet } from '@/entities/common/ui/email-bottom-sheet';
|
||||||
|
|
||||||
export interface AmountSectionProps {
|
export interface AmountSectionProps {
|
||||||
detail: VatReturnDetailResponse;
|
detail: VatReturnDetailResponse;
|
||||||
@@ -13,12 +14,22 @@ export interface AmountSectionProps {
|
|||||||
export const AmountSection = ({
|
export const AmountSection = ({
|
||||||
detail
|
detail
|
||||||
}: AmountSectionProps) => {
|
}: AmountSectionProps) => {
|
||||||
const [isOpen, setIsOpen] = useState<boolean>(false);
|
const [isOpen, setIsOpen] = useState<boolean>(false);
|
||||||
|
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
||||||
|
|
||||||
const openSection = () => {
|
const openSection = () => {
|
||||||
const status = !isOpen;
|
const status = !isOpen;
|
||||||
setIsOpen(status);
|
setIsOpen(status);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onRequestDownload = (userEmail?: string) => {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const onClickToOpenDownloadBottomSheet = () => {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="txn-num-group">
|
<div className="txn-num-group">
|
||||||
@@ -76,10 +87,22 @@ export const AmountSection = ({
|
|||||||
<span className="value">{ moment(detail.issueDate).format('YYYY.MM.DD') }</span>
|
<span className="value">{ moment(detail.issueDate).format('YYYY.MM.DD') }</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="txn-doc">
|
<div className="txn-doc">
|
||||||
<button className="doc-btn" type="button">세금계산서</button>
|
<button
|
||||||
<button className="doc-btn" type="button">상세자료</button>
|
className="doc-btn"
|
||||||
|
type="button"
|
||||||
|
onClick={ onClickToOpenDownloadBottomSheet }
|
||||||
|
>세금계산서</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{ !!downloadBottomSheetOn &&
|
||||||
|
<EmailBottomSheet
|
||||||
|
bottomSheetOn={ downloadBottomSheetOn }
|
||||||
|
setBottomSheetOn={ setDownloadBottomSheetOn }
|
||||||
|
imageSave={ true }
|
||||||
|
sendEmail={ true }
|
||||||
|
sendRequest={ onRequestDownload }
|
||||||
|
></EmailBottomSheet>
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -51,7 +51,7 @@ export const BillingListPage = () => {
|
|||||||
const [minAmount, setMinAmount] = useState<number>();
|
const [minAmount, setMinAmount] = useState<number>();
|
||||||
const [maxAmount, setMaxAmount] = useState<number>();
|
const [maxAmount, setMaxAmount] = useState<number>();
|
||||||
|
|
||||||
const [emailBottomSheetOn, setEmailBottomSheetOn] = useState<boolean>(false);
|
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
||||||
|
|
||||||
useSetHeaderTitle('빌링');
|
useSetHeaderTitle('빌링');
|
||||||
useSetHeaderType(HeaderType.LeftArrow);
|
useSetHeaderType(HeaderType.LeftArrow);
|
||||||
@@ -102,8 +102,8 @@ export const BillingListPage = () => {
|
|||||||
const onClickToOpenFilter = () => {
|
const onClickToOpenFilter = () => {
|
||||||
setFilterOn(!filterOn);
|
setFilterOn(!filterOn);
|
||||||
};
|
};
|
||||||
const onClickToDownloadExcel = () => {
|
const onClickToOpenDownloadBottomSheet = () => {
|
||||||
setEmailBottomSheetOn(true);
|
setDownloadBottomSheetOn(true);
|
||||||
};
|
};
|
||||||
const onClickToSort = (sort: SortTypeKeys) => {
|
const onClickToSort = (sort: SortTypeKeys) => {
|
||||||
setSortType(sort);
|
setSortType(sort);
|
||||||
@@ -119,7 +119,7 @@ export const BillingListPage = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const onRequestDownloadExcel = (userEmail?: string) => {
|
const onRequestDownload = (userEmail?: string) => {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ export const BillingListPage = () => {
|
|||||||
<img
|
<img
|
||||||
src={ IMAGE_ROOT + '/ico_download.svg' }
|
src={ IMAGE_ROOT + '/ico_download.svg' }
|
||||||
alt="다운로드"
|
alt="다운로드"
|
||||||
onClick={ () => onClickToDownloadExcel() }
|
onClick={ () => onClickToOpenDownloadBottomSheet() }
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -217,13 +217,13 @@ export const BillingListPage = () => {
|
|||||||
setMinAmount={ setMinAmount }
|
setMinAmount={ setMinAmount }
|
||||||
setMaxAmount={ setMaxAmount }
|
setMaxAmount={ setMaxAmount }
|
||||||
></BillingFilter>
|
></BillingFilter>
|
||||||
{ !!emailBottomSheetOn &&
|
{ !!downloadBottomSheetOn &&
|
||||||
<EmailBottomSheet
|
<EmailBottomSheet
|
||||||
bottomSheetOn={ emailBottomSheetOn }
|
bottomSheetOn={ downloadBottomSheetOn }
|
||||||
setBottomSheetOn={ setEmailBottomSheetOn }
|
setBottomSheetOn={ setDownloadBottomSheetOn }
|
||||||
imageSave={ false }
|
imageSave={ false }
|
||||||
sendEmail={ true }
|
sendEmail={ true }
|
||||||
sendRequest={ onRequestDownloadExcel }
|
sendRequest={ onRequestDownload }
|
||||||
></EmailBottomSheet>
|
></EmailBottomSheet>
|
||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import { useVatReturnDetailMutation } from '@/entities/vat-return/api/use-vat-re
|
|||||||
import { HeaderType } from '@/entities/common/model/types';
|
import { HeaderType } from '@/entities/common/model/types';
|
||||||
import {
|
import {
|
||||||
VatReturnDetailParams,
|
VatReturnDetailParams,
|
||||||
VatReturnDetailResponse
|
VatReturnDetailResponse,
|
||||||
|
VatReturnTaxInvoiceParams,
|
||||||
|
VatReturnTaxInvoiceResponse
|
||||||
} from '@/entities/vat-return/model/types';
|
} from '@/entities/vat-return/model/types';
|
||||||
import {
|
import {
|
||||||
useSetOnBack,
|
useSetOnBack,
|
||||||
@@ -18,6 +20,8 @@ import { SupplierSection } from '@/entities/vat-return/ui/section/supplier-secti
|
|||||||
import { ReceiverSection } from '@/entities/vat-return/ui/section/receiver-section';
|
import { ReceiverSection } from '@/entities/vat-return/ui/section/receiver-section';
|
||||||
import { IssueSection } from '@/entities/vat-return/ui/section/issue-section';
|
import { IssueSection } from '@/entities/vat-return/ui/section/issue-section';
|
||||||
import { AmountSection } from '@/entities/vat-return/ui/section/amount-section';
|
import { AmountSection } from '@/entities/vat-return/ui/section/amount-section';
|
||||||
|
import { useVatReturnTaxInvoiceMutation } from '@/entities/vat-return/api/use-vat-return-tax-invoice-mutation';
|
||||||
|
import { VatReturnListDetailBottomSheet } from '@/entities/vat-return/ui/list-detail-bottom-sheet';
|
||||||
|
|
||||||
export const DetailPage = () => {
|
export const DetailPage = () => {
|
||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
@@ -27,7 +31,8 @@ export const DetailPage = () => {
|
|||||||
taxInvoiceNumber = 'TAX202506300001';
|
taxInvoiceNumber = 'TAX202506300001';
|
||||||
|
|
||||||
const [openAmount, setOpenAmount] = useState<boolean>(false);
|
const [openAmount, setOpenAmount] = useState<boolean>(false);
|
||||||
const [detail, setDetail] = useState<VatReturnDetailResponse>({});
|
const [bottomSheetOn, setBottomSheetOn] = useState<boolean>(false);
|
||||||
|
const [detail, setDetail] = useState<VatReturnTaxInvoiceResponse>({});
|
||||||
|
|
||||||
useSetHeaderTitle('세금계산서 상세');
|
useSetHeaderTitle('세금계산서 상세');
|
||||||
useSetHeaderType(HeaderType.RightClose);
|
useSetHeaderType(HeaderType.RightClose);
|
||||||
@@ -36,9 +41,10 @@ export const DetailPage = () => {
|
|||||||
});
|
});
|
||||||
useSetFooterMode(false);
|
useSetFooterMode(false);
|
||||||
|
|
||||||
|
const { mutateAsync: vatReturnTaxInvoice } = useVatReturnTaxInvoiceMutation();
|
||||||
const { mutateAsync: vatReturnDetail } = useVatReturnDetailMutation();
|
const { mutateAsync: vatReturnDetail } = useVatReturnDetailMutation();
|
||||||
|
|
||||||
const callDetail = () => {
|
const callTaxInvoice = () => {
|
||||||
let params: VatReturnDetailParams = {
|
let params: VatReturnDetailParams = {
|
||||||
taxInvoiceNumber: taxInvoiceNumber,
|
taxInvoiceNumber: taxInvoiceNumber,
|
||||||
};
|
};
|
||||||
@@ -46,8 +52,13 @@ export const DetailPage = () => {
|
|||||||
setDetail(rs);
|
setDetail(rs);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onClickToOpenBottomSheet = () => {
|
||||||
|
setBottomSheetOn(true);
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
callDetail();
|
callTaxInvoice();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -74,9 +85,21 @@ export const DetailPage = () => {
|
|||||||
></SupplierSection>
|
></SupplierSection>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="apply-row">
|
||||||
|
<button
|
||||||
|
className="btn-50 btn-blue flex-1"
|
||||||
|
onClick={ onClickToOpenBottomSheet }
|
||||||
|
>거래 취소</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
{ !!bottomSheetOn &&
|
||||||
|
<VatReturnListDetailBottomSheet
|
||||||
|
bottomSheetOn={ bottomSheetOn }
|
||||||
|
setBottomSheetOn={ setBottomSheetOn }
|
||||||
|
></VatReturnListDetailBottomSheet>
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
@@ -18,11 +18,12 @@ import { useStore } from '@/shared/model/store';
|
|||||||
import { getLocalStorage, setLocalStorage } from '@/shared/lib';
|
import { getLocalStorage, setLocalStorage } from '@/shared/lib';
|
||||||
import { StorageKeys } from '@/shared/constants/local-storage';
|
import { StorageKeys } from '@/shared/constants/local-storage';
|
||||||
import { HomeGroupsParams, HomeGroupsResponse } from '@/entities/home/model/types';
|
import { HomeGroupsParams, HomeGroupsResponse } from '@/entities/home/model/types';
|
||||||
import { BusinessPropertyByMidParams, BusinessPropertyByMidResponse, LoginResponse, ShortcutUserParams, ShortcutUserResponse } from '@/entities/user/model/types';
|
import { BusinessPropertyByMidParams, BusinessPropertyByMidResponse, LoginResponse, ShortcutUserParams, ShortcutUserResponse, UserFindAuthMethodParams, UserFindAuthMethodResponse } from '@/entities/user/model/types';
|
||||||
import { useCodesListByCodeClMutation } from '@/entities/common/api/use-codes-list-by-codeCl-mutaion';
|
import { useCodesListByCodeClMutation } from '@/entities/common/api/use-codes-list-by-codeCl-mutaion';
|
||||||
import { useShortcutUserMutation } from '@/entities/user/api/use-shortcut-user-mutation';
|
import { useShortcutUserMutation } from '@/entities/user/api/use-shortcut-user-mutation';
|
||||||
import { useShortcutDefaultMutation } from '@/entities/user/api/use-shortcut-detault-mutation';
|
import { useShortcutDefaultMutation } from '@/entities/user/api/use-shortcut-detault-mutation';
|
||||||
import { useBusinessPropertyByMidMutation } from '@/entities/user/api/use-business-property-by-mid-mutation';
|
import { useBusinessPropertyByMidMutation } from '@/entities/user/api/use-business-property-by-mid-mutation';
|
||||||
|
import { useUserFindAuthMethodMutation } from '@/entities/user/api/use-user-find-authmethod-mutation';
|
||||||
|
|
||||||
export interface ContextType {
|
export interface ContextType {
|
||||||
setOnBack: (onBack: () => void) => void;
|
setOnBack: (onBack: () => void) => void;
|
||||||
@@ -65,6 +66,7 @@ export const SubLayout = () => {
|
|||||||
const { mutateAsync: shortcutUser } = useShortcutUserMutation();
|
const { mutateAsync: shortcutUser } = useShortcutUserMutation();
|
||||||
const { mutateAsync: shortcutDefault } = useShortcutDefaultMutation();
|
const { mutateAsync: shortcutDefault } = useShortcutDefaultMutation();
|
||||||
const { mutateAsync: businessPropertyByMid } = useBusinessPropertyByMidMutation();
|
const { mutateAsync: businessPropertyByMid } = useBusinessPropertyByMidMutation();
|
||||||
|
const { mutateAsync: findAuthMethod } = useUserFindAuthMethodMutation();
|
||||||
|
|
||||||
const wrapperClassName = 'wrapper';
|
const wrapperClassName = 'wrapper';
|
||||||
|
|
||||||
@@ -159,6 +161,34 @@ export const SubLayout = () => {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const callFindAuthMethod = () => {
|
||||||
|
let userInfo = useStore.getState().UserStore.userInfo;
|
||||||
|
if(!!userInfo.usrid && !! mid){
|
||||||
|
let params: UserFindAuthMethodParams = {
|
||||||
|
usrid: userInfo.usrid,
|
||||||
|
mid: mid
|
||||||
|
};
|
||||||
|
findAuthMethod(params).then((rs: any) => {
|
||||||
|
let emails = rs.emails.map((value: any, index: any) => {
|
||||||
|
return value.content;
|
||||||
|
});
|
||||||
|
console.log('emails -->', emails)
|
||||||
|
useStore.getState().UserStore.setUserEmails(emails);
|
||||||
|
let options: Array<Record<string, string>> = emails.map((value: any, index: any) => {
|
||||||
|
return {
|
||||||
|
name: value,
|
||||||
|
value: value
|
||||||
|
};
|
||||||
|
});
|
||||||
|
useStore.getState().UserStore.setSelectOptionsEmails(options);
|
||||||
|
if(!!emails[0]){
|
||||||
|
useStore.getState().UserStore.setEmail(emails[0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
const handleLogin = useCallback(async () => {
|
const handleLogin = useCallback(async () => {
|
||||||
let userParmas;
|
let userParmas;
|
||||||
if(!isNativeEnvironment){
|
if(!isNativeEnvironment){
|
||||||
@@ -221,6 +251,7 @@ export const SubLayout = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(!!mid){
|
if(!!mid){
|
||||||
// callBusinessPropertyByMid();
|
// callBusinessPropertyByMid();
|
||||||
|
callFindAuthMethod();
|
||||||
}
|
}
|
||||||
}, [mid]);
|
}, [mid]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user