From f6ffed8607e6ebecb9b1c8e7f401079b52b2f036 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 27 Oct 2025 17:06:20 +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:=20trainticket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/trainticket/index.jsx | 7 +++++-- src/views/trainticket/invoice.jsx | 9 ++++++--- src/views/trainticket/invoicePaid.jsx | 5 ++++- src/views/trainticket/plan.jsx | 5 ++++- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/views/trainticket/index.jsx b/src/views/trainticket/index.jsx index b77c282..12129ff 100644 --- a/src/views/trainticket/index.jsx +++ b/src/views/trainticket/index.jsx @@ -9,6 +9,7 @@ import { DATE_FORMAT } from "@/config"; import { TableExportBtn } from "@/components/Data"; import trainTicketStore from "@/stores/Trainticket"; import { usingStorage } from "@/hooks/usingStorage"; +import useFormStore from "@/stores/Form"; const planListColumns = [ { @@ -87,7 +88,9 @@ const planListColumns = [ const Trainticket = 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] = trainTicketStore(state => [state.getPlanList, state.planList, state.loading]); const showTotal = total => `合计 ${total} `; @@ -111,7 +114,7 @@ const Trainticket = 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/trainticket/invoice.jsx b/src/views/trainticket/invoice.jsx index bb7aa31..0afc1ed 100644 --- a/src/views/trainticket/invoice.jsx +++ b/src/views/trainticket/invoice.jsx @@ -10,11 +10,14 @@ import { TableExportBtn } from "@/components/Data"; import trainTicketStore from "@/stores/Trainticket"; 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] = trainTicketStore(state => [state.getVEIFlightBill, state.vEIFlightBill, state.loading, state.postVEIFlightBillSubmit]); const showTotal = total => `合计 ${total} `; const [selectedValues, setSelectedValues] = useState([]); @@ -205,9 +208,9 @@ 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); //console.log(vEIFlightBill); - + }} /> diff --git a/src/views/trainticket/invoicePaid.jsx b/src/views/trainticket/invoicePaid.jsx index 84d9eee..e7ab916 100644 --- a/src/views/trainticket/invoicePaid.jsx +++ b/src/views/trainticket/invoicePaid.jsx @@ -12,11 +12,14 @@ import useInvoiceStore from "@/stores/Invoice"; import { fetchInvoicePaidDetail } from "@/stores/Invoice"; import { usingStorage } from "@/hooks/usingStorage"; +import useFormStore from "@/stores/Form"; const InvoicePaid = 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 [invoicePaidDetail, setInvoicePaidDetail] = useState([]); const [invoiceNO, setInvoiceNO] = useState([]); //显示账单编号 const [loading, invoicePaid, fetchInvoicePaid] = useInvoiceStore(state => [state.loading, state.invoicePaid, state.fetchInvoicePaid]); diff --git a/src/views/trainticket/plan.jsx b/src/views/trainticket/plan.jsx index fdfe08b..7fb4319 100644 --- a/src/views/trainticket/plan.jsx +++ b/src/views/trainticket/plan.jsx @@ -11,10 +11,13 @@ import BackBtn from "@/components/BackBtn"; import { station_names } from "@/views/trainticket/station_name"; import { Upload } from "antd"; import { ImageUploader, ImageViewer,simple_encrypt } from "@/components/ImageUploader"; +import useFormStore from "@/stores/Form"; const TrainticketPlan = props => { const { coli_sn, gri_sn } = useParams(); - const { travelAgencyId, loginToken, userId } = usingStorage(); + const [{agency, ...formValues}] = useFormStore(state => [state.formValuesToSub]); + const { travelAgencyId: myAgencyId, loginToken, userId } = usingStorage(); + const travelAgencyId = agency || myAgencyId; const [ getPlanDetail, planDetail,