|
|
@ -96,7 +96,6 @@ function Newest() {
|
|
|
|
const [guideSelectOptions, setGuideSelectOptions] = useState([])
|
|
|
|
const [guideSelectOptions, setGuideSelectOptions] = useState([])
|
|
|
|
|
|
|
|
|
|
|
|
const formValuesToSub = useFormStore((state) => state.formValuesToSub)
|
|
|
|
const formValuesToSub = useFormStore((state) => state.formValuesToSub)
|
|
|
|
|
|
|
|
|
|
|
|
const [fetchAllGuideList, fetchReservationList, reservationList, reservationPage, cityList, selectReservation, getCityListByReservationId, setupCityGuide, updateReservationGuide] =
|
|
|
|
const [fetchAllGuideList, fetchReservationList, reservationList, reservationPage, cityList, selectReservation, getCityListByReservationId, setupCityGuide, updateReservationGuide] =
|
|
|
|
useReservationStore((state) =>
|
|
|
|
useReservationStore((state) =>
|
|
|
|
[state.fetchAllGuideList, state.fetchReservationList, state.reservationList, state.reservationPage, state.cityList, state.selectReservation, state.getCityListByReservationId, state.setupCityGuide, state.updateReservationGuide])
|
|
|
|
[state.fetchAllGuideList, state.fetchReservationList, state.reservationList, state.reservationPage, state.cityList, state.selectReservation, state.getCityListByReservationId, state.setupCityGuide, state.updateReservationGuide])
|
|
|
@ -104,13 +103,9 @@ function Newest() {
|
|
|
|
const { notification } = App.useApp()
|
|
|
|
const { notification } = App.useApp()
|
|
|
|
|
|
|
|
|
|
|
|
useEffect (() => {
|
|
|
|
useEffect (() => {
|
|
|
|
if (location.search !== '?back') {
|
|
|
|
|
|
|
|
// 第一页,未确认计划
|
|
|
|
|
|
|
|
onSearchClick(1, 1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
fetchAllGuideList()
|
|
|
|
fetchAllGuideList()
|
|
|
|
.then((guideList) => {
|
|
|
|
.then((guideList) => {
|
|
|
|
const selectOptions = guideList.map((data, index) => {
|
|
|
|
const selectOptions = guideList.map((data) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
value: data.guideId,
|
|
|
|
value: data.guideId,
|
|
|
|
label: data.guideName
|
|
|
|
label: data.guideName
|
|
|
@ -137,6 +132,7 @@ function Newest() {
|
|
|
|
setDataLoading(false);
|
|
|
|
setDataLoading(false);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const handleOk = () => {
|
|
|
|
const handleOk = () => {
|
|
|
|
updateReservationGuide()
|
|
|
|
updateReservationGuide()
|
|
|
|
.finally(() => {
|
|
|
|
.finally(() => {
|
|
|
@ -144,15 +140,18 @@ function Newest() {
|
|
|
|
setDataLoading(false);
|
|
|
|
setDataLoading(false);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const handleCancel = () => {
|
|
|
|
const handleCancel = () => {
|
|
|
|
setIsModalOpen(false);
|
|
|
|
setIsModalOpen(false);
|
|
|
|
setDataLoading(false);
|
|
|
|
setDataLoading(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 默认重新搜索第一页,所有状态的计划
|
|
|
|
// 默认重新搜索第一页,所有状态的计划
|
|
|
|
const onSearchClick = (current=1, status=null) => {
|
|
|
|
const searchReservation = (submitValues, current=1) => {
|
|
|
|
setDataLoading(true)
|
|
|
|
setDataLoading(true)
|
|
|
|
fetchReservationList(formValuesToSub, current)
|
|
|
|
console.info('onSearchClick')
|
|
|
|
|
|
|
|
console.info(submitValues)
|
|
|
|
|
|
|
|
fetchReservationList(submitValues, current)
|
|
|
|
.catch(ex => {
|
|
|
|
.catch(ex => {
|
|
|
|
notification.error({
|
|
|
|
notification.error({
|
|
|
|
message: `Notification`,
|
|
|
|
message: `Notification`,
|
|
|
@ -208,20 +207,11 @@ function Newest() {
|
|
|
|
dates: { label: t('group:ArrivalDate') },
|
|
|
|
dates: { label: t('group:ArrivalDate') },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
onSubmit={(err, formVal, filedsVal) => {
|
|
|
|
onMounted={(initialValue) => {
|
|
|
|
setDataLoading(true)
|
|
|
|
searchReservation(initialValue)
|
|
|
|
fetchReservationList(formVal)
|
|
|
|
}}
|
|
|
|
.catch(ex => {
|
|
|
|
onSubmit={() => {
|
|
|
|
notification.error({
|
|
|
|
searchReservation(formValuesToSub)
|
|
|
|
message: 'Notification',
|
|
|
|
|
|
|
|
description: ex.message,
|
|
|
|
|
|
|
|
placement: 'top',
|
|
|
|
|
|
|
|
duration: 4,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.finally(() => {
|
|
|
|
|
|
|
|
setDataLoading(false)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<Title level={3}></Title>
|
|
|
|
<Title level={3}></Title>
|
|
|
@ -238,7 +228,9 @@ function Newest() {
|
|
|
|
total: reservationPage.total,
|
|
|
|
total: reservationPage.total,
|
|
|
|
simple: true
|
|
|
|
simple: true
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
onChange={(pagination) => {onSearchClick(pagination.current)}}
|
|
|
|
onChange={(pagination) => {
|
|
|
|
|
|
|
|
searchReservation(formValuesToSub, pagination.current)
|
|
|
|
|
|
|
|
}}
|
|
|
|
columns={reservationListColumns} dataSource={reservationList}
|
|
|
|
columns={reservationListColumns} dataSource={reservationList}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|