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`,