Merge remote-tracking branch 'origin/main'

perf/export-docx
Lei OT 12 months ago
commit 0a391acdd0

@ -1,7 +1,7 @@
{ {
"name": "global-highlights-hub", "name": "global-highlights-hub",
"private": true, "private": true,
"version": "2.0.0-alpha.0", "version": "2.0.0-alpha.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

@ -30,8 +30,8 @@ const airTicketStore = create((set, get) => ({
async getPlanDetail(vei_sn, gri_sn) { async getPlanDetail(vei_sn, gri_sn) {
const { setPlanDetail } = get(); const { setPlanDetail } = get();
const searchParams = { const searchParams = {
vei_sn: 6376, //vei_sn, vei_sn: 4272, //vei_sn,
gri_sn: 369040, //gri_sn gri_sn: 372928, //gri_sn
}; };
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;

@ -128,6 +128,7 @@ function Management() {
const onAccountFinish = (values) => { const onAccountFinish = (values) => {
saveOrUpdateAccount(values) saveOrUpdateAccount(values)
.then(() => { .then(() => {
setAccountModalOpen(false)
handelAccountSearch() handelAccountSearch()
}) })
.catch(ex => { .catch(ex => {
@ -224,7 +225,7 @@ function Management() {
htmlType: 'submit', htmlType: 'submit',
}} }}
title={t('account:detail')} title={t('account:detail')}
open={isAccountModalOpen} onOk={() => setAccountModalOpen(false)} onCancel={() => setAccountModalOpen(false)} open={isAccountModalOpen} onCancel={() => setAccountModalOpen(false)}
destroyOnClose destroyOnClose
forceRender forceRender
modalRender={(dom) => ( modalRender={(dom) => (

@ -132,6 +132,7 @@ function RoleList() {
const onRoleFinish = (values) => { const onRoleFinish = (values) => {
saveOrUpdateRole(values) saveOrUpdateRole(values)
.then(() => { .then(() => {
setRoleModalOpen(false)
fetchRoleList() fetchRoleList()
.then(r => { .then(r => {
setRoleAllList(r) setRoleAllList(r)
@ -148,6 +149,7 @@ function RoleList() {
} }
const onRoleFailed = (error) => { const onRoleFailed = (error) => {
console.log('Failed:', error)
// form.resetFields() // form.resetFields()
} }
@ -160,7 +162,7 @@ function RoleList() {
htmlType: 'submit', htmlType: 'submit',
}} }}
title={t('account:detail')} title={t('account:detail')}
open={isRoleModalOpen} onOk={() => setRoleModalOpen(false)} onCancel={() => setRoleModalOpen(false)} open={isRoleModalOpen} onCancel={() => setRoleModalOpen(false)}
destroyOnClose destroyOnClose
forceRender forceRender
modalRender={(dom) => ( modalRender={(dom) => (

@ -1,5 +1,5 @@
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import { Grid, Divider, Layout, Form, Input, Col, Row, Space, Collapse, Table, Button } from "antd"; 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 { PhoneOutlined, CustomerServiceOutlined, AudioOutlined, ArrowUpOutlined, ArrowDownOutlined } 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";
@ -15,14 +15,96 @@ const AirticketPlan = props => {
const reservationUrl = `https://p9axztuwd7x8a7.mycht.cn/Service_BaseInfoWeb/FlightPlanDocx?GRI_SN=${coli_sn}&VEI_SN=${travelAgencyId}`; const reservationUrl = `https://p9axztuwd7x8a7.mycht.cn/Service_BaseInfoWeb/FlightPlanDocx?GRI_SN=${coli_sn}&VEI_SN=${travelAgencyId}`;
const reservationPreviewUrl = OFFICEWEBVIEWERURL + encodeURIComponent(reservationUrl); const reservationPreviewUrl = OFFICEWEBVIEWERURL + encodeURIComponent(reservationUrl);
console.log(reservationPreviewUrl); // console.log(reservationPreviewUrl);
//
const guestListColumns = [
{
title: "姓名",
key: "MEI_Name",
dataIndex: "MEI_Name",
},
{
title: "证件类型",
key: "MEI_PassportType",
dataIndex: "MEI_PassportType",
},
{
title: "证件号",
key: "MEI_PassportNo",
dataIndex: "MEI_PassportNo",
},
{
title: "证件有效期",
key: "MEI_PassportValidDate",
dataIndex: "MEI_PassportValidDate",
},
{
title: "性别",
key: "MEI_Gender",
dataIndex: "MEI_Gender",
},
{
title: "年龄",
key: "MEI_age",
dataIndex: "MEI_age",
},
{
title: "国籍",
key: "MEI_Country",
dataIndex: "MEI_Country",
},
{
title: "票号",
key: "MEI_SN",
dataIndex: "MEI_SN",
},
{
title: "PNR",
key: "MEI_SN",
dataIndex: "MEI_SN",
},
{
title: "机票费用RMB含基建和税",
key: "MEI_SN",
dataIndex: "MEI_SN",
},
{
title: "折扣",
key: "MEI_SN",
dataIndex: "MEI_SN",
},
{
title: "手续费",
key: "MEI_SN",
dataIndex: "MEI_SN",
},
{
title: "机票类型(成人/儿童/婴儿)",
key: "MEI_SN",
dataIndex: "MEI_SN",
},
{
title: "操作",
key: "MEI_SN",
dataIndex: "MEI_SN",
render: (_, record) => {
return (
<span>
<Typography.Link onClick={() => showModal(record)}>编辑</Typography.Link> | <Typography.Link onClick={() => console.log("del")}>删除</Typography.Link>
</span>
);
},
},
];
const Airticket_form = props => { const Airticket_form = props => {
const aitInfo = props.airInfo; const aitInfo = props.airInfo;
return ( return (
<> <>
<Form <Form
name="basic" component={false}
name={"ticket_form_" + aitInfo.id}
labelCol={{ labelCol={{
span: 8, span: 8,
}} }}
@ -38,18 +120,15 @@ const AirticketPlan = props => {
// onFinish={onFinish} // onFinish={onFinish}
// onFinishFailed={onFinishFailed} // onFinishFailed={onFinishFailed}
autoComplete="off"> autoComplete="off">
<Form.Item label="日期" name="username" rules={[{ required: true }]}>
<Input value={aitInfo.StartDate} />
</Form.Item>
<Form.Item label="城市" name="password" rules={[{ required: true }]}> <Form.Item label="城市" name="password" rules={[{ required: true }]}>
<Space.Compact> <Space.Compact>
<Input placeholder="出发" prefix={<ArrowUpOutlined />} value={aitInfo.FromCity} /> <Input placeholder="出发" prefix={<ArrowUpOutlined />} value={aitInfo.FromCity} />
<Input placeholder="抵达" prefix={<ArrowDownOutlined />} value={aitInfo.ToCity} /> <Input placeholder="抵达" prefix={<ArrowDownOutlined />} value={aitInfo.ToCity} />
</Space.Compact> </Space.Compact>
</Form.Item> </Form.Item>
<Form.Item label="航班" name="password" rules={[{ required: true }]}> <Form.Item label="日期和航班" name="username" rules={[{ required: true }]}>
<Space.Compact> <Space.Compact>
<Input value={aitInfo.StartDate} />
<Input placeholder="航空公司" /> <Input placeholder="航空公司" />
<Input placeholder="航班号" value={aitInfo.FlightNo} /> <Input placeholder="航班号" value={aitInfo.FlightNo} />
</Space.Compact> </Space.Compact>
@ -74,18 +153,24 @@ const AirticketPlan = props => {
<Input placeholder="行李" /> <Input placeholder="行李" />
</Space.Compact> </Space.Compact>
</Form.Item> </Form.Item>
{/* <Form.Item <Form.Item
wrapperCol={{ wrapperCol={{
offset: 8, offset: 14,
span: 16, span: 16,
}}> }}>
<Button type="primary" htmlType="submit"> <Space>
Submit <Button type="primary" htmlType="submit">
</Button> 保存机票信息
</Form.Item> */} </Button>
<Button type="dashed" htmlType="submit">
添加出票信息和费用
</Button>
</Space>
</Form.Item>
<Divider orientation="left">费用列表</Divider>
<Table bordered={true} rowKey="id" columns={guestListColumns} dataSource={guestList} loading={loading} pagination={false} />
</Form> </Form>
<Divider />
<Table bordered={true} rowKey="id" columns={guestListColumns} dataSource={guestList} loading={loading} pagination={false} />
</> </>
); );
}; };
@ -102,73 +187,146 @@ const AirticketPlan = props => {
: []; : [];
}; };
const guestListColumns = [ // begin
{ const [isModalOpen, setIsModalOpen] = useState(false);
title: "姓名", const [ticket_form] = Form.useForm();
key: "MEI_Name",
dataIndex: "MEI_Name", const showModal = ticket => {
}, setIsModalOpen(true);
{ ticket_form.setFieldsValue(ticket);
title: "证件类型", };
key: "MEI_PassportType",
dataIndex: "MEI_PassportType", const handleOk = () => {
}, ticket_form
{ .validateFields()
title: "证件号", .then(values => {
key: "MEI_PassportNo", //
dataIndex: "MEI_PassportNo", console.log("Received values of form: ", values);
}, ticket_form.resetFields();
{ setIsModalOpen(false);
title: "证件有效期", })
key: "MEI_PassportValidDate", .catch(info => {
dataIndex: "MEI_PassportValidDate", console.log("Validate Failed:", info);
}, });
{ };
title: "性别",
key: "MEI_Gender", const handleCancel = () => {
dataIndex: "MEI_Gender", ticket_form.resetFields();
}, setIsModalOpen(false);
{ };
title: "年龄",
key: "MEI_age", const onChangeType = value => {
dataIndex: "MEI_age", console.log(value);
}, };
{
title: "国籍", const TicketModal = () => {
key: "MEI_Country", return (
dataIndex: "MEI_Country", <>
}, <Modal title="Basic Modal" open={isModalOpen} onOk={handleOk} onCancel={handleCancel}>
{ <Form
title: "票号", form={ticket_form}
key: "MEI_SN", labelCol={{
dataIndex: "MEI_SN", span: 5,
}, }}>
{ <Form.Item label="费用类型" name="MEI_Name2222">
title: "PNR", <Select
key: "MEI_SN", defaultValue="jack"
dataIndex: "MEI_SN", style={{
}, width: 160,
{ }}
title: "机票费用RMB含基建和税", onChange={onChangeType}
key: "MEI_SN", options={[
dataIndex: "MEI_SN", {
}, value: "jack",
{ label: "出票",
title: "折扣", },
key: "MEI_SN", {
dataIndex: "MEI_SN", value: "lucy",
}, label: "改签",
{ },
title: "手续费", {
key: "MEI_SN", value: "Yiminghe",
dataIndex: "MEI_SN", label: "退票",
}, },
{ {
title: "机票类型(成人/儿童/婴儿)", value: "Yimingh2e",
key: "MEI_SN", label: "其它",
dataIndex: "MEI_SN", },
}, ]}
]; />
</Form.Item>
<Form.Item label="机票类型" name="MEI_Name2222">
<Select
style={{
width: 160,
}}
onChange={() => console.log("dsads")}
options={[
{
value: "jack",
label: "成人",
},
{
value: "lucy",
label: "儿童",
},
{
value: "Yiminghe",
label: "婴儿",
},
]}
/>
</Form.Item>
<Form.Item label="票号">
<Input />
</Form.Item>
<Form.Item label="机票价格">
<Input placeholder="含基建和税" prefix="¥" />
</Form.Item>
<Form.Item label="折扣" name="MEI_Name33">
<Input />
</Form.Item>
<Form.Item label="PNR">
<Input />
</Form.Item>
<Form.Item label="手续费/费用" name="MEI_Name66" rules={[{ required: true }]}>
<Input prefix="¥" />
</Form.Item>
<Form.Item label="选择客人" name="MEI_Name66">
<Select
style={{
width: 160,
}}
onChange={() => console.log("dsads")}
options={[
{
value: "jack",
label: "成人",
},
{
value: "lucy",
label: "儿童",
},
{
value: "Yiminghe",
label: "婴儿",
},
]}
/>
</Form.Item>
<Form.Item label="备注">
<Input.TextArea rows={4} />
</Form.Item>
</Form>
</Modal>
</>
);
};
// end
useEffect(() => { useEffect(() => {
getPlanDetail(travelAgencyId, coli_sn); getPlanDetail(travelAgencyId, coli_sn);
@ -190,7 +348,9 @@ const AirticketPlan = props => {
<Collapse items={detail_items()} /> <Collapse items={detail_items()} />
</Col> </Col>
</Row> </Row>
<TicketModal />
</Space> </Space>
); );
}; };
export default AirticketPlan; export default AirticketPlan;

Loading…
Cancel
Save