|
|
|
|
@ -153,6 +153,17 @@ function ReviewList() {
|
|
|
|
|
const searchReview = (submitValues) => {
|
|
|
|
|
setDataLoading(true);
|
|
|
|
|
fetchReviewList(submitValues, travelAgencyId)
|
|
|
|
|
.then((result) => {
|
|
|
|
|
// 把搜索到团合并到供应商半年内的团中,解决站外好评在半年以前
|
|
|
|
|
const currentGroupList = result.map((r) => ({ value: r.referenceId, label: r.referenceNumber }))
|
|
|
|
|
const mergedGroupList = [...currentGroupList,...groupListOptions]
|
|
|
|
|
const uniqueMergedGroupList = Array.from(
|
|
|
|
|
new Map(mergedGroupList.map(item => [item.value, item])).values()
|
|
|
|
|
)
|
|
|
|
|
setGroupListOptions(
|
|
|
|
|
uniqueMergedGroupList
|
|
|
|
|
);
|
|
|
|
|
})
|
|
|
|
|
.catch((ex) => {
|
|
|
|
|
notification.error({
|
|
|
|
|
message: `Notification`,
|
|
|
|
|
@ -162,11 +173,24 @@ function ReviewList() {
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
setDataLoading(false);
|
|
|
|
|
});
|
|
|
|
|
setDataLoading(false)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const initCityList = async (referenceId) => {
|
|
|
|
|
const cityList = await fetchCityList(travelAgencyId, referenceId);
|
|
|
|
|
setCityListOptions(
|
|
|
|
|
cityList.map((city) => {
|
|
|
|
|
return {
|
|
|
|
|
value: city.CII_SN,
|
|
|
|
|
label: city.CityName,
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const onReviewSeleted = async (review) => {
|
|
|
|
|
initCityList(review.referenceId)
|
|
|
|
|
// 转换为 Form.Item DatePicker 格式
|
|
|
|
|
review.datePosted = dayjs(review.datePosted);
|
|
|
|
|
formReview.setFieldsValue(review);
|
|
|
|
|
@ -249,16 +273,8 @@ function ReviewList() {
|
|
|
|
|
showSearch
|
|
|
|
|
placeholder="Select a Reference Number"
|
|
|
|
|
optionFilterProp="children"
|
|
|
|
|
onChange={async (groupId) => {
|
|
|
|
|
const cityList = await fetchCityList(travelAgencyId, groupId);
|
|
|
|
|
setCityListOptions(
|
|
|
|
|
cityList.map((city) => {
|
|
|
|
|
return {
|
|
|
|
|
value: city.CII_SN,
|
|
|
|
|
label: city.CityName,
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
onChange={referenceId => {
|
|
|
|
|
initCityList(referenceId)
|
|
|
|
|
}}
|
|
|
|
|
filterOption={(input, option) =>
|
|
|
|
|
(option?.label ?? "")
|
|
|
|
|
@ -342,6 +358,7 @@ function ReviewList() {
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<Table
|
|
|
|
|
rowKey={record => record.reviewId}
|
|
|
|
|
bordered
|
|
|
|
|
loading={dataLoading}
|
|
|
|
|
pagination={{
|
|
|
|
|
|