- 거래내역 필터 기획상 미일치 수정

This commit is contained in:
HyeonJongKim
2025-11-21 17:22:40 +09:00
parent 622515485c
commit 487bf2b3f1
7 changed files with 61 additions and 23 deletions

View File

@@ -172,7 +172,14 @@ export const PayoutDetail = ({
</li> </li>
<li className="kv-row"> <li className="kv-row">
<span className="k">{t('additionalService.payout.disbursementDateTime')}</span> <span className="k">{t('additionalService.payout.disbursementDateTime')}</span>
<span className="v">{detail?.settlementDateTime ? moment(detail?.settlementDateTime, 'YYYYMMDDHHmmss').format('YYYY.MM.DD HH:mm:ss') : ""}</span> <span className="v">
{detail?.settlementDateTime
? detail.settlementDateTime.length === 8
? moment(detail.settlementDateTime, 'YYYYMMDD').format('YYYY.MM.DD')
: moment(detail.settlementDateTime, 'YYYYMMDDHHmmss').format('YYYY.MM.DD HH:mm:ss')
: ""
}
</span>
</li> </li>
<li className="kv-row"> <li className="kv-row">
<span className="k">{t('additionalService.payout.businessNumber')}</span> <span className="k">{t('additionalService.payout.businessNumber')}</span>

View File

@@ -56,7 +56,7 @@ export enum AllTransactionServiceCode {
}; };
export enum AllTransactionSearchCl { export enum AllTransactionSearchCl {
ALL = 'ALL', ALL = '',
CARD_NO = 'CARD_NO', CARD_NO = 'CARD_NO',
CARD_APPROVAL_NO = 'CARD_APPROVAL_NO', CARD_APPROVAL_NO = 'CARD_APPROVAL_NO',
BANK_BUYER_NM = 'BANK_BUYER_NM', BANK_BUYER_NM = 'BANK_BUYER_NM',
@@ -774,8 +774,8 @@ export interface AllTransactionFilterProps extends FilterProps {
maxAmount?: number; maxAmount?: number;
cardCode?: string; cardCode?: string;
bankCode?: string; bankCode?: string;
searchCl?: AllTransactionSearchCl; searchCl: AllTransactionSearchCl;
searchValue?: string; searchValue: string;
setMid: (mid: string) => void; setMid: (mid: string) => void;
setMoid: (moid: string) => void; setMoid: (moid: string) => void;
setTid: (tid: string) => void; setTid: (tid: string) => void;
@@ -787,8 +787,8 @@ export interface AllTransactionFilterProps extends FilterProps {
setMaxAmount: (maxAmount?: number) => void; setMaxAmount: (maxAmount?: number) => void;
setCardCode: (cardCode: string | undefined) => void; setCardCode: (cardCode: string | undefined) => void;
setBankCode: (bankCode: string | undefined) => void; setBankCode: (bankCode: string | undefined) => void;
setSearchCl: (searchCl: AllTransactionSearchCl | undefined) => void; setSearchCl: (searchCl: AllTransactionSearchCl) => void;
setSearchValue: (searchValue: string | undefined) => void; setSearchValue: (searchValue: string) => void;
serviceCodeOptions?: Array<Record<string, any>>; serviceCodeOptions?: Array<Record<string, any>>;
}; };
export interface CashReceiptFilterProps extends FilterProps { export interface CashReceiptFilterProps extends FilterProps {

View File

@@ -72,8 +72,8 @@ export const AllTransactionFilter = ({
const [filterCardBankCode, setFilterCardBankCode] = useState<string>(''); const [filterCardBankCode, setFilterCardBankCode] = useState<string>('');
const [filterSearchCl, setFilterSearchCl] = useState<AllTransactionSearchCl | undefined>(searchCl); const [filterSearchCl, setFilterSearchCl] = useState<AllTransactionSearchCl>(searchCl);
const [filterSearchValue, setFilterSearchValue] = useState<string | undefined>(searchValue); const [filterSearchValue, setFilterSearchValue] = useState<string>(searchValue);
const [searchClOptionsGroup, setSearchClOptionsGroup] = useState<Array<Record<string, string>>>([]); const [searchClOptionsGroup, setSearchClOptionsGroup] = useState<Array<Record<string, string>>>([]);
@@ -150,42 +150,57 @@ export const AllTransactionFilter = ({
setFilterServiceCode(value); setFilterServiceCode(value);
if(value === ''){ if(value === ''){
setFilterSearchCl(undefined); options.push({name: t('filter.searchOptions.all'), value: AllTransactionSearchCl.ALL});
} }
else if(value === '01'){ else if(value === '01'){
options.push({name: t('filter.searchOptions.all'), value: AllTransactionSearchCl.ALL});
options.push({name: t('filter.searchOptions.cardNumber'), value: AllTransactionSearchCl.CARD_NO}); options.push({name: t('filter.searchOptions.cardNumber'), value: AllTransactionSearchCl.CARD_NO});
options.push({name: t('filter.searchOptions.approvalNumber'), value: AllTransactionSearchCl.CARD_APPROVAL_NO}); options.push({name: t('filter.searchOptions.approvalNumber'), value: AllTransactionSearchCl.CARD_APPROVAL_NO});
} }
else if(value === '02'){ else if(value === '02'){
options.push({name: t('filter.searchOptions.all'), value: AllTransactionSearchCl.ALL});
options.push({name: t('filter.searchOptions.buyerName'), value: AllTransactionSearchCl.BANK_BUYER_NM}); options.push({name: t('filter.searchOptions.buyerName'), value: AllTransactionSearchCl.BANK_BUYER_NM});
} }
else if(value === '03'){ else if(value === '03'){
options.push({name: t('filter.searchOptions.all'), value: AllTransactionSearchCl.ALL});
options.push({name: t('filter.searchOptions.virtualAccountNumber'), value: AllTransactionSearchCl.VACCT_NO}); options.push({name: t('filter.searchOptions.virtualAccountNumber'), value: AllTransactionSearchCl.VACCT_NO});
options.push({name: t('filter.searchOptions.depositorName'), value: AllTransactionSearchCl.VACCT_DEPOSIT_NM}); options.push({name: t('filter.searchOptions.depositorName'), value: AllTransactionSearchCl.VACCT_DEPOSIT_NM});
} }
else if(value === '05'){ else if(value === '05'){
options.push({name: t('filter.searchOptions.all'), value: AllTransactionSearchCl.ALL});
options.push({name: t('filter.searchOptions.phoneNumber'), value: AllTransactionSearchCl.TEL_NO}); options.push({name: t('filter.searchOptions.phoneNumber'), value: AllTransactionSearchCl.TEL_NO});
} }
else if(value === '14'){ else if(value === '14'){
options.push({name: t('filter.searchOptions.all'), value: AllTransactionSearchCl.ALL});
options.push({name: t('filter.searchOptions.culturelandId'), value: AllTransactionSearchCl.SSGMONEY_GIFT_NO}); options.push({name: t('filter.searchOptions.culturelandId'), value: AllTransactionSearchCl.SSGMONEY_GIFT_NO});
} }
else if(value === '21'){ else if(value === '21'){
options.push({name: t('filter.searchOptions.all'), value: AllTransactionSearchCl.ALL});
options.push({name: t('filter.searchOptions.giftCardNumber'), value: AllTransactionSearchCl.SSGBANK_APPROVAL_NO}); options.push({name: t('filter.searchOptions.giftCardNumber'), value: AllTransactionSearchCl.SSGBANK_APPROVAL_NO});
} }
else if(value === '24'){ else if(value === '24'){
options.push({name: t('filter.searchOptions.all'), value: AllTransactionSearchCl.ALL});
options.push({name: t('filter.searchOptions.approvalNumber'), value: AllTransactionSearchCl.CMSBANK_USER_ID}); options.push({name: t('filter.searchOptions.approvalNumber'), value: AllTransactionSearchCl.CMSBANK_USER_ID});
} }
else if(value === '26'){ else if(value === '26'){
options.push({name: t('filter.searchOptions.all'), value: AllTransactionSearchCl.ALL});
options.push({name: t('filter.searchOptions.customerId'), value: AllTransactionSearchCl.SSGBANK_APPROVAL_NO}); options.push({name: t('filter.searchOptions.customerId'), value: AllTransactionSearchCl.SSGBANK_APPROVAL_NO});
} }
else if(value === '31'){ else if(value === '31'){
options.push({name: t('filter.searchOptions.all'), value: AllTransactionSearchCl.ALL});
options.push({name: t('filter.searchOptions.tmoneyCardNumber'), value: AllTransactionSearchCl.TMONEY_CARD_NO}); options.push({name: t('filter.searchOptions.tmoneyCardNumber'), value: AllTransactionSearchCl.TMONEY_CARD_NO});
} }
setSearchClOptionsGroup(options); setSearchClOptionsGroup(options);
// 옵션이 있을 경우 첫 번째 옵션을 자동으로 선택 // 현재 searchCl이 기본값이 아니고 새 옵션 목록에 없으면 첫 번째 옵션으로 설정하고 searchValue 초기화
if(options.length > 0 && options[0]){ if(options.length > 0 && options[0]){
setFilterSearchCl(options[0].value as AllTransactionSearchCl); if (filterSearchCl !== '') {
const currentSearchClExists = options.some(opt => opt.value === filterSearchCl);
if (!currentSearchClExists) {
setFilterSearchCl(options[0].value as AllTransactionSearchCl);
setFilterSearchValue('');
}
}
} }
}; };
@@ -204,6 +219,12 @@ export const AllTransactionFilter = ({
setSearchClOptions(val); setSearchClOptions(val);
}; };
const handleSearchClChange = (value: any) => {
setFilterSearchCl(value);
// searchCl이 변경되면 searchValue 초기화
setFilterSearchValue('');
};
useEffect(() => { useEffect(() => {
onChangeServiceCode(serviceCode); onChangeServiceCode(serviceCode);
@@ -289,12 +310,13 @@ export const AllTransactionFilter = ({
<FilterSelectInput <FilterSelectInput
title={t('filter.detailSearch')} title={t('filter.detailSearch')}
selectValue={ filterSearchCl } selectValue={ filterSearchCl }
selectSetter={ setFilterSearchCl } selectSetter={ handleSearchClChange }
selectOptions={ searchClOptionsGroup } selectOptions={ searchClOptionsGroup }
inputValue={ filterSearchValue } inputValue={ filterSearchValue }
inputSetter={ setFilterSearchValue } inputSetter={ setFilterSearchValue }
handleInputFocus={ handleInputFocus} handleInputFocus={ handleInputFocus}
keyboardAwarePadding={ keyboardAwarePadding } keyboardAwarePadding={ keyboardAwarePadding }
disabled={ filterSearchCl === AllTransactionSearchCl.ALL }
></FilterSelectInput> ></FilterSelectInput>
</div> </div>

View File

@@ -109,6 +109,7 @@
"processingResult": "Result", "processingResult": "Result",
"deliveryStatus": "Delivery Status", "deliveryStatus": "Delivery Status",
"searchOptions": { "searchOptions": {
"all": "All",
"cardNumber": "Card Number", "cardNumber": "Card Number",
"approvalNumber": "Approval Number", "approvalNumber": "Approval Number",
"buyerName": "Purchaser Name", "buyerName": "Purchaser Name",

View File

@@ -109,6 +109,7 @@
"processingResult": "처리결과", "processingResult": "처리결과",
"deliveryStatus": "배송상태", "deliveryStatus": "배송상태",
"searchOptions": { "searchOptions": {
"all": "전체",
"cardNumber": "카드번호", "cardNumber": "카드번호",
"approvalNumber": "승인번호", "approvalNumber": "승인번호",
"buyerName": "구매자명", "buyerName": "구매자명",

View File

@@ -52,8 +52,8 @@ const defaultParams = {
maxAmount: undefined, maxAmount: undefined,
cardCode: undefined, cardCode: undefined,
bankCode: undefined, bankCode: undefined,
searchCl: undefined, searchCl: '' as AllTransactionSearchCl,
searchValue: undefined searchValue: ''
}; };
export const AllTransactionListPage = () => { export const AllTransactionListPage = () => {
const { navigate } = useNavigate(); const { navigate } = useNavigate();
@@ -81,8 +81,8 @@ export const AllTransactionListPage = () => {
const [maxAmount, setMaxAmount] = useState<number | undefined>(defaultParams.maxAmount); const [maxAmount, setMaxAmount] = useState<number | undefined>(defaultParams.maxAmount);
const [cardCode, setCardCode] = useState<string | undefined>(defaultParams.cardCode); const [cardCode, setCardCode] = useState<string | undefined>(defaultParams.cardCode);
const [bankCode, setBankCode] = useState<string | undefined>(defaultParams.bankCode); const [bankCode, setBankCode] = useState<string | undefined>(defaultParams.bankCode);
const [searchCl, setSearchCl] = useState<AllTransactionSearchCl | undefined>(defaultParams.searchCl); const [searchCl, setSearchCl] = useState<AllTransactionSearchCl>(defaultParams.searchCl);
const [searchValue, setSearchValue] = useState<string | undefined>(defaultParams.searchValue); const [searchValue, setSearchValue] = useState<string>(defaultParams.searchValue);
const [totalCount, setTotalCount] = useState<number>(0); const [totalCount, setTotalCount] = useState<number>(0);
const [totalAmount, setTotalAmount] = useState<number>(0); const [totalAmount, setTotalAmount] = useState<number>(0);
@@ -137,8 +137,8 @@ export const AllTransactionListPage = () => {
goodsName: goodsName, goodsName: goodsName,
cardCode: cardCode, cardCode: cardCode,
bankCode: bankCode, bankCode: bankCode,
searchCl: searchCl, searchCl: searchCl === '' ? undefined : searchCl,
searchValue: searchValue, searchValue: searchCl === '' ? undefined : (searchValue || ""),
sortType: sortType sortType: sortType
}; };
let listParams: AllTransactionListParams = { let listParams: AllTransactionListParams = {
@@ -236,8 +236,8 @@ export const AllTransactionListPage = () => {
goodsName: goodsName, goodsName: goodsName,
cardCode: cardCode, cardCode: cardCode,
bankCode: bankCode, bankCode: bankCode,
searchCl: searchCl, searchCl: searchCl === '' ? undefined : searchCl,
searchValue: searchValue, searchValue: searchCl === '' ? undefined : (searchValue || ""),
}; };
transactionDownloadExcel(params).then((rs: TransactionDownloadExcelResponse) => { transactionDownloadExcel(params).then((rs: TransactionDownloadExcelResponse) => {
console.log(rs); console.log(rs);
@@ -264,6 +264,10 @@ export const AllTransactionListPage = () => {
let val = e.target.value; let val = e.target.value;
// onchagne 에서 useState가 즉시 반영 안되므로 값을 직접 바로 넘긴다. // onchagne 에서 useState가 즉시 반영 안되므로 값을 직접 바로 넘긴다.
setServiceCode(val); setServiceCode(val);
// serviceCode 변경 시 searchCl을 전체(ALL)로 초기화
setSearchCl(AllTransactionSearchCl.ALL);
setSearchValue('');
}; };
const getServiceCodeOptions = () => { const getServiceCodeOptions = () => {

View File

@@ -9,6 +9,7 @@ export interface FilterSelectInputProps {
inputSetter?: (value: any) => void; inputSetter?: (value: any) => void;
handleInputFocus?: (e: FocusEvent<HTMLInputElement>) => void; handleInputFocus?: (e: FocusEvent<HTMLInputElement>) => void;
keyboardAwarePadding?: CSSProperties; keyboardAwarePadding?: CSSProperties;
disabled?: boolean;
}; };
export const FilterSelectInput = ({ export const FilterSelectInput = ({
title, title,
@@ -18,7 +19,8 @@ export const FilterSelectInput = ({
inputValue, inputValue,
inputSetter, inputSetter,
handleInputFocus, handleInputFocus,
keyboardAwarePadding keyboardAwarePadding,
disabled = false
}: FilterSelectInputProps) => { }: FilterSelectInputProps) => {
const getSelectOptions = () => { const getSelectOptions = () => {
let rs = []; let rs = [];
@@ -66,9 +68,10 @@ export const FilterSelectInput = ({
className="flex-1" className="flex-1"
type="text" type="text"
style={{ height: '38px' }} style={{ height: '38px' }}
value={inputValue} value={inputValue || ''}
onChange={onChangeInput} onChange={onChangeInput}
onFocus={handleInputFocus} onFocus={handleInputFocus}
disabled={disabled}
/> />
</div> </div>
</div> </div>