diff --git a/src/stores/Auth.js b/src/stores/Auth.js index c547088..6b1679c 100644 --- a/src/stores/Auth.js +++ b/src/stores/Auth.js @@ -9,8 +9,8 @@ class Auth { login = { userId: 1, - username: 'Giffigan(Discova)', - travelAgencyId: 628 + username: 'Vu Xuan Giang(TOI)', + travelAgencyId: 30333 } } diff --git a/src/stores/Reservation.js b/src/stores/Reservation.js index 4fc465d..1b2f6bb 100644 --- a/src/stores/Reservation.js +++ b/src/stores/Reservation.js @@ -12,10 +12,10 @@ class Reservation { fetchReservationList(referenceNo, fromDate, thruDate) { const fetchUrl = prepareUrl(HT_HOST + '/service-tourdesign/GetPlanSearchList') - .append('VEISn', this.root.authStore.login.travelAgencyId) + .append('VEI_SN', this.root.authStore.login.travelAgencyId) .append('GroupNo', referenceNo) .append('DateStart', fromDate) - .append('DataEnd', thruDate) + .append('DateEnd', thruDate) .append('ReTotal', 0) .append('PageSize', 0) .append('PageNum', 0) @@ -55,19 +55,20 @@ class Reservation { .then(json => { runInAction(() => { if (json.errcode == 0) { - console.info(json); - // this.reservationList = json.Result.map((data, index) => { - // return { - // key: data.vas_gri_sn, - // id: data.vas_gri_sn, - // referenceNumber: data.GriName, - // arrivalDate: data.GetGDate, - // pax: data.PersonNum, - // status: data.GState, - // reservationDate: data.GetGDate, - // guide: data.Guide, - // } - // }); + this.itineraryList = json.VendorTour.map((data, index) => { + return { + key: data.GRD_GRI_SN, + day: data.GRD_OrderDate, + placeTransport: data.GRD_Traffic, + todayActivities: data.GRD_LandscapeWL, + accommodation: data.GRD_Hotel, + meals: data.GRD_Meal_L + data.GRD_Meal_S, + } + }); + this.reservationDetail = { + referenceNumber: json.PlanDetail[0].GRI_Name, tourGuide: json.Guide[0].TGI2_Name, arrivalDate: json.PlanDetail[0].eoi_getdate + }; + this.customerNames = json.CusAndRequest[0].GCI_CustomerList; } else { throw new Error(json.errmsg + ': ' + json.errcode); } @@ -77,6 +78,13 @@ class Reservation { reservationList = []; + reservationDetail = { + referenceNumber: '', arrivalDate: '', tourGuide: '' + }; + + itineraryList = [ + ]; + customerList = [ { title: 'Crane / Gemma Chelse', @@ -99,33 +107,7 @@ class Reservation { description: 'Gender: Male Nationality: United States Passport: 593422145 Expiration Date: 2023-04-25 Birth Date: 2012-03-26s', }, ]; - - itineraryList = [ - { - key: '1', - day: 'Tue 05-Jul-2022', - placeTransport: 'Bangkok to Chiang Mai, PG217 Dep 12:15 - Arr 13:35 (Economy class)', - todayActivities: 'Hotel to airport Transfer (Bangkok), Airport to Hotel Transfer (Chiang Mai), Street Food Tour in Chiang Mai (Morning or Afternoon)', - accommodation: 'The Rim Resort **** (Dahla Junior Suite)', - meals: 'B,D' - }, - { - key: '2', - day: 'Wed 06-Jul-2022', - placeTransport: 'Chiang Mai', - todayActivities: 'Elephant Jungle Sanctuary Half Day Tour (Private transfer and Join in activity), Chiang Mai City Lifestyle Experiece and Mountain Doi Suthep Half Day Tour with a rickshaw ride', - accommodation: 'The Rim Resort **** (Dahla Junior Suite)', - meals: 'B' - }, - { - key: '3', - day: 'Thu 07-Jul-2022', - placeTransport: 'Chiang Mai to Phuket , VZ414 Dep 10:40 - Arr 12:50 (Economy class)', - todayActivities: 'Hotel to airport Transfer (Chiang Mai), Airport to Hotel Transfer (Phuket )', - accommodation: 'Pamookkoo Resort **** (Family room)', - meals: 'B' - }, - ]; + customerNames = ''; } export default Reservation; \ No newline at end of file diff --git a/src/views/App.jsx b/src/views/App.jsx index 11d08cc..3f5eb2c 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -71,7 +71,7 @@ function App() { }}>
- + App logo - + { - console.info('Detail.useEffect: ' + reservationId); + useEffect(() => { reservationStore.fetchReservation(reservationId) .catch(ex => { notification.error({ @@ -61,7 +60,7 @@ function Detail() { - Reference Number: 220629-W220420009; Arrival date: 2023-12-15; Tour guide: Giffigan + Reference Number: {reservationDetail.referenceNumber}; Arrival date: {reservationDetail.arrivalDate}; Tour guide: {reservationDetail.tourGuide} diff --git a/src/views/reservation/Newest.jsx b/src/views/reservation/Newest.jsx index a047964..28cdc21 100644 --- a/src/views/reservation/Newest.jsx +++ b/src/views/reservation/Newest.jsx @@ -77,10 +77,6 @@ function Newest() { setIsModalOpen(false); }; - useEffect(() => { - console.info('Newest.useEffect'); - }, []); - const onSearchClick = () => { setTableLoading(true); reservationStore.fetchReservationList(referenceNo, selectedDateRange[0], selectedDateRange[1])