diff --git a/src/stores/Invoice.js b/src/stores/Invoice.js index 52e4984..95cab3e 100644 --- a/src/stores/Invoice.js +++ b/src/stores/Invoice.js @@ -8,7 +8,7 @@ import dayjs from "dayjs"; import { create } from 'zustand'; import { devtools } from 'zustand/middleware'; - +import useAuthStore from '@/stores/Auth'; const initialState = { invoiceList: [], //账单列表 @@ -124,7 +124,7 @@ export class Invoice { fetchInvoiceDetail(GMDSN, GSN) { const fetchUrl = prepareUrl(HT_HOST + "/service-cusservice/PTGetZDDetail") - .append("VEI_SN", this.root.authStore.login.travelAgencyId) + .append("VEI_SN", useAuthStore.getState().loginUser.travelAgencyId) .append("GRI_SN", GSN) .append("GMD_SN", GMDSN) .append("LGC", 1) @@ -231,7 +231,7 @@ export class Invoice { postEditInvoiceDetail(GMD_SN, Currency, Cost, PayDate, Pic, Memo) { let postUrl = HT_HOST + "/service-cusservice/EditSupplierFK"; let formData = new FormData(); - formData.append("LMI_SN", this.root.authStore.login.userId); + formData.append("LMI_SN", useAuthStore.getState().loginUser.userId); formData.append("GMD_SN", GMD_SN); formData.append("Currency", Currency); formData.append("Cost", Cost); @@ -249,8 +249,8 @@ export class Invoice { postAddInvoice(GRI_SN, Currency, Cost, PayDate, Pic, Memo) { let postUrl = HT_HOST + "/service-cusservice/AddSupplierFK"; let formData = new FormData(); - formData.append("LMI_SN", this.root.authStore.login.userId); - formData.append("VEI_SN", this.root.authStore.login.travelAgencyId); + formData.append("LMI_SN", useAuthStore.getState().loginUser.userId); + formData.append("VEI_SN", useAuthStore.getState().loginUser.travelAgencyId); formData.append("GRI_SN", GRI_SN); formData.append("Currency", Currency); formData.append("Cost", Cost); diff --git a/src/views/invoice/Detail.jsx b/src/views/invoice/Detail.jsx index cd1e539..01a91a2 100644 --- a/src/views/invoice/Detail.jsx +++ b/src/views/invoice/Detail.jsx @@ -8,6 +8,7 @@ import { PlusOutlined, AuditOutlined, SmileOutlined, SolutionOutlined, EditOutli import { isNotEmpty } from "@/utils/commons"; import * as config from "@/config"; import dayjs from "dayjs"; +import useAuthStore from '@/stores/Auth'; const { Title,Text } = Typography; const { TextArea } = Input; @@ -15,7 +16,10 @@ const { TextArea } = Input; function Detail() { const navigate = useNavigate(); const { GMDSN, GSN } = useParams(); - const { invoiceStore, authStore } = useStore(); + const { invoiceStore, } = useStore(); + + const [travelAgencyId, token] = useAuthStore((state) => [state.loginUser.travelAgencyId, state.loginUser.token]); + const { invoicekImages, invoiceGroupInfo, invoiceProductList, invoiceCurrencyList, invoiceZDDetail } = invoiceStore; const [form] = Form.useForm(); const [dataLoading, setDataLoading] = useState(false); @@ -35,7 +39,7 @@ function Detail() { invoiceStore .fetchInvoiceDetail(GMDSN, GSN) .then(json => { - let ZDDetail = json.ZDDetail; + let ZDDetail = json.ZDDetail; if (isNotEmpty(ZDDetail)) { let arrLen = ZDDetail.length; const formData = ZDDetail.map((data, index) => { @@ -122,7 +126,7 @@ function Detail() { description: "Success Submit!", placement: "top", duration: 4, - }); + }); } }); } @@ -272,13 +276,13 @@ function Detail() { }, ]} > - - - Payment is arranged during the last week of each month. If the invoice is issued after the 20th, please select the following month for payment. For urgent payments, please contact the travel advisor. + + + Payment is arranged during the last week of each month. If the invoice is issued after the 20th, please select the following month for payment. For urgent payments, please contact the travel advisor. -
+
+ + + -