From 5323b53891538ee2f329b921b328a97567ab85c9 Mon Sep 17 00:00:00 2001 From: Ycc Date: Wed, 26 Nov 2025 14:29:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9C=BA=E7=A5=A8=E4=BB=93?= =?UTF-8?q?=E4=BD=8D=E9=80=89=E6=8B=A9=E5=92=8C=E4=BA=BA=E5=91=98=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/airticket/Plan.jsx | 385 +++++++++++++++++++---------------- 1 file changed, 207 insertions(+), 178 deletions(-) diff --git a/src/views/airticket/Plan.jsx b/src/views/airticket/Plan.jsx index bfcd7b1..237d5ae 100644 --- a/src/views/airticket/Plan.jsx +++ b/src/views/airticket/Plan.jsx @@ -1,19 +1,19 @@ -import { useState, useEffect } from "react"; -import { Checkbox, Divider, DatePicker, Modal, Form, Input, Col, Row, Space, Collapse, Table, Button, Select, App, Popconfirm, Switch, Radio, List } from "antd"; -import { PhoneOutlined, FrownTwoTone, LikeTwoTone, ArrowUpOutlined, ArrowDownOutlined, PlusOutlined } from "@ant-design/icons"; -import { useParams, useHref, useNavigate, NavLink } from "react-router-dom"; -import { isEmpty, formatColonTime } from "@/utils/commons"; -import { OFFICEWEBVIEWERURL } from "@/config"; -import dayjs from "dayjs"; -import airTicketStore from "@/stores/Airticket"; -import { usingStorage } from "@/hooks/usingStorage"; -import BackBtn from "@/components/BackBtn"; -import useFormStore from "@/stores/Form"; +import { useState, useEffect } from 'react'; +import { Checkbox, Divider, DatePicker, Modal, Form, Input, Col, Row, Space, Collapse, Table, Button, Select, App, Popconfirm, Switch, Radio, List } from 'antd'; +import { PhoneOutlined, FrownTwoTone, LikeTwoTone, ArrowUpOutlined, ArrowDownOutlined, PlusOutlined } from '@ant-design/icons'; +import { useParams, useHref, useNavigate, NavLink } from 'react-router-dom'; +import { isEmpty, formatColonTime } from '@/utils/commons'; +import { OFFICEWEBVIEWERURL } from '@/config'; +import dayjs from 'dayjs'; +import airTicketStore from '@/stores/Airticket'; +import { usingStorage } from '@/hooks/usingStorage'; +import BackBtn from '@/components/BackBtn'; +import useFormStore from '@/stores/Form'; const AirticketPlan = props => { - const [{agency, ...formValuesToSub}] = useFormStore(state => [state.formValuesToSub]); + const [{ agency, ...formValuesToSub }] = useFormStore(state => [state.formValuesToSub]); const { coli_sn, gri_sn } = useParams(); const { travelAgencyId: myAgencyId, loginToken, userId } = usingStorage(); - const travelAgencyId = agency; // || myAgencyId; + const travelAgencyId = agency; // || myAgencyId; const [ getPlanDetail, planDetail, @@ -60,7 +60,7 @@ const AirticketPlan = props => { return ( guestList && guestList.map(item => { - return { label: `${item.MEI_Name} , ${item.MEI_PassportNo}`, value: `${item.MEI_Name} , ${item.MEI_PassportNo} , ${item.MEI_Country} , ${item.MEI_Gender} , ${item.MEI_age} , ${item.MEI_Birthday}` }; + return { label: `${item.MEI_Name} , ${item.MEI_PassportNo}`, value: `${item.MEI_Name} , ${item.MEI_PassportNo} , ${item.MEI_Country} , ${item.MEI_Gender} , ${item.MEI_age} age , ${item.MEI_Birthday}(YYYY-MM-DD)` }; }) ); }; @@ -81,62 +81,62 @@ const AirticketPlan = props => { //费用列表 const costListColumns = [ { - title: "客人信息/备注", - key: "Memo", - dataIndex: "Memo", + title: '客人信息/备注', + key: 'Memo', + dataIndex: 'Memo', }, { - title: "状态", - key: "CostType", - dataIndex: "CostType", + title: '状态', + key: 'CostType', + dataIndex: 'CostType', }, { - title: "票号", - key: "TicketNo", - dataIndex: "TicketNo", - render: (text, record) => (record.CostType == "出票" ? text : "-"), + title: '票号', + key: 'TicketNo', + dataIndex: 'TicketNo', + render: (text, record) => (record.CostType == '出票' ? text : '-'), }, { - title: "PNR", - key: "PNR", - dataIndex: "PNR", - render: (text, record) => (record.CostType == "出票" ? text : "-"), + title: 'PNR', + key: 'PNR', + dataIndex: 'PNR', + render: (text, record) => (record.CostType == '出票' ? text : '-'), }, { - title: "机票类型", - key: "FlightType", - dataIndex: "FlightType", - render: (text, record) => (record.CostType == "出票" ? text : "-"), + title: '机票类型', + key: 'FlightType', + dataIndex: 'FlightType', + render: (text, record) => (record.CostType == '出票' ? text : '-'), }, { - title: "机票价格", - key: "Cost", - dataIndex: "Cost", - render: (text, record) => (record.CostType == "出票" ? text : "-"), + title: '机票价格', + key: 'Cost', + dataIndex: 'Cost', + render: (text, record) => (record.CostType == '出票' ? text : '-'), }, { - title: "服务费", - key: "ServiceFee", - dataIndex: "ServiceFee", + title: '服务费', + key: 'ServiceFee', + dataIndex: 'ServiceFee', }, { - title: "折扣", - key: "Discount", - dataIndex: "Discount", - render: (text, record) => (record.CostType == "出票" ? text : "-"), + title: '折扣', + key: 'Discount', + dataIndex: 'Discount', + render: (text, record) => (record.CostType == '出票' ? text : '-'), }, { - title: "编辑", - key: "CLC_SN", - dataIndex: "CLC_SN", + title: '编辑', + key: 'CLC_SN', + dataIndex: 'CLC_SN', render: (text, record) => record.CheckStatus <= 2 ? ( showModal(record)}>编辑 - handleDelete(record.CLC_SN)} okText="是" cancelText="否"> - @@ -154,7 +154,7 @@ const AirticketPlan = props => { <>
{ .then(() => { notification.success({ message: `成功`, - description: "机票信息保存成功!", - placement: "top", + description: '机票信息保存成功!', + placement: 'top', duration: 4, icon: , }); @@ -176,104 +176,133 @@ const AirticketPlan = props => { .catch(() => { notification.error({ message: `错误`, - description: "保存失败", - placement: "top", + description: '保存失败', + placement: 'top', duration: 4, icon: , }); }); }} - autoComplete="off"> - 航班信息 + autoComplete='off'> + 航班信息 - + - + - - + + - - + + - - + + - - - + + - - + + - + - + + + - - + + + - - + + {/* */} + + + - - - + + + - - 出票信息 + 出票信息 - +
- - @@ -294,8 +323,8 @@ const AirticketPlan = props => { .then(() => { notification.success({ message: `成功`, - description: "提醒信息已发出!", - placement: "top", + description: '提醒信息已发出!', + placement: 'top', duration: 4, icon: , }); @@ -304,26 +333,26 @@ const AirticketPlan = props => { .catch(() => { notification.error({ message: `错误`, - description: "提醒失败", - placement: "top", + description: '提醒失败', + placement: 'top', duration: 4, icon: , }); }); }} - autoComplete="off"> - + autoComplete='off'> + - - + + - + - @@ -341,15 +370,15 @@ const AirticketPlan = props => { label: `${item.StartDate} ${item.FlightNo}(${item.FromAirport}${item.FlightStart}-${item.ToAirport}${item.FlightEnd})(${item.FlightCabin})`, extra: ( { delete_flight_info(item.CLF_SN); //删除记录 getPlanDetail(travelAgencyId, gri_sn); //更新页面计划详情,含费用列表 }} - okText="是" - cancelText="否"> - @@ -372,11 +401,11 @@ const AirticketPlan = props => { const showModal = ticket => { setIsModalOpen(true); ticket_form.resetFields(); - if (isEmpty(ticket.CostType)) ticket.CostType = "出票"; - ticket.CostType == "出票" ? setisTicketType(true) : setisTicketType(false); //如果是出票类型,显示票号、折扣等选项 + if (isEmpty(ticket.CostType)) ticket.CostType = '出票'; + ticket.CostType == '出票' ? setisTicketType(true) : setisTicketType(false); //如果是出票类型,显示票号、折扣等选项 isEmpty(ticket.CLC_SN) ? setisAddNew(true) : setisAddNew(false); //如果是新增窗口 ticket_form.setFieldsValue(ticket); - if (isEmpty(ticket.Memo)) ticket_form.setFieldsValue({ Memo: "" }); + if (isEmpty(ticket.Memo)) ticket_form.setFieldsValue({ Memo: '' }); }; const handleOk = (close_modal = true) => { @@ -384,13 +413,13 @@ const AirticketPlan = props => { .validateFields() .then(values => { // 在这里处理表单提交逻辑,例如发送数据到服务器 - console.log("Received values of form: ", values); + console.log('Received values of form: ', values); postFlightCost(values) .then(() => { notification.success({ message: `成功`, - description: "保存成功!", - placement: "top", + description: '保存成功!', + placement: 'top', duration: 4, icon: , }); @@ -399,8 +428,8 @@ const AirticketPlan = props => { .catch(() => { notification.error({ message: `错误`, - description: "保存失败", - placement: "top", + description: '保存失败', + placement: 'top', duration: 4, icon: , }); @@ -408,7 +437,7 @@ const AirticketPlan = props => { if (close_modal) setIsModalOpen(false); }) .catch(info => { - console.log("Validate Failed:", info); + console.log('Validate Failed:', info); }); }; @@ -422,8 +451,8 @@ const AirticketPlan = props => { .then(() => { notification.success({ message: `成功`, - description: "删除成功!", - placement: "top", + description: '删除成功!', + placement: 'top', duration: 4, icon: , }); @@ -432,8 +461,8 @@ const AirticketPlan = props => { .catch(() => { notification.error({ message: `错误`, - description: "删除失败", - placement: "top", + description: '删除失败', + placement: 'top', duration: 4, icon: , }); @@ -441,7 +470,7 @@ const AirticketPlan = props => { }; const onChangeType = value => { - if (value == "出票") { + if (value == '出票') { setisTicketType(true); } else { setisTicketType(false); @@ -462,13 +491,13 @@ const AirticketPlan = props => { confirmInfo_form .validateFields() .then(values => { - console.log("Received values of form: ", values.ConfirmInfo); + console.log('Received values of form: ', values.ConfirmInfo); postVeiFlightPlanConfirm(travelAgencyId, gri_sn, userId, values.ConfirmInfo) .then(() => { notification.success({ message: `成功`, - description: "保存成功!", - placement: "top", + description: '保存成功!', + placement: 'top', duration: 4, icon: , }); @@ -477,8 +506,8 @@ const AirticketPlan = props => { .catch(() => { notification.error({ message: `错误`, - description: "保存失败", - placement: "top", + description: '保存失败', + placement: 'top', duration: 4, icon: , }); @@ -487,7 +516,7 @@ const AirticketPlan = props => { setisModalOpen_confirmInfo(false); }) .catch(info => { - console.log("Validate Failed:", info); + console.log('Validate Failed:', info); }); }; @@ -501,42 +530,42 @@ const AirticketPlan = props => { }, []); return ( - + - + - - - + + - {planDetail ? `${planDetail[0]?.GRI_No} - ${planDetail[0]?.WL}` : ""} + {planDetail ? `${planDetail[0]?.GRI_No} - ${planDetail[0]?.WL}` : ''}
-

+

{ - await postFlightDetail("", gri_sn, travelAgencyId, { FlightNo: "新的记录", FlightStatus: 1 }, []); //新增加一条记录 + await postFlightDetail('', gri_sn, travelAgencyId, { FlightNo: '新的记录', FlightStatus: 1 }, []); //新增加一条记录 getPlanDetail(travelAgencyId, gri_sn); //计划详情,含费用列表 }} - okText="是" - cancelText="否"> - @@ -544,12 +573,12 @@ const AirticketPlan = props => { - 计划变更 + 计划变更

- + {" "} - {' '} + @@ -604,7 +633,7 @@ const AirticketPlan = props => { labelCol={{ span: 5, }}> - + - + - + { )} - + { {isTicketType && ( <> - + - + guestList_OnChange(e)} style={{ @@ -709,20 +738,20 @@ const AirticketPlan = props => { )} - + -