물건목록 페이징갯수, 정렬기준 유지하도록 수정6

This commit is contained in:
basssy 2024-11-13 11:56:03 +09:00
parent 1e7e0ffb64
commit 3e8a57f3a7

View File

@ -173,7 +173,8 @@ export default function Stuff() {
schFromDt: dayjs(new Date()).add(-1, 'year').format('YYYY-MM-DD'),
schToDt: dayjs(new Date()).format('YYYY-MM-DD'),
startRow: (pageNo - 1) * pageSize + 1,
endRow: pageNo * pageSize,
// endRow: pageNo * pageSize,
endRow: stuffSearchParams?.endRow,
schSelSaleStoreId: stuffSearchParams?.schSelSaleStoreId ? stuffSearchParams.schSelSaleStoreId : '',
schOtherSelSaleStoreId: stuffSearchParams?.schOtherSelSaleStoreId ? stuffSearchParams.schOtherSelSaleStoreId : '',
schSortType: stuffSearchParams.schSortType,
@ -191,11 +192,7 @@ export default function Stuff() {
})
}
//if (session.storeId === 'T01') {
fetchData()
//} else if (stuffSearch.schSelSaleStoreId !== '') {
//fetchData()
//}
} else if (stuffSearchParams?.code === 'M') {
const params = {
saleStoreId: session?.storeId,
@ -255,12 +252,15 @@ export default function Stuff() {
: stuffSearchParams.schSelSaleStoreId
setPageSize(e.target.value)
setStuffSearch({
...stuffSearchParams,
// ...stuffSearchParams,
...stuffSearch,
code: 'S',
startRow: startRow,
endRow: 1 * e.target.value,
})
setPageNo(1)
const apiUrl = `/api/object/list?saleStoreId=${session?.storeId}&${queryStringFormatter(stuffSearchParams)}`
get({ url: apiUrl }).then((res) => {
if (!isEmptyArray(res)) {
@ -346,13 +346,13 @@ export default function Stuff() {
</div>
<div className="left-unit-box">
<div className="select-box mr5" style={{ width: '110px' }}>
<select className="select-light black" name="" id="" onChange={onChangeSortType}>
<select className="select-light black" onChange={onChangeSortType} defaultValue={stuffSearch.schSortType}>
<option value="R">{getMessage('stuff.search.grid.schSortTypeR')}</option>
<option value="U">{getMessage('stuff.search.grid.schSortTypeU')}</option>
</select>
</div>
<div className="select-box" style={{ width: '80px' }}>
<select className="select-light black" name="" id="" onChange={onChangePerPage}>
<select className="select-light black" onChange={onChangePerPage} defaultValue={stuffSearch.endRow}>
<option value="100">100</option>
<option value="200">200</option>
<option value="300">300</option>