下拉选择航空公司

main
Ycc 9 months ago
parent 9d789723a8
commit 7296ed954c

@ -12,6 +12,7 @@ const airTicketStore = create((set, get) => ({
setGuestList: guestList => set({ guestList }), setGuestList: guestList => set({ guestList }),
setVEIFlightBill: vEIFlightBill => set({ vEIFlightBill }), setVEIFlightBill: vEIFlightBill => set({ vEIFlightBill }),
setVeiPlanChangeTxt: veiPlanChangeTxt => set({ veiPlanChangeTxt }), setVeiPlanChangeTxt: veiPlanChangeTxt => set({ veiPlanChangeTxt }),
setAirPortList: airPortList => set({ airPortList }),
async getPlanList(vei_sn, GRI_Name, TimeStart, TimeEnd) { async getPlanList(vei_sn, GRI_Name, TimeStart, TimeEnd) {
const { setLoading, setPlanList } = get(); const { setLoading, setPlanList } = get();
@ -39,7 +40,7 @@ const airTicketStore = create((set, get) => ({
const _result = errcode !== 0 ? [] : result; const _result = errcode !== 0 ? [] : result;
setPlanDetail(_result); setPlanDetail(_result);
//return _result.filter(item => isNotEmpty(item.GRI_No)); //return _result.filter(item => isNotEmpty(item.GRI_No));
return 'dsadsd'; 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) {
@ -53,7 +54,7 @@ const airTicketStore = create((set, get) => ({
for (const [key, value] of Object.entries(info_object)) { for (const [key, value] of Object.entries(info_object)) {
formData.set(key, value); //再用新值覆盖 formData.set(key, value); //再用新值覆盖
} }
formData.set('StartDate', dayjs(info_object.StartDate).format(DATE_FORMAT)); //再用新值覆盖 formData.set("StartDate", dayjs(info_object.StartDate).format(DATE_FORMAT)); //再用新值覆盖
//是否出票的值true、false变为1或0 //是否出票的值true、false变为1或0
formData.set("TicketIssued", info_object.TicketIssued ? 1 : 0); formData.set("TicketIssued", info_object.TicketIssued ? 1 : 0);
const postUrl = HT_HOST + "/Service_BaseInfoWeb/edit_or_new_flight_info"; const postUrl = HT_HOST + "/Service_BaseInfoWeb/edit_or_new_flight_info";
@ -175,6 +176,47 @@ const airTicketStore = create((set, get) => ({
const _result = errcode !== 0 ? [] : result; const _result = errcode !== 0 ? [] : result;
return _result; return _result;
}, },
//获取机场列表
async getAirPortList() {
const { setAirPortList } = get();
const { errcode, result } = await fetchJSON(`${HT_HOST}/Service_BaseInfoWeb/GetAirPortInfo`);
const _result = errcode !== 0 ? [] : result;
setAirPortList(_result);
},
airLineList: [
{ label: "CA-国航", value: "国航" },
{ label: "MU-东方航空", value: "东方航空" },
{ label: "FM-上海航空", value: "上海航空" },
{ label: "CZ-南方航空", value: "南方航空" },
{ label: "HO-吉祥航空", value: "吉祥航空" },
{ label: "HU-海南航空", value: "海南航空" },
{ label: "ZH-深圳航空", value: "深圳航空" },
{ label: "MF-厦门航空", value: "厦门航空" },
{ label: "3U-四川航空", value: "四川航空" },
{ label: "SC-山东航空", value: "山东航空" },
{ label: "JD-首都航空", value: "首都航空" },
{ label: "BK-奥凯航空", value: "奥凯航空" },
{ label: "GS-天津航空", value: "天津航空" },
{ label: "CN-大新华", value: "大新华" },
{ label: "KN-中联航", value: "中联航" },
{ label: "TV-西藏航空", value: "西藏航空" },
{ label: "8L-祥鹏航空", value: "祥鹏航空" },
{ label: "KY-昆明航空", value: "昆明航空" },
{ label: "EU-成都航空", value: "成都航空" },
{ label: "G5-华夏航空", value: "华夏航空" },
{ label: "NS-河北航空", value: "河北航空" },
{ label: "QW-青岛航空", value: "青岛航空" },
{ label: "Y8-扬子江", value: "扬子江" },
{ label: "PN-西部航空", value: "西部航空" },
{ label: "DZ-东海航空", value: "东海航空" },
{ label: "GT-桂林航空", value: "桂林航空" },
{ label: "9H-长安航空", value: "长安航空" },
{ label: "GY-多彩航空", value: "多彩航空" },
{ label: "DR-瑞丽航空", value: "瑞丽航空" },
{ label: "GJ-长龙航空", value: "长龙航空" },
{ label: "GX-广西北部", value: "广西北部" },
],
})); }));
export default airTicketStore; export default airTicketStore;

@ -12,8 +12,24 @@ 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, delete_flight_info] = const [
airTicketStore(state => [ getPlanDetail,
planDetail,
getGuestList,
guestList,
loading,
postFlightDetail,
postFlightCost,
deleteFlightCost,
getVeiPlanChange,
veiPlanChangeTxt,
postVeiFlightPlanConfirm,
ticketIssuedNotifications,
delete_flight_info,
getAirPortList,
airPortList,
airLineList,
] = airTicketStore(state => [
state.getPlanDetail, state.getPlanDetail,
state.planDetail, state.planDetail,
state.getGuestList, state.getGuestList,
@ -27,6 +43,9 @@ const AirticketPlan = props => {
state.postVeiFlightPlanConfirm, state.postVeiFlightPlanConfirm,
state.ticketIssuedNotifications, state.ticketIssuedNotifications,
state.delete_flight_info, state.delete_flight_info,
state.getAirPortList,
state.airPortList,
state.airLineList,
]); ]);
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);
@ -34,7 +53,7 @@ const AirticketPlan = props => {
const { notification } = App.useApp(); const { notification } = App.useApp();
//console.log(reservationPreviewUrl); //console.log(reservationPreviewUrl);
// //
const guestList_select = () => { const guestList_select = () => {
return ( return (
guestList && guestList &&
@ -47,6 +66,15 @@ const AirticketPlan = props => {
const guestList_OnChange = value => { const guestList_OnChange = value => {
ticket_form.setFieldsValue({ Memo: `${value}` }); ticket_form.setFieldsValue({ Memo: `${value}` });
}; };
//
const airPortList_select = () => {
return (
airPortList &&
airPortList.map(item => {
return { label: `${item.AirPort_Code} - ${item.AirPort_Name}`, value: item.AirPort_Name };
})
);
};
// //
const costListColumns = [ const costListColumns = [
@ -165,24 +193,39 @@ const AirticketPlan = props => {
</Space> </Space>
</Form.Item> </Form.Item>
<Form.Item label="出发日期、航司、航班" required> <Form.Item label="出发日期、航班、航司" required>
<Space> <Space>
<Form.Item name="StartDate" noStyle rules={[{ required: true, message: "请输入出发日期!" }]}> <Form.Item name="StartDate" noStyle rules={[{ required: true, message: "请输入出发日期!" }]}>
{/* <Input placeholder="出发日期" /> */}
<DatePicker /> <DatePicker />
</Form.Item> </Form.Item>
<Form.Item name="FlightCompany" noStyle>
<Input placeholder="航空公司" />
</Form.Item>
<Form.Item name="FlightNo" noStyle rules={[{ required: true, message: "请输入航班号!" }]}> <Form.Item name="FlightNo" noStyle rules={[{ required: true, message: "请输入航班号!" }]}>
<Input placeholder="航班号" /> <Input placeholder="航班号" />
</Form.Item> </Form.Item>
<Form.Item name="FlightCompany" noStyle>
<Select
showSearch
placeholder="航空公司"
style={{
minWidth: 160,
}}
filterOption={(input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase())}
options={airLineList}
/>
</Form.Item>
</Space> </Space>
</Form.Item> </Form.Item>
<Form.Item label="出发" required> <Form.Item label="出发" required>
<Space> <Space>
<Form.Item name="FromAirport" noStyle rules={[{ required: true, message: "请输入出发机场!" }]}> <Form.Item name="FromAirport" noStyle rules={[{ required: true, message: "请输入出发机场!" }]}>
<Input placeholder="机场" /> <Select
showSearch
placeholder="机场"
style={{
minWidth: 160,
}}
filterOption={(input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase())}
options={airPortList_select()}
/>
</Form.Item> </Form.Item>
<Form.Item name="FromTerminal" noStyle> <Form.Item name="FromTerminal" noStyle>
<Input placeholder="航站楼" /> <Input placeholder="航站楼" />
@ -195,7 +238,15 @@ const AirticketPlan = props => {
<Form.Item label="抵达" required> <Form.Item label="抵达" required>
<Space> <Space>
<Form.Item name="ToAirport" noStyle rules={[{ required: true, message: "请输入抵达机场!" }]}> <Form.Item name="ToAirport" noStyle rules={[{ required: true, message: "请输入抵达机场!" }]}>
<Input placeholder="机场" /> <Select
showSearch
placeholder="机场"
style={{
minWidth: 160,
}}
filterOption={(input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase())}
options={airPortList_select()}
/>
</Form.Item> </Form.Item>
<Form.Item name="ToTerminal" noStyle> <Form.Item name="ToTerminal" noStyle>
<Input placeholder="航站楼" /> <Input placeholder="航站楼" />
@ -509,6 +560,7 @@ const AirticketPlan = props => {
style={{ style={{
width: 160, width: 160,
}} }}
placeholder="如 0.9"
/> />
</Form.Item> </Form.Item>
<Form.Item label="选择客人" name="MEI_Name66"> <Form.Item label="选择客人" name="MEI_Name66">
@ -605,6 +657,7 @@ const AirticketPlan = props => {
getPlanDetail(travelAgencyId, gri_sn); // getPlanDetail(travelAgencyId, gri_sn); //
getGuestList(coli_sn); // getGuestList(coli_sn); //
getVeiPlanChange(travelAgencyId, gri_sn); // getVeiPlanChange(travelAgencyId, gri_sn); //
getAirPortList(); //
}, []); }, []);
return ( return (
@ -630,7 +683,9 @@ const AirticketPlan = props => {
<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}> <Col md={24} lg={24} xxl={24}>
<br />
<p style={{ textAlign: "right" }}> <p style={{ textAlign: "right" }}>
<Popconfirm <Popconfirm
title="请确认要增加航班记录" title="请确认要增加航班记录"

Loading…
Cancel
Save