|
|
|
@ -3,7 +3,9 @@ import { useState, useEffect } from 'react';
|
|
|
|
|
import { observer } from "mobx-react";
|
|
|
|
|
import { toJS } from "mobx";
|
|
|
|
|
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 { formatDate, isEmpty } from "@/utils/commons";
|
|
|
|
|
import { DATE_PRESETS } from "@/config";
|
|
|
|
|
import { formatDate, isNotEmpty } from "@/utils/commons";
|
|
|
|
|
|
|
|
|
@ -15,12 +17,19 @@ function Newest() {
|
|
|
|
|
title: 'Reference number',
|
|
|
|
|
dataIndex: 'referenceNumber',
|
|
|
|
|
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',
|
|
|
|
|
dataIndex: 'arrivalDate',
|
|
|
|
|
key: 'Arrival date',
|
|
|
|
|
render: (text, record) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: 'Pax',
|
|
|
|
@ -36,7 +45,7 @@ function Newest() {
|
|
|
|
|
title: 'Res. sending date',
|
|
|
|
|
key: 'Reservation date',
|
|
|
|
|
dataIndex: 'reservationDate',
|
|
|
|
|
render: (text, record) => (isNotEmpty(text) ? formatDate(new Date(text)) : ""),
|
|
|
|
|
render: (text, record) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: 'Guide',
|
|
|
|
@ -79,7 +88,7 @@ function Newest() {
|
|
|
|
|
reservationStore.setupCityGuide(city.cityId, guideId);
|
|
|
|
|
}}
|
|
|
|
|
onSearch={(value) => {
|
|
|
|
|
console.log('search:', value);
|
|
|
|
|
// console.log('search:', value);
|
|
|
|
|
}}
|
|
|
|
|
filterOption={(input, option) =>
|
|
|
|
|
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
|
|
|
|
|