|
|
@ -3,7 +3,9 @@ import { useState, useEffect } 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, App, Select } from 'antd';
|
|
|
|
import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, Radio, Modal, App, Select } from 'antd';
|
|
|
|
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
import { useStore } from '@/stores/StoreContext.js';
|
|
|
|
import { useStore } from '@/stores/StoreContext.js';
|
|
|
|
|
|
|
|
import { formatDate, isEmpty } from "@/utils/commons";
|
|
|
|
import { DATE_PRESETS } from "@/config";
|
|
|
|
import { DATE_PRESETS } from "@/config";
|
|
|
|
|
|
|
|
|
|
|
|
const { Title } = Typography;
|
|
|
|
const { Title } = Typography;
|
|
|
@ -14,12 +16,19 @@ function Newest() {
|
|
|
|
title: 'Reference number',
|
|
|
|
title: 'Reference number',
|
|
|
|
dataIndex: 'referenceNumber',
|
|
|
|
dataIndex: 'referenceNumber',
|
|
|
|
key: 'Reference number',
|
|
|
|
key: 'Reference number',
|
|
|
|
render: (text, record) => <NavLink to={`/reservation/${record.reservationId}`}>{text}</NavLink>,
|
|
|
|
render: (text, record) => {
|
|
|
|
|
|
|
|
const requiredHighlight = dayjs(record.arrivalDate).add(2, 'day').isBefore(dayjs(), 'day') && isEmpty(record.guide);
|
|
|
|
|
|
|
|
const linkClassName = requiredHighlight ? 'reservation-highlight' : '';
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<NavLink className={linkClassName} to={`/reservation/${record.reservationId}`}>{text}</NavLink>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: 'Arrival date',
|
|
|
|
title: 'Arrival date',
|
|
|
|
dataIndex: 'arrivalDate',
|
|
|
|
dataIndex: 'arrivalDate',
|
|
|
|
key: 'Arrival date',
|
|
|
|
key: 'Arrival date',
|
|
|
|
|
|
|
|
render: (text, record) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: 'Pax',
|
|
|
|
title: 'Pax',
|
|
|
@ -34,7 +43,8 @@ function Newest() {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: 'Res. sending date',
|
|
|
|
title: 'Res. sending date',
|
|
|
|
key: 'Reservation date',
|
|
|
|
key: 'Reservation date',
|
|
|
|
dataIndex: 'reservationDate'
|
|
|
|
dataIndex: 'reservationDate',
|
|
|
|
|
|
|
|
render: (text, record) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
title: 'Guide',
|
|
|
|
title: 'Guide',
|
|
|
@ -100,6 +110,12 @@ function Newest() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.info(dayjs('2023-5-27').add(3, 'day'));
|
|
|
|
|
|
|
|
// console.info(dayjs().isSame(dayjs('2023-5-27').add(3, 'day'), 'day'));
|
|
|
|
|
|
|
|
// console.info(dayjs().isBefore(dayjs('2023-5-27').add(3, 'day'), 'day'));
|
|
|
|
|
|
|
|
// console.info(dayjs('2023-5-28').add(3, 'day'));
|
|
|
|
|
|
|
|
// console.info(dayjs().isBefore(dayjs('2023-5-28').add(3, 'day'), 'day'));
|
|
|
|
|
|
|
|
|
|
|
|
useEffect (() => {
|
|
|
|
useEffect (() => {
|
|
|
|
if (location.search !== '?back') {
|
|
|
|
if (location.search !== '?back') {
|
|
|
|
// 第一页,未确认计划
|
|
|
|
// 第一页,未确认计划
|
|
|
|