完成确认变更功能

release
Jimmy Liow 2 years ago
parent e6f11c7113
commit 64e696dbe8

@ -56,8 +56,8 @@ class Reservation {
return fetchJSON(fetchUrl)
.then(json => {
runInAction(() => {
if (json.errcode == 0) {
if (json.errcode == 0) {
runInAction(() => {
this.itineraryList = json.VendorTour.map((data, index) => {
return {
key: data.GRD_SN,
@ -85,13 +85,28 @@ class Reservation {
PCI_ConfirmDate: data.PCI_ConfirmDate
}
});
} else {
throw new Error(json.errmsg + ': ' + json.errcode);
}
});
});
} else {
throw new Error(json.errmsg + ': ' + json.errcode);
}
});
}
// get confirmationList() {
// return computed(() => {
// return json.PlanChange.map((data, index) => {
// return {
// key: data.PCI_SN,
// PCI_Changetext: data.PCI_Changetext,
// PCI_SendDate: data.PCI_SendDate,
// ConfirmPerson: data.ConfirmPerson,
// PCI_ConfirmText: data.PCI_ConfirmText,
// PCI_ConfirmDate: data.PCI_ConfirmDate
// }
// });
// }).get();
// }
fetchCityList(reservationId) {
const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTGetCityGuide')
.append('VEI_SN', this.root.authStore.login.travelAgencyId)
@ -167,10 +182,20 @@ class Reservation {
return postForm(postUrl, formData)
.then(json => {
console.info(json);
if (json.errcode == 0 && json.Result.length == 1) {
runInAction(() => {
this.selectedConfirmation.PCI_ConfirmText = json.Result[0].PCI_ConfirmText;
this.selectedConfirmation.PCI_ConfirmDate = json.Result[0].PCI_ConfirmDate;
});
return json;
}
});
}
editReservation(reservation) {
this.selectedReservation = reservation;
}
editConfirmation(confirmation) {
this.selectedConfirmation = confirmation;
}

@ -14,27 +14,22 @@ function Detail() {
{
title: 'Day',
dataIndex: 'day',
key: 'day',
},
{
title: 'Place & Transport',
dataIndex: 'placeTransport',
key: 'placeTransport',
},
{
title: 'Todays Activities',
dataIndex: 'todayActivities',
key: 'todayActivities',
},
{
title: 'Accommodation',
dataIndex: 'accommodation',
key: 'accommodation',
},
{
title: 'Meals',
dataIndex: 'meals',
key: 'meals',
},
];
@ -79,7 +74,8 @@ function Detail() {
const { reservationId } = useParams();
const { reservationStore } = useStore();
const [dataLoading, setDataLoading] = useState(false);
const { itineraryList, customerNames, confirmationList, reservationDetail } = reservationStore;
const { itineraryList, customerNames, reservationDetail } = reservationStore;
const confirmationList = reservationStore.confirmationList;
const showConfirmModal = (confirm) => {
setIsModalOpen(true);
@ -176,7 +172,7 @@ function Detail() {
bordered
loading={dataLoading}
pagination={false}
dataSource={toJS(confirmationList)} columns={confirmationListColumns}
dataSource={confirmationList} columns={confirmationListColumns}
/>
</Space>
</Col>

Loading…
Cancel
Save