|
|
|
@ -8,7 +8,7 @@ export const fetchCityList = async (travelAgencyId, reservationId) => {
|
|
|
|
|
const { errcode, Result } = await fetchJSON(
|
|
|
|
|
`${HT_HOST}/service-cusservice/PTGetCityGuide`,
|
|
|
|
|
{ VEI_SN: travelAgencyId, GRI_SN: reservationId, LGC: 1 })
|
|
|
|
|
return errcode !== 0 ? {} : Result;
|
|
|
|
|
return errcode !== 0 ? {} : Result
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const fetchPlanDetail = async (travelAgencyId, reservationId) => {
|
|
|
|
@ -31,7 +31,7 @@ export const fetchAttachList = async (reservationId) => {
|
|
|
|
|
const { errcode, result } = await fetchJSON(
|
|
|
|
|
`${HT_HOST}/service-fileServer/PlanChangeFileList`,
|
|
|
|
|
{ GRI_SN: reservationId })
|
|
|
|
|
return errcode !== 0 ? {} : result;
|
|
|
|
|
return errcode !== 0 ? {} : result
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const useReservationStore = create((set, get) => ({
|
|
|
|
@ -105,12 +105,12 @@ const useReservationStore = create((set, get) => ({
|
|
|
|
|
.append('TotalNum', totalNum)
|
|
|
|
|
.append('PageSize', reservationPage.size)
|
|
|
|
|
.append('PageIndex', current)
|
|
|
|
|
.build();
|
|
|
|
|
.build()
|
|
|
|
|
|
|
|
|
|
return fetchJSON(fetchUrl)
|
|
|
|
|
.then(json => {
|
|
|
|
|
if (json.errcode == 0) {
|
|
|
|
|
const mapReservationList = (json?.Result??[]).map((data, index) => {
|
|
|
|
|
const mapReservationList = (json?.Result??[]).map((data) => {
|
|
|
|
|
return {
|
|
|
|
|
key: data.vas_gri_sn,
|
|
|
|
|
reservationId: data.vas_gri_sn,
|
|
|
|
@ -132,32 +132,32 @@ const useReservationStore = create((set, get) => ({
|
|
|
|
|
}
|
|
|
|
|
}))
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error(json.errmsg + ': ' + json.errcode);
|
|
|
|
|
throw new Error(json.errmsg + ': ' + json.errcode)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
fetchAllGuideList: () => {
|
|
|
|
|
const { travelAgencyId } = usingStorage()
|
|
|
|
|
const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTGetGuideList')
|
|
|
|
|
.append('VEI_SN', travelAgencyId)
|
|
|
|
|
.build();
|
|
|
|
|
.build()
|
|
|
|
|
|
|
|
|
|
return fetchJSON(fetchUrl)
|
|
|
|
|
.then(json => {
|
|
|
|
|
if (json.errcode == 0) {
|
|
|
|
|
const guideList = (json?.Result??[]).map((data, index) => {
|
|
|
|
|
const guideList = (json?.Result??[]).map((data) => {
|
|
|
|
|
return {
|
|
|
|
|
guideId: data.TGI_SN,
|
|
|
|
|
guideName: data.TGI2_Name,
|
|
|
|
|
mobileNo: data.TGI_Mobile
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return guideList;
|
|
|
|
|
})
|
|
|
|
|
return guideList
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error(json.errmsg + ': ' + json.errcode);
|
|
|
|
|
throw new Error(json.errmsg + ': ' + json.errcode)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getReservationDetail: async (reservationId) => {
|
|
|
|
@ -167,8 +167,8 @@ const useReservationStore = create((set, get) => ({
|
|
|
|
|
|
|
|
|
|
const mapConfirmationList = planChangeList.map((data) => {
|
|
|
|
|
const filterAttchList = attachListJson.filter(attch => {
|
|
|
|
|
return attch.PCI_SN === data.PCI_SN;
|
|
|
|
|
});
|
|
|
|
|
return attch.PCI_SN === data.PCI_SN
|
|
|
|
|
})
|
|
|
|
|
return {
|
|
|
|
|
key: data.PCI_SN,
|
|
|
|
|
PCI_Changetext: data.PCI_Changetext,
|
|
|
|
@ -209,7 +209,7 @@ const useReservationStore = create((set, get) => ({
|
|
|
|
|
getReservationDetail(travelAgencyId, reservationDetail.reservationId)
|
|
|
|
|
return json
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setupCityGuide: (cityId, guideId) => {
|
|
|
|
@ -229,7 +229,7 @@ const useReservationStore = create((set, get) => ({
|
|
|
|
|
if (json.errcode != 0) {
|
|
|
|
|
throw new Error(json.errmsg + ': ' + json.errcode)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -241,7 +241,7 @@ const useReservationStore = create((set, get) => ({
|
|
|
|
|
.append('VEI_SN', travelAgencyId)
|
|
|
|
|
.append('GRI_SN', selectedReservation.reservationId)
|
|
|
|
|
.append('LGC', 1)
|
|
|
|
|
.build();
|
|
|
|
|
.build()
|
|
|
|
|
|
|
|
|
|
return fetchJSON(fetchUrl)
|
|
|
|
|
.then(json => {
|
|
|
|
@ -252,10 +252,6 @@ const useReservationStore = create((set, get) => ({
|
|
|
|
|
return data.GuideName
|
|
|
|
|
}).join(',')
|
|
|
|
|
|
|
|
|
|
runInAction(() => {
|
|
|
|
|
selectedReservation.guide = reservationGuide
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
set((state) => ({
|
|
|
|
|
selectedReservation: {
|
|
|
|
|
...state.selectedReservation,
|
|
|
|
|