통합거래조회 UI api

This commit is contained in:
focp212@naver.com
2025-09-11 13:40:21 +09:00
parent 409a711b9a
commit 1b4af7a82f
27 changed files with 1056 additions and 390 deletions

View File

@@ -4,7 +4,7 @@ import { resultify } from '@/shared/lib/resultify';
import { CBDCAxiosError } from '@/shared/@types/error'; import { CBDCAxiosError } from '@/shared/@types/error';
import { import {
BillingDetailParams, BillingDetailParams,
DetailResponse BillingDetailResponse
} from '../model/types'; } from '../model/types';
import { import {
useMutation, useMutation,
@@ -13,12 +13,12 @@ import {
export const billingDetail = (params: BillingDetailParams) => { export const billingDetail = (params: BillingDetailParams) => {
return resultify( return resultify(
axios.post<DetailResponse>(API_URL.billingDetail(), params), axios.post<BillingDetailResponse>(API_URL.billingDetail(), params),
); );
}; };
export const useBillingDetailMutation = (options?: UseMutationOptions<DetailResponse, CBDCAxiosError, BillingDetailParams>) => { export const useBillingDetailMutation = (options?: UseMutationOptions<BillingDetailResponse, CBDCAxiosError, BillingDetailParams>) => {
const mutation = useMutation<DetailResponse, CBDCAxiosError, BillingDetailParams>({ const mutation = useMutation<BillingDetailResponse, CBDCAxiosError, BillingDetailParams>({
...options, ...options,
mutationFn: (params: BillingDetailParams) => billingDetail(params), mutationFn: (params: BillingDetailParams) => billingDetail(params),
}); });

View File

@@ -37,7 +37,7 @@ export interface SortOptionsBoxProps {
sortBy: SortByKeys; sortBy: SortByKeys;
onCliCkToSort: (sortBy: SortByKeys) => void; onCliCkToSort: (sortBy: SortByKeys) => void;
}; };
export interface ListItemProps extends ListItem{ export interface ListItemProps extends AllTransactionListItem, CashReceiptListItem, EscrowListItem, BillingListItem {
transactionCategory?: TransactionCategory; transactionCategory?: TransactionCategory;
}; };
export interface ListDateGroupProps { export interface ListDateGroupProps {
@@ -61,10 +61,8 @@ export interface BillingListProps {
transactionCategory: TransactionCategory; transactionCategory: TransactionCategory;
listItems: Record<string, Array<ListItemProps>> listItems: Record<string, Array<ListItemProps>>
}; };
export interface ListItem { export interface AllTransactionListItem {
tid?: string; tid?: string;
issueNumber?: number;
billKey?: string;
mid?: string; mid?: string;
stateDate?: string; stateDate?: string;
stateCode?: string; stateCode?: string;
@@ -75,11 +73,35 @@ export interface ListItem {
serviceDetailName?: string; serviceDetailName?: string;
goodsAmount?: number; goodsAmount?: number;
}; };
export interface CashReceiptListItem {
id?: number;
amount?: number;
customerName?: string;
issueNumber?: number;
issueStatus?: string;
paymentMethod?: string;
processResult?: string;
transactionDateTime?: string;
};
export interface EscrowListItem {
id?: number;
mid?: string;
transactionDateTime?: string;
customerName?: string;
issueNumber?: number;
transactionAmount?: number;
deliveryStatus?: string;
settlementStatus?: string;
cancelStatus?: string;
};
export interface BillingListItem extends BillingItem {
};
export interface BillingItem { export interface BillingItem {
billKey: string; billKey?: string;
tid: string; tid?: string;
orderNumber: string; orderNumber?: string;
approvalNumber?: string; approvalNumber?: string;
approvalDate?: string; approvalDate?: string;
transactionDateTime?: string; transactionDateTime?: string;
@@ -142,28 +164,28 @@ export interface CashReceiptListParams {
}; };
export interface EscrowListParams { export interface EscrowListParams {
mid: string; mid?: string;
searchType: string; searchType?: string;
searchKeyword: string; searchKeyword?: string;
startDate: string; startDate?: string;
endDate: string; endDate?: string;
deliveryStatus: string; deliveryStatus?: string;
settlementStatus: string; settlementStatus?: string;
minAmount: number; minAmount?: number;
maxAmount: number; maxAmount?: number;
pagination: DefaultRequestPagination; pagination?: DefaultRequestPagination;
}; };
export interface BillingListParams { export interface BillingListParams {
mid: string; mid?: string;
searchType: string; searchType?: string;
searchKeyword: string; searchKeyword?: string;
startDate: string; startDate?: string;
endDate: string; endDate?: string;
requestStatus: string; requestStatus?: string;
processResult: string; processResult?: string;
paymentMethod: string; paymentMethod?: string;
pagination: DefaultRequestPagination pagination?: DefaultRequestPagination
}; };
export interface AllTransactionDetailParams { export interface AllTransactionDetailParams {
@@ -309,18 +331,7 @@ export interface EscrowInfo {
deliveryAddress: string; deliveryAddress: string;
}; };
export interface DetailResponse { export interface BillingInfo {
amountInfo?: AmountInfo;
importantInfo?: ImportantInfo;
paymentInfo?: PaymentInfo;
transactionInfo?: TransactionInfo;
settlementInfo?: SettlementInfo;
partCancelInfo?: PartCancelInfo;
issueInfo?: IssueInfo;
detailInfo?: DetailInfo;
escrowInfo?: EscrowInfo;
};
export interface BillingDetailResponse {
billKey: string; billKey: string;
tid: string; tid: string;
orderNumber: string; orderNumber: string;
@@ -333,10 +344,27 @@ export interface BillingDetailResponse {
buyerName: string; buyerName: string;
} }
export interface DetailInfoProps extends DetailResponse{ export interface DetailResponse {
amountInfo?: AmountInfo;
importantInfo?: ImportantInfo;
paymentInfo?: PaymentInfo;
transactionInfo?: TransactionInfo;
settlementInfo?: SettlementInfo;
partCancelInfo?: PartCancelInfo;
issueInfo?: IssueInfo;
detailInfo?: DetailInfo;
escrowInfo?: EscrowInfo;
billingInfo?: BillingInfo;
};
export interface BillingDetailResponse extends BillingInfo {
}
export interface DetailInfoProps extends DetailResponse {
transactionCategory: TransactionCategory; transactionCategory: TransactionCategory;
show?: boolean; show?: boolean;
tid?: string; tid?: string;
serviceCode?: string;
issueNumber?: number; issueNumber?: number;
onClickToShowInfo?: (info: InfoWrapKeys) => void; onClickToShowInfo?: (info: InfoWrapKeys) => void;
} }

View File

@@ -1,3 +1,4 @@
import moment from 'moment';
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import { NumericFormat } from 'react-number-format'; import { NumericFormat } from 'react-number-format';
import { DetailArrow } from '../detail-arrow'; import { DetailArrow } from '../detail-arrow';
@@ -9,9 +10,93 @@ export const AmountInfoWrap = ({
amountInfo, amountInfo,
show, show,
tid, tid,
serviceCode,
onClickToShowInfo onClickToShowInfo
}: DetailInfoProps) => { }: DetailInfoProps) => {
const { mutateAsync: downloadConfirmation } = useDownloadConfirmationMutation(); const { mutateAsync: downloadConfirmation } = useDownloadConfirmationMutation();
const subItems: Record<string, Record<string, string>> = {
mid: {name: 'MID', type: 'string'},
amount: {name: '거래금액', type: 'number'},
cardAmount: {name: '신용카드금액', type: 'number'},
pointAmount: {name: '포인트금액', type: 'number'},
couponAmount: {name: '쿠폰금액', type: 'number'},
kakaoMoney: {name: '카카오머니', type: 'number'},
kakaoPoint: {name: '카카오포인트', type: 'number'},
kakaoInstantDiscount: {name: '카카오 즉시할인', type: 'number'},
naverPoint: {name: '네이버 포인트', type: 'number'},
tossMoney: {name: '토스머니', type: 'number'},
tossDiscount: {name: '토스할인', type: 'number'},
paycoPoint: {name: '페이코 포인트', type: 'number'},
paycoCoupon: {name: '페이코 쿠폰', type: 'number'},
escrowFee: {name: '에스크로수수료', type: 'number'}
};
const showTop = ['01', '02', '03', '26'];
const showSubItems: Record<string, Array<string>> = {
// 신용카드
'01': ['mid', 'cardAmount', 'pointAmount',
'couponAmount', 'escrowFee', 'kakaoMoney',
'kakaoPoint', 'kakaoInstantDiscount', 'naverPoint',
'tossMoney', 'tossDiscount', 'paycoPoint', 'paycoCoupon'
],
// 계좌이체
'02': ['amount', 'mid', 'escrowFee'],
// 가상계좌
'03': ['amount', 'mid'],
// 휴대폰
'04': ['amount', 'mid'],
// 계좌간편결제
'26': ['amount', 'mid', 'escrowFee'],
// SSG머니
'21': ['amount', 'mid'],
// SSG은행계좌
'24': ['amount', 'mid'],
// 문화상품권
'14': ['amount', 'mid'],
// 티머니페이
'31': ['amount', 'mid'],
};
const checkValue = (val: any) => {
return (!!val || val === 0);
};
let newAmountInfo: Record<string, any> | undefined = amountInfo;
const subLi = () => {
let rs = [];
if(!!newAmountInfo && !!serviceCode && !!showSubItems[serviceCode]){
for(let i=0;i<showSubItems[serviceCode].length;i++){
let k = showSubItems[serviceCode][i];
if(!!k){
rs.push(
<li
key={`key-amount-item-${i}`}
className="amount-item"
>
<span className="label">·&nbsp;&nbsp;{ subItems[k]?.name }</span>
<span className="value">
{ (checkValue(newAmountInfo[k]) && subItems[k]?.type === 'string') &&
newAmountInfo[k]
}
{ (checkValue(newAmountInfo[k]) && subItems[k]?.type === 'number') &&
<NumericFormat
value={ newAmountInfo[k] }
thousandSeparator
displayType="text"
></NumericFormat>
}
{ (checkValue(newAmountInfo[k]) && subItems[k]?.type === 'date') &&
moment(newAmountInfo[k]).format('YYYY.MM.DD')
}
</span>
</li>
);
}
}
}
return rs;
}
const variants = { const variants = {
hidden: { height: 0, padding: 0, margin: 0, display: 'none' }, hidden: { height: 0, padding: 0, margin: 0, display: 'none' },
visible: { height: 'auto', padding: '16px', margin: '10px 0', display: 'block' }, visible: { height: 'auto', padding: '16px', margin: '10px 0', display: 'block' },
@@ -62,46 +147,7 @@ export const AmountInfoWrap = ({
transition={{ duration: 0.3 }} transition={{ duration: 0.3 }}
> >
<ul className="amount-list"> <ul className="amount-list">
<li className="amount-item"> { subLi() }
<span className="label">·&nbsp;&nbsp;</span>
<span className="value">
<NumericFormat
value={ amountInfo?.cardAmount }
thousandSeparator
displayType="text"
></NumericFormat>
</span>
</li>
<li className="amount-item">
<span className="label">·&nbsp;&nbsp;</span>
<span className="value">
<NumericFormat
value={ amountInfo?.pointAmount }
thousandSeparator
displayType="text"
></NumericFormat>
</span>
</li>
<li className="amount-item">
<span className="label">·&nbsp;&nbsp;</span>
<span className="value minus">
<NumericFormat
value={ amountInfo?.couponAmount }
thousandSeparator
displayType="text"
></NumericFormat>
</span>
</li>
<li className="amount-item">
<span className="label">·&nbsp;&nbsp;</span>
<span className="value">
<NumericFormat
value={ amountInfo?.escrowFee }
thousandSeparator
displayType="text"
></NumericFormat>
</span>
</li>
</ul> </ul>
</motion.div> </motion.div>

View File

@@ -0,0 +1,70 @@
import moment from 'moment';
import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
export const BillingInfoWrap = ({
transactionCategory,
billingInfo,
show,
onClickToShowInfo
}: DetailInfoProps) => {
const onClickToSetShowInfo = () => {
if(!!onClickToShowInfo){
onClickToShowInfo(InfoWrapKeys.Important);
}
};
return (
<>
<div className="txn-section">
<div className="section-title"> </div>
<ul className="kv-list">
<li className="kv-row">
<span className="k"></span>
<span className="v">{ billingInfo?.billKey }</span>
</li>
<li className="kv-row">
<span className="k">TID</span>
<span className="v">{ billingInfo?.tid }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ billingInfo?.orderNumber }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ billingInfo?.approvalNumber }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ moment(billingInfo?.approvalDate).format('YYYY.MM.DD') }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ billingInfo?.requestStatus }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ billingInfo?.processResult }</span>
</li>
{ (!!billingInfo?.installmentMonth && parseInt(billingInfo?.installmentMonth) > 1) &&
<li className="kv-row">
<span className="k"></span>
<span className="v">{ billingInfo?.installmentMonth } </span>
</li>
}
<li className="kv-row">
<span className="k"></span>
<span className="v">{ billingInfo?.productName }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ billingInfo?.buyerName }</span>
</li>
</ul>
</div>
</>
)
};

View File

@@ -1,5 +1,4 @@
import moment from 'moment'; import moment from 'moment';
import { motion } from 'framer-motion';
import { DetailArrow } from '../detail-arrow'; import { DetailArrow } from '../detail-arrow';
import { InfoWrapKeys, DetailInfoProps } from '../../model/types'; import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
@@ -9,10 +8,6 @@ export const DetailInfoWrap = ({
show, show,
onClickToShowInfo onClickToShowInfo
}: DetailInfoProps) => { }: DetailInfoProps) => {
const variants = {
hidden: { height: 0, padding: 0, display: 'none' },
visible: { height: 'auto', paddingTop: '12px', display: 'block' },
};
const onClickToSetShowInfo = () => { const onClickToSetShowInfo = () => {
if(!!onClickToShowInfo){ if(!!onClickToShowInfo){
@@ -27,17 +22,46 @@ export const DetailInfoWrap = ({
className="section-title with-toggle" className="section-title with-toggle"
onClick={ () => onClickToSetShowInfo() } onClick={ () => onClickToSetShowInfo() }
> >
<DetailArrow show={ show }></DetailArrow> <DetailArrow show={ show }></DetailArrow>
</div> </div>
<motion.ul <ul className="kv-list">
className="kv-list" <li className="kv-row">
initial="hidden" <span className="k"></span>
animate={ (show)? 'visible': 'hidden' } <span className="v">{ moment(detailInfo?.cancelDate).format('YYYY.MM.DD') }</span>
variants={ variants } </li>
transition={{ duration: 0.3 }} <li className="kv-row">
> <span className="k"></span>
<span className="v">{ detailInfo?.cancelApprovalNumber }</span>
</motion.ul> </li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ detailInfo?.receiptInfo }</span>
</li>
<li className="kv-row">
<span className="k">TID</span>
<span className="v">{ detailInfo?.tid }</span>
</li>
<li className="kv-row">
<span className="k">ID</span>
<span className="v">{ detailInfo?.merchantTid }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ detailInfo?.subMallName }</span>
</li>
<li className="kv-row">
<span className="k"> </span>
<span className="v">{ detailInfo?.subMallBusinessNumber }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ detailInfo?.issueChannel }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ detailInfo?.failureReason }</span>
</li>
</ul>
</div> </div>
</> </>
) )

View File

@@ -10,8 +10,8 @@ export const EscrowInfoWrap = ({
onClickToShowInfo onClickToShowInfo
}: DetailInfoProps) => { }: DetailInfoProps) => {
const variants = { const variants = {
hidden: { height: 0, padding: 0, display: 'none' }, hidden: { height: 0, display: 'none' },
visible: { height: 'auto', paddingTop: '12px', display: 'block' }, visible: { height: 'auto', display: 'block' },
}; };
const onClickToSetShowInfo = () => { const onClickToSetShowInfo = () => {
@@ -36,7 +36,46 @@ export const EscrowInfoWrap = ({
variants={ variants } variants={ variants }
transition={{ duration: 0.3 }} transition={{ duration: 0.3 }}
> >
<li className="kv-row">
<span className="k"></span>
<span className="v">{ escrowInfo?.deliveryStatus }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ moment(escrowInfo?.deliveryRegistrationDate).format('YYYY.MM.DD') }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ moment(escrowInfo?.deliveryCompleteDate).format('YYYY.MM.DD') }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ moment(escrowInfo?.purchaseConfirmDate).format('YYYY.MM.DD') }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ escrowInfo?.purchaseRejectReason }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ escrowInfo?.rejectReason }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ escrowInfo?.escrowCertNumber }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ escrowInfo?.deliveryCompany }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ escrowInfo?.trackingNumber }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ escrowInfo?.deliveryAddress }</span>
</li>
</motion.ul> </motion.ul>
</div> </div>
</> </>

View File

@@ -1,56 +1,138 @@
import moment from 'moment'; import moment from 'moment';
import { InfoWrapKeys, DetailInfoProps } from '../../model/types'; import { NumericFormat } from 'react-number-format';
import { InfoWrapKeys, DetailInfoProps, TransactionCategory } from '../../model/types';
export const ImportantInfoWrap = ({ export const ImportantInfoWrap = ({
transactionCategory, transactionCategory,
importantInfo, importantInfo,
show, serviceCode
onClickToShowInfo }: DetailInfoProps) => {
}: DetailInfoProps) => {
const onClickToSetShowInfo = () => { const subItems: Record<string, Record<string, string>> = {
if(!!onClickToShowInfo){ ordNo: {name: '주문번호', type: 'string'},
onClickToShowInfo(InfoWrapKeys.Important); tid: {name: 'TID', type: 'string'},
} tradeStatus: {name: '거래상태', type: 'string'},
tradeMethod: {name: '거래수단', type: 'string'},
approvalDate: {name: '승인일', type: 'date'},
tradeDate: {name: '거래일', type: 'date'},
requestDate: {name: '요청일', type: 'date'},
cancelDate: {name: '취소일', type: 'date'},
productName: {name: '상품명', type: 'string'}
}; };
const showSubItems: Record<string, Array<string>> = {
// 신용카드
'01': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
'approvalDate', 'cancelDate', 'productName'],
// 계좌이체
'02': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
'tradeDate', 'cancelDate', 'productName'],
// 가상계좌
'03': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
'requestDate', 'cancelDate', 'productName'],
// 휴대폰
'04': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
'tradeDate', 'cancelDate', 'productName'],
// 계좌간편결제
'26': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
'tradeDate', 'cancelDate', 'productName'],
// SSG머니
'21': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
'tradeDate', 'cancelDate', 'productName'],
// SSG은행계좌
'24': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
'tradeDate', 'cancelDate', 'productName'],
// 문화상품권
'14': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
'tradeDate', 'cancelDate', 'productName'],
// 티머니페이
'31': ['ordNo', 'tid', 'tradeStatus', 'tradeMethod',
'tradeDate', 'cancelDate', 'productName'],
};
const checkValue = (val: any) => {
return (!!val || val === 0);
};
let newImportantInfo: Record<string, any> | undefined = importantInfo;
const subLi = () => {
let rs = [];
if(!!newImportantInfo && !!serviceCode && !!showSubItems[serviceCode]){
for(let i=0;i<showSubItems[serviceCode].length;i++){
let k = showSubItems[serviceCode][i];
if(!!k){
rs.push(
<li
key={`key-important-item-${i}`}
className="kv-row"
>
<span className="k">·&nbsp;&nbsp;{ subItems[k]?.name }</span>
<span className="v">
{ (checkValue(newImportantInfo[k]) && subItems[k]?.type === 'string') &&
newImportantInfo[k]
}
{ (checkValue(newImportantInfo[k]) && subItems[k]?.type === 'number') &&
<NumericFormat
value={ newImportantInfo[k] }
thousandSeparator
displayType="text"
suffix='원'
></NumericFormat>
}
{ (checkValue(newImportantInfo[k]) && subItems[k]?.type === 'date') &&
moment(newImportantInfo[k]).format('YYYY.MM.DD')
}
</span>
</li>
);
}
}
}
return rs;
};
return ( return (
<> <>
<div className="txn-section"> <div className="txn-section">
<div className="section-title">중요 정보</div> <div className="section-title">중요 정보</div>
<ul className="kv-list"> <ul className="kv-list">
<li className="kv-row"> { (transactionCategory === TransactionCategory.AllTransaction) &&
<span className="k"></span> subLi()
<span className="v">{ importantInfo?.ordNo }</span>
</li>
<li className="kv-row">
<span className="k">TID</span>
<span className="v">{ importantInfo?.tid }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ importantInfo?.tradeStatus }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ importantInfo?.tradeMethod }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ moment(importantInfo?.approvalDate).format('YYYY.MM.DD') }</span>
</li>
{
/*
<li className="kv-row">
<span className="k">취소일</span>
<span className="v">2025.06.08</span>
</li>
*/
} }
<li className="kv-row"> { (transactionCategory === TransactionCategory.Escrow) &&
<span className="k"></span> <>
<span className="v">{ importantInfo?.productName }</span> <li className="kv-row">
</li> <span className="k">주문번호</span>
<span className="v">{ importantInfo?.orderNumber }</span>
</li>
<li className="kv-row">
<span className="k">TID</span>
<span className="v">{ importantInfo?.tid }</span>
</li>
<li className="kv-row">
<span className="k">거래상태</span>
<span className="v">{ importantInfo?.transactionStatus }</span>
</li>
<li className="kv-row">
<span className="k">결제수단</span>
<span className="v">{ importantInfo?.paymentMethod }</span>
</li>
<li className="kv-row">
<span className="k">승인일</span>
<span className="v">{ moment(importantInfo?.approvalDateTime).format('YYYY.MM.DD HH:mm:ss') }</span>
</li>
<li className="kv-row">
<span className="k">취소일</span>
<span className="v">{ importantInfo?.cancelDate }</span>
</li>
<li className="kv-row">
<span className="k">상품명</span>
<span className="v">{ importantInfo?.productName }</span>
</li>
</>
}
</ul> </ul>
</div> </div>
</> </>

View File

@@ -1,7 +1,6 @@
import moment from 'moment';
import { motion } from 'framer-motion';
import { DetailArrow } from '../detail-arrow'; import { DetailArrow } from '../detail-arrow';
import { InfoWrapKeys, DetailInfoProps } from '../../model/types'; import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
import moment from 'moment';
export const IssueInfoWrap = ({ export const IssueInfoWrap = ({
transactionCategory, transactionCategory,
@@ -9,10 +8,7 @@ export const IssueInfoWrap = ({
show, show,
onClickToShowInfo onClickToShowInfo
}: DetailInfoProps) => { }: DetailInfoProps) => {
const variants = {
hidden: { height: 0, padding: 0, display: 'none' },
visible: { height: 'auto', paddingTop: '12px', display: 'block' },
};
const onClickToSetShowInfo = () => { const onClickToSetShowInfo = () => {
if(!!onClickToShowInfo){ if(!!onClickToShowInfo){
@@ -27,17 +23,42 @@ export const IssueInfoWrap = ({
className="section-title with-toggle" className="section-title with-toggle"
onClick={ () => onClickToSetShowInfo() } onClick={ () => onClickToSetShowInfo() }
> >
<DetailArrow show={ show }></DetailArrow> <DetailArrow show={ show }></DetailArrow>
</div> </div>
<motion.ul <ul className="kv-list">
className="kv-list" <li className="kv-row">
initial="hidden" <span className="k"></span>
animate={ (show)? 'visible': 'hidden' } <span className="v">{ issueInfo?.approvalNumber }</span>
variants={ variants } </li>
transition={{ duration: 0.3 }} <li className="kv-row">
> <span className="k"></span>
<span className="v">{ issueInfo?.issueNumber }</span>
</motion.ul> </li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ moment(issueInfo?.issueDateTime).format('YYYY.MM.DD HH:mm:ss') }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ issueInfo?.purpose }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ issueInfo?.paymentMethod }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ issueInfo?.productName }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ issueInfo?.transmissionStatus }</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">{ issueInfo?.transactionType }</span>
</li>
</ul>
</div> </div>
</> </>
) )

View File

@@ -1,3 +1,4 @@
import moment from 'moment';
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import { NumericFormat } from 'react-number-format'; import { NumericFormat } from 'react-number-format';
import { DetailArrow } from '../detail-arrow'; import { DetailArrow } from '../detail-arrow';
@@ -6,13 +7,93 @@ import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
export const PartCancelInfoWrap = ({ export const PartCancelInfoWrap = ({
transactionCategory, transactionCategory,
partCancelInfo, partCancelInfo,
serviceCode,
show, show,
onClickToShowInfo onClickToShowInfo
}: DetailInfoProps) => { }: DetailInfoProps) => {
const subItems: Record<string, Record<string, string>> = {
originalTid: {name: '원거래 TID', type: 'string'},
originalAmount: {name: '원거래 금액', type: 'number'},
partCancelTid: {name: (serviceCode === '05')? '재승인 TID': '부분취소 TID', type: 'string'},
partCancelAmount: {name: '부분취소 금액', type: 'number'},
remainingAmount: {name: (serviceCode === '05')? '재승인 금액': '부분취소 후 잔액', type: 'number'},
};
console.log(serviceCode)
const showSubItems: Record<string, Array<string>> = {
// 신용카드
'01': ['originalTid', 'originalAmount', 'partCancelTid',
'partCancelAmount', 'remainingAmount'],
// 계좌이체
'02': ['originalTid', 'originalAmount', 'partCancelTid',
'partCancelAmount', 'remainingAmount'],
// 가상계좌
'03': ['originalTid', 'originalAmount', 'partCancelTid',
'partCancelAmount', 'remainingAmount'],
// 휴대폰
'04': ['originalTid', 'originalAmount', 'partCancelTid',
'partCancelAmount', 'remainingAmount'],
// 계좌간편결제
'26': ['originalTid', 'originalAmount', 'partCancelTid',
'partCancelAmount', 'remainingAmount'],
// SSG머니
'21': ['originalTid', 'originalAmount', 'partCancelTid',
'partCancelAmount', 'remainingAmount'],
// SSG은행계좌
'24': ['originalTid', 'originalAmount', 'partCancelTid',
'partCancelAmount', 'remainingAmount'],
// 문화상품권
'14': ['originalTid', 'originalAmount', 'partCancelTid',
'partCancelAmount', 'remainingAmount'],
// 티머니페이
'31': ['originalTid', 'originalAmount', 'partCancelTid',
'partCancelAmount', 'remainingAmount'],
};
const checkValue = (val: any) => {
return (!!val || val === 0);
};
let newPartCancelInfo: Record<string, any> | undefined = partCancelInfo;
const subLi = () => {
let rs = [];
if(!!newPartCancelInfo && !!serviceCode && !!showSubItems[serviceCode]){
for(let i=0;i<showSubItems[serviceCode].length;i++){
let k = showSubItems[serviceCode][i];
if(!!k){
rs.push(
<li
key={`key-important-item-${i}`}
className="kv-row"
>
<span className="k">·&nbsp;&nbsp;{ subItems[k]?.name }</span>
<span className="v">
{ (checkValue(newPartCancelInfo[k]) && subItems[k]?.type === 'string') &&
newPartCancelInfo[k]
}
{ (checkValue(newPartCancelInfo[k]) && subItems[k]?.type === 'number') &&
<NumericFormat
value={ newPartCancelInfo[k] }
thousandSeparator
displayType="text"
suffix='원'
></NumericFormat>
}
{ (checkValue(newPartCancelInfo[k]) && subItems[k]?.type === 'date') &&
moment(newPartCancelInfo[k]).format('YYYY.MM.DD')
}
</span>
</li>
);
}
}
}
return rs;
};
const variants = { const variants = {
hidden: { height: 0, padding: 0, display: 'none' }, hidden: { height: 0, display: 'none' },
visible: { height: 'auto', paddingTop: '12px', display: 'block' }, visible: { height: 'auto', display: 'block' },
}; };
const onClickToSetShowInfo = () => { const onClickToSetShowInfo = () => {
@@ -37,40 +118,7 @@ export const PartCancelInfoWrap = ({
variants={ variants } variants={ variants }
transition={{ duration: 0.3 }} transition={{ duration: 0.3 }}
> >
<li className="kv-row"> { subLi() }
<span className="k"> TID</span>
<span className="v">{ partCancelInfo?.originalTid }</span>
</li>
<li className="kv-row">
<span className="k"> </span>
<span className="v">
<NumericFormat
value={ partCancelInfo?.originalAmount }
thousandSeparator
displayType="text"
suffix={ '원' }
></NumericFormat>
</span>
</li>
<li className="kv-row">
<span className="k"> TID</span>
<span className="v">nictest00m01012506171629294150</span>
</li>
<li className="kv-row">
<span className="k"> </span>
<span className="v">50,000</span>
</li>
<li className="kv-row nopadding">
<span className="k"> </span>
<span className="v">
<NumericFormat
value={ partCancelInfo?.remainingAmount }
thousandSeparator
displayType="text"
suffix={ '원' }
></NumericFormat>
</span>
</li>
</motion.ul> </motion.ul>
</div> </div>
</> </>

View File

@@ -1,16 +1,122 @@
import moment from 'moment';
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import { DetailArrow } from '../detail-arrow'; import { DetailArrow } from '../detail-arrow';
import { InfoWrapKeys, DetailInfoProps } from '../../model/types'; import { InfoWrapKeys, DetailInfoProps, TransactionCategory } from '../../model/types';
import { NumericFormat } from 'react-number-format';
export const PaymentInfoWrap = ({ export const PaymentInfoWrap = ({
transactionCategory, transactionCategory,
paymentInfo, paymentInfo,
serviceCode,
show, show,
onClickToShowInfo onClickToShowInfo
}: DetailInfoProps) => { }: DetailInfoProps) => {
const subItems: Record<string, Record<string, string>> = {
approvalAcquire: {name: '승인매입', type: 'string'},
approvalReturn: {name: '승인반송(횟수)', type: 'number'},
approvalReAcquire: {name: '승인재매입(횟수)', type: 'number'},
approvalVAN: {name: '승인VAN', type: 'string'},
cancelAcquire: {name: '취소매입', type: 'string'},
cancelReturn: {name: '취소반송', type: 'string'},
cancelReAcquire: {name: '취소재매입', type: 'string'},
acquireVAN: {name: '매입VAN', type: 'string'},
acquireCompany: {name: '매입사(발급사)', type: 'string'},
cardNumber: {name: '카드번호', type: 'string'},
approvalNumber: {name: '승인번호', type: 'string'},
installmentPeriod: {name: '할부기간', type: 'number'},
authentication: {name: '인증', type: 'string'},
accountType: {name: '유형', type: 'string'},
bankName: {name: '은행명', type: 'string'},
accountNumber: {name: '계좌번호', type: 'string'},
depositBankName: {name: '입금금융기관명', type: 'string'},
depositorName: {name: '입금자명', type: 'string'},
depositDeadline: {name: '입금기한', type: 'date'},
depositDate: {name: '입금일', type: 'date'},
refundScheduleDate: {name: '환불예정일', type: 'date'},
refundBankName: {name: '환불은행명', type: 'string'},
refundAccountNumber: {name: '환불계좌번호', type: 'string'},
accountHolder: {name: '예금주', type: 'string'},
refundCompleteDate: {name: '환불완료일', type: 'date'},
partner: {name: '제휴사', type: 'string'},
cpid: {name: 'CPID', type: 'string'},
productCategory: {name: '상품구분', type: 'string'},
phoneNumber: {name: '휴대폰번호', type: 'string'},
customerId: {name: '고객ID', type: 'string'},
giftCardNumber: {name: '상품권번호', type: 'string'},
culturelandId: {name: '컬처랜드ID', type: 'string'},
};
const showSubItems: Record<string, Array<string>> = {
// 신용카드
'01': ['approvalAcquire', 'approvalReturn', 'approvalReAcquire',
'approvalVAN', 'cancelAcquire', 'cancelReturn', 'cancelReAcquire',
'acquireVAN', 'acquireCompany', 'cardNumber', 'approvalNumber',
'installmentPeriod', 'authentication'],
// 계좌이체
'02': ['accountType', 'bankName', 'accountNumber'],
// 가상계좌
'03': ['bankName', 'accountNumber', 'depositBankName', 'depositorName',
'depositDeadline', 'depositDate', 'refundScheduleDate',
'refundBankName', 'refundAccountNumber', 'accountHolder'],
// 휴대폰
'04': ['refundCompleteDate', 'partner', 'cpid', 'productCategory', 'phoneNumber'],
// 계좌간편결제
'26': ['bankName', 'refundCompleteDate', 'accountHolder', 'accountType', 'customerId'],
// SSG머니
'21': ['giftCardNumber'],
// SSG은행계좌
'24': [],
// 문화상품권
'14': ['culturelandId'],
// 티머니페이
'31': ['cardNumber', 'approvalNumber', 'cpid'],
};
const checkValue = (val: any) => {
return (!!val || val === 0);
};
let newPaymentInfo: Record<string, any> | undefined = paymentInfo;
const subLi = () => {
let rs = [];
if(!!newPaymentInfo && !!serviceCode && !!showSubItems[serviceCode]){
for(let i=0;i<showSubItems[serviceCode].length;i++){
let k = showSubItems[serviceCode][i];
if(!!k){
rs.push(
<li
key={`key-important-item-${i}`}
className="kv-row"
>
<span className="k">·&nbsp;&nbsp;{ subItems[k]?.name }</span>
<span className="v">
{ (checkValue(newPaymentInfo[k]) && subItems[k]?.type === 'string') &&
newPaymentInfo[k]
}
{ (checkValue(newPaymentInfo[k]) && subItems[k]?.type === 'number') &&
<NumericFormat
value={ newPaymentInfo[k] }
thousandSeparator
displayType="text"
suffix='원'
></NumericFormat>
}
{ (checkValue(newPaymentInfo[k]) && subItems[k]?.type === 'date') &&
moment(newPaymentInfo[k]).format('YYYY.MM.DD')
}
</span>
</li>
);
}
}
}
return rs;
};
const variants = { const variants = {
hidden: { height: 0, padding: 0, display: 'none' }, hidden: { height: 0, display: 'none' },
visible: { height: 'auto', paddingTop: '12px', display: 'block' }, visible: { height: 'auto', display: 'block' },
}; };
const onClickToSetShowInfo = () => { const onClickToSetShowInfo = () => {
@@ -35,14 +141,28 @@ export const PaymentInfoWrap = ({
variants={ variants } variants={ variants }
transition={{ duration: 0.3 }} transition={{ duration: 0.3 }}
> >
<li className="kv-row"> { (transactionCategory === TransactionCategory.AllTransaction) &&
<span className="k"> </span> subLi()
<span className="v">10,000,000</span> }
</li> { (transactionCategory === TransactionCategory.Escrow) &&
<li className="kv-row"> <>
<span className="k"></span> <li className="kv-row">
<span className="v">0</span> <span className="k"> </span>
</li> <span className="v">
<NumericFormat
value={ paymentInfo?.paymentAmount }
thousandSeparator
displayType="text"
suffix='원'
></NumericFormat>
</span>
</li>
<li className="kv-row">
<span className="k"> </span>
<span className="v">{ paymentInfo?.approvalNumber }</span>
</li>
</>
}
</motion.ul> </motion.ul>
</div> </div>
</> </>

View File

@@ -1,4 +1,5 @@
import moment from 'moment'; import moment from 'moment';
import { NumericFormat } from 'react-number-format';
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import { DetailArrow } from '../detail-arrow'; import { DetailArrow } from '../detail-arrow';
import { InfoWrapKeys, DetailInfoProps } from '../../model/types'; import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
@@ -6,12 +7,92 @@ import { InfoWrapKeys, DetailInfoProps } from '../../model/types';
export const SettlementInfoWrap = ({ export const SettlementInfoWrap = ({
transactionCategory, transactionCategory,
settlementInfo, settlementInfo,
serviceCode,
show, show,
onClickToShowInfo onClickToShowInfo
}: DetailInfoProps) => { }: DetailInfoProps) => {
const subItems: Record<string, Record<string, string>> = {
approvalSettleDate: {name: '승인정산일', type: 'date'},
approvalSettleAmount: {name: '승인정산금액', type: 'number'},
cancelSettleDate: {name: '취소정산일', type: 'date'},
cancelSettleAmount: {name: '취소정산금액', type: 'number'},
};
const showSubItems: Record<string, Array<string>> = {
// 신용카드
'01': ['approvalSettleDate', 'approvalSettleAmount',
'cancelSettleDate', 'cancelSettleAmount'],
// 계좌이체
'02': ['approvalSettleDate', 'approvalSettleAmount',
'cancelSettleDate', 'cancelSettleAmount'],
// 가상계좌
'03': ['approvalSettleDate', 'approvalSettleAmount',
'cancelSettleDate', 'cancelSettleAmount'],
// 휴대폰
'04': ['approvalSettleDate', 'approvalSettleAmount',
'cancelSettleDate', 'cancelSettleAmount'],
// 계좌간편결제
'26': ['approvalSettleDate', 'approvalSettleAmount',
'cancelSettleDate', 'cancelSettleAmount'],
// SSG머니
'21': ['approvalSettleDate', 'approvalSettleAmount',
'cancelSettleDate', 'cancelSettleAmount'],
// SSG은행계좌
'24': ['approvalSettleDate', 'approvalSettleAmount',
'cancelSettleDate', 'cancelSettleAmount'],
// 문화상품권
'14': ['approvalSettleDate', 'approvalSettleAmount',
'cancelSettleDate', 'cancelSettleAmount'],
// 티머니페이
'31': ['approvalSettleDate', 'approvalSettleAmount',
'cancelSettleDate', 'cancelSettleAmount'],
};
const checkValue = (val: any) => {
return (!!val || val === 0);
};
let newSettlementInfo: Record<string, any> | undefined = settlementInfo;
const subLi = () => {
let rs = [];
if(!!newSettlementInfo && !!serviceCode && !!showSubItems[serviceCode]){
for(let i=0;i<showSubItems[serviceCode].length;i++){
let k = showSubItems[serviceCode][i];
if(!!k){
rs.push(
<li
key={`key-important-item-${i}`}
className="kv-row"
>
<span className="k">·&nbsp;&nbsp;{ subItems[k]?.name }</span>
<span className="v">
{ (checkValue(newSettlementInfo[k]) && subItems[k]?.type === 'string') &&
newSettlementInfo[k]
}
{ (checkValue(newSettlementInfo[k]) && subItems[k]?.type === 'number') &&
<NumericFormat
value={ newSettlementInfo[k] }
thousandSeparator
displayType="text"
suffix='원'
></NumericFormat>
}
{ (checkValue(newSettlementInfo[k]) && subItems[k]?.type === 'date') &&
moment(newSettlementInfo[k]).format('YYYY.MM.DD')
}
</span>
</li>
);
}
}
}
return rs;
};
const variants = { const variants = {
hidden: { height: 0, padding: 0, display: 'none' }, hidden: { height: 0, display: 'none' },
visible: { height: 'auto', paddingTop: '12px', display: 'block' }, visible: { height: 'auto', display: 'block' },
}; };
const onClickToSetShowInfo = () => { const onClickToSetShowInfo = () => {
@@ -36,14 +117,7 @@ export const SettlementInfoWrap = ({
variants={ variants } variants={ variants }
transition={{ duration: 0.3 }} transition={{ duration: 0.3 }}
> >
<li className="kv-row"> { subLi() }
<span className="k"> </span>
<span className="v">{ moment(settlementInfo?.approvalSettleDate).format('YYYY.MM.DD') }</span>
</li>
<li className="kv-row">
<span className="k"> </span>
<span className="v"></span>
</li>
</motion.ul> </motion.ul>
</div> </div>
</> </>

View File

@@ -1,16 +1,102 @@
import moment from 'moment';
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import { DetailArrow } from '../detail-arrow'; import { DetailArrow } from '../detail-arrow';
import { InfoWrapKeys, DetailInfoProps } from '../../model/types'; import { InfoWrapKeys, DetailInfoProps, TransactionCategory } from '../../model/types';
import { NumericFormat } from 'react-number-format';
export const TransactionInfoWrap = ({ export const TransactionInfoWrap = ({
transactionCategory, transactionCategory,
transactionInfo, transactionInfo,
serviceCode,
show, show,
onClickToShowInfo onClickToShowInfo
}: DetailInfoProps) => { }: DetailInfoProps) => {
const subItems: Record<string, Record<string, string>> = {
buyerName: {name: '구매자명', type: 'string'},
email: {name: '이메일', type: 'string'},
phoneNumber: {name: '전화번호', type: 'string'},
cancelReason: {name: '취소사유', type: 'string'},
cancelRequestor: {name: '취소요청자', type: 'string'},
partialCancel: {name: '부분취소', type: 'string'},
cashReceiptIssue: {name: '현금영수증발행', type: 'string'},
};
const showSubItems: Record<string, Array<string>> = {
// 신용카드
'01': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
'cancelRequestor', 'partialCancel'],
// 계좌이체
'02': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
'cancelRequestor', 'partialCancel', 'cashReceiptIssue'],
// 가상계좌
'03': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
'cancelRequestor', 'partialCancel', 'cashReceiptIssue'],
// 휴대폰
'04': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
'cancelRequestor'],
// 계좌간편결제
'26': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
'cancelRequestor', 'partialCancel', 'cashReceiptIssue'],
// SSG머니
'21': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
'cancelRequestor'],
// SSG은행계좌
'24': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
'cancelRequestor'],
// 문화상품권
'14': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
'cancelRequestor'],
// 티머니페이
'31': ['buyerName', 'email', 'phoneNumber', 'cancelReason',
'cancelRequestor'],
};
const checkValue = (val: any) => {
return (!!val || val === 0);
};
let newTransactionInfo: Record<string, any> | undefined = transactionInfo;
const subLi = () => {
let rs = [];
if(!!newTransactionInfo && !!serviceCode && !!showSubItems[serviceCode]){
for(let i=0;i<showSubItems[serviceCode].length;i++){
let k = showSubItems[serviceCode][i];
if(!!k){
rs.push(
<li
key={`key-important-item-${i}`}
className="kv-row"
>
<span className="k">·&nbsp;&nbsp;{ subItems[k]?.name }</span>
<span className="v">
{ (checkValue(newTransactionInfo[k]) && subItems[k]?.type === 'string') &&
newTransactionInfo[k]
}
{ (checkValue(newTransactionInfo[k]) && subItems[k]?.type === 'number') &&
<NumericFormat
value={ newTransactionInfo[k] }
thousandSeparator
displayType="text"
suffix='원'
></NumericFormat>
}
{ (checkValue(newTransactionInfo[k]) && subItems[k]?.type === 'date') &&
moment(newTransactionInfo[k]).format('YYYY.MM.DD')
}
</span>
</li>
);
}
}
}
return rs;
};
const variants = { const variants = {
hidden: { height: 0, padding: 0, display: 'none' }, hidden: { height: 0, display: 'none' },
visible: { height: 'auto', paddingTop: '12px', display: 'block' }, visible: { height: 'auto', display: 'block' },
}; };
const onClickToSetShowInfo = () => { const onClickToSetShowInfo = () => {
@@ -35,14 +121,22 @@ export const TransactionInfoWrap = ({
variants={ variants } variants={ variants }
transition={{ duration: 0.3 }} transition={{ duration: 0.3 }}
> >
<li className="kv-row"> { (transactionCategory === TransactionCategory.AllTransaction) &&
<span className="k"></span> subLi()
<span className="v">NICE PAY</span> }
</li> { (transactionCategory === TransactionCategory.Escrow) &&
<li className="kv-row"> <>
<span className="k"></span> <li className="kv-row">
<span className="v">123-45-67890</span> <span className="k"></span>
</li> <span className="v">NICE PAY</span>
</li>
<li className="kv-row">
<span className="k"></span>
<span className="v">123-45-67890</span>
</li>
</>
}
</motion.ul> </motion.ul>
</div> </div>
</> </>

View File

@@ -24,8 +24,6 @@ export const ListDateGroup = ({
transactionCategory={ transactionCategory } transactionCategory={ transactionCategory }
key={ key } key={ key }
tid={ items[i]?.tid } tid={ items[i]?.tid }
issueNumber={ items[i]?.issueNumber }
billKey={ items[i]?.billKey }
mid={ items[i]?.mid } mid={ items[i]?.mid }
stateDate={ items[i]?.stateDate } stateDate={ items[i]?.stateDate }
stateCode={ items[i]?.stateCode } stateCode={ items[i]?.stateCode }
@@ -35,6 +33,23 @@ export const ListDateGroup = ({
serviceName={ items[i]?.serviceName } serviceName={ items[i]?.serviceName }
serviceDetailName={ items[i]?.serviceDetailName } serviceDetailName={ items[i]?.serviceDetailName }
goodsAmount={ items[i]?.goodsAmount } goodsAmount={ items[i]?.goodsAmount }
id={ items[i]?.id }
amount={ items[i]?.amount }
customerName={ items[i]?.customerName }
issueNumber={ items[i]?.issueNumber }
issueStatus={ items[i]?.issueStatus }
paymentMethod={ items[i]?.paymentMethod }
processResult={ items[i]?.processResult }
transactionDateTime={ items[i]?.transactionDateTime }
transactionAmount={ items[i]?.transactionAmount }
deliveryStatus={ items[i]?.deliveryStatus }
settlementStatus={ items[i]?.settlementStatus }
cancelStatus={ items[i]?.cancelStatus }
billKey={ items[i]?.billKey }
orderNumber={ items[i]?.orderNumber }
></ListItem> ></ListItem>
) )
} }

View File

@@ -2,21 +2,18 @@ import { NumericFormat } from 'react-number-format';
import { PATHS } from '@/shared/constants/paths'; import { PATHS } from '@/shared/constants/paths';
import { useNavigate } from '@/shared/lib/hooks/use-navigate'; import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { ListItemProps, TransactionCategory } from '../model/types'; import { ListItemProps, TransactionCategory } from '../model/types';
import moment from 'moment';
export const ListItem = ({ export const ListItem = ({
transactionCategory, transactionCategory,
tid, tid, mid, stateDate, stateCode, stateName,
issueNumber, installmentMonth, serviceCode, serviceName,
billKey, serviceDetailName, goodsAmount,
mid, id, amount, customerName, issueNumber,
stateDate, issueStatus, paymentMethod, processResult,
stateCode, transactionDateTime, transactionAmount,
stateName, deliveryStatus, settlementStatus,
installmentMonth, cancelStatus, billKey, orderNumber
serviceCode,
serviceName,
serviceDetailName,
goodsAmount
}: ListItemProps) => { }: ListItemProps) => {
const { navigate } = useNavigate(); const { navigate } = useNavigate();
const getItemClass = () => { const getItemClass = () => {
@@ -51,7 +48,8 @@ export const ListItem = ({
if(transactionCategory === TransactionCategory.AllTransaction){ if(transactionCategory === TransactionCategory.AllTransaction){
navigate(PATHS.transaction.allTransaction.detail, { navigate(PATHS.transaction.allTransaction.detail, {
state: { state: {
tid: tid tid: tid,
serviceCode: serviceCode
} }
}); });
} }
@@ -82,9 +80,85 @@ export const ListItem = ({
}; };
const getTime = () => { const getTime = () => {
let time = stateDate?.substring(8, 12); let timeStr = '';
let timeStr = time?.substring(0, 2) + ':' + time?.substring(2, 4); if(transactionCategory === TransactionCategory.AllTransaction){
return timeStr; let time = stateDate?.substring(8, 12);
timeStr = time?.substring(0, 2) + ':' + time?.substring(2, 4);
}
else{
timeStr = moment(transactionDateTime).format('HH:mm');
}
return timeStr
};
const getTitle = () => {
let str = '';
if(transactionCategory === TransactionCategory.AllTransaction){
str = `${serviceName}(${serviceDetailName})`;
}
else if(transactionCategory === TransactionCategory.CashReceipt){
str = `${customerName}(${issueNumber})`
}
else if(transactionCategory === TransactionCategory.Escrow){
str = `${customerName}(${issueNumber})`
}
else if(transactionCategory === TransactionCategory.Billing){
str = `${billKey}`
}
return str;
};
const getDetail = () => {
let rs = [];
if(transactionCategory === TransactionCategory.AllTransaction){
rs.push(
<>
<span>{ getTime() }</span>
<span className="separator">|</span>
<span>{ stateName }</span>
<span className="separator">|</span>
<span>{ mid }</span>
</>
);
}
else if(transactionCategory === TransactionCategory.CashReceipt){
rs.push(
<>
<span>{ getTime() }</span>
<span className="separator">|</span>
<span>{ issueStatus }</span>
<span className="separator">|</span>
<span>{ paymentMethod }</span>
<span className="separator">|</span>
<span>{ processResult }</span>
</>
);
}
else if(transactionCategory === TransactionCategory.Escrow){
rs.push(
<>
<span>{ getTime() }</span>
<span className="separator">|</span>
<span>{ deliveryStatus }</span>
<span className="separator">|</span>
<span>{ settlementStatus }</span>
<span className="separator">|</span>
<span>{ cancelStatus }</span>
</>
);
}
else if(transactionCategory === TransactionCategory.Billing){
rs.push(
<>
<span>{ getTime() }</span>
<span className="separator">|</span>
<span>{ processResult }</span>
<span className="separator">|</span>
<span>{ paymentMethod }</span>
</>
);
}
return rs;
}; };
return ( return (
@@ -97,13 +171,9 @@ export const ListItem = ({
<div className={ `status-dot ${getDotClass()}`}></div> <div className={ `status-dot ${getDotClass()}`}></div>
</div> </div>
<div className="transaction-content"> <div className="transaction-content">
<div className="transaction-title">{ `${serviceName}(${serviceDetailName})` }</div> <div className="transaction-title">{ getTitle() }</div>
<div className="transaction-details"> <div className="transaction-details">
<span>{ stateName }</span> { getDetail() }
<span className="separator">|</span>
<span>{ getTime() }</span>
<span className="separator">|</span>
<span>{ mid }</span>
{ (!!installmentMonth && parseInt(installmentMonth) > 1) && { (!!installmentMonth && parseInt(installmentMonth) > 1) &&
<> <>
<span className="separator">|</span> <span className="separator">|</span>

View File

@@ -23,7 +23,7 @@ export const useUserInfo = () => {
accessTokenExpiresIn, accessTokenExpiresIn,
refreshTokenExpiresIn, refreshTokenExpiresIn,
menuGrants, menuGrants,
usrid, // usrid,
// clientAddressIP, // clientAddressIP,
// requires2FA // requires2FA
} = result; } = result;
@@ -33,10 +33,10 @@ export const useUserInfo = () => {
setLocalStorage(StorageKeys.AccessTokenExpiresIn, accessTokenExpiresIn); setLocalStorage(StorageKeys.AccessTokenExpiresIn, accessTokenExpiresIn);
setLocalStorage(StorageKeys.RefreshTokenExpiresIn, refreshTokenExpiresIn); setLocalStorage(StorageKeys.RefreshTokenExpiresIn, refreshTokenExpiresIn);
setLocalStorage(StorageKeys.MenuGrants, menuGrants); setLocalStorage(StorageKeys.MenuGrants, menuGrants);
setLocalStorage(StorageKeys.Usrid, usrid); // setLocalStorage(StorageKeys.Usrid, usrid);
// setLocalStorage(StorageKeys.ClientAddressIP, clientAddressIP); // setLocalStorage(StorageKeys.ClientAddressIP, clientAddressIP);
// setLocalStorage(StorageKeys.Requires2FA, requires2FA); // setLocalStorage(StorageKeys.Requires2FA, requires2FA);
console.log(result)
useStore.getState().UserStore.setUserInfo(result); useStore.getState().UserStore.setUserInfo(result);
} }
} }

View File

@@ -14,7 +14,7 @@ export interface LoginResponse {
accessTokenExpiresIn?: number; accessTokenExpiresIn?: number;
refreshTokenExpiresIn?: number; refreshTokenExpiresIn?: number;
menuGrants?: Array<MenuGrantsItem>; menuGrants?: Array<MenuGrantsItem>;
usrid?: string; // usrid?: string;
clientAddressIP?: string; clientAddressIP?: string;
tempToken?: string, tempToken?: string,
tempTokenExpiresIn?: number; tempTokenExpiresIn?: number;

View File

@@ -56,7 +56,7 @@ export const HomePage = () => {
let accessTokenExpiresIn = getLocalStorage(StorageKeys.AccessTokenExpiresIn); let accessTokenExpiresIn = getLocalStorage(StorageKeys.AccessTokenExpiresIn);
let refreshTokenExpiresIn = getLocalStorage(StorageKeys.RefreshTokenExpiresIn); let refreshTokenExpiresIn = getLocalStorage(StorageKeys.RefreshTokenExpiresIn);
let menuGrants = getLocalStorage(StorageKeys.TokenType); let menuGrants = getLocalStorage(StorageKeys.TokenType);
let usrid = getLocalStorage(StorageKeys.Usrid); // let usrid = getLocalStorage(StorageKeys.Usrid);
useStore.getState().UserStore.setUserInfo({ useStore.getState().UserStore.setUserInfo({
tokenType: tokenType, tokenType: tokenType,
@@ -65,7 +65,7 @@ export const HomePage = () => {
accessTokenExpiresIn: accessTokenExpiresIn, accessTokenExpiresIn: accessTokenExpiresIn,
refreshTokenExpiresIn: refreshTokenExpiresIn, refreshTokenExpiresIn: refreshTokenExpiresIn,
menuGrants: menuGrants, menuGrants: menuGrants,
usrid: usrid // usrid: usrid
}); });
setLoginSuccess(true); setLoginSuccess(true);
} }

View File

@@ -35,6 +35,7 @@ export const AllTransactionDetailPage = () => {
const { navigate } = useNavigate(); const { navigate } = useNavigate();
const location = useLocation(); const location = useLocation();
const tid = location.state.tid; const tid = location.state.tid;
const serviceCode = location.state.serviceCode;
const [amountInfo, setAmountInfo] = useState<AmountInfo>(); const [amountInfo, setAmountInfo] = useState<AmountInfo>();
const [importantInfo, setImportantInfo] = useState<ImportantInfo>(); const [importantInfo, setImportantInfo] = useState<ImportantInfo>();
@@ -137,17 +138,20 @@ export const AllTransactionDetailPage = () => {
amountInfo={ amountInfo } amountInfo={ amountInfo }
show={ showAmountInfo } show={ showAmountInfo }
tid={ tid } tid={ tid }
serviceCode={ serviceCode }
onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) } onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) }
></AmountInfoWrap> ></AmountInfoWrap>
<div className="txn-divider minus"></div> <div className="txn-divider"></div>
<ImportantInfoWrap <ImportantInfoWrap
transactionCategory={ TransactionCategory.AllTransaction } transactionCategory={ TransactionCategory.AllTransaction }
importantInfo={ importantInfo } importantInfo={ importantInfo }
serviceCode={ serviceCode }
></ImportantInfoWrap> ></ImportantInfoWrap>
<div className="txn-divider minus"></div> <div className="txn-divider"></div>
<PaymentInfoWrap <PaymentInfoWrap
transactionCategory={ TransactionCategory.AllTransaction } transactionCategory={ TransactionCategory.AllTransaction }
paymentInfo={ paymentInfo } paymentInfo={ paymentInfo }
serviceCode={ serviceCode }
show={ showPaymentInfo } show={ showPaymentInfo }
onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) } onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) }
></PaymentInfoWrap> ></PaymentInfoWrap>
@@ -155,6 +159,7 @@ export const AllTransactionDetailPage = () => {
<TransactionInfoWrap <TransactionInfoWrap
transactionCategory={ TransactionCategory.AllTransaction } transactionCategory={ TransactionCategory.AllTransaction }
transactionInfo={ transactionInfo } transactionInfo={ transactionInfo }
serviceCode={ serviceCode }
show={ showTransactionInfo } show={ showTransactionInfo }
onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) } onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) }
></TransactionInfoWrap> ></TransactionInfoWrap>
@@ -162,6 +167,7 @@ export const AllTransactionDetailPage = () => {
<SettlementInfoWrap <SettlementInfoWrap
transactionCategory={ TransactionCategory.AllTransaction } transactionCategory={ TransactionCategory.AllTransaction }
settlementInfo={ settlementInfo } settlementInfo={ settlementInfo }
serviceCode={ serviceCode }
show={ showSettlementInfo } show={ showSettlementInfo }
onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) } onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) }
></SettlementInfoWrap> ></SettlementInfoWrap>
@@ -169,6 +175,7 @@ export const AllTransactionDetailPage = () => {
<PartCancelInfoWrap <PartCancelInfoWrap
transactionCategory={ TransactionCategory.AllTransaction } transactionCategory={ TransactionCategory.AllTransaction }
partCancelInfo={ partCancelInfo } partCancelInfo={ partCancelInfo }
serviceCode={ serviceCode }
show={ showPartCancelInfo } show={ showPartCancelInfo }
onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) } onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) }
></PartCancelInfoWrap> ></PartCancelInfoWrap>

View File

@@ -5,7 +5,7 @@ import { IMAGE_ROOT } from '@/shared/constants/common';
import { PATHS } from '@/shared/constants/paths'; import { PATHS } from '@/shared/constants/paths';
import { useNavigate } from '@/shared/lib/hooks/use-navigate'; import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { AllTransactionList } from '@/entities/transaction/ui/all-transaction-list'; import { AllTransactionList } from '@/entities/transaction/ui/all-transaction-list';
import { ListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types'; import { AllTransactionListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types';
import { useAllTransactionListMutation } from '@/entities/transaction/api/use-all-transaction-list-mutation'; import { useAllTransactionListMutation } from '@/entities/transaction/api/use-all-transaction-list-mutation';
import { useAllTransactionListSummaryMutation } from '@/entities/transaction/api/use-all-transaction-list-summary-mutation'; import { useAllTransactionListSummaryMutation } from '@/entities/transaction/api/use-all-transaction-list-summary-mutation';
import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation'; import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation';
@@ -84,12 +84,12 @@ export const AllTransactionListPage = () => {
}); });
}; };
const assembleData = (content: Array<ListItem>) => { const assembleData = (content: Array<AllTransactionListItem>) => {
let data: any = {}; let data: any = {};
if(content && content.length > 0){ if(content && content.length > 0){
for(let i=0;i<content?.length;i++){ for(let i=0;i<content?.length;i++){
let stateDate = content[i]?.stateDate; let stateDate = content[i]?.stateDate?.substring(0, 8);
let groupDate = stateDate?.substring(0, 8); let groupDate = moment(stateDate).format('YYYYMMDD');
if(!!groupDate && !data.hasOwnProperty(groupDate)){ if(!!groupDate && !data.hasOwnProperty(groupDate)){
data[groupDate] = []; data[groupDate] = [];
} }
@@ -141,7 +141,10 @@ export const AllTransactionListPage = () => {
if(!!serviceCodeOptions && serviceCodeOptions.length > 0) if(!!serviceCodeOptions && serviceCodeOptions.length > 0)
for(let i=0;i<serviceCodeOptions.length;i++){ for(let i=0;i<serviceCodeOptions.length;i++){
rs.push( rs.push(
<option value={serviceCodeOptions[i]?.value}>{ serviceCodeOptions[i]?.text }</option> <option
key={`key-${i}`}
value={serviceCodeOptions[i]?.value}
>{ serviceCodeOptions[i]?.text }</option>
) )
} }
return rs; return rs;

View File

@@ -1,28 +1,15 @@
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useLocation } from 'react-router'; import { useLocation } from 'react-router';
import { PATHS } from '@/shared/constants/paths'; import { PATHS } from '@/shared/constants/paths';
import { Dialog } from '@/shared/ui/dialogs/dialog';
import { overlay } from 'overlay-kit';
import { useNavigate } from '@/shared/lib/hooks/use-navigate'; import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { useBillingDetailMutation } from '@/entities/transaction/api/use-billing-detail-mutation'; import { useBillingDetailMutation } from '@/entities/transaction/api/use-billing-detail-mutation';
import { AmountInfoWrap } from '@/entities/transaction/ui/info-wrap/amount-info-wrap'; import { BillingInfoWrap } from '@/entities/transaction/ui/info-wrap/billing-info-wrap';
import { ImportantInfoWrap } from '@/entities/transaction/ui/info-wrap/important-info-wrap';
import { PaymentInfoWrap } from '@/entities/transaction/ui/info-wrap/payment-info-wrap';
import { TransactionInfoWrap } from '@/entities/transaction/ui/info-wrap/transaction-info-wrap';
import { SettlementInfoWrap } from '@/entities/transaction/ui/info-wrap/settlement-info-wrap';
import { PartCancelInfoWrap } from '@/entities/transaction/ui/info-wrap/part-cancel-info-wrap';
import { HeaderType } from '@/entities/common/model/types'; import { HeaderType } from '@/entities/common/model/types';
import { import {
TransactionCategory, TransactionCategory,
BillingDetailParams, BillingDetailParams,
DetailResponse, BillingDetailResponse,
AmountInfo, BillingInfo
ImportantInfo,
PaymentInfo,
TransactionInfo,
SettlementInfo,
PartCancelInfo,
InfoWrapKeys
} from '@/entities/transaction/model/types'; } from '@/entities/transaction/model/types';
import { import {
useSetOnBack, useSetOnBack,
@@ -35,17 +22,7 @@ export const BillingDetailPage = () => {
const { navigate } = useNavigate(); const { navigate } = useNavigate();
const location = useLocation(); const location = useLocation();
const [amountInfo, setAmountInfo] = useState<AmountInfo>(); const [billingInfo, setBillingInfo] = useState<BillingInfo>();
const [importantInfo, setImportantInfo] = useState<ImportantInfo>();
const [paymentInfo, setPaymentInfo] = useState<PaymentInfo>();
const [transactionInfo, setTransactionInfo] = useState<TransactionInfo>();
const [settlementInfo, setSettlementInfo] = useState<SettlementInfo>();
const [partCancelInfo, setPartCancelInfo] = useState<PartCancelInfo>();
const [showAmount, setShowAmount] = useState<boolean>(false);
const [showPayment, setShowPayment] = useState<boolean>(false);
const [showTransaction, setShowTransaction] = useState<boolean>(false);
const [showSettlement, setShowSettlement] = useState<boolean>(false);
const [showPartCancel, setShowPartCancel] = useState<boolean>(false);
useSetHeaderTitle('빌링 상세'); useSetHeaderTitle('빌링 상세');
useSetHeaderType(HeaderType.RightClose); useSetHeaderType(HeaderType.RightClose);
@@ -60,37 +37,14 @@ export const BillingDetailPage = () => {
let billingDetailParams: BillingDetailParams = { let billingDetailParams: BillingDetailParams = {
billKey: location?.state.billKey billKey: location?.state.billKey
}; };
billingDetail(billingDetailParams).then((rs: DetailResponse) => { billingDetail(billingDetailParams).then((rs: BillingDetailResponse) => {
setAmountInfo(rs.amountInfo); setBillingInfo(rs);
setImportantInfo(rs.importantInfo);
setPaymentInfo(rs.paymentInfo);
setTransactionInfo(rs.transactionInfo);
setSettlementInfo(rs.settlementInfo);
setPartCancelInfo(rs.partCancelInfo);
}); });
}; };
useEffect(() => { useEffect(() => {
callDetail(); callDetail();
}, []); }, []);
const onClickToShowInfo = (infoWrapKey: InfoWrapKeys) => {
if(infoWrapKey === InfoWrapKeys.Amount){
setShowAmount(!showAmount);
}
else if(infoWrapKey === InfoWrapKeys.Payment){
setShowPayment(!showPayment);
}
else if(infoWrapKey === InfoWrapKeys.Transaction){
setShowTransaction(!showTransaction);
}
else if(infoWrapKey === InfoWrapKeys.Settlement){
setShowSettlement(!showSettlement);
}
else if(infoWrapKey === InfoWrapKeys.PartCancel){
setShowPartCancel(!showPartCancel);
}
};
return ( return (
<> <>
<main> <main>
@@ -98,48 +52,12 @@ export const BillingDetailPage = () => {
<div className="tab-pane sub active"> <div className="tab-pane sub active">
<div className="option-list"> <div className="option-list">
<div className="txn-detail"> <div className="txn-detail">
<AmountInfoWrap <BillingInfoWrap
transactionCategory={ TransactionCategory.Billing } transactionCategory={ TransactionCategory.Billing }
amountInfo={ amountInfo } billingInfo={ billingInfo }
show={ showAmount } ></BillingInfoWrap>
onClickToShowInfo={ (info) => onClickToShowInfo(info) }
></AmountInfoWrap>
<div className="txn-divider minus"></div>
<ImportantInfoWrap
transactionCategory={ TransactionCategory.Billing }
importantInfo={ importantInfo }
></ImportantInfoWrap>
<div className="txn-divider minus"></div>
<PaymentInfoWrap
transactionCategory={ TransactionCategory.Billing }
paymentInfo={ paymentInfo }
show={ showPayment }
onClickToShowInfo={ (info) => onClickToShowInfo(info) }
></PaymentInfoWrap>
<div className="txn-divider"></div>
<TransactionInfoWrap
transactionCategory={ TransactionCategory.Billing }
transactionInfo={ transactionInfo }
show={ showTransaction }
onClickToShowInfo={ (info) => onClickToShowInfo(info) }
></TransactionInfoWrap>
<div className="txn-divider"></div>
<SettlementInfoWrap
transactionCategory={ TransactionCategory.Billing }
settlementInfo={ settlementInfo }
show={ showSettlement }
onClickToShowInfo={ (info) => onClickToShowInfo(info) }
></SettlementInfoWrap>
<div className="txn-divider"></div>
<PartCancelInfoWrap
transactionCategory={ TransactionCategory.Billing }
partCancelInfo={ partCancelInfo }
show={ showPartCancel }
onClickToShowInfo={ (info) => onClickToShowInfo(info) }
></PartCancelInfoWrap>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</main> </main>

View File

@@ -1,10 +1,11 @@
import moment from 'moment'; import moment from 'moment';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useStore } from '@/shared/model/store';
import { IMAGE_ROOT } from '@/shared/constants/common'; import { IMAGE_ROOT } from '@/shared/constants/common';
import { PATHS } from '@/shared/constants/paths'; import { PATHS } from '@/shared/constants/paths';
import { useNavigate } from '@/shared/lib/hooks/use-navigate'; import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { BillingList } from '@/entities/transaction/ui/billing-list'; import { BillingList } from '@/entities/transaction/ui/billing-list';
import { ListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types'; import { BillingListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types';
import { useBillingListMutation } from '@/entities/transaction/api/use-billing-list-mutation'; import { useBillingListMutation } from '@/entities/transaction/api/use-billing-list-mutation';
import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation'; import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation';
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constants'; import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constants';
@@ -27,6 +28,7 @@ const serviceCodes = [
export const BillingListPage = () => { export const BillingListPage = () => {
const { navigate } = useNavigate(); const { navigate } = useNavigate();
const userInfo = useStore((state) => state.UserStore.UserInfo);
const [selectedServiceCode, setSelectedServiceCode] = useState<string>('all'); const [selectedServiceCode, setSelectedServiceCode] = useState<string>('all');
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New); const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
@@ -69,12 +71,11 @@ export const BillingListPage = () => {
}); });
} }
const assembleData = (content: Array<ListItem>) => { const assembleData = (content: Array<BillingListItem>) => {
let data: any = {}; let data: any = {};
if(content && content.length > 0){ if(content && content.length > 0){
for(let i=0;i<content?.length;i++){ for(let i=0;i<content?.length;i++){
let stateDate = content[i]?.stateDate; let groupDate = moment(content[i]?.transactionDateTime).format('YYYYMMDD');
let groupDate = stateDate?.substring(0, 8);
if(!!groupDate && !data.hasOwnProperty(groupDate)){ if(!!groupDate && !data.hasOwnProperty(groupDate)){
data[groupDate] = []; data[groupDate] = [];
} }

View File

@@ -1,8 +1,6 @@
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useLocation } from 'react-router'; import { useLocation } from 'react-router';
import { PATHS } from '@/shared/constants/paths'; import { PATHS } from '@/shared/constants/paths';
import { Dialog } from '@/shared/ui/dialogs/dialog';
import { overlay } from 'overlay-kit';
import { useNavigate } from '@/shared/lib/hooks/use-navigate'; import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { useCashReceiptDetailMutation } from '@/entities/transaction/api/use-cash-receipt-detail-mutation'; import { useCashReceiptDetailMutation } from '@/entities/transaction/api/use-cash-receipt-detail-mutation';
import { IssueInfoWrap } from '@/entities/transaction/ui/info-wrap/issue-info-wrap'; import { IssueInfoWrap } from '@/entities/transaction/ui/info-wrap/issue-info-wrap';
@@ -29,7 +27,6 @@ export const CashReceiptDetailPage = () => {
const [issueInfo, setIssueInfo] = useState<IssueInfo>(); const [issueInfo, setIssueInfo] = useState<IssueInfo>();
const [detailInfo, setDetailInfo] = useState<DetailInfo>(); const [detailInfo, setDetailInfo] = useState<DetailInfo>();
const [showIssueInfo, setShowIssueInfo] = useState<boolean>(false);
const [showDetailInfo, setShowDetailInfo] = useState<boolean>(false); const [showDetailInfo, setShowDetailInfo] = useState<boolean>(false);
useSetHeaderTitle('현금영수증 상세'); useSetHeaderTitle('현금영수증 상세');
@@ -55,10 +52,7 @@ export const CashReceiptDetailPage = () => {
}, []); }, []);
const onClickToShowInfo = (infoWrapKey: InfoWrapKeys) => { const onClickToShowInfo = (infoWrapKey: InfoWrapKeys) => {
if(infoWrapKey === InfoWrapKeys.Issue){ if(infoWrapKey === InfoWrapKeys.Detail){
setShowIssueInfo(!showIssueInfo);
}
else if(infoWrapKey === InfoWrapKeys.Detail){
setShowDetailInfo(!showDetailInfo); setShowDetailInfo(!showDetailInfo);
} }
}; };
@@ -73,8 +67,6 @@ export const CashReceiptDetailPage = () => {
<IssueInfoWrap <IssueInfoWrap
transactionCategory={ TransactionCategory.CashReceipt } transactionCategory={ TransactionCategory.CashReceipt }
issueInfo={ issueInfo } issueInfo={ issueInfo }
show={ showIssueInfo }
onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) }
></IssueInfoWrap> ></IssueInfoWrap>
<div className="txn-divider minus"></div> <div className="txn-divider minus"></div>
<DetailInfoWrap <DetailInfoWrap

View File

@@ -5,7 +5,7 @@ import { IMAGE_ROOT } from '@/shared/constants/common';
import { PATHS } from '@/shared/constants/paths'; import { PATHS } from '@/shared/constants/paths';
import { useNavigate } from '@/shared/lib/hooks/use-navigate'; import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { CashReceiptList } from '@/entities/transaction/ui/cash-receipt-list'; import { CashReceiptList } from '@/entities/transaction/ui/cash-receipt-list';
import { ListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types'; import { CashReceiptListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types';
import { useCashReceiptListMutation } from '@/entities/transaction/api/use-cash-receipt-list-mutation'; import { useCashReceiptListMutation } from '@/entities/transaction/api/use-cash-receipt-list-mutation';
import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation'; import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation';
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constants'; import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constants';
@@ -63,17 +63,17 @@ export const CashReceiptListPage = () => {
}; };
cashReceiptList(listParams).then((rs) => { cashReceiptList(listParams).then((rs) => {
console.log(rs)
setListItems(assembleData(rs.content)); setListItems(assembleData(rs.content));
}); });
}; };
const assembleData = (content: Array<ListItem>) => { const assembleData = (content: Array<CashReceiptListItem>) => {
let data: any = {}; let data: any = {};
if(content && content.length > 0){ if(content && content.length > 0){
for(let i=0;i<content?.length;i++){ for(let i=0;i<content?.length;i++){
let stateDate = content[i]?.stateDate; let groupDate = moment(content[i]?.transactionDateTime).format('YYYYMMDD');
let groupDate = stateDate?.substring(0, 8);
if(!!groupDate && !data.hasOwnProperty(groupDate)){ if(!!groupDate && !data.hasOwnProperty(groupDate)){
data[groupDate] = []; data[groupDate] = [];
} }

View File

@@ -1,10 +1,11 @@
import moment from 'moment'; import moment from 'moment';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useStore } from '@/shared/model/store';
import { IMAGE_ROOT } from '@/shared/constants/common'; import { IMAGE_ROOT } from '@/shared/constants/common';
import { PATHS } from '@/shared/constants/paths'; import { PATHS } from '@/shared/constants/paths';
import { useNavigate } from '@/shared/lib/hooks/use-navigate'; import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { EscrowList } from '@/entities/transaction/ui/escrow-list'; import { EscrowList } from '@/entities/transaction/ui/escrow-list';
import { ListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types'; import { EscrowListItem, TransactionCategory, SortByKeys } from '@/entities/transaction/model/types';
import { useEscrowListMutation } from '@/entities/transaction/api/use-escrow-list-mutation'; import { useEscrowListMutation } from '@/entities/transaction/api/use-escrow-list-mutation';
import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation'; import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation';
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constants'; import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constants';
@@ -26,14 +27,15 @@ const serviceCodes = [
export const EscrowListPage = () => { export const EscrowListPage = () => {
const { navigate } = useNavigate(); const { navigate } = useNavigate();
const userInfo = useStore((state) => state.UserStore.UserInfo);
const [selectedServiceCode, setSelectedServiceCode] = useState<string>('all'); const [selectedServiceCode, setSelectedServiceCode] = useState<string>('all');
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New); const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
const [listItems, setListItems] = useState({}); const [listItems, setListItems] = useState({});
const [filterOn, setFilterOn] = useState<boolean>(false); const [filterOn, setFilterOn] = useState<boolean>(false);
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM); const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
const [startDate, setStartDate] = useState(moment().subtract(1, 'month').format('YYYYMMDD')); const [startDate, setStartDate] = useState(moment().subtract(1, 'month').format('YYYY-MM-DD'));
const [endDate, setEndDate] = useState(moment().format('YYYYMMDD')); const [endDate, setEndDate] = useState(moment().format('YYYY-MM-DD'));
useSetHeaderTitle('에스크로'); useSetHeaderTitle('에스크로');
useSetHeaderType(HeaderType.LeftArrow); useSetHeaderType(HeaderType.LeftArrow);
@@ -49,32 +51,33 @@ export const EscrowListPage = () => {
sortBy?: string, sortBy?: string,
val?: string val?: string
}) => { }) => {
pageParam.sortBy = (option?.sortBy)? option.sortBy: sortBy; // pageParam.sortBy = (option?.sortBy)? option.sortBy: sortBy;
setPageParam(pageParam); setPageParam(pageParam);
let listParams = { let listParams = {
mid: "nictest001m", mid: 'nictest001m',
searchType: "ORDER_NUMBER", searchType: 'ORDER_NUMBER',
searchKeyword: "01384234", searchKeyword: '',
startDate: startDate, startDate: startDate,
endDate: endDate, endDate: endDate,
deliveryStatus: "ALL", deliveryStatus: 'ALL',
settlementStatus: "ALL", settlementStatus: 'ALL',
minAmount: 0, minAmount: 0,
maxAmount: 999999999, maxAmount: 999999999,
pagination: pageParam pagination: pageParam
}; };
console.log(listParams)
escrowList(listParams).then((rs) => { escrowList(listParams).then((rs) => {
setListItems(assembleData(rs.content)); setListItems(assembleData(rs.content));
}); });
}; };
const assembleData = (content: Array<ListItem>) => { const assembleData = (content: Array<EscrowListItem>) => {
let data: any = {}; let data: any = {};
if(content && content.length > 0){ if(content && content.length > 0){
for(let i=0;i<content?.length;i++){ for(let i=0;i<content?.length;i++){
let stateDate = content[i]?.stateDate; let groupDate = moment(content[i]?.transactionDateTime).format('YYYYMMDD');
let groupDate = stateDate?.substring(0, 8);
if(!!groupDate && !data.hasOwnProperty(groupDate)){ if(!!groupDate && !data.hasOwnProperty(groupDate)){
data[groupDate] = []; data[groupDate] = [];
} }

View File

@@ -148,15 +148,15 @@ export const API_URL = {
/* Escro Management - 에스크로 API */ /* Escro Management - 에스크로 API */
escrowList: () => { escrowList: () => {
// POST: 에스크로 목록 조회 // POST: 에스크로 목록 조회
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/escrows/list`; return `${API_BASE_URL}/api/v1/escrows/list`;
}, },
escrowDetail: () => { escrowDetail: () => {
// POST: 에스크로 목록 상세 조회 // POST: 에스크로 목록 상세 조회
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/escrows/detail`; return `${API_BASE_URL}/api/v1/escrows/detail`;
}, },
escroMailResend: () => { escroMailResend: () => {
// POST: 에스크로 메일 재발송 // POST: 에스크로 메일 재발송
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/escrows/mail/resend`; return `${API_BASE_URL}/api/v1/escrows/mail/resend`;
}, },

View File

@@ -19,3 +19,14 @@ main {
.ic20.rot-180{ .ic20.rot-180{
transform: rotate(180deg); transform: rotate(180deg);
} }
.txn-divider{
z-index: 20;
}
.txn-section{
z-index: 20;
background-color: #ffffff;
}
.kv-list{
padding-bottom: 20px;
z-index: 10;
}

View File

@@ -142,7 +142,7 @@ export const Menu = ({
> >
<div className="full-menu-container"> <div className="full-menu-container">
<div className="full-menu-header"> <div className="full-menu-header">
<div className="full-menu-title">{ userInfo.usrid } <span>(madzoneviper)</span></div> <div className="full-menu-title">{ 'nictest001m' } <span>(madzoneviper)</span></div>
<div className="full-menu-actions"> <div className="full-menu-actions">
<button <button
className="full-menu-settings" className="full-menu-settings"