sort 구조 변경
This commit is contained in:
@@ -230,7 +230,7 @@ export const ListItem = ({
|
||||
</div>
|
||||
<div className="transaction-amount">
|
||||
<NumericFormat
|
||||
value={ goodsAmount }
|
||||
value={ goodsAmount || amount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix={ '원' }
|
||||
|
||||
@@ -34,25 +34,22 @@ export const ListWrap = () => {
|
||||
|
||||
const { mutateAsync: vatReturnList } = useVatReturnListMutation();
|
||||
|
||||
const callList = (option?: {
|
||||
sortType?: SortTypeKeys
|
||||
}) => {
|
||||
const callList = () => {
|
||||
let params: VatReturnListParams = {
|
||||
mid: mid,
|
||||
startMonth: startMonth,
|
||||
endMonth: endMonth,
|
||||
receiptType: receiptType,
|
||||
targetType: targetType,
|
||||
page: pageParam
|
||||
page: {
|
||||
...pageParam,
|
||||
...{ sortType: sortType }
|
||||
}
|
||||
};
|
||||
if(params.page){
|
||||
params.page.sortType = option?.sortType || sortType;
|
||||
setPageParam(params.page);
|
||||
}
|
||||
|
||||
vatReturnList(params).then((rs: VatReturnListResponse) => {
|
||||
setListItems(rs.content);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
const onClickToOpenFIlter = () => {
|
||||
@@ -72,7 +69,7 @@ export const ListWrap = () => {
|
||||
callList();
|
||||
}, [
|
||||
mid, startMonth, endMonth,
|
||||
receiptType, targetType
|
||||
receiptType, targetType, sortType
|
||||
]);
|
||||
|
||||
const getListDateGroup = () => {
|
||||
|
||||
@@ -74,17 +74,14 @@ export const AllTransactionListPage = () => {
|
||||
const { mutateAsync: allTransactionListSummary } = useAllTransactionListSummaryMutation();
|
||||
const { mutateAsync: downloadExcel } = useDownloadExcelMutation();
|
||||
|
||||
const callList = (option?: {
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
}) => {
|
||||
const callList = () => {
|
||||
let listSummaryParams: AllTransactionListSummaryParams = {
|
||||
moid: moid,
|
||||
tid: tid,
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
statusCode: statusCode,
|
||||
serviceCode: option?.val || serviceCode,
|
||||
serviceCode: serviceCode,
|
||||
minAmount: minAmount,
|
||||
maxAmount: maxAmount,
|
||||
dateCl: dateCl,
|
||||
@@ -133,9 +130,6 @@ export const AllTransactionListPage = () => {
|
||||
};
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
callList({
|
||||
sortType: sort
|
||||
});
|
||||
};
|
||||
const callServiceCodeOptions = () => {
|
||||
let serviceCodes = useStore.getState().CommonStore.serviceCodes;
|
||||
@@ -147,9 +141,6 @@ export const AllTransactionListPage = () => {
|
||||
let val = e.target.value;
|
||||
// onchagne 에서 useState가 즉시 반영 안되므로 값을 직접 바로 넘긴다.
|
||||
setServiceCode(val);
|
||||
callList({
|
||||
val: val
|
||||
});
|
||||
};
|
||||
|
||||
const getServiceCodeOptions = () => {
|
||||
@@ -173,7 +164,7 @@ export const AllTransactionListPage = () => {
|
||||
useEffect(() => {
|
||||
callList();
|
||||
}, [
|
||||
mid, moid, tid,
|
||||
mid, moid, tid, sortType,
|
||||
fromDate, toDate,
|
||||
statusCode, serviceCode,
|
||||
minAmount, maxAmount,
|
||||
|
||||
@@ -63,19 +63,8 @@ export const BillingListPage = () => {
|
||||
const { mutateAsync: billingList } = useBillingListMutation();
|
||||
const { mutateAsync: downloadExcel } = useDownloadExcelMutation();
|
||||
|
||||
const callList = (option?: {
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
}) => {
|
||||
let newMinAmount = minAmount;
|
||||
if(!!minAmount && typeof(minAmount) === 'string'){
|
||||
newMinAmount = parseInt(minAmount);
|
||||
}
|
||||
let newMaxAmount = maxAmount;
|
||||
if(!!maxAmount && typeof(maxAmount) === 'string'){
|
||||
newMaxAmount = parseInt(maxAmount);
|
||||
}
|
||||
let listParams: BillingListParams = {
|
||||
const callList = () => {
|
||||
let listParams: BillingListParams = {
|
||||
mid: mid,
|
||||
searchType: searchType,
|
||||
searchKeyword: searchKeyword,
|
||||
@@ -84,16 +73,14 @@ export const BillingListPage = () => {
|
||||
requestStatus: requestStatus,
|
||||
processResult: processResult,
|
||||
paymentMethod: paymentMethod,
|
||||
minAmount: newMinAmount,
|
||||
maxAmount: newMaxAmount,
|
||||
page: pageParam
|
||||
minAmount: minAmount,
|
||||
maxAmount: maxAmount,
|
||||
page: {
|
||||
...pageParam,
|
||||
...{ sortType: sortType }
|
||||
}
|
||||
};
|
||||
|
||||
if(listParams.page){
|
||||
listParams.page.sortType = option?.sortType || sortType;
|
||||
setPageParam(listParams.page);
|
||||
}
|
||||
|
||||
billingList(listParams).then((rs: BillingListResponse) => {
|
||||
setListItems(rs.content);
|
||||
});
|
||||
@@ -107,16 +94,10 @@ export const BillingListPage = () => {
|
||||
};
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
callList({
|
||||
sortType: sort
|
||||
});
|
||||
};
|
||||
|
||||
const onClickToRequestStatus = (val: BillingRequestStatus) => {
|
||||
setRequestStatus(val);
|
||||
callList({
|
||||
val: val
|
||||
});
|
||||
};
|
||||
|
||||
const onRequestDownload = (userEmail?: string) => {
|
||||
@@ -124,13 +105,10 @@ export const BillingListPage = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callList();
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
callList();
|
||||
}, [
|
||||
mid, searchType, searchKeyword,
|
||||
startDate, endDate,
|
||||
startDate, endDate, sortType,
|
||||
requestStatus, processResult, paymentMethod,
|
||||
minAmount, maxAmount
|
||||
]);
|
||||
|
||||
@@ -69,16 +69,13 @@ export const CashReceiptListPage = () => {
|
||||
const { mutateAsync: cashReceiptSummary } = useCashReceiptSummaryMutation();
|
||||
const { mutateAsync: downloadExcel } = useDownloadExcelMutation();
|
||||
|
||||
const callList = (option?: {
|
||||
sortType?: SortTypeKeys,
|
||||
val?: CashReceiptTransactionType
|
||||
}) => {
|
||||
const callList = () => {
|
||||
let listSummaryParams: CashReceiptSummaryParams = {
|
||||
mid: mid,
|
||||
startDate: startDate,
|
||||
endDate: endDate,
|
||||
purposeType: purposeType,
|
||||
transactionType: option?.val || transactionType,
|
||||
transactionType: transactionType,
|
||||
processResult: processResult,
|
||||
searchNumberType: searchNumberType,
|
||||
searchNumber: searchNumber,
|
||||
@@ -86,16 +83,12 @@ export const CashReceiptListPage = () => {
|
||||
};
|
||||
let listParams: CashReceiptListParams = {
|
||||
...listSummaryParams,
|
||||
...{
|
||||
page: pageParam
|
||||
page: {
|
||||
...pageParam,
|
||||
...{ sortType: sortType }
|
||||
}
|
||||
};
|
||||
|
||||
if(listParams.page){
|
||||
listParams.page.sortType = option?.sortType || sortType;
|
||||
setPageParam(listParams.page);
|
||||
}
|
||||
|
||||
cashReceiptList(listParams).then((rs: CashReceiptListResponse) => {
|
||||
setListItems(rs.content);
|
||||
});
|
||||
@@ -126,25 +119,16 @@ export const CashReceiptListPage = () => {
|
||||
};
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
callList({
|
||||
sortType: sort
|
||||
});
|
||||
};
|
||||
|
||||
const onClickToTransactionType = (val: CashReceiptTransactionType) => {
|
||||
setTransactionType(val);
|
||||
callList({
|
||||
val: val
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callList();
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
callList();
|
||||
}, [
|
||||
mid, startDate, endDate,
|
||||
mid, startDate, endDate, sortType,
|
||||
purposeType, transactionType, processResult,
|
||||
searchNumberType, searchNumber
|
||||
]);
|
||||
|
||||
@@ -61,19 +61,8 @@ export const EscrowListPage = () => {
|
||||
const { mutateAsync: escrowList } = useEscrowListMutation();
|
||||
const { mutateAsync: downloadExcel } = useDownloadExcelMutation();
|
||||
|
||||
const callList = (option?: {
|
||||
sortType?: SortTypeKeys,
|
||||
val?: string
|
||||
}) => {
|
||||
let newMinAmount = minAmount;
|
||||
if(!!minAmount && typeof(minAmount) === 'string'){
|
||||
newMinAmount = parseInt(minAmount);
|
||||
}
|
||||
let newMaxAmount = maxAmount;
|
||||
if(!!maxAmount && typeof(maxAmount) === 'string'){
|
||||
newMaxAmount = parseInt(maxAmount);
|
||||
}
|
||||
let listParams: EscrowListParams = {
|
||||
const callList = () => {
|
||||
let listParams: EscrowListParams = {
|
||||
mid: mid,
|
||||
searchType: 'ORDER_NUMBER',
|
||||
searchKeyword: searchKeyword,
|
||||
@@ -81,16 +70,14 @@ export const EscrowListPage = () => {
|
||||
endDate: endDate,
|
||||
deliveryStatus: deliveryStatus,
|
||||
settlementStatus: settlementStatus,
|
||||
minAmount: newMinAmount,
|
||||
maxAmount: newMaxAmount,
|
||||
page: pageParam
|
||||
minAmount: minAmount,
|
||||
maxAmount: maxAmount,
|
||||
page: {
|
||||
...pageParam,
|
||||
...{ sortType: sortType }
|
||||
}
|
||||
};
|
||||
|
||||
if(listParams.page){
|
||||
listParams.page.sortType = option?.sortType || sortType;
|
||||
setPageParam(listParams.page);
|
||||
}
|
||||
|
||||
escrowList(listParams).then((rs: EscrowListResponse) => {
|
||||
setListItems(rs.content);
|
||||
});
|
||||
@@ -114,26 +101,17 @@ export const EscrowListPage = () => {
|
||||
};
|
||||
const onClickToSort = (sort: SortTypeKeys) => {
|
||||
setSortType(sort);
|
||||
callList({
|
||||
sortType: sort
|
||||
});
|
||||
};
|
||||
|
||||
const onClickToDeliveryStatus = (val: EscrowDeliveryStatus) => {
|
||||
setDeliveryStatus(val);
|
||||
callList({
|
||||
val: val
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callList();
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
callList();
|
||||
}, [
|
||||
mid, searchType, searchKeyword,
|
||||
startDate, endDate,
|
||||
startDate, endDate, sortType,
|
||||
deliveryStatus, settlementStatus,
|
||||
minAmount, maxAmount
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user