Merge branch 'main' of github.com:hainatravel/GHHub

release
赵鹏 2 years ago
commit 627b7775e4

@ -4,27 +4,27 @@ import dayjs from "dayjs";
export const DATE_FORMAT = "YYYY-MM-DD"; export const DATE_FORMAT = "YYYY-MM-DD";
export const DATE_PRESETS = [ export const DATE_PRESETS = [
{ {
label: "本周", label: "This Week",
value: [dayjs().startOf("w"), dayjs().endOf("w")], value: [dayjs().startOf("w"), dayjs().endOf("w")],
}, },
{ {
label: "上周", label: "Last Week",
value: [dayjs().startOf("w").subtract(7, "days"), dayjs().endOf("w").subtract(7, "days")], value: [dayjs().startOf("w").subtract(7, "days"), dayjs().endOf("w").subtract(7, "days")],
}, },
{ {
label: "本月", label: "This Month",
value: [dayjs().startOf("M"), dayjs().endOf("M")], value: [dayjs().startOf("M"), dayjs().endOf("M")],
}, },
{ {
label: "上个月", label: "Last Month",
value: [dayjs().subtract(1, "M").startOf("M"), dayjs().subtract(1, "M").endOf("M")], value: [dayjs().subtract(1, "M").startOf("M"), dayjs().subtract(1, "M").endOf("M")],
}, },
{ {
label: "近三月", label: "Last Three Month",
value: [dayjs().subtract(2, "M").startOf("M"), dayjs().endOf("M")], value: [dayjs().subtract(2, "M").startOf("M"), dayjs().endOf("M")],
}, },
{ {
label: "今年", label: "This Year",
value: [dayjs().startOf("y"), dayjs().endOf("y")], value: [dayjs().startOf("y"), dayjs().endOf("y")],
}, },
// 本月: [dayjs().startOf("month"), moment().endOf("month")], // 本月: [dayjs().startOf("month"), moment().endOf("month")],

@ -1,5 +1,5 @@
import { makeAutoObservable, runInAction } from "mobx"; import { makeAutoObservable, runInAction } from "mobx";
import * as req from "@/utils/request"; import { fetchJSON, postForm } from "@/utils/request";
import { prepareUrl } from "@/utils/commons"; import { prepareUrl } from "@/utils/commons";
import * as config from "@/config"; import * as config from "@/config";
import dayjs from "dayjs"; import dayjs from "dayjs";
@ -34,19 +34,16 @@ class Feedback {
this.loading = true; this.loading = true;
let url = `/service-Cooperate/Cooperate/SearchFeedbackList`; let url = `/service-Cooperate/Cooperate/SearchFeedbackList`;
url += `?PageSize=2000&PageIndex=1&PageTotal=0&veisn=${veisn}&GruopNo=${EOI_Group_Name}&TimeStart=${TimeStart}&TimeEnd=${TimeEnd}`; url += `?PageSize=2000&PageIndex=1&PageTotal=0&veisn=${veisn}&GruopNo=${EOI_Group_Name}&TimeStart=${TimeStart}&TimeEnd=${TimeEnd}`;
fetch(config.HT_HOST + url) url += `&token=${this.root.authStore.login.token}`;
.then(response => response.json()) return fetchJSON(config.HT_HOST + url).then(json => {
.then(json => { runInAction(() => {
console.log(json); this.feedbackList = json.Result;
runInAction(() => {
this.feedbackList = json.Result;
this.loading = false;
});
})
.catch(error => {
this.loading = false; this.loading = false;
console.log("fetch data failed", error);
}); });
if (json.errcode !== 0) {
throw new Error(json.errmsg + ": " + json.errcode);
}
});
} }
/* /*
@ -56,6 +53,7 @@ class Feedback {
getFeedbackDetail(VEI_SN, GRI_SN) { getFeedbackDetail(VEI_SN, GRI_SN) {
let url = `/service-Cooperate/Cooperate/getFeedbackDetail`; let url = `/service-Cooperate/Cooperate/getFeedbackDetail`;
url += `?GRI_SN=${GRI_SN}&VEI_SN=${VEI_SN}`; url += `?GRI_SN=${GRI_SN}&VEI_SN=${VEI_SN}`;
url += `&token=${this.root.authStore.login.token}`;
fetch(config.HT_HOST + url) fetch(config.HT_HOST + url)
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -74,6 +72,7 @@ class Feedback {
getFeedbackImages(VEI_SN, GRI_SN) { getFeedbackImages(VEI_SN, GRI_SN) {
let url = `/service-fileServer/ListFile`; let url = `/service-fileServer/ListFile`;
url += `?GRI_SN=${GRI_SN}&VEI_SN=${VEI_SN}`; url += `?GRI_SN=${GRI_SN}&VEI_SN=${VEI_SN}`;
url += `&token=${this.root.authStore.login.token}`;
fetch(config.HT_HOST + url) fetch(config.HT_HOST + url)
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -98,6 +97,7 @@ class Feedback {
getFeedbackInfo(VEI_SN, GRI_SN) { getFeedbackInfo(VEI_SN, GRI_SN) {
let url = `/service-Cooperate/Cooperate/getVEIFeedbackInfo`; let url = `/service-Cooperate/Cooperate/getVEIFeedbackInfo`;
url += `?GRI_SN=${GRI_SN}&VEI_SN=${VEI_SN}`; url += `?GRI_SN=${GRI_SN}&VEI_SN=${VEI_SN}`;
url += `&token=${this.root.authStore.login.token}`;
return fetch(config.HT_HOST + url) return fetch(config.HT_HOST + url)
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -115,6 +115,7 @@ class Feedback {
removeFeedbackImages(fileurl) { removeFeedbackImages(fileurl) {
let url = `/service-fileServer/FileDelete`; let url = `/service-fileServer/FileDelete`;
url += `?fileurl=${fileurl}`; url += `?fileurl=${fileurl}`;
url += `&token=${this.root.authStore.login.token}`;
return fetch(config.HT_HOST + url) return fetch(config.HT_HOST + url)
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -134,6 +135,7 @@ class Feedback {
formData.append("GRI_SN", GRI_SN); formData.append("GRI_SN", GRI_SN);
formData.append("EOI_SN", EOI_SN); formData.append("EOI_SN", EOI_SN);
formData.append("FeedbackInfo", info_content); formData.append("FeedbackInfo", info_content);
formData.append("token", this.root.authStore.login.token);
return fetch(config.HT_HOST + url, { return fetch(config.HT_HOST + url, {
method: "POST", method: "POST",
body: formData, body: formData,

@ -17,6 +17,7 @@ class Notice {
getBulletinList(LMI_SN) { getBulletinList(LMI_SN) {
let url = `/service-Cooperate/Cooperate/GetBulletinList`; let url = `/service-Cooperate/Cooperate/GetBulletinList`;
url += `?LMI_SN=${LMI_SN}`; url += `?LMI_SN=${LMI_SN}`;
url+=`&token=${this.root.authStore.login.token}`;
fetch(config.HT_HOST + url) fetch(config.HT_HOST + url)
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -37,6 +38,7 @@ class Notice {
getNoticeDetail(LMI_SN, CCP_BLID) { getNoticeDetail(LMI_SN, CCP_BLID) {
let url = `/service-Cooperate/Cooperate/GetBulletinDetail`; let url = `/service-Cooperate/Cooperate/GetBulletinDetail`;
url += `?LMI_SN=${LMI_SN}&CCP_BLID=${CCP_BLID}`; url += `?LMI_SN=${LMI_SN}&CCP_BLID=${CCP_BLID}`;
url+=`&token=${this.root.authStore.login.token}`;
fetch(config.HT_HOST + url) fetch(config.HT_HOST + url)
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
@ -54,6 +56,7 @@ class Notice {
getBulletinUnReadCount(LMI_SN) { getBulletinUnReadCount(LMI_SN) {
let url = `/service-Cooperate/Cooperate/GetBulletinUnReadCount`; let url = `/service-Cooperate/Cooperate/GetBulletinUnReadCount`;
url += `?LMI_SN=${LMI_SN}`; url += `?LMI_SN=${LMI_SN}`;
url+=`&token=${this.root.authStore.login.token}`;
fetch(config.HT_HOST + url) fetch(config.HT_HOST + url)
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {

@ -108,7 +108,32 @@ class Reservation {
}); });
} }
fetchGuideList() { updateReservationGuide() {
const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTGetCityGuide')
.append('VEI_SN', this.root.authStore.login.travelAgencyId)
.append('GRI_SN', this.selectedReservation.reservationId)
.append('LGC', 1)
.build();
return fetchJSON(fetchUrl)
.then(json => {
if (json.errcode == 0) {
const reservationGuide = (json?.Result??[]).filter((data) => {
return data.TGI_SN != 0;
}).map((data) => {
return data.GuideName;
}).join(',');
runInAction(() => {
this.selectedReservation.guide = reservationGuide;
});
return reservationGuide;
} else {
throw new Error(json.errmsg + ': ' + json.errcode);
}
});
}
fetchAllGuideList() {
const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTGetGuideList') const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTGetGuideList')
.append('VEI_SN', this.root.authStore.login.travelAgencyId) .append('VEI_SN', this.root.authStore.login.travelAgencyId)
.build(); .build();
@ -117,8 +142,7 @@ class Reservation {
.then(json => { .then(json => {
runInAction(() => { runInAction(() => {
if (json.errcode == 0) { if (json.errcode == 0) {
console.info(json.Result); this.cityGuideList = (json?.Result??[]).map((data, index) => {
this.guideList = (json?.Result??[]).map((data, index) => {
return { return {
guideId: data.TGI_SN, guideId: data.TGI_SN,
guideName: data.TGI2_Name, guideName: data.TGI2_Name,
@ -144,7 +168,9 @@ class Reservation {
return postForm(postUrl, formData) return postForm(postUrl, formData)
.then(json => { .then(json => {
console.info(json); if (json.errcode != 0) {
throw new Error(json.errmsg + ': ' + json.errcode);
}
}); });
} }
@ -183,7 +209,7 @@ class Reservation {
}); });
} }
guideList = []; cityGuideList = [];
cityList = []; cityList = [];
selectedReservation = null; selectedReservation = null;

@ -60,7 +60,7 @@ function Detail() {
feedbackStore.postFeedbackInfo(feedbackInfo.EEF_VEI_SN, feedbackInfo.EEF_GRI_SN, feedbackInfo.EEF_EOI_SN, values.info_content).then(() => { feedbackStore.postFeedbackInfo(feedbackInfo.EEF_VEI_SN, feedbackInfo.EEF_GRI_SN, feedbackInfo.EEF_EOI_SN, values.info_content).then(() => {
notification.success({ notification.success({
message: `Notification`, message: `Notification`,
description: "提交成功", description: "Submit Successful",
placement: "top", placement: "top",
duration: 4, duration: 4,
}); });
@ -141,7 +141,7 @@ function Detail() {
<Row gutter={16}> <Row gutter={16}>
<Col span={20}> <Col span={20}>
<Title level={4}>站外好评</Title> <Title level={4}>External Reviews</Title>
</Col> </Col>
<Col span={4}></Col> <Col span={4}></Col>
</Row> </Row>
@ -155,7 +155,7 @@ function Detail() {
<Row gutter={16}> <Row gutter={16}>
<Col span={20}> <Col span={20}>
<Title level={4}>地接社的反馈</Title> <Title level={4}>Send Feedback</Title>
</Col> </Col>
<Col span={4}></Col> <Col span={4}></Col>
</Row> </Row>
@ -164,7 +164,7 @@ function Detail() {
<Col span={4}></Col> <Col span={4}></Col>
<Col span={18}> <Col span={18}>
<Form name="feedback_detail_from" onFinish={onFinish} labelCol={{ span: 5 }} form={form}> <Form name="feedback_detail_from" onFinish={onFinish} labelCol={{ span: 5 }} form={form}>
<Divider orientation="left">上传照片</Divider> <Divider orientation="left">Upload photos</Divider>
<Form.Item> <Form.Item>
<Upload <Upload
name="ghhfile" name="ghhfile"
@ -181,7 +181,6 @@ function Detail() {
</div> </div>
</Upload> </Upload>
</Form.Item> </Form.Item>
<Divider orientation="left">地接社反馈信息</Divider>
<Form.Item <Form.Item
name="info_content" name="info_content"
rules={[ rules={[
@ -190,7 +189,7 @@ function Detail() {
message: "Please input your messages!", message: "Please input your messages!",
}, },
]}> ]}>
<Input.TextArea rows={6}></Input.TextArea> <Input.TextArea rows={6} placeholder="Any feedback for this group you would like to send to Asia Highlights"></Input.TextArea>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">

@ -2,81 +2,94 @@ import { NavLink } from "react-router-dom";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { toJS } from "mobx"; import { toJS } from "mobx";
import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, Radio } from "antd"; import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, App } from "antd";
import { useStore } from "@/stores/StoreContext.js"; import { useStore } from "@/stores/StoreContext.js";
import * as config from "@/config"; import * as config from "@/config";
const { Title } = Typography; const { Title } = Typography;
const feedbackListColumns = [ const feedbackListColumns = [
{ {
title: "团名", title: "Ref.No",
dataIndex: "EOI_Group_Name", dataIndex: "EOI_Group_Name",
render: (text, record) => <NavLink to={`/feedback/${record.EOI_GRI_SN}`}>{text}</NavLink>, render: (text, record) => <NavLink to={`/feedback/${record.EOI_GRI_SN}`}>{text}</NavLink>,
}, },
{ {
title: "离团日期", title: "Arrival Date",
dataIndex: "EOI_Date", dataIndex: "EOI_Date",
render: (text, record) => text, render: (text, record) => text,
sorter: (a, b) => b.EOI_Date - a.EOI_Date, sorter: (a, b) => b.EOI_Date - a.EOI_Date,
}, },
{ {
title: "城市", title: "Cities",
key: "City", key: "City",
dataIndex: "City", dataIndex: "City",
}, },
{ {
title: "评分", title: "Guides",
dataIndex: "Average", dataIndex: "GriName",
sorter: (a, b) => b.Average - a.Average,
}, },
{ {
title: "图片数", title: "Post Survey",
dataIndex: "PicNum", dataIndex: "Average",
sorter: (a, b) => b.PicNum - a.PicNum, sorter: (a, b) => b.Average - a.Average,
}, },
{ {
title: "导游", title: "External Reviews",
dataIndex: "GriName", dataIndex: "GriName",
}, },
{
title: "表状态",
dataIndex: "FState",
sorter: (a, b) => b.FState - a.FState,
},
]; ];
function Index() { function Index() {
const { notification } = App.useApp();
const { feedbackStore, authStore } = useStore(); const { feedbackStore, authStore } = useStore();
const { feedbackList, search_date_start, search_date_end } = feedbackStore; const { feedbackList, search_date_start, search_date_end } = feedbackStore;
const [referenceNo, onNumberChange] = useState(""); const [referenceNo, onNumberChange] = useState("");
const showTotal = total => `Total ${feedbackList.length} items`; const showTotal = total => `Total ${feedbackList.length} items`;
useEffect(() => { useEffect(() => {
feedbackStore.searchFeedbackList(authStore.login.travelAgencyId, referenceNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT) + " 23:59"); feedbackStore.searchFeedbackList(authStore.login.travelAgencyId, referenceNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT) + " 23:59")
.catch(ex => {
notification.error({
message: `Error`,
description: ex.message,
placement: 'top',
duration: 4,
});
});
}, []); }, []);
return ( return (
<Space direction="vertical" style={{ width: "100%" }}> <Space direction="vertical" style={{ width: "100%" }}>
<Title level={3}>反馈表</Title> <Title level={3}></Title>
<Row gutter={16}> <Row gutter={16}>
<Col md={24} lg={6} xxl={4}> <Col md={24} lg={6} xxl={4}>
<Input <Input
placeholder="团号" placeholder="Reference Number"
onChange={e => { onChange={e => {
onNumberChange(e.target.value); onNumberChange(e.target.value);
}} }}
/> />
</Col> </Col>
<Col md={24} lg={6} xxl={4}> <Col md={24} lg={8} xxl={6}>
<DatePicker.RangePicker format={config.DATE_FORMAT} allowClear={false} style={{ width: "100%" }} value={[search_date_start, search_date_end]} presets={config.DATE_PRESETS} onChange={feedbackStore.onDateRangeChange} /> <Space direction="horizontal">
Arrival Date
<DatePicker.RangePicker
format={config.DATE_FORMAT}
allowClear={false}
style={{ width: "100%" }}
value={[search_date_start, search_date_end]}
presets={config.DATE_PRESETS}
onChange={feedbackStore.onDateRangeChange}
/>
</Space>
</Col> </Col>
<Col md={24} lg={4} xxl={4}> <Col md={24} lg={4} xxl={4}>
<Button <Button
type="primary" type="primary"
loading={feedbackStore.loading} loading={feedbackStore.loading}
onClick={() => feedbackStore.searchFeedbackList(authStore.login.travelAgencyId, referenceNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT) + " 23:59")}> onClick={() => feedbackStore.searchFeedbackList(authStore.login.travelAgencyId, referenceNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT) + " 23:59")}>
搜索 Search
</Button> </Button>
</Col> </Col>
</Row> </Row>

@ -73,7 +73,7 @@ function Newest() {
allowClear allowClear
placeholder="Select a guide" placeholder="Select a guide"
optionFilterProp="children" optionFilterProp="children"
defaultValue={guideSelectOptions.length == 0 ? null : city.tourGuideId} defaultValue={(guideSelectOptions.length == 0 || city.tourGuideId == 0) ? null : city.tourGuideId}
onChange={(guideId) => { onChange={(guideId) => {
reservationStore.setupCityGuide(city.cityId, guideId); reservationStore.setupCityGuide(city.cityId, guideId);
}} }}
@ -90,11 +90,11 @@ function Newest() {
const location = useLocation(); const location = useLocation();
const { reservationStore } = useStore(); const { reservationStore } = useStore();
const { reservationList, reservationPage, referenceNo, arrivalDateRange, cityList, guideList } = reservationStore; const { reservationList, reservationPage, referenceNo, arrivalDateRange, cityList, cityGuideList } = reservationStore;
const [isModalOpen, setIsModalOpen] = useState(false); const [isModalOpen, setIsModalOpen] = useState(false);
const [dataLoading, setDataLoading] = useState(false); const [dataLoading, setDataLoading] = useState(false);
const { notification } = App.useApp(); const { notification } = App.useApp();
const guideSelectOptions = guideList.map((data, index) => { const guideSelectOptions = cityGuideList.map((data, index) => {
return { return {
value: data.guideId, value: data.guideId,
label: data.guideName label: data.guideName
@ -110,11 +110,11 @@ function Newest() {
}; };
}, []); }, []);
const showCityGuideModal = (reservation) => { const showCityGuideModal = (reservation) => {
setDataLoading(true); setDataLoading(true);
setIsModalOpen(true); setIsModalOpen(true);
reservationStore.editReservation(reservation); reservationStore.editReservation(reservation);
reservationStore.fetchGuideList(); reservationStore.fetchAllGuideList();
reservationStore.fetchCityList(reservation.reservationId) reservationStore.fetchCityList(reservation.reservationId)
.catch(ex => { .catch(ex => {
notification.error({ notification.error({
@ -129,8 +129,11 @@ function Newest() {
}); });
}; };
const handleOk = () => { const handleOk = () => {
setIsModalOpen(false); reservationStore.updateReservationGuide()
setDataLoading(false); .finally(() => {
setIsModalOpen(false);
setDataLoading(false);
});
}; };
const handleCancel = () => { const handleCancel = () => {
setIsModalOpen(false); setIsModalOpen(false);
@ -186,10 +189,10 @@ function Newest() {
</Space> </Space>
</Modal> </Modal>
<Space direction="vertical" style={{ width: '100%' }}> <Space direction="vertical" style={{ width: '100%' }}>
<Title level={3}>Newest Reservations</Title> <Title level={3}></Title>
<Row gutter={{ md: 24 }}> <Row gutter={{ md: 24 }}>
<Col span={6}> <Col span={6}>
<Input placeholder="Reference number" value={referenceNo} onChange={(e) => { reservationStore.updatePropertyValue('referenceNo', e.target.value)} } /> <Input placeholder="Reference Number" value={referenceNo} onChange={(e) => { reservationStore.updatePropertyValue('referenceNo', e.target.value)} } />
</Col> </Col>
<Col span={18}> <Col span={18}>
<Space direction="horizontal"> <Space direction="horizontal">
@ -222,7 +225,7 @@ function Newest() {
simple: true simple: true
}} }}
onChange={(pagination, filters, sorter, extra) => {onSearchClick(pagination.current);}} onChange={(pagination, filters, sorter, extra) => {onSearchClick(pagination.current);}}
columns={reservationListColumns} dataSource={toJS(reservationList)} columns={reservationListColumns} dataSource={reservationList}
/> />
</Col> </Col>
</Row> </Row>

Loading…
Cancel
Save