에스크로 빌링 현금영수증 세금계산서 필터 뱃지
This commit is contained in:
@@ -40,6 +40,17 @@ import { useBillingExcelMutation } from '@/entities/transaction/api/use-billing-
|
||||
|
||||
/* 빌링 34 */
|
||||
const menuId = 34;
|
||||
const defaultParams = {
|
||||
searchType: BillingSearchType.ALL,
|
||||
searchKeyword: '',
|
||||
startDate: moment().format('YYYYMMDD'),
|
||||
endDate: moment().format('YYYYMMDD'),
|
||||
requestStatus: BillingRequestStatus.ALL,
|
||||
processResult: BillingProcessResult.ALL,
|
||||
paymentMethod: BillingPaymentMethod.ALL,
|
||||
minAmount: undefined,
|
||||
maxAmount: undefined
|
||||
};
|
||||
export const BillingListPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const { t } = useTranslation();
|
||||
@@ -51,21 +62,23 @@ export const BillingListPage = () => {
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [pageParam, setPageParam] = useState<DefaultRequestPagination>(DEFAULT_PAGE_PARAM);
|
||||
const [mid, setMid] = useState<string>(userMid);
|
||||
const [searchType, setSearchType] = useState<BillingSearchType>(BillingSearchType.ALL);
|
||||
const [searchKeyword, setSearchKeyword] = useState<string>('');
|
||||
const [startDate, setStartDate] = useState(moment().format('YYYYMMDD'));
|
||||
const [endDate, setEndDate] = useState(moment().format('YYYYMMDD'));
|
||||
const [requestStatus, setRequestStatus] = useState<BillingRequestStatus>(BillingRequestStatus.ALL);
|
||||
const [processResult, setProcessResult] = useState<BillingProcessResult>(BillingProcessResult.ALL);
|
||||
const [paymentMethod, setPaymentMethod] = useState<BillingPaymentMethod>(BillingPaymentMethod.ALL);
|
||||
const [minAmount, setMinAmount] = useState<number>();
|
||||
const [maxAmount, setMaxAmount] = useState<number>();
|
||||
const [searchType, setSearchType] = useState<BillingSearchType>(defaultParams.searchType);
|
||||
const [searchKeyword, setSearchKeyword] = useState<string>(defaultParams.searchKeyword);
|
||||
const [startDate, setStartDate] = useState<string>(defaultParams.startDate);
|
||||
const [endDate, setEndDate] = useState<string>(defaultParams.endDate);
|
||||
const [requestStatus, setRequestStatus] = useState<BillingRequestStatus>(defaultParams.requestStatus);
|
||||
const [processResult, setProcessResult] = useState<BillingProcessResult>(defaultParams.processResult);
|
||||
const [paymentMethod, setPaymentMethod] = useState<BillingPaymentMethod>(defaultParams.paymentMethod);
|
||||
const [minAmount, setMinAmount] = useState<number | undefined>(defaultParams.minAmount);
|
||||
const [maxAmount, setMaxAmount] = useState<number | undefined>(defaultParams.maxAmount);
|
||||
|
||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
||||
|
||||
const [detailOn, setDetailOn] = useState<boolean>(false);
|
||||
const [detailTid, setDetailTid] = useState<string>('');
|
||||
|
||||
const [filterUsed, setFilterUsed] = useState<boolean>(false);
|
||||
|
||||
useSetHeaderTitle(t('billing.title'));
|
||||
useSetHeaderType(HeaderType.LeftArrow);
|
||||
useSetOnBack(() => {
|
||||
@@ -213,8 +226,26 @@ export const BillingListPage = () => {
|
||||
setDetailTid(detailData.tid);
|
||||
};
|
||||
|
||||
const checkUsedFilter = () => {
|
||||
let rs: boolean = true;
|
||||
if(searchType === defaultParams.searchType
|
||||
&& searchKeyword === defaultParams.searchKeyword
|
||||
&& startDate === defaultParams.startDate
|
||||
&& endDate === defaultParams.endDate
|
||||
&& requestStatus === defaultParams.requestStatus
|
||||
&& processResult === defaultParams.processResult
|
||||
&& paymentMethod === defaultParams.paymentMethod
|
||||
&& minAmount === defaultParams.minAmount
|
||||
&& maxAmount === defaultParams.maxAmount
|
||||
){
|
||||
rs = false;
|
||||
}
|
||||
setFilterUsed(rs);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callList();
|
||||
checkUsedFilter();
|
||||
}, [
|
||||
mid, searchType, searchKeyword,
|
||||
startDate, endDate, sortType,
|
||||
@@ -242,6 +273,9 @@ export const BillingListPage = () => {
|
||||
alt={ t('transaction.searchOptions') }
|
||||
onClick={ onClickToOpenFilter }
|
||||
/>
|
||||
{ filterUsed &&
|
||||
<span className="notification-badge2"></span>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
<button className="download-btn">
|
||||
|
||||
Reference in New Issue
Block a user