diff --git a/src/stores/Reservation.js b/src/stores/Reservation.js index 33c1b1f..9e3a978 100644 --- a/src/stores/Reservation.js +++ b/src/stores/Reservation.js @@ -56,8 +56,8 @@ class Reservation { return fetchJSON(fetchUrl) .then(json => { - runInAction(() => { - if (json.errcode == 0) { + if (json.errcode == 0) { + runInAction(() => { this.itineraryList = json.VendorTour.map((data, index) => { return { key: data.GRD_SN, @@ -85,13 +85,28 @@ class Reservation { PCI_ConfirmDate: data.PCI_ConfirmDate } }); - } else { - throw new Error(json.errmsg + ': ' + json.errcode); - } - }); + }); + } else { + throw new Error(json.errmsg + ': ' + json.errcode); + } }); } + // get confirmationList() { + // return computed(() => { + // return json.PlanChange.map((data, index) => { + // return { + // key: data.PCI_SN, + // PCI_Changetext: data.PCI_Changetext, + // PCI_SendDate: data.PCI_SendDate, + // ConfirmPerson: data.ConfirmPerson, + // PCI_ConfirmText: data.PCI_ConfirmText, + // PCI_ConfirmDate: data.PCI_ConfirmDate + // } + // }); + // }).get(); + // } + fetchCityList(reservationId) { const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTGetCityGuide') .append('VEI_SN', this.root.authStore.login.travelAgencyId) @@ -167,10 +182,20 @@ class Reservation { return postForm(postUrl, formData) .then(json => { - console.info(json); + if (json.errcode == 0 && json.Result.length == 1) { + runInAction(() => { + this.selectedConfirmation.PCI_ConfirmText = json.Result[0].PCI_ConfirmText; + this.selectedConfirmation.PCI_ConfirmDate = json.Result[0].PCI_ConfirmDate; + }); + return json; + } }); } + editReservation(reservation) { + this.selectedReservation = reservation; + } + editConfirmation(confirmation) { this.selectedConfirmation = confirmation; } diff --git a/src/views/reservation/Detail.jsx b/src/views/reservation/Detail.jsx index 53bb003..cd06240 100644 --- a/src/views/reservation/Detail.jsx +++ b/src/views/reservation/Detail.jsx @@ -14,27 +14,22 @@ function Detail() { { title: 'Day', dataIndex: 'day', - key: 'day', }, { title: 'Place & Transport', dataIndex: 'placeTransport', - key: 'placeTransport', }, { title: 'Today’s Activities', dataIndex: 'todayActivities', - key: 'todayActivities', }, { title: 'Accommodation', dataIndex: 'accommodation', - key: 'accommodation', }, { title: 'Meals', dataIndex: 'meals', - key: 'meals', }, ]; @@ -79,7 +74,8 @@ function Detail() { const { reservationId } = useParams(); const { reservationStore } = useStore(); const [dataLoading, setDataLoading] = useState(false); - const { itineraryList, customerNames, confirmationList, reservationDetail } = reservationStore; + const { itineraryList, customerNames, reservationDetail } = reservationStore; + const confirmationList = reservationStore.confirmationList; const showConfirmModal = (confirm) => { setIsModalOpen(true); @@ -176,7 +172,7 @@ function Detail() { bordered loading={dataLoading} pagination={false} - dataSource={toJS(confirmationList)} columns={confirmationListColumns} + dataSource={confirmationList} columns={confirmationListColumns} />