|
|
|
@ -60,7 +60,7 @@ function Newest() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const { reservationStore } = useStore();
|
|
|
|
|
const { reservationList } = reservationStore;
|
|
|
|
|
const { reservationList, reservationPage } = reservationStore;
|
|
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
|
|
|
const [selectedDateRange, onDateRangeChange] = useState([]);
|
|
|
|
|
const [referenceNo, onNumberChange] = useState('');
|
|
|
|
@ -77,9 +77,9 @@ function Newest() {
|
|
|
|
|
setIsModalOpen(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onSearchClick = () => {
|
|
|
|
|
const onSearchClick = (current) => {
|
|
|
|
|
setTableLoading(true);
|
|
|
|
|
reservationStore.fetchReservationList(referenceNo, selectedDateRange[0], selectedDateRange[1])
|
|
|
|
|
reservationStore.fetchReservationList(current, referenceNo, selectedDateRange[0], selectedDateRange[1])
|
|
|
|
|
.catch(ex => {
|
|
|
|
|
notification.error({
|
|
|
|
|
message: `Notification`,
|
|
|
|
@ -196,7 +196,7 @@ function Newest() {
|
|
|
|
|
</Space>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={14}>
|
|
|
|
|
<Button type='primary' onClick={() => onSearchClick()}>Search</Button>
|
|
|
|
|
<Button type='primary' onClick={() => onSearchClick(1)}>Search</Button>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row>
|
|
|
|
@ -207,10 +207,12 @@ function Newest() {
|
|
|
|
|
loading={tableLoading}
|
|
|
|
|
pagination={{
|
|
|
|
|
position: ['bottomCenter'],
|
|
|
|
|
current: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
total: 200
|
|
|
|
|
current: reservationPage.current,
|
|
|
|
|
pageSize: reservationPage.size,
|
|
|
|
|
total: reservationPage.total,
|
|
|
|
|
simple: true
|
|
|
|
|
}}
|
|
|
|
|
onChange={(pagination, filters, sorter, extra) => {onSearchClick(pagination.current);}}
|
|
|
|
|
columns={reservationListColumns} dataSource={toJS(reservationList)}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|