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