|
|
@ -2,7 +2,7 @@ import { NavLink } from "react-router-dom";
|
|
|
|
import { useEffect, useState } from 'react';
|
|
|
|
import { useEffect, useState } from 'react';
|
|
|
|
import { observer } from "mobx-react";
|
|
|
|
import { observer } from "mobx-react";
|
|
|
|
import { toJS } from "mobx";
|
|
|
|
import { toJS } from "mobx";
|
|
|
|
import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, Radio, Modal } from 'antd';
|
|
|
|
import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, Radio, Modal, App } from 'antd';
|
|
|
|
import { useStore } from '@/stores/StoreContext.js';
|
|
|
|
import { useStore } from '@/stores/StoreContext.js';
|
|
|
|
|
|
|
|
|
|
|
|
const { Title } = Typography;
|
|
|
|
const { Title } = Typography;
|
|
|
@ -64,6 +64,8 @@ function Newest() {
|
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
|
|
const [selectedDateRange, onDateRangeChange] = useState([]);
|
|
|
|
const [selectedDateRange, onDateRangeChange] = useState([]);
|
|
|
|
const [referenceNo, onNumberChange] = useState('');
|
|
|
|
const [referenceNo, onNumberChange] = useState('');
|
|
|
|
|
|
|
|
const [tableLoading, setTableLoading] = useState(false);
|
|
|
|
|
|
|
|
const { notification } = App.useApp();
|
|
|
|
|
|
|
|
|
|
|
|
const showModal = () => {
|
|
|
|
const showModal = () => {
|
|
|
|
setIsModalOpen(true);
|
|
|
|
setIsModalOpen(true);
|
|
|
@ -80,9 +82,19 @@ function Newest() {
|
|
|
|
}, []);
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
|
|
const onSearchClick = () => {
|
|
|
|
const onSearchClick = () => {
|
|
|
|
console.info(selectedDateRange);
|
|
|
|
setTableLoading(true);
|
|
|
|
console.info(referenceNo);
|
|
|
|
reservationStore.fetchReservation(referenceNo, selectedDateRange[0], selectedDateRange[1])
|
|
|
|
reservationStore.fetchReservation(referenceNo, selectedDateRange[0], selectedDateRange[1]);
|
|
|
|
.catch(ex => {
|
|
|
|
|
|
|
|
notification.error({
|
|
|
|
|
|
|
|
message: `Notification`,
|
|
|
|
|
|
|
|
description: ex.message,
|
|
|
|
|
|
|
|
placement: 'top',
|
|
|
|
|
|
|
|
duration: 4,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.finally(() => {
|
|
|
|
|
|
|
|
setTableLoading(false);
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
@ -196,6 +208,7 @@ function Newest() {
|
|
|
|
<Table
|
|
|
|
<Table
|
|
|
|
title={() => 'Reservations without the tour guide information will be highlighted in red if the arrival date is within 3 days.'}
|
|
|
|
title={() => 'Reservations without the tour guide information will be highlighted in red if the arrival date is within 3 days.'}
|
|
|
|
bordered
|
|
|
|
bordered
|
|
|
|
|
|
|
|
loading={tableLoading}
|
|
|
|
pagination={{
|
|
|
|
pagination={{
|
|
|
|
position: ['bottomCenter'],
|
|
|
|
position: ['bottomCenter'],
|
|
|
|
current: 1,
|
|
|
|
current: 1,
|
|
|
|