|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
import { useState, useEffect } from "react";
|
|
|
|
|
import { Grid, Divider, Layout, Modal, Form, Input, Col, Row, Space, Collapse, Table, Button, Select, InputNumber, Typography } from "antd";
|
|
|
|
|
import { PhoneOutlined, CustomerServiceOutlined, AudioOutlined, ArrowUpOutlined, ArrowDownOutlined } from "@ant-design/icons";
|
|
|
|
|
import { Grid, Divider, Layout, Modal, Form, Input, Col, Row, Space, Collapse, Table, Button, Select, App, Typography } from "antd";
|
|
|
|
|
import { PhoneOutlined, FrownTwoTone, LikeTwoTone, ArrowUpOutlined, ArrowDownOutlined } from "@ant-design/icons";
|
|
|
|
|
import { useParams, useHref, useNavigate, NavLink } from "react-router-dom";
|
|
|
|
|
import { isEmpty, formatColonTime } from "@/utils/commons";
|
|
|
|
|
import { OFFICEWEBVIEWERURL } from "@/config";
|
|
|
|
@ -9,13 +9,22 @@ import airTicketStore from "@/stores/Airticket";
|
|
|
|
|
import { usingStorage } from "@/hooks/usingStorage";
|
|
|
|
|
|
|
|
|
|
const AirticketPlan = props => {
|
|
|
|
|
const { coli_sn } = useParams();
|
|
|
|
|
const { coli_sn, gri_sn } = useParams();
|
|
|
|
|
const { travelAgencyId, loginToken } = usingStorage();
|
|
|
|
|
const [getPlanDetail, planDetail, getGuestList, guestList, loading] = airTicketStore(state => [state.getPlanDetail, state.planDetail, state.getGuestList, state.guestList, state.loading]);
|
|
|
|
|
const [getPlanDetail, planDetail, getGuestList, guestList, loading, postFlightDetail, getFlightCostList] = airTicketStore(state => [
|
|
|
|
|
state.getPlanDetail,
|
|
|
|
|
state.planDetail,
|
|
|
|
|
state.getGuestList,
|
|
|
|
|
state.guestList,
|
|
|
|
|
state.loading,
|
|
|
|
|
state.postFlightDetail,
|
|
|
|
|
state.getFlightCostList,
|
|
|
|
|
]);
|
|
|
|
|
const reservationUrl = `https://p9axztuwd7x8a7.mycht.cn/Service_BaseInfoWeb/FlightPlanDocx?GRI_SN=${coli_sn}&VEI_SN=${travelAgencyId}`;
|
|
|
|
|
const reservationPreviewUrl = OFFICEWEBVIEWERURL + encodeURIComponent(reservationUrl);
|
|
|
|
|
|
|
|
|
|
// console.log(reservationPreviewUrl);
|
|
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
const { notification } = App.useApp();
|
|
|
|
|
//console.log(reservationPreviewUrl);
|
|
|
|
|
|
|
|
|
|
//乘客列表
|
|
|
|
|
const guestListColumns = [
|
|
|
|
@ -98,79 +107,185 @@ const AirticketPlan = props => {
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
//费用列表
|
|
|
|
|
const costListColumns = [
|
|
|
|
|
{
|
|
|
|
|
title: "费用类型",
|
|
|
|
|
key: "CostType",
|
|
|
|
|
dataIndex: "CostType",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "金额",
|
|
|
|
|
key: "Cost",
|
|
|
|
|
dataIndex: "Cost",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "PNR",
|
|
|
|
|
key: "PNR",
|
|
|
|
|
dataIndex: "PNR",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "FlightCost",
|
|
|
|
|
key: "FlightCost",
|
|
|
|
|
dataIndex: "FlightCost",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Discount",
|
|
|
|
|
key: "Discount",
|
|
|
|
|
dataIndex: "Discount",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "ServiceFee",
|
|
|
|
|
key: "ServiceFee",
|
|
|
|
|
dataIndex: "ServiceFee",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "DateTime",
|
|
|
|
|
key: "DateTime",
|
|
|
|
|
dataIndex: "DateTime",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "FlightType",
|
|
|
|
|
key: "FlightType",
|
|
|
|
|
dataIndex: "FlightType",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Memo",
|
|
|
|
|
key: "Memo",
|
|
|
|
|
dataIndex: "Memo",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "编辑",
|
|
|
|
|
key: "CLF_SN",
|
|
|
|
|
dataIndex: "CLF_SN", //GRI_SN VEI_SN
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const Airticket_form = props => {
|
|
|
|
|
const aitInfo = props.airInfo;
|
|
|
|
|
const airInfo = props.airInfo;
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Form
|
|
|
|
|
component={false}
|
|
|
|
|
name={"ticket_form_" + aitInfo.id}
|
|
|
|
|
labelCol={{
|
|
|
|
|
span: 8,
|
|
|
|
|
}}
|
|
|
|
|
wrapperCol={{
|
|
|
|
|
span: 16,
|
|
|
|
|
}}
|
|
|
|
|
style={{
|
|
|
|
|
maxWidth: 600,
|
|
|
|
|
}}
|
|
|
|
|
initialValues={{
|
|
|
|
|
remember: true,
|
|
|
|
|
}}
|
|
|
|
|
// onFinish={onFinish}
|
|
|
|
|
// onFinishFailed={onFinishFailed}
|
|
|
|
|
autoComplete="off">
|
|
|
|
|
<Form.Item label="城市" name="password" rules={[{ required: true }]}>
|
|
|
|
|
<Space.Compact>
|
|
|
|
|
<Input placeholder="出发" prefix={<ArrowUpOutlined />} value={aitInfo.FromCity} />
|
|
|
|
|
<Input placeholder="抵达" prefix={<ArrowDownOutlined />} value={aitInfo.ToCity} />
|
|
|
|
|
</Space.Compact>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item label="日期和航班" name="username" rules={[{ required: true }]}>
|
|
|
|
|
<Space.Compact>
|
|
|
|
|
<Input value={aitInfo.StartDate} />
|
|
|
|
|
<Input placeholder="航空公司" />
|
|
|
|
|
<Input placeholder="航班号" value={aitInfo.FlightNo} />
|
|
|
|
|
</Space.Compact>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item label="出发" name="password" rules={[{ required: true }]}>
|
|
|
|
|
<Space.Compact>
|
|
|
|
|
<Input placeholder="机场" />
|
|
|
|
|
<Input placeholder="航站楼" />
|
|
|
|
|
<Input placeholder="出发时间" value={formatColonTime(aitInfo.FlightTimeStart)} />
|
|
|
|
|
</Space.Compact>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item label="抵达" name="password" rules={[{ required: true }]}>
|
|
|
|
|
<Space.Compact>
|
|
|
|
|
<Input placeholder="机场" />
|
|
|
|
|
<Input placeholder="航站楼" />
|
|
|
|
|
<Input placeholder="抵达时间" value={formatColonTime(aitInfo.FlightTimeEnd)} />
|
|
|
|
|
</Space.Compact>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item label="仓位和行李" name="password">
|
|
|
|
|
<Space.Compact>
|
|
|
|
|
<Input placeholder="仓位" />
|
|
|
|
|
<Input placeholder="行李" />
|
|
|
|
|
</Space.Compact>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item
|
|
|
|
|
wrapperCol={{
|
|
|
|
|
offset: 14,
|
|
|
|
|
span: 16,
|
|
|
|
|
}}>
|
|
|
|
|
<Space>
|
|
|
|
|
<Button type="primary" htmlType="submit">
|
|
|
|
|
保存机票信息
|
|
|
|
|
</Button>
|
|
|
|
|
<Button type="dashed" htmlType="submit">
|
|
|
|
|
添加出票信息和费用
|
|
|
|
|
</Button>
|
|
|
|
|
</Space>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col md={4} lg={4} xxl={4}></Col>
|
|
|
|
|
<Col md={16} lg={16} xxl={16}>
|
|
|
|
|
<Form
|
|
|
|
|
name={"ticket_form_" + airInfo.id}
|
|
|
|
|
labelCol={{
|
|
|
|
|
span: 6,
|
|
|
|
|
}}
|
|
|
|
|
wrapperCol={{
|
|
|
|
|
span: 16,
|
|
|
|
|
}}
|
|
|
|
|
initialValues={airInfo}
|
|
|
|
|
onFinish={values => {
|
|
|
|
|
postFlightDetail(airInfo.CLF_SN, airInfo.GRI_SN, airInfo.VEI_SN, airInfo, values)
|
|
|
|
|
.then(() => {
|
|
|
|
|
notification.success({
|
|
|
|
|
message: `成功`,
|
|
|
|
|
description: "机票信息保存成功!",
|
|
|
|
|
placement: "top",
|
|
|
|
|
duration: 4,
|
|
|
|
|
icon: <LikeTwoTone />,
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
notification.error({
|
|
|
|
|
message: `错误`,
|
|
|
|
|
description: "保存失败",
|
|
|
|
|
placement: "top",
|
|
|
|
|
duration: 4,
|
|
|
|
|
icon: <FrownTwoTone />,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}}
|
|
|
|
|
autoComplete="off">
|
|
|
|
|
<Form.Item label="城市">
|
|
|
|
|
<Space>
|
|
|
|
|
<Form.Item name="FromCity" noStyle>
|
|
|
|
|
<Input placeholder="出发" prefix={<ArrowUpOutlined />} />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item name="ToCity" noStyle>
|
|
|
|
|
<Input placeholder="抵达" prefix={<ArrowDownOutlined />} />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Space>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
<Form.Item label="出发日期、航司、航班">
|
|
|
|
|
<Space>
|
|
|
|
|
<Form.Item name="StartDate" noStyle>
|
|
|
|
|
<Input placeholder="出发日期" />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item name="FlightCompany" noStyle>
|
|
|
|
|
<Input placeholder="航空公司" />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item name="FlightNo" noStyle>
|
|
|
|
|
<Input placeholder="航班号" />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Space>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item label="出发">
|
|
|
|
|
<Space>
|
|
|
|
|
<Form.Item name="FromAirport" noStyle>
|
|
|
|
|
<Input placeholder="机场" />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item name="FromTerminal" noStyle>
|
|
|
|
|
<Input placeholder="航站楼" />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item name="FlightStart" noStyle>
|
|
|
|
|
<Input placeholder="出发时间" />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Space>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item label="抵达">
|
|
|
|
|
<Space>
|
|
|
|
|
<Form.Item name="ToAirport" noStyle>
|
|
|
|
|
<Input placeholder="机场" />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item name="ToTerminal" noStyle>
|
|
|
|
|
<Input placeholder="航站楼" />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item name="FlightEnd" noStyle>
|
|
|
|
|
<Input placeholder="抵达时间" />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Space>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
<Form.Item label="仓位和行李">
|
|
|
|
|
<Space>
|
|
|
|
|
<Form.Item name="FlightCabin" noStyle>
|
|
|
|
|
<Input placeholder="仓位" />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item name="Baggage" noStyle>
|
|
|
|
|
<Input placeholder="行李说明" />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Space>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item label="备注" name="FlightMemo">
|
|
|
|
|
<Input.TextArea rows={5} />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
|
|
<Divider orientation="left">费用列表</Divider>
|
|
|
|
|
<Table bordered={true} rowKey="id" columns={guestListColumns} dataSource={guestList} loading={loading} pagination={false} />
|
|
|
|
|
</Form>
|
|
|
|
|
<Form.Item
|
|
|
|
|
wrapperCol={{
|
|
|
|
|
offset: 14,
|
|
|
|
|
span: 16,
|
|
|
|
|
}}>
|
|
|
|
|
<Space>
|
|
|
|
|
<Button type="primary" htmlType="submit">
|
|
|
|
|
保存机票信息
|
|
|
|
|
</Button>
|
|
|
|
|
<Button type="dashed">添加出票信息和费用</Button>
|
|
|
|
|
</Space>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Form>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col md={4} lg={4} xxl={4}></Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col md={24} lg={24} xxl={24}>
|
|
|
|
|
<Divider orientation="left">费用列表</Divider>
|
|
|
|
|
<Table bordered={true} rowKey="CLC_SN" columns={costListColumns} dataSource={airInfo.Flightcost_AsJOSN} loading={loading} pagination={false} />
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
@ -180,7 +295,7 @@ const AirticketPlan = props => {
|
|
|
|
|
? planDetail.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
key: item.id,
|
|
|
|
|
label: `${item.StartDate} 计划: ${item.FlightInfo}`,
|
|
|
|
|
label: `${item.StartDate}`,
|
|
|
|
|
children: <Airticket_form airInfo={item} />,
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
@ -222,7 +337,7 @@ const AirticketPlan = props => {
|
|
|
|
|
const TicketModal = () => {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Modal title="Basic Modal" open={isModalOpen} onOk={handleOk} onCancel={handleCancel}>
|
|
|
|
|
<Modal title="费用信息" open={isModalOpen} onOk={handleOk} onCancel={handleCancel}>
|
|
|
|
|
<Form
|
|
|
|
|
form={ticket_form}
|
|
|
|
|
labelCol={{
|
|
|
|
@ -329,9 +444,8 @@ const AirticketPlan = props => {
|
|
|
|
|
// 机票信息编辑表单 end
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
getPlanDetail(travelAgencyId, coli_sn);
|
|
|
|
|
getPlanDetail(travelAgencyId, gri_sn);
|
|
|
|
|
getGuestList(travelAgencyId, coli_sn);
|
|
|
|
|
console.log(detail_items());
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|