diff --git a/src/stores/Reservation.js b/src/stores/Reservation.js index 533aae6..104f416 100644 --- a/src/stores/Reservation.js +++ b/src/stores/Reservation.js @@ -46,18 +46,7 @@ class Reservation { }); } - reservationList = [ - { - key: '1', - id: '1', - referenceNumber: '-', - arrivalDate: '-', - pax: '-', - status: '-', - reservationDate: '-', - guide: '-', - } - ]; + reservationList = []; customerList = [ { diff --git a/src/views/reservation/Detail.jsx b/src/views/reservation/Detail.jsx index 4df116f..0abebec 100644 --- a/src/views/reservation/Detail.jsx +++ b/src/views/reservation/Detail.jsx @@ -79,7 +79,7 @@ function Detail() { pagination={{ hideOnSinglePage: true }} - dataSource={itineraryList} columns={itineraryListColumns} + dataSource={toJS(itineraryList)} columns={itineraryListColumns} /> @@ -88,7 +88,7 @@ function Detail() { Customer Names (Full name as it appears on passport)} itemLayout="horizontal" - dataSource={customerList} + dataSource={toJS(customerList)} renderItem={(item, index) => ( {text}, - }, - { - title: 'Arrival date', - dataIndex: 'arrivalDate', - key: 'Arrival date', - }, - { - title: 'Pax', - key: 'Pax', - dataIndex: 'pax' - }, - { - title: 'Status', - key: 'Status', - dataIndex: 'status' - }, - { - title: 'Reservation date', - key: 'Reservation date', - dataIndex: 'reservationDate' - }, - { - title: 'Guide', - key: 'Guide', - dataIndex: 'guide' - }, -]; - function Newest() { - + const reservationListColumns = [ + { + title: 'Reference number', + dataIndex: 'referenceNumber', + key: 'Reference number', + render: (text, record) => {text}, + }, + { + title: 'Arrival date', + dataIndex: 'arrivalDate', + key: 'Arrival date', + }, + { + title: 'Pax', + key: 'Pax', + dataIndex: 'pax' + }, + { + title: 'Status', + key: 'Status', + dataIndex: 'status' + }, + { + title: 'Reservation date', + key: 'Reservation date', + dataIndex: 'reservationDate' + }, + { + title: 'Guide', + key: 'Guide', + dataIndex: 'guide', + render: guideRender + }, + ]; + + function guideRender(text, record) { + if (record.key === '3') { + return ( + + + + ); + } else { + return ( + + {record.guide} + + + ); + } + } const { reservationStore } = useStore(); const { reservationList } = reservationStore; + const [isModalOpen, setIsModalOpen] = useState(false); + + const showModal = () => { + setIsModalOpen(true); + }; + const handleOk = () => { + setIsModalOpen(false); + }; + const handleCancel = () => { + setIsModalOpen(false); + }; useEffect(() => { console.info('Newest.useEffect'); }, []); return ( - - Newest Reservations - - + <> + + + + + + + + + + Guide + + + + + + + + + + + + + + + + + + + + Newest Reservations + + - - - - Arrival Date - + + + Arrival Date + + + + + + + + + +
'Reservations without the tour guide information will be highlighted in red if the arrival date is within 3 days.'} + bordered + pagination={{ + position: ['bottomCenter'], + current: 1, + pageSize: 10, + total: 200 + }} + columns={reservationListColumns} dataSource={toJS(reservationList)} /> - - - - - - - - -
- - - + + + + ); } diff --git a/src/views/reservation/Print.jsx b/src/views/reservation/Print.jsx index 90a791e..243c4bd 100644 --- a/src/views/reservation/Print.jsx +++ b/src/views/reservation/Print.jsx @@ -3,11 +3,10 @@ import { useEffect } from 'react'; import { observer } from "mobx-react"; import { toJS } from "mobx"; import moment from "moment"; -import { Row, Col, Space, Button, Table, Input, Typography, List } from 'antd'; +import { Row, Col, Space, Table, Typography, List, Watermark } from 'antd'; import { useStore } from '../../stores/StoreContext.js'; const { Title } = Typography; -const { TextArea } = Input; const itineraryListColumns = [ { @@ -48,6 +47,7 @@ function Print() { }, [reservationId]); return ( + @@ -68,11 +68,11 @@ function Print() { ( {index + 1}. {item.title}} + title={{item.title}} description={item.description} /> @@ -106,7 +106,7 @@ function Print() { pagination={{ hideOnSinglePage: true }} - dataSource={itineraryList} columns={itineraryListColumns} + dataSource={toJS(itineraryList)} columns={itineraryListColumns} /> @@ -130,8 +130,8 @@ function Print() { Asia Highlights Contact: - + ); }