From 4b66cc64c6350cb27923bd59c2783508ff631fbf Mon Sep 17 00:00:00 2001 From: Jimmy Liow <18777396951@163.com> Date: Thu, 27 Apr 2023 15:09:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=95=B0=E6=8D=AE=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Reservation.js | 10 +++++----- src/views/reservation/Detail.jsx | 28 ++++++++++++++++++++++------ src/views/reservation/Newest.jsx | 4 ++-- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/stores/Reservation.js b/src/stores/Reservation.js index dd55f3f..835c732 100644 --- a/src/stores/Reservation.js +++ b/src/stores/Reservation.js @@ -12,13 +12,13 @@ class Reservation { fetchReservationList(current, referenceNo, fromDate, thruDate) { this.reservationPage.current = current; - const fetchUrl = prepareUrl(HT_HOST + '/service-tourdesign/GetPlanSearchList') + const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/GetPlanSearchList') .append('VEI_SN', this.root.authStore.login.travelAgencyId) .append('GroupNo', referenceNo) .append('DateStart', fromDate) .append('DateEnd', thruDate) - .append('RsTotal', this.reservationPage.total) - .append('PageNum', this.reservationPage.size) + .append('TotalNum', this.reservationPage.total) + .append('PageSize', this.reservationPage.size) .append('PageIndex', this.reservationPage.current) .build(); @@ -47,7 +47,7 @@ class Reservation { } fetchReservation(reservationId) { - const fetchUrl = prepareUrl(HT_HOST + '/service-tourdesign/GetPlanInfo') + const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/GetPlanInfo') .append('VEI_SN', this.root.authStore.login.travelAgencyId) .append('GRI_SN', reservationId) .build(); @@ -98,7 +98,7 @@ class Reservation { itineraryList = [ ]; - + customerNames = ''; } diff --git a/src/views/reservation/Detail.jsx b/src/views/reservation/Detail.jsx index cabe475..b178a83 100644 --- a/src/views/reservation/Detail.jsx +++ b/src/views/reservation/Detail.jsx @@ -1,5 +1,5 @@ import { useParams, useNavigate } from "react-router-dom"; -import { useEffect } from 'react'; +import { useEffect, useState } from 'react'; import { observer } from "mobx-react"; import { toJS } from "mobx"; import { Row, Col, Space, Button, Table, Input, Typography, List, App } from 'antd'; @@ -41,9 +41,11 @@ function Detail() { const { notification } = App.useApp(); const { reservationId } = useParams(); const { reservationStore } = useStore(); + const [dataLoading, setDataLoading] = useState(false); const { itineraryList, customerNames, customerList, reservationDetail } = reservationStore; - useEffect(() => { + useEffect(() => { + setDataLoading(true); reservationStore.fetchReservation(reservationId) .catch(ex => { notification.error({ @@ -52,6 +54,9 @@ function Detail() { placement: 'top', duration: 4, }); + }) + .finally(() => { + setDataLoading(false); }); }, [reservationId]); @@ -78,6 +83,7 @@ function Detail() {