|
|
|
@ -53,23 +53,51 @@ class Reservation {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fetchReservation(reservationId) {
|
|
|
|
|
const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/GetPlanInfo')
|
|
|
|
|
const fetchDetailUrl = prepareUrl(HT_HOST + '/service-cusservice/GetPlanInfo')
|
|
|
|
|
.append('VEI_SN', this.root.authStore.login.travelAgencyId)
|
|
|
|
|
.append('GRI_SN', reservationId)
|
|
|
|
|
.append("token", this.root.authStore.login.token)
|
|
|
|
|
.build();
|
|
|
|
|
// https://p9axztuwd7x8a7.mycht.cn/service-fileServer/PlanChangeFileList
|
|
|
|
|
const fetchAttachmentUrl = prepareUrl(HT_HOST + '/service-fileServer/PlanChangeFileList')
|
|
|
|
|
.append('GRI_SN', reservationId)
|
|
|
|
|
.append("token", this.root.authStore.login.token)
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|
return fetchJSON(fetchUrl)
|
|
|
|
|
const attachmentPromise = fetchJSON(fetchAttachmentUrl)
|
|
|
|
|
.then(json => {
|
|
|
|
|
if (json.errcode == 0) {
|
|
|
|
|
return json;
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error(json.errmsg + ': ' + json.errcode);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const detailPromise = fetchJSON(fetchDetailUrl)
|
|
|
|
|
.then(json => {
|
|
|
|
|
if (json.errcode == 0) {
|
|
|
|
|
return json;
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error(json.errmsg + ': ' + json.errcode);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return Promise.all([attachmentPromise, detailPromise])
|
|
|
|
|
.then(results => {
|
|
|
|
|
const attachList = results[0].result;
|
|
|
|
|
const planDetail = results[1].PlanDetail[0];
|
|
|
|
|
const planChange = results[1]?.PlanChange??[];
|
|
|
|
|
runInAction(() => {
|
|
|
|
|
this.reservationDetail = {
|
|
|
|
|
referenceNumber: json.PlanDetail[0].GRI_Name,
|
|
|
|
|
tourGuide: json.PlanDetail[0].Guide,
|
|
|
|
|
arrivalDate: json.PlanDetail[0].eoi_getdate,
|
|
|
|
|
referenceNumber: planDetail.GRI_Name,
|
|
|
|
|
tourGuide: planDetail.Guide,
|
|
|
|
|
arrivalDate: planDetail.eoi_getdate,
|
|
|
|
|
reservationId: reservationId
|
|
|
|
|
};
|
|
|
|
|
this.confirmationList = (json?.PlanChange??[]).map((data, index) => {
|
|
|
|
|
this.confirmationList = planChange.map((data, index) => {
|
|
|
|
|
const filterAttchList = attachList.filter(attch => {
|
|
|
|
|
return attch.PCI_SN === data.PCI_SN;
|
|
|
|
|
});
|
|
|
|
|
return {
|
|
|
|
|
key: data.PCI_SN,
|
|
|
|
|
PCI_Changetext: data.PCI_Changetext,
|
|
|
|
@ -77,15 +105,12 @@ class Reservation {
|
|
|
|
|
ConfirmPerson: data.ConfirmPerson,
|
|
|
|
|
PCI_ConfirmText: data.PCI_ConfirmText,
|
|
|
|
|
PCI_ConfirmDate: data.PCI_ConfirmDate,
|
|
|
|
|
VAS_SN: data.PCI_VAS_SN
|
|
|
|
|
VAS_SN: data.PCI_VAS_SN,
|
|
|
|
|
attachmentList: filterAttchList
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
return json;
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error(json.errmsg + ': ' + json.errcode);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fetchCityList(reservationId) {
|
|
|
|
|