增加查询计划详情

release
Jimmy Liow 2 years ago
parent ecd2531bb5
commit 910ffc3f69

@ -9,7 +9,7 @@ class Auth {
login = { login = {
userId: 1, userId: 1,
username: 'LiaoYijun(IT)', username: 'Giffigan(Discova)',
travelAgencyId: 628 travelAgencyId: 628
} }
} }

@ -10,7 +10,7 @@ class Reservation {
this.root = root; this.root = root;
} }
fetchReservation(referenceNo, fromDate, thruDate) { fetchReservationList(referenceNo, fromDate, thruDate) {
const fetchUrl = prepareUrl(HT_HOST + '/service-tourdesign/GetPlanSearchList') const fetchUrl = prepareUrl(HT_HOST + '/service-tourdesign/GetPlanSearchList')
.append('VEISn', this.root.authStore.login.travelAgencyId) .append('VEISn', this.root.authStore.login.travelAgencyId)
.append('GroupNo', referenceNo) .append('GroupNo', referenceNo)
@ -45,6 +45,36 @@ class Reservation {
}); });
} }
fetchReservation(reservationId) {
const fetchUrl = prepareUrl(HT_HOST + '/service-tourdesign/GetPlanInfo')
.append('VEI_SN', this.root.authStore.login.travelAgencyId)
.append('GRI_SN', reservationId)
.build();
return fetchJSON(fetchUrl)
.then(json => {
runInAction(() => {
if (json.errcode == 0) {
console.info(json);
// this.reservationList = json.Result.map((data, index) => {
// return {
// key: data.vas_gri_sn,
// id: data.vas_gri_sn,
// referenceNumber: data.GriName,
// arrivalDate: data.GetGDate,
// pax: data.PersonNum,
// status: data.GState,
// reservationDate: data.GetGDate,
// guide: data.Guide,
// }
// });
} else {
throw new Error(json.errmsg + ': ' + json.errcode);
}
});
});
}
reservationList = []; reservationList = [];
customerList = [ customerList = [

@ -3,7 +3,7 @@ import { useEffect } from 'react';
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { toJS } from "mobx"; import { toJS } from "mobx";
import moment from "moment"; import moment from "moment";
import { Row, Col, Space, Button, Table, Input, Typography, List } from 'antd'; import { Row, Col, Space, Button, Table, Input, Typography, List, App } from 'antd';
import { useStore } from '../../stores/StoreContext.js'; import { useStore } from '../../stores/StoreContext.js';
const { Title } = Typography; const { Title } = Typography;
@ -39,12 +39,22 @@ const itineraryListColumns = [
function Detail() { function Detail() {
const navigate = useNavigate(); const navigate = useNavigate();
const { notification } = App.useApp();
const { reservationId } = useParams(); const { reservationId } = useParams();
const { reservationStore } = useStore(); const { reservationStore } = useStore();
const { itineraryList, customerList } = reservationStore; const { itineraryList, customerList } = reservationStore;
useEffect(() => { useEffect(() => {
console.info('Detail.useEffect: ' + reservationId); console.info('Detail.useEffect: ' + reservationId);
reservationStore.fetchReservation(reservationId)
.catch(ex => {
notification.error({
message: `Notification`,
description: ex.message,
placement: 'top',
duration: 4,
});
});
}, [reservationId]); }, [reservationId]);
return ( return (

@ -83,7 +83,7 @@ function Newest() {
const onSearchClick = () => { const onSearchClick = () => {
setTableLoading(true); setTableLoading(true);
reservationStore.fetchReservation(referenceNo, selectedDateRange[0], selectedDateRange[1]) reservationStore.fetchReservationList(referenceNo, selectedDateRange[0], selectedDateRange[1])
.catch(ex => { .catch(ex => {
notification.error({ notification.error({
message: `Notification`, message: `Notification`,

Loading…
Cancel
Save