|
|
|
@ -73,7 +73,7 @@ function Newest() {
|
|
|
|
|
allowClear
|
|
|
|
|
placeholder="Select a guide"
|
|
|
|
|
optionFilterProp="children"
|
|
|
|
|
defaultValue={guideSelectOptions.length == 0 ? null : city.tourGuideId}
|
|
|
|
|
defaultValue={(guideSelectOptions.length == 0 || city.tourGuideId == 0) ? null : city.tourGuideId}
|
|
|
|
|
onChange={(guideId) => {
|
|
|
|
|
reservationStore.setupCityGuide(city.cityId, guideId);
|
|
|
|
|
}}
|
|
|
|
@ -90,11 +90,11 @@ function Newest() {
|
|
|
|
|
|
|
|
|
|
const location = useLocation();
|
|
|
|
|
const { reservationStore } = useStore();
|
|
|
|
|
const { reservationList, reservationPage, referenceNo, arrivalDateRange, cityList, guideList } = reservationStore;
|
|
|
|
|
const { reservationList, reservationPage, referenceNo, arrivalDateRange, cityList, cityGuideList } = reservationStore;
|
|
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
|
|
|
const [dataLoading, setDataLoading] = useState(false);
|
|
|
|
|
const { notification } = App.useApp();
|
|
|
|
|
const guideSelectOptions = guideList.map((data, index) => {
|
|
|
|
|
const guideSelectOptions = cityGuideList.map((data, index) => {
|
|
|
|
|
return {
|
|
|
|
|
value: data.guideId,
|
|
|
|
|
label: data.guideName
|
|
|
|
@ -110,11 +110,11 @@ function Newest() {
|
|
|
|
|
};
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const showCityGuideModal = (reservation) => {
|
|
|
|
|
const showCityGuideModal = (reservation) => {
|
|
|
|
|
setDataLoading(true);
|
|
|
|
|
setIsModalOpen(true);
|
|
|
|
|
reservationStore.editReservation(reservation);
|
|
|
|
|
reservationStore.fetchGuideList();
|
|
|
|
|
reservationStore.fetchAllGuideList();
|
|
|
|
|
reservationStore.fetchCityList(reservation.reservationId)
|
|
|
|
|
.catch(ex => {
|
|
|
|
|
notification.error({
|
|
|
|
@ -129,8 +129,11 @@ function Newest() {
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const handleOk = () => {
|
|
|
|
|
setIsModalOpen(false);
|
|
|
|
|
setDataLoading(false);
|
|
|
|
|
reservationStore.updateReservationGuide()
|
|
|
|
|
.finally(() => {
|
|
|
|
|
setIsModalOpen(false);
|
|
|
|
|
setDataLoading(false);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const handleCancel = () => {
|
|
|
|
|
setIsModalOpen(false);
|
|
|
|
@ -222,7 +225,7 @@ function Newest() {
|
|
|
|
|
simple: true
|
|
|
|
|
}}
|
|
|
|
|
onChange={(pagination, filters, sorter, extra) => {onSearchClick(pagination.current);}}
|
|
|
|
|
columns={reservationListColumns} dataSource={toJS(reservationList)}
|
|
|
|
|
columns={reservationListColumns} dataSource={reservationList}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|