계좌성명 조회 페이지 UI 추가 (내역,상세,요청,필터)
This commit is contained in:
@@ -12,7 +12,7 @@ import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constants';
|
||||
import { Filter } from '@/entities/transaction/ui/filter';
|
||||
import { SortOptionsBox } from '@/entities/transaction/ui/sort-options-box';
|
||||
import { HeaderType } from '@/entities/common/model/types';
|
||||
import {
|
||||
import {
|
||||
useSetOnBack,
|
||||
useSetHeaderTitle,
|
||||
useSetHeaderType,
|
||||
@@ -20,22 +20,22 @@ import {
|
||||
} from '@/widgets/sub-layout/use-sub-layout';
|
||||
|
||||
const serviceCodes = [
|
||||
{name: '전체', key: 'all'},
|
||||
{name: '승인', key: 'approval'},
|
||||
{name: '취소', key: 'cancel'}
|
||||
{ name: '전체', key: 'all' },
|
||||
{ name: '승인', key: 'approval' },
|
||||
{ name: '취소', key: 'cancel' }
|
||||
];
|
||||
|
||||
export const CashReceiptListPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
|
||||
const [selectedServiceCode, setSelectedServiceCode] = useState<string>('all');
|
||||
const [selectedServiceCode, setSelectedServiceCode] = useState<string>('all');
|
||||
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
|
||||
const [listItems, setListItems] = useState({});
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||
const [startDate, setStartDate] = useState(moment().subtract(1, 'month').format('YYYYMMDD'));
|
||||
const [endDate, setEndDate] = useState(moment().format('YYYYMMDD'));
|
||||
|
||||
|
||||
useSetHeaderTitle('현금영수증');
|
||||
useSetHeaderType(HeaderType.LeftArrow);
|
||||
useSetOnBack(() => {
|
||||
@@ -45,70 +45,70 @@ export const CashReceiptListPage = () => {
|
||||
|
||||
const { mutateAsync: cashReceiptList } = useCashReceiptListMutation();
|
||||
const { mutateAsync: downloadExcel } = useDownloadExcelMutation();
|
||||
|
||||
|
||||
const callList = (option?: {
|
||||
sortBy?: string,
|
||||
val?: string
|
||||
}) => {
|
||||
pageParam.sortBy = (option?.sortBy)? option.sortBy: sortBy;
|
||||
setPageParam(pageParam);
|
||||
sortBy?: string,
|
||||
val?: string
|
||||
}) => {
|
||||
pageParam.sortBy = (option?.sortBy) ? option.sortBy : sortBy;
|
||||
setPageParam(pageParam);
|
||||
let listParams = {
|
||||
mid: 'string',
|
||||
startDate: '2025-06-08',
|
||||
endDate: '2025-06-08',
|
||||
purposeType: 'ALL',
|
||||
issueStatus: 'ALL',
|
||||
processResult: 'ALL',
|
||||
mid: 'string',
|
||||
startDate: '2025-06-08',
|
||||
endDate: '2025-06-08',
|
||||
purposeType: 'ALL',
|
||||
issueStatus: 'ALL',
|
||||
processResult: 'ALL',
|
||||
pagination: pageParam
|
||||
};
|
||||
|
||||
cashReceiptList(listParams).then((rs) => {
|
||||
};
|
||||
|
||||
cashReceiptList(listParams).then((rs) => {
|
||||
console.log(rs)
|
||||
setListItems(assembleData(rs.content));
|
||||
});
|
||||
|
||||
};
|
||||
setListItems(assembleData(rs.content));
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
const assembleData = (content: Array<CashReceiptListItem>) => {
|
||||
let data: any = {};
|
||||
if(content && content.length > 0){
|
||||
for(let i=0;i<content?.length;i++){
|
||||
let groupDate = moment(content[i]?.transactionDateTime).format('YYYYMMDD');
|
||||
if(!!groupDate && !data.hasOwnProperty(groupDate)){
|
||||
data[groupDate] = [];
|
||||
}
|
||||
if(!!groupDate && data.hasOwnProperty(groupDate)){
|
||||
data[groupDate].push(content[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return data;
|
||||
};
|
||||
let data: any = {};
|
||||
if (content && content.length > 0) {
|
||||
for (let i = 0; i < content?.length; i++) {
|
||||
let groupDate = moment(content[i]?.transactionDateTime).format('YYYYMMDD');
|
||||
if (!!groupDate && !data.hasOwnProperty(groupDate)) {
|
||||
data[groupDate] = [];
|
||||
}
|
||||
if (!!groupDate && data.hasOwnProperty(groupDate)) {
|
||||
data[groupDate].push(content[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
||||
const onClickToOpenFilter = () => {
|
||||
setFilterOn(!filterOn);
|
||||
};
|
||||
const onClickToDownloadExcel = () => {
|
||||
// tid??? 확인 필요
|
||||
downloadExcel({
|
||||
// tid: tid
|
||||
}).then((rs) => {
|
||||
setFilterOn(!filterOn);
|
||||
};
|
||||
const onClickToDownloadExcel = () => {
|
||||
// tid??? 확인 필요
|
||||
downloadExcel({
|
||||
// tid: tid
|
||||
}).then((rs) => {
|
||||
|
||||
});
|
||||
};
|
||||
const onCliCkToSort = (sort: SortByKeys) => {
|
||||
setSortBy(sort);
|
||||
callList({ sortBy: sort });
|
||||
};
|
||||
|
||||
});
|
||||
};
|
||||
const onCliCkToSort = (sort: SortByKeys) => {
|
||||
setSortBy(sort);
|
||||
callList({sortBy: sort});
|
||||
};
|
||||
|
||||
const onClickToServiceCode = (val: string) => {
|
||||
setSelectedServiceCode(val);
|
||||
callList({val: val});
|
||||
};
|
||||
setSelectedServiceCode(val);
|
||||
callList({ val: val });
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callList();
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
callList();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -118,26 +118,26 @@ export const CashReceiptListPage = () => {
|
||||
<div className="summary-section">
|
||||
<div className="credit-controls">
|
||||
<div>
|
||||
<input
|
||||
type="text"
|
||||
className="credit-period"
|
||||
value={ moment(startDate).format('YYYY.MM.DD') + '-' + moment(endDate).format('YYYY.MM.DD') }
|
||||
readOnly={ true }
|
||||
<input
|
||||
type="text"
|
||||
className="credit-period"
|
||||
value={moment(startDate).format('YYYY.MM.DD') + '-' + moment(endDate).format('YYYY.MM.DD')}
|
||||
readOnly={true}
|
||||
/>
|
||||
<button className="filter-btn">
|
||||
<img
|
||||
src={ IMAGE_ROOT + '/ico_setting.svg' }
|
||||
alt="검색옵션"
|
||||
onClick={ () => onClickToOpenFilter() }
|
||||
/>
|
||||
<img
|
||||
src={IMAGE_ROOT + '/ico_setting.svg'}
|
||||
alt="검색옵션"
|
||||
onClick={() => onClickToOpenFilter()}
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
<button className="download-btn">
|
||||
<img
|
||||
src={ IMAGE_ROOT + '/ico_download.svg' }
|
||||
<img
|
||||
src={IMAGE_ROOT + '/ico_download.svg'}
|
||||
alt="다운로드"
|
||||
onClick={ () => onClickToDownloadExcel() }
|
||||
/>
|
||||
onClick={() => onClickToDownloadExcel()}
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
<div className="credit-summary">
|
||||
@@ -145,19 +145,19 @@ export const CashReceiptListPage = () => {
|
||||
<span className="label">승인</span>
|
||||
<strong className="amount22">
|
||||
<NumericFormat
|
||||
value={ 83745200 }
|
||||
value={83745200}
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix={ '원' }
|
||||
></NumericFormat>
|
||||
suffix={'원'}
|
||||
></NumericFormat>
|
||||
</strong>
|
||||
<span className="count">
|
||||
<NumericFormat
|
||||
value={ 2745 }
|
||||
value={2745}
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
prefix={ '(' }
|
||||
suffix={ '건)' }
|
||||
prefix={'('}
|
||||
suffix={'건)'}
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</div>
|
||||
@@ -165,55 +165,55 @@ export const CashReceiptListPage = () => {
|
||||
<span className="label">취소</span>
|
||||
<strong className="amount19">
|
||||
<NumericFormat
|
||||
value={ 534407 }
|
||||
value={534407}
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix={ '원' }
|
||||
suffix={'원'}
|
||||
></NumericFormat>
|
||||
</strong>
|
||||
<span className="count">
|
||||
<NumericFormat
|
||||
value={ 32 }
|
||||
value={32}
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
prefix={ '(' }
|
||||
suffix={ '건)' }
|
||||
prefix={'('}
|
||||
suffix={'건)'}
|
||||
></NumericFormat>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="filter-section">
|
||||
<SortOptionsBox
|
||||
sortBy={ sortBy }
|
||||
onCliCkToSort={ onCliCkToSort }
|
||||
></SortOptionsBox>
|
||||
<div>
|
||||
sortBy={sortBy}
|
||||
onCliCkToSort={onCliCkToSort}
|
||||
></SortOptionsBox>
|
||||
<div>
|
||||
<div className="full-menu-keywords no-padding">
|
||||
{
|
||||
serviceCodes.map((value, index) => (
|
||||
<span
|
||||
key={ `key-service-code=${ index }` }
|
||||
className={ `keyword-tag ${(selectedServiceCode === value.key)? 'active': ''}` }
|
||||
onClick={ () => onClickToServiceCode(value.key) }
|
||||
>{ value.name }</span>
|
||||
))
|
||||
}
|
||||
{
|
||||
serviceCodes.map((value, index) => (
|
||||
<span
|
||||
key={`key-service-code=${index}`}
|
||||
className={`keyword-tag ${(selectedServiceCode === value.key) ? 'active' : ''}`}
|
||||
onClick={() => onClickToServiceCode(value.key)}
|
||||
>{value.name}</span>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<CashReceiptList
|
||||
listItems={ listItems }
|
||||
transactionCategory={ TransactionCategory.CashReceipt }
|
||||
></CashReceiptList>
|
||||
<CashReceiptList
|
||||
listItems={listItems}
|
||||
transactionCategory={TransactionCategory.CashReceipt}
|
||||
></CashReceiptList>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<Filter
|
||||
filterOn={ filterOn }
|
||||
setFilterOn={ setFilterOn }
|
||||
></Filter>
|
||||
filterOn={filterOn}
|
||||
setFilterOn={setFilterOn}
|
||||
></Filter>
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user