读取地接社所有导游

release
Jimmy Liow 2 years ago
parent 2ef1468c55
commit 1a11bf25d5

@ -108,6 +108,29 @@ class Reservation {
});
}
fetchGuideList() {
const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTGetGuideList')
.append('VEI_SN', 628)//this.root.authStore.login.travelAgencyId)
.build();
return fetchJSON(fetchUrl)
.then(json => {
runInAction(() => {
if (json.errcode == 0) {
this.guideList = json.Result.map((data, index) => {
return {
guideName: data.TGI2_Name,
mobileNo: data.TGI_Mobile
}
});
} else {
throw new Error(json.errmsg + ': ' + json.errcode);
}
});
});
}
guideList = [];
cityList = [];
reservationList = [];

@ -63,49 +63,45 @@ function Newest() {
function cityGuideRender(text, city) {
return (
<Select
showSearch
style={{
width: 280,
}}
placeholder="Select a guide"
optionFilterProp="children"
onChange={(value) => {
console.log(`selected ${value}`);
}}
onSearch={(value) => {
console.log('search:', value);
}}
filterOption={(input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
}
options={[
{
value: 'jack',
label: 'Jack',
},
{
value: 'lucy',
label: 'Lucy',
},
{
value: 'tom',
label: 'Tom',
},
]}
showSearch
style={{
width: 280,
}}
bordered={false}
placeholder="Select a guide"
optionFilterProp="children"
onChange={(value) => {
console.log(`selected ${value}`);
}}
onSearch={(value) => {
console.log('search:', value);
}}
filterOption={(input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
}
options={toJS(guideSelectOptions)}
/>
);
}
const { reservationStore } = useStore();
const { reservationList, reservationPage, cityList } = reservationStore;
const { reservationList, reservationPage, cityList, guideList } = reservationStore;
const [isModalOpen, setIsModalOpen] = useState(false);
const [arrivalDateRange, onDateRangeChange] = useState([]);
const [referenceNo, onNumberChange] = useState('');
const [dataLoading, setDataLoading] = useState(false);
const { notification } = App.useApp();
const guideSelectOptions = guideList.map((data, index) => {
return {
value: data.guideName,
label: data.guideName
}
});
const showCityGuideModal = (reservation) => {
setDataLoading(true);
setIsModalOpen(true);
reservationStore.fetchGuideList();
reservationStore.fetchCityList(reservation.referenceId)
.catch(ex => {
notification.error({

Loading…
Cancel
Save