From 347719f77dc2d62cb17b27b025e7194cffb9e9cb Mon Sep 17 00:00:00 2001 From: Jimmy Liow <18777396951@163.com> Date: Wed, 24 May 2023 15:19:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=A2=E8=AE=A1=E5=88=92=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=B8=BA=E7=A1=AE=E8=AE=A4=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Auth.js | 1 + src/stores/Reservation.js | 3 ++- src/views/reservation/Newest.jsx | 10 ++++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/stores/Auth.js b/src/stores/Auth.js index e248a6e..0c50211 100644 --- a/src/stores/Auth.js +++ b/src/stores/Auth.js @@ -11,6 +11,7 @@ class Auth { makeAutoObservable(this, { rootStore: false }); this.root = root; this.login.token = root.getSession(KEY_LOGIN_TOKEN); + console.info('Auth()'); } valdateUserPassword(usr, pwd) { diff --git a/src/stores/Reservation.js b/src/stores/Reservation.js index ada1565..d276ec4 100644 --- a/src/stores/Reservation.js +++ b/src/stores/Reservation.js @@ -10,7 +10,7 @@ class Reservation { this.root = root; } - fetchReservationList(current) { + fetchReservationList(current, status=null) { const fromDate = this.arrivalDateRange.length == 0 ? null : this.arrivalDateRange[0].format('YYYY-MM-DD'); const thruDate = this.arrivalDateRange.length == 0 ? null : this.arrivalDateRange[1].format('YYYY-MM-DD'); this.reservationPage.current = current; @@ -21,6 +21,7 @@ class Reservation { .append('GroupNo', this.referenceNo) .append('DateStart', fromDate) .append('DateEnd', thruDate) + .append('NotConfirm', status) .append('TotalNum', totalNum) .append('PageSize', this.reservationPage.size) .append('PageIndex', this.reservationPage.current) diff --git a/src/views/reservation/Newest.jsx b/src/views/reservation/Newest.jsx index cfd35e9..3849413 100644 --- a/src/views/reservation/Newest.jsx +++ b/src/views/reservation/Newest.jsx @@ -102,8 +102,9 @@ function Newest() { }); useEffect (() => { - if (location.search !== '?back') { - onSearchClick(); + if (location.search !== '?back') { + // 第一页,未确认计划 + onSearchClick(1, 1); } return () => { console.info('unmount...'); @@ -140,9 +141,10 @@ function Newest() { setDataLoading(false); }; - const onSearchClick = (current=1) => { + // 默认重新搜索第一页,所有状态的计划 + const onSearchClick = (current=1, status=null) => { setDataLoading(true); - reservationStore.fetchReservationList(current) + reservationStore.fetchReservationList(current, status) .catch(ex => { notification.error({ message: `Notification`,