新增航班和删除航班功能

main
Ycc 10 months ago
parent 0cc9a0bb17
commit c6283f0cc2

@ -38,6 +38,8 @@ const airTicketStore = create((set, get) => ({
const { errcode, result } = await fetchJSON(`${HT_HOST}/Service_BaseInfoWeb/GetFlightPlanDetail`, searchParams); const { errcode, result } = await fetchJSON(`${HT_HOST}/Service_BaseInfoWeb/GetFlightPlanDetail`, searchParams);
const _result = errcode !== 0 ? [] : result; const _result = errcode !== 0 ? [] : result;
setPlanDetail(_result); setPlanDetail(_result);
//return _result.filter(item => isNotEmpty(item.GRI_No));
return 'dsadsd';
}, },
async postFlightDetail(CLF_SN, GRI_SN, VEI_SN, original_values, info_object) { async postFlightDetail(CLF_SN, GRI_SN, VEI_SN, original_values, info_object) {
@ -62,6 +64,15 @@ const airTicketStore = create((set, get) => ({
} }
}); });
}, },
//删除航班信息
async delete_flight_info(CLF_SN) {
const searchParams = {
CLF_SN: CLF_SN,
};
const { errcode, result } = await fetchJSON(`${HT_HOST}/Service_BaseInfoWeb/Delete_flight_info`, searchParams);
const _result = errcode !== 0 ? [] : result;
return _result;
},
async getGuestList(coli_sn) { async getGuestList(coli_sn) {
const { setGuestList } = get(); const { setGuestList } = get();

@ -1,6 +1,6 @@
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import { Grid, Divider, Layout, Modal, Form, Input, Col, Row, Space, Collapse, Table, Button, Select, App, Popconfirm, Switch } from "antd"; import { Grid, Divider, Layout, Modal, Form, Input, Col, Row, Space, Collapse, Table, Button, Select, App, Popconfirm, Switch } from "antd";
import { PhoneOutlined, FrownTwoTone, LikeTwoTone, ArrowUpOutlined, ArrowDownOutlined } from "@ant-design/icons"; import { PhoneOutlined, FrownTwoTone, LikeTwoTone, ArrowUpOutlined, ArrowDownOutlined, PlusOutlined } from "@ant-design/icons";
import { useParams, useHref, useNavigate, NavLink } from "react-router-dom"; import { useParams, useHref, useNavigate, NavLink } from "react-router-dom";
import { isEmpty, formatColonTime } from "@/utils/commons"; import { isEmpty, formatColonTime } from "@/utils/commons";
import { OFFICEWEBVIEWERURL } from "@/config"; import { OFFICEWEBVIEWERURL } from "@/config";
@ -12,20 +12,22 @@ import BackBtn from "@/components/BackBtn";
const AirticketPlan = props => { const AirticketPlan = props => {
const { coli_sn, gri_sn } = useParams(); const { coli_sn, gri_sn } = useParams();
const { travelAgencyId, loginToken, userId } = usingStorage(); const { travelAgencyId, loginToken, userId } = usingStorage();
const [getPlanDetail, planDetail, getGuestList, guestList, loading, postFlightDetail, postFlightCost, deleteFlightCost, getVeiPlanChange, veiPlanChangeTxt, postVeiFlightPlanConfirm, ticketIssuedNotifications] = airTicketStore(state => [ const [getPlanDetail, planDetail, getGuestList, guestList, loading, postFlightDetail, postFlightCost, deleteFlightCost, getVeiPlanChange, veiPlanChangeTxt, postVeiFlightPlanConfirm, ticketIssuedNotifications, delete_flight_info] =
state.getPlanDetail, airTicketStore(state => [
state.planDetail, state.getPlanDetail,
state.getGuestList, state.planDetail,
state.guestList, state.getGuestList,
state.loading, state.guestList,
state.postFlightDetail, state.loading,
state.postFlightCost, state.postFlightDetail,
state.deleteFlightCost, state.postFlightCost,
state.getVeiPlanChange, state.deleteFlightCost,
state.veiPlanChangeTxt, state.getVeiPlanChange,
state.postVeiFlightPlanConfirm, state.veiPlanChangeTxt,
state.ticketIssuedNotifications, state.postVeiFlightPlanConfirm,
]); state.ticketIssuedNotifications,
state.delete_flight_info,
]);
const reservationUrl = `https://p9axztuwd7x8a7.mycht.cn/Service_BaseInfoWeb/FlightPlanDocx?GRI_SN=${gri_sn}&VEI_SN=${travelAgencyId}&token=${loginToken}`; const reservationUrl = `https://p9axztuwd7x8a7.mycht.cn/Service_BaseInfoWeb/FlightPlanDocx?GRI_SN=${gri_sn}&VEI_SN=${travelAgencyId}&token=${loginToken}`;
const reservationPreviewUrl = OFFICEWEBVIEWERURL + encodeURIComponent(reservationUrl); const reservationPreviewUrl = OFFICEWEBVIEWERURL + encodeURIComponent(reservationUrl);
const [form] = Form.useForm(); const [form] = Form.useForm();
@ -279,7 +281,21 @@ const AirticketPlan = props => {
return { return {
key: item.id, key: item.id,
label: `${item.StartDate} ${item.FlightNo}(${item.FromAirport}${item.FlightStart}-${item.ToAirport}${item.FlightEnd})(${item.FlightCabin})`, label: `${item.StartDate} ${item.FlightNo}(${item.FromAirport}${item.FlightStart}-${item.ToAirport}${item.FlightEnd})(${item.FlightCabin})`,
extra: `${item.GRI_No}-${item.WL}`, extra: (
<Popconfirm
title="请确认要删除航班记录"
description=""
onConfirm={() => {
delete_flight_info(item.CLF_SN); //
getPlanDetail(travelAgencyId, gri_sn); //
}}
okText="是"
cancelText="否">
<Button type="dashed" size="small" disabled={item.Flightcost_AsJOSN.length == 0 ? false : true}>
删除
</Button>
</Popconfirm>
),
children: <Airticket_form airInfo={item} />, children: <Airticket_form airInfo={item} />,
}; };
}) })
@ -287,6 +303,7 @@ const AirticketPlan = props => {
}; };
// begin // begin
const [isModalOpen, setIsModalOpen] = useState(false); const [isModalOpen, setIsModalOpen] = useState(false);
const [isModalOpen_confirmInfo, setisModalOpen_confirmInfo] = useState(false); const [isModalOpen_confirmInfo, setisModalOpen_confirmInfo] = useState(false);
const [isTicketType, setisTicketType] = useState(true); const [isTicketType, setisTicketType] = useState(true);
@ -564,7 +581,7 @@ const AirticketPlan = props => {
<Row> <Row>
<Col md={24} lg={24} xxl={24} style={{ height: "100%" }}> <Col md={24} lg={24} xxl={24} style={{ height: "100%" }}>
<iframe id="msdoc-iframe-reservation" title="msdoc-iframe-reservation" src={reservationPreviewUrl+'&v='+Math.random()} style={{ width: "100%", height: "600px" }}></iframe> <iframe id="msdoc-iframe-reservation" title="msdoc-iframe-reservation" src={reservationPreviewUrl + "&v=" + Math.random()} style={{ width: "100%", height: "600px" }}></iframe>
<Button type="link" target="_blank" href={reservationUrl}> <Button type="link" target="_blank" href={reservationUrl}>
下载 下载
</Button> </Button>
@ -572,10 +589,27 @@ const AirticketPlan = props => {
</Row> </Row>
<Row> <Row>
<Divider orientation="left">出票信息</Divider> <Divider orientation="center">出票信息 {planDetail ? `${planDetail[0].GRI_No} - ${planDetail[0].WL}` : ""}</Divider>
<Col md={24} lg={24} xxl={24}> <Col md={24} lg={24} xxl={24}>
<Collapse items={detail_items()} /> <Collapse items={detail_items()} />
</Col> </Col>
<Col md={24} lg={24} xxl={24}>
<p style={{ textAlign: "right" }}>
<Popconfirm
title="请确认要增加航班记录"
description=""
onConfirm={() => {
postFlightDetail("", gri_sn, travelAgencyId, { FlightNo: "新的记录", FlightStatus: 1 }, []); //
getPlanDetail(travelAgencyId, gri_sn); //
}}
okText="是"
cancelText="否">
<Button type="dashed" icon={<PlusOutlined />}>
新增航班记录
</Button>
</Popconfirm>
</p>
</Col>
</Row> </Row>
<Row> <Row>
<Divider orientation="left">计划变更</Divider> <Divider orientation="left">计划变更</Divider>

Loading…
Cancel
Save