|
|
|
@ -62,9 +62,9 @@ function Newest() {
|
|
|
|
|
const { reservationStore } = useStore();
|
|
|
|
|
const { reservationList, reservationPage } = reservationStore;
|
|
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
|
|
|
const [selectedDateRange, onDateRangeChange] = useState([]);
|
|
|
|
|
const [arrivalDateRange, onDateRangeChange] = useState([]);
|
|
|
|
|
const [referenceNo, onNumberChange] = useState('');
|
|
|
|
|
const [tableLoading, setTableLoading] = useState(false);
|
|
|
|
|
const [dataLoading, setDataLoading] = useState(false);
|
|
|
|
|
const { notification } = App.useApp();
|
|
|
|
|
|
|
|
|
|
const showModal = () => {
|
|
|
|
@ -77,9 +77,9 @@ function Newest() {
|
|
|
|
|
setIsModalOpen(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onSearchClick = (current) => {
|
|
|
|
|
setTableLoading(true);
|
|
|
|
|
reservationStore.fetchReservationList(current, referenceNo, selectedDateRange[0], selectedDateRange[1])
|
|
|
|
|
const onSearchClick = (current=1) => {
|
|
|
|
|
setDataLoading(true);
|
|
|
|
|
reservationStore.fetchReservationList(current, referenceNo, arrivalDateRange[0], arrivalDateRange[1])
|
|
|
|
|
.catch(ex => {
|
|
|
|
|
notification.error({
|
|
|
|
|
message: `Notification`,
|
|
|
|
@ -89,7 +89,7 @@ function Newest() {
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
setTableLoading(false);
|
|
|
|
|
setDataLoading(false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -196,7 +196,7 @@ function Newest() {
|
|
|
|
|
</Space>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={14}>
|
|
|
|
|
<Button type='primary' onClick={() => onSearchClick(1)}>Search</Button>
|
|
|
|
|
<Button type='primary' onClick={() => onSearchClick()} loading={dataLoading}>Search</Button>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row>
|
|
|
|
@ -204,7 +204,7 @@ function Newest() {
|
|
|
|
|
<Table
|
|
|
|
|
title={() => 'Reservations without the tour guide information will be highlighted in red if the arrival date is within 3 days.'}
|
|
|
|
|
bordered
|
|
|
|
|
loading={tableLoading}
|
|
|
|
|
loading={dataLoading}
|
|
|
|
|
pagination={{
|
|
|
|
|
position: ['bottomCenter'],
|
|
|
|
|
current: reservationPage.current,
|
|
|
|
|