From 7296ed954c8c2d89d978d4d605ca55754bb7e91d Mon Sep 17 00:00:00 2001 From: Ycc Date: Fri, 20 Sep 2024 16:05:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E9=80=89=E6=8B=A9=E8=88=AA?= =?UTF-8?q?=E7=A9=BA=E5=85=AC=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Airticket.js | 68 ++++++++++++++++++----- src/views/airticket/Plan.jsx | 103 +++++++++++++++++++++++++++-------- 2 files changed, 134 insertions(+), 37 deletions(-) diff --git a/src/stores/Airticket.js b/src/stores/Airticket.js index 454ebf4..b0aa0db 100644 --- a/src/stores/Airticket.js +++ b/src/stores/Airticket.js @@ -12,6 +12,7 @@ const airTicketStore = create((set, get) => ({ setGuestList: guestList => set({ guestList }), setVEIFlightBill: vEIFlightBill => set({ vEIFlightBill }), setVeiPlanChangeTxt: veiPlanChangeTxt => set({ veiPlanChangeTxt }), + setAirPortList: airPortList => set({ airPortList }), async getPlanList(vei_sn, GRI_Name, TimeStart, TimeEnd) { const { setLoading, setPlanList } = get(); @@ -39,7 +40,7 @@ const airTicketStore = create((set, get) => ({ const _result = errcode !== 0 ? [] : result; setPlanDetail(_result); //return _result.filter(item => isNotEmpty(item.GRI_No)); - return 'dsadsd'; + return "dsadsd"; }, 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)) { 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 formData.set("TicketIssued", info_object.TicketIssued ? 1 : 0); const postUrl = HT_HOST + "/Service_BaseInfoWeb/edit_or_new_flight_info"; @@ -65,15 +66,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 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) { const { setGuestList } = get(); @@ -86,7 +87,7 @@ const airTicketStore = create((set, get) => ({ }, //获取账单列表 async getVEIFlightBill(VEI_SN, GRI_Name, CheckStatus, FlightDate1, FlightDate2) { - const { setLoading,setVEIFlightBill } = get(); + const { setLoading, setVEIFlightBill } = get(); setLoading(true); const searchParams = { VEI_SN: VEI_SN, @@ -152,7 +153,7 @@ const airTicketStore = create((set, get) => ({ }); }, //提交账单 - async postVEIFlightBillSubmit(VEI_SN,values) { + async postVEIFlightBillSubmit(VEI_SN, values) { const formData = new FormData(); formData.append("vei_sn", VEI_SN); formData.append("billdata", JSON.stringify(values)); @@ -175,6 +176,47 @@ const airTicketStore = create((set, get) => ({ const _result = errcode !== 0 ? [] : 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; diff --git a/src/views/airticket/Plan.jsx b/src/views/airticket/Plan.jsx index 4635de9..25e66fa 100644 --- a/src/views/airticket/Plan.jsx +++ b/src/views/airticket/Plan.jsx @@ -12,29 +12,48 @@ import BackBtn from "@/components/BackBtn"; const AirticketPlan = props => { const { coli_sn, gri_sn } = useParams(); const { travelAgencyId, loginToken, userId } = usingStorage(); - const [getPlanDetail, planDetail, getGuestList, guestList, loading, postFlightDetail, postFlightCost, deleteFlightCost, getVeiPlanChange, veiPlanChangeTxt, postVeiFlightPlanConfirm, ticketIssuedNotifications, delete_flight_info] = - airTicketStore(state => [ - state.getPlanDetail, - state.planDetail, - state.getGuestList, - state.guestList, - state.loading, - state.postFlightDetail, - state.postFlightCost, - state.deleteFlightCost, - state.getVeiPlanChange, - state.veiPlanChangeTxt, - state.postVeiFlightPlanConfirm, - state.ticketIssuedNotifications, - state.delete_flight_info, - ]); + const [ + getPlanDetail, + planDetail, + getGuestList, + guestList, + loading, + postFlightDetail, + postFlightCost, + deleteFlightCost, + getVeiPlanChange, + veiPlanChangeTxt, + postVeiFlightPlanConfirm, + ticketIssuedNotifications, + delete_flight_info, + getAirPortList, + airPortList, + airLineList, + ] = airTicketStore(state => [ + state.getPlanDetail, + state.planDetail, + state.getGuestList, + state.guestList, + state.loading, + state.postFlightDetail, + state.postFlightCost, + state.deleteFlightCost, + state.getVeiPlanChange, + state.veiPlanChangeTxt, + state.postVeiFlightPlanConfirm, + state.ticketIssuedNotifications, + 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 reservationPreviewUrl = OFFICEWEBVIEWERURL + encodeURIComponent(reservationUrl); const [form] = Form.useForm(); const { notification } = App.useApp(); //console.log(reservationPreviewUrl); - //乘客列表 + //乘客下拉列表 const guestList_select = () => { return ( guestList && @@ -47,6 +66,15 @@ const AirticketPlan = props => { const guestList_OnChange = 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 = [ @@ -165,24 +193,39 @@ const AirticketPlan = props => { - + - {/* */} - - - + + + @@ -195,7 +238,15 @@ const AirticketPlan = props => { - + @@ -509,6 +560,7 @@ const AirticketPlan = props => { style={{ width: 160, }} + placeholder="如 0.9" /> @@ -605,6 +657,7 @@ const AirticketPlan = props => { getPlanDetail(travelAgencyId, gri_sn); //计划详情,含费用列表 getGuestList(coli_sn); //客人列表 getVeiPlanChange(travelAgencyId, gri_sn); //计划变更信息 + getAirPortList(); //获取机场信息 }, []); return ( @@ -630,7 +683,9 @@ const AirticketPlan = props => { + +