|
|
|
@ -2,12 +2,14 @@ import { useParams, useNavigate } from "react-router-dom";
|
|
|
|
|
import { useEffect, useState } from 'react';
|
|
|
|
|
import { observer } from "mobx-react";
|
|
|
|
|
import { toJS } from "mobx";
|
|
|
|
|
import { Row, Col, Space, Button, Table, Input, Typography, List, App } from 'antd';
|
|
|
|
|
import { Row, Col, Space, Button, Table, Input, Typography, Modal, App } from 'antd';
|
|
|
|
|
import { useStore } from '@/stores/StoreContext.js';
|
|
|
|
|
|
|
|
|
|
const { Title } = Typography;
|
|
|
|
|
const { TextArea } = Input;
|
|
|
|
|
|
|
|
|
|
function Detail() {
|
|
|
|
|
|
|
|
|
|
const itineraryListColumns = [
|
|
|
|
|
{
|
|
|
|
|
title: 'Day',
|
|
|
|
@ -36,13 +38,67 @@ const itineraryListColumns = [
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
function Detail() {
|
|
|
|
|
const confirmationListColumns = [
|
|
|
|
|
{
|
|
|
|
|
title: 'PCI_Changetext',
|
|
|
|
|
dataIndex: 'PCI_Changetext',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: 'PCI_SendDate',
|
|
|
|
|
dataIndex: 'PCI_SendDate',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: 'ConfirmPerson',
|
|
|
|
|
dataIndex: 'ConfirmPerson',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: 'PCI_ConfirmText',
|
|
|
|
|
dataIndex: 'PCI_ConfirmText',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: 'PCI_ConfirmDate',
|
|
|
|
|
dataIndex: 'PCI_ConfirmDate',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: 'Action',
|
|
|
|
|
render: confirmRender
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
function confirmRender(text, confirm) {
|
|
|
|
|
return (
|
|
|
|
|
<Button type="link" onClick={() => showConfirmModal(confirm)}>Confirm</Button>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const navigate = useNavigate();
|
|
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
|
|
|
const [confirmLoading, setConfirmLoading] = useState(false);
|
|
|
|
|
const [confirmText, setConfirmText] = useState('');
|
|
|
|
|
const { notification } = App.useApp();
|
|
|
|
|
const { reservationId } = useParams();
|
|
|
|
|
const { reservationStore } = useStore();
|
|
|
|
|
const [dataLoading, setDataLoading] = useState(false);
|
|
|
|
|
const { itineraryList, customerNames, customerList, reservationDetail } = reservationStore;
|
|
|
|
|
const { itineraryList, customerNames, confirmationList, reservationDetail } = reservationStore;
|
|
|
|
|
|
|
|
|
|
const showConfirmModal = (confirm) => {
|
|
|
|
|
setIsModalOpen(true);
|
|
|
|
|
setConfirmText(confirm.PCI_ConfirmText);
|
|
|
|
|
reservationStore.editConfirmation(confirm);
|
|
|
|
|
console.info(confirm);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleOk = () => {
|
|
|
|
|
setConfirmLoading(true);
|
|
|
|
|
reservationStore.submitConfirmation(confirmText)
|
|
|
|
|
.finally(() => {
|
|
|
|
|
setIsModalOpen(false);
|
|
|
|
|
setConfirmLoading(false);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const handleCancel = () => {
|
|
|
|
|
setIsModalOpen(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
setDataLoading(true);
|
|
|
|
@ -61,6 +117,22 @@ function Detail() {
|
|
|
|
|
}, [reservationId]);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Modal
|
|
|
|
|
centered
|
|
|
|
|
confirmLoading={confirmLoading}
|
|
|
|
|
open={isModalOpen} onOk={handleOk} onCancel={handleCancel}
|
|
|
|
|
>
|
|
|
|
|
<Title level={4}>Confirm</Title>
|
|
|
|
|
<TextArea
|
|
|
|
|
value={confirmText}
|
|
|
|
|
onChange={(e) => setConfirmText(e.target.value)}
|
|
|
|
|
autoSize={{
|
|
|
|
|
minRows: 3,
|
|
|
|
|
maxRows: 5,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Modal>
|
|
|
|
|
<Space direction="vertical" style={{ width: '100%' }}>
|
|
|
|
|
<Row gutter={{ md: 24 }}>
|
|
|
|
|
<Col span={20}>
|
|
|
|
@ -100,21 +172,17 @@ function Detail() {
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={24}><Space direction="vertical" style={{ width: '100%' }}>
|
|
|
|
|
<Title level={5}>Confirmation</Title>
|
|
|
|
|
<TextArea rows={4}
|
|
|
|
|
autoSize={{
|
|
|
|
|
minRows: 2,
|
|
|
|
|
maxRows: 6,
|
|
|
|
|
}}
|
|
|
|
|
value="------变更内容 (2023-04-17):------
|
|
|
|
|
客人火车变更:
|
|
|
|
|
4月27日 D2952(1249-1549)(一等)北站
|
|
|
|
|
4月30日 D1761(1646-2006)(一等)西站
|
|
|
|
|
======收到后请速确认并回执,谢谢! 变更日期:2023-04-16" maxLength={6} />
|
|
|
|
|
<Button type="primary" onClick={() => console.info('submit')}>Submit</Button>
|
|
|
|
|
<Table
|
|
|
|
|
bordered
|
|
|
|
|
loading={dataLoading}
|
|
|
|
|
pagination={false}
|
|
|
|
|
dataSource={toJS(confirmationList)} columns={confirmationListColumns}
|
|
|
|
|
/>
|
|
|
|
|
</Space>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Space>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|