|
|
|
@ -2,7 +2,7 @@ import { NavLink } from "react-router-dom";
|
|
|
|
|
import { useState } from 'react';
|
|
|
|
|
import { observer } from "mobx-react";
|
|
|
|
|
import { toJS } from "mobx";
|
|
|
|
|
import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, Radio, Modal, App } from 'antd';
|
|
|
|
|
import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, Radio, Modal, App, Select } from 'antd';
|
|
|
|
|
import { useStore } from '@/stores/StoreContext.js';
|
|
|
|
|
|
|
|
|
|
const { Title } = Typography;
|
|
|
|
@ -13,7 +13,7 @@ function Newest() {
|
|
|
|
|
title: 'Reference number',
|
|
|
|
|
dataIndex: 'referenceNumber',
|
|
|
|
|
key: 'Reference number',
|
|
|
|
|
render: (text, record) => <NavLink to={`/reservation/${record.id}`}>{text}</NavLink>,
|
|
|
|
|
render: (text, record) => <NavLink to={`/reservation/${record.referenceId}`}>{text}</NavLink>,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: 'Arrival date',
|
|
|
|
@ -59,6 +59,42 @@ function Newest() {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function cityGuideRender(text, city) {
|
|
|
|
|
return (
|
|
|
|
|
<Select
|
|
|
|
|
showSearch
|
|
|
|
|
style={{
|
|
|
|
|
width: 280,
|
|
|
|
|
}}
|
|
|
|
|
placeholder="Select a guide"
|
|
|
|
|
optionFilterProp="children"
|
|
|
|
|
onChange={(value) => {
|
|
|
|
|
console.log(`selected ${value}`);
|
|
|
|
|
}}
|
|
|
|
|
onSearch={(value) => {
|
|
|
|
|
console.log('search:', value);
|
|
|
|
|
}}
|
|
|
|
|
filterOption={(input, option) =>
|
|
|
|
|
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
|
|
|
|
|
}
|
|
|
|
|
options={[
|
|
|
|
|
{
|
|
|
|
|
value: 'jack',
|
|
|
|
|
label: 'Jack',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'lucy',
|
|
|
|
|
label: 'Lucy',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'tom',
|
|
|
|
|
label: 'Tom',
|
|
|
|
|
},
|
|
|
|
|
]}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
const { reservationStore } = useStore();
|
|
|
|
|
const { reservationList, reservationPage, cityList } = reservationStore;
|
|
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
|
|
@ -67,9 +103,8 @@ function Newest() {
|
|
|
|
|
const [dataLoading, setDataLoading] = useState(false);
|
|
|
|
|
const { notification } = App.useApp();
|
|
|
|
|
|
|
|
|
|
const showModal = (reservation) => {
|
|
|
|
|
console.info(reservation);
|
|
|
|
|
|
|
|
|
|
const showModal = (reservation) => {
|
|
|
|
|
setIsModalOpen(true);
|
|
|
|
|
reservationStore.fetchCityList(reservation.referenceId)
|
|
|
|
|
.catch(ex => {
|
|
|
|
|
notification.error({
|
|
|
|
@ -82,7 +117,6 @@ function Newest() {
|
|
|
|
|
.finally(() => {
|
|
|
|
|
setDataLoading(false);
|
|
|
|
|
});
|
|
|
|
|
setIsModalOpen(true);
|
|
|
|
|
};
|
|
|
|
|
const handleOk = () => {
|
|
|
|
|
setIsModalOpen(false);
|
|
|
|
@ -128,61 +162,14 @@ function Newest() {
|
|
|
|
|
{
|
|
|
|
|
title: 'Tour Guide',
|
|
|
|
|
dataIndex: 'tourGuide',
|
|
|
|
|
key: 'tourGuide'
|
|
|
|
|
key: 'tourGuide',
|
|
|
|
|
render: cityGuideRender,
|
|
|
|
|
}
|
|
|
|
|
]}
|
|
|
|
|
dataSource={toJS(cityList)}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row gutter={{ md: 24 }}>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<Title level={5}>Guide</Title>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
<Row gutter={{ md: 24 }}>
|
|
|
|
|
<Col span={16}>
|
|
|
|
|
<Input placeholder="Guide" />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={8}>
|
|
|
|
|
<Button type='primary' onClick={() => {}}>Search</Button>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row gutter={{ md: 24 }}>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<Radio.Group options={[
|
|
|
|
|
{
|
|
|
|
|
label: 'Jim',
|
|
|
|
|
value: '1',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'Giffigan',
|
|
|
|
|
value: '2',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'Herry',
|
|
|
|
|
value: '3',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'Giffigan',
|
|
|
|
|
value: '4',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'Herry',
|
|
|
|
|
value: '5',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'Giffigan',
|
|
|
|
|
value: '6',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'Herry',
|
|
|
|
|
value: '7',
|
|
|
|
|
},
|
|
|
|
|
]} />
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Space>
|
|
|
|
|
</Modal>
|
|
|
|
|
<Space direction="vertical" style={{ width: '100%' }}>
|
|
|
|
|