From 0e393762aee3352dadc6fda303ed0745d9a2e77f Mon Sep 17 00:00:00 2001 From: Lei OT Date: Tue, 28 Oct 2025 13:49:12 +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:=20invoice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.jsx | 4 ++-- src/views/invoice/Detail.jsx | 11 ++++++++--- src/views/invoice/History.jsx | 4 ++-- src/views/invoice/Index.jsx | 15 +++++++++------ src/views/invoice/Paid.jsx | 7 ++++++- src/views/invoice/PaidDetail.jsx | 6 +++++- 6 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/main.jsx b/src/main.jsx index af56f23..8afaf69 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -82,8 +82,8 @@ const initRouter = async () => { { path: 'notice/:CCP_BLID', element: }, // { path: 'invoice',element:}, - { path: 'invoice/detail/:GMDSN/:GSN',element:}, - { path: 'invoice/history/:GMDSN/:GSN',element:}, + { path: 'invoice/detail/:GMDSN/:GSN/:VEI',element:}, + { path: 'invoice/history/:GMDSN/:GSN/:VEI',element:}, { path: 'invoice/paid',element:}, { path: 'invoice/paid/detail/:flid', element: }, diff --git a/src/views/invoice/Detail.jsx b/src/views/invoice/Detail.jsx index c0c6239..515175b 100644 --- a/src/views/invoice/Detail.jsx +++ b/src/views/invoice/Detail.jsx @@ -9,13 +9,18 @@ import { fetchInvoiceDetail, postEditInvoiceDetail, postAddInvoice } from "@/sto import { removeFeedbackImages } from "@/stores/Feedback"; import BackBtn from "@/components/BackBtn"; import { usingStorage } from "@/hooks/usingStorage"; +import useFormStore from "@/stores/Form"; const { Title, Text } = Typography; function Detail() { const navigate = useNavigate(); - const { GMDSN, GSN } = useParams(); - const { userId, travelAgencyId, loginToken } = usingStorage(); + const { GMDSN, GSN, VEI: agency } = useParams(); + const { userId, travelAgencyId: myAgencyId, loginToken } = usingStorage(); + + const [{agency: pickAgency, ...formValues}] = useFormStore(state => [state.formValuesToSub]); + const travelAgencyId = Number(agency) || pickAgency || myAgencyId; + const [form] = Form.useForm(); const [dataLoading, setDataLoading] = useState(false); const [edited, setEdited] = useState(true); //表单是否允许编辑 @@ -358,7 +363,7 @@ function Detail() { - diff --git a/src/views/invoice/History.jsx b/src/views/invoice/History.jsx index 1238718..bac40a2 100644 --- a/src/views/invoice/History.jsx +++ b/src/views/invoice/History.jsx @@ -10,8 +10,8 @@ import useInvoiceStore from "@/stores/Invoice"; import { usingStorage } from "@/hooks/usingStorage"; function History() { - const { travelAgencyId } = usingStorage(); - const { GMDSN, GSN } = useParams(); + const { travelAgencyId: myAgencyId } = usingStorage(); + const { GMDSN, GSN, VEI: travelAgencyId } = useParams(); const [dataLoading, setDataLoading] = useState(false); const [invoiceZDDetail, setInvoiceZDDetail] = useState([]); const { notification } = App.useApp(); diff --git a/src/views/invoice/Index.jsx b/src/views/invoice/Index.jsx index a36f9b4..78212fb 100644 --- a/src/views/invoice/Index.jsx +++ b/src/views/invoice/Index.jsx @@ -6,10 +6,13 @@ import SearchForm from '@/components/SearchForm'; import dayjs from 'dayjs'; import useInvoiceStore from '@/stores/Invoice'; import { usingStorage } from "@/hooks/usingStorage"; +import useFormStore from "@/stores/Form"; function Index() { - const {travelAgencyId, } = usingStorage(); + const [{agency, ...formValues}] = useFormStore(state => [state.formValuesToSub]); + const { travelAgencyId: myAgencyId } = usingStorage(); + const travelAgencyId = agency || myAgencyId; const [invoiceList, fetchInvoiceList] = useInvoiceStore((state) => [state.invoiceList, state.fetchInvoiceList]); const navigate = useNavigate(); const { notification } = App.useApp(); @@ -20,7 +23,7 @@ function Index() { title: "Ref.No", dataIndex: "GroupName", key: "GroupName", - render: (text, record) => {text}, + render: (text, record) => {text}, }, { title: "Arrival Date", @@ -72,7 +75,7 @@ function Index() { return ( - + { - fetchInvoiceList(travelAgencyId, formVal.referenceNo, formVal.startdate, formVal.enddate, formVal.invoiceStatus); + fetchInvoiceList(formVal.agency || travelAgencyId, formVal.referenceNo, formVal.startdate, formVal.enddate, formVal.invoiceStatus); }} /> - + -