통합거래조회 UI api
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useLocation } from 'react-router';
|
||||
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 { useCashReceiptDetailMutation } from '@/entities/transaction/api/use-cash-receipt-detail-mutation';
|
||||
import { IssueInfoWrap } from '@/entities/transaction/ui/info-wrap/issue-info-wrap';
|
||||
@@ -29,7 +27,6 @@ export const CashReceiptDetailPage = () => {
|
||||
|
||||
const [issueInfo, setIssueInfo] = useState<IssueInfo>();
|
||||
const [detailInfo, setDetailInfo] = useState<DetailInfo>();
|
||||
const [showIssueInfo, setShowIssueInfo] = useState<boolean>(false);
|
||||
const [showDetailInfo, setShowDetailInfo] = useState<boolean>(false);
|
||||
|
||||
useSetHeaderTitle('현금영수증 상세');
|
||||
@@ -55,10 +52,7 @@ export const CashReceiptDetailPage = () => {
|
||||
}, []);
|
||||
|
||||
const onClickToShowInfo = (infoWrapKey: InfoWrapKeys) => {
|
||||
if(infoWrapKey === InfoWrapKeys.Issue){
|
||||
setShowIssueInfo(!showIssueInfo);
|
||||
}
|
||||
else if(infoWrapKey === InfoWrapKeys.Detail){
|
||||
if(infoWrapKey === InfoWrapKeys.Detail){
|
||||
setShowDetailInfo(!showDetailInfo);
|
||||
}
|
||||
};
|
||||
@@ -73,8 +67,6 @@ export const CashReceiptDetailPage = () => {
|
||||
<IssueInfoWrap
|
||||
transactionCategory={ TransactionCategory.CashReceipt }
|
||||
issueInfo={ issueInfo }
|
||||
show={ showIssueInfo }
|
||||
onClickToShowInfo={ (infoWrapKey) => onClickToShowInfo(infoWrapKey) }
|
||||
></IssueInfoWrap>
|
||||
<div className="txn-divider minus"></div>
|
||||
<DetailInfoWrap
|
||||
|
||||
@@ -5,7 +5,7 @@ import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
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 { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constants';
|
||||
@@ -63,17 +63,17 @@ export const CashReceiptListPage = () => {
|
||||
};
|
||||
|
||||
cashReceiptList(listParams).then((rs) => {
|
||||
console.log(rs)
|
||||
setListItems(assembleData(rs.content));
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
const assembleData = (content: Array<ListItem>) => {
|
||||
const assembleData = (content: Array<CashReceiptListItem>) => {
|
||||
let data: any = {};
|
||||
if(content && content.length > 0){
|
||||
for(let i=0;i<content?.length;i++){
|
||||
let stateDate = content[i]?.stateDate;
|
||||
let groupDate = stateDate?.substring(0, 8);
|
||||
let groupDate = moment(content[i]?.transactionDateTime).format('YYYYMMDD');
|
||||
if(!!groupDate && !data.hasOwnProperty(groupDate)){
|
||||
data[groupDate] = [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user