更新分配导游会显示错误

release
Jimmy Liow 2 years ago
parent 0352fc9f5d
commit 3c62ca03ab

@ -93,6 +93,9 @@ class Reservation {
.append('LGC', 1)
.build();
runInAction(() => {
this.cityList = [];
});
return fetchJSON(fetchUrl)
.then(json => {
runInAction(() => {
@ -145,20 +148,19 @@ class Reservation {
return fetchJSON(fetchUrl)
.then(json => {
runInAction(() => {
if (json.errcode == 0) {
this.cityGuideList = (json?.Result??[]).map((data, index) => {
const guideList = (json?.Result??[]).map((data, index) => {
return {
guideId: data.TGI_SN,
guideName: data.TGI2_Name,
mobileNo: data.TGI_Mobile
}
});
return guideList;
} else {
throw new Error(json.errmsg + ': ' + json.errcode);
}
});
});
}
setupCityGuide(cityId, guideId) {
@ -211,7 +213,6 @@ class Reservation {
});
}
cityGuideList = [];
cityList = [];
selectedReservation = null;

@ -98,22 +98,27 @@ function Newest() {
}
const location = useLocation();
const { reservationStore } = useStore();
const { reservationList, reservationPage, referenceNo, arrivalDateRange, cityList, cityGuideList } = reservationStore;
const [isModalOpen, setIsModalOpen] = useState(false);
const [dataLoading, setDataLoading] = useState(false);
const [guideSelectOptions, setGuideSelectOptions] = useState([]);
const { reservationStore } = useStore();
const { reservationList, reservationPage, referenceNo, arrivalDateRange, cityList } = reservationStore;
const { notification } = App.useApp();
const guideSelectOptions = cityGuideList.map((data, index) => {
return {
value: data.guideId,
label: data.guideName
}
});
useEffect (() => {
if (location.search !== '?back') {
//
onSearchClick(1, 1);
reservationStore.fetchAllGuideList()
.then((guideList) => {
const selectOptions = guideList.map((data, index) => {
return {
value: data.guideId,
label: data.guideName
}
});
setGuideSelectOptions(selectOptions);
});
}
return () => {
// unmount...
@ -124,7 +129,6 @@ function Newest() {
setDataLoading(true);
setIsModalOpen(true);
reservationStore.editReservation(reservation);
reservationStore.fetchAllGuideList();
reservationStore.fetchCityList(reservation.reservationId)
.catch(ex => {
notification.error({

Loading…
Cancel
Save