From bc4bd24fca2b540e366dc6b134f28254e6c13ab2 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 27 Oct 2025 16:57:00 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=88=87=E6=8D=A2=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86:=20airticket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/airticket/Index.jsx | 7 +++++-- src/views/airticket/Invoice.jsx | 7 +++++-- src/views/airticket/InvoicePaid.jsx | 10 ++++++---- src/views/airticket/Plan.jsx | 8 +++++--- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/views/airticket/Index.jsx b/src/views/airticket/Index.jsx index 26b7d99..9a63933 100644 --- a/src/views/airticket/Index.jsx +++ b/src/views/airticket/Index.jsx @@ -9,6 +9,7 @@ import { DATE_FORMAT } from "@/config"; import { TableExportBtn } from "@/components/Data"; import airTicketStore from "@/stores/Airticket"; import { usingStorage } from "@/hooks/usingStorage"; +import useFormStore from "@/stores/Form"; const planListColumns = [ { @@ -86,7 +87,9 @@ const planListColumns = [ const Airticket = props => { const navigate = useNavigate(); - const { travelAgencyId } = usingStorage(); + const [{agency, ...formValues}] = useFormStore(state => [state.formValuesToSub]); + const { travelAgencyId: myAgencyId } = usingStorage(); + const travelAgencyId = agency || myAgencyId; const [getPlanList, planList, loading] = airTicketStore(state => [state.getPlanList, state.planList, state.loading]); const showTotal = total => `合计 ${total} `; @@ -110,7 +113,7 @@ const Airticket = props => { }, }} onSubmit={(err, formVal, filedsVal) => { - getPlanList(travelAgencyId, formVal.referenceNo, formVal.startdate, formVal.endtime, formVal.plan_state, formVal.airticket_state); + getPlanList(formVal.agency || travelAgencyId, formVal.referenceNo, formVal.startdate, formVal.endtime, formVal.plan_state, formVal.airticket_state); }} /> diff --git a/src/views/airticket/Invoice.jsx b/src/views/airticket/Invoice.jsx index 73680e3..1ab2dfb 100644 --- a/src/views/airticket/Invoice.jsx +++ b/src/views/airticket/Invoice.jsx @@ -11,10 +11,13 @@ import { TableExportBtn } from "@/components/Data"; import airTicketStore from "@/stores/Airticket"; import { usingStorage } from "@/hooks/usingStorage"; +import useFormStore from "@/stores/Form"; const Invoice = props => { const navigate = useNavigate(); const { notification } = App.useApp(); - const { travelAgencyId } = usingStorage(); + const [{agency, ...formValues}] = useFormStore(state => [state.formValuesToSub]); + const { travelAgencyId: myAgencyId } = usingStorage(); + const travelAgencyId = agency || myAgencyId; const [getVEIFlightBill, vEIFlightBill, loading, postVEIFlightBillSubmit] = airTicketStore(state => [state.getVEIFlightBill, state.vEIFlightBill, state.loading, state.postVEIFlightBillSubmit]); const showTotal = total => `合计 ${total} `; const [selectedValues, setSelectedValues] = useState([]); @@ -217,7 +220,7 @@ const Invoice = props => { }, }} onSubmit={(err, formVal, filedsVal) => { - getVEIFlightBill(travelAgencyId, formVal.referenceNo, formVal.invoiceCheckStatus, formVal.startdate, formVal.endtime); + getVEIFlightBill(formVal.agency || travelAgencyId, formVal.referenceNo, formVal.invoiceCheckStatus, formVal.startdate, formVal.endtime); }} /> diff --git a/src/views/airticket/InvoicePaid.jsx b/src/views/airticket/InvoicePaid.jsx index 0a9dcd9..db17818 100644 --- a/src/views/airticket/InvoicePaid.jsx +++ b/src/views/airticket/InvoicePaid.jsx @@ -13,11 +13,13 @@ import { fetchInvoicePaidDetail } from "@/stores/Invoice"; import airTicketStore from "@/stores/Airticket"; import { usingStorage } from "@/hooks/usingStorage"; - +import useFormStore from "@/stores/Form"; const InvoicePaid = props => { - const navigate = useNavigate(); + const navigate = useNavigate(); const { notification } = App.useApp(); - const { travelAgencyId } = usingStorage(); + const [{agency, ...formValues}] = useFormStore(state => [state.formValuesToSub]); + const { travelAgencyId:myAgencyId } = usingStorage(); + const travelAgencyId = agency || myAgencyId; const [invoicePaidDetail, setInvoicePaidDetail] = useState([]); const [invoiceNO, setInvoiceNO] = useState([]); //显示账单编号 const [loading, invoicePaid, fetchInvoicePaid] = useInvoiceStore(state => [state.loading, state.invoicePaid, state.fetchInvoicePaid]); @@ -106,7 +108,7 @@ const InvoicePaid = props => { }, }} onSubmit={(err, formVal) => { - fetchInvoicePaid(travelAgencyId, "", formVal.startdate, formVal.enddate); + fetchInvoicePaid(formVal.agency || travelAgencyId, "", formVal.startdate, formVal.enddate); setInvoicePaidDetail([]); }} /> diff --git a/src/views/airticket/Plan.jsx b/src/views/airticket/Plan.jsx index bd61d85..f698d62 100644 --- a/src/views/airticket/Plan.jsx +++ b/src/views/airticket/Plan.jsx @@ -8,10 +8,12 @@ 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 { coli_sn, gri_sn } = useParams(); - const { travelAgencyId, loginToken, userId } = usingStorage(); + const { travelAgencyId: myAgencyId, loginToken, userId } = usingStorage(); + const travelAgencyId = agency || myAgencyId; const [ getPlanDetail, planDetail, @@ -517,7 +519,7 @@ const AirticketPlan = props => { - {planDetail ? `${planDetail[0].GRI_No} - ${planDetail[0].WL}` : ""} + {planDetail ? `${planDetail[0]?.GRI_No} - ${planDetail[0]?.WL}` : ""}