反馈表列表和详细页

release
unknown 2 years ago
parent 998302332d
commit 8042127689

@ -0,0 +1,5 @@
import React from "react";
export const stores_Context = React.createContext();
export const DATE_FORMAT = "YYYY-MM-DD";
export const HT_HOST = process.env.NODE_ENV == "production" ? "https://p9axztuwd7x8a7.mycht.cn" : "http://202.103.68.100:890";

@ -15,6 +15,8 @@ import Index from "@/views/index";
import ErrorPage from "@/views/error-page";
import ReservationNewest from "@/views/reservation/Newest";
import ReservationDetail from "@/views/reservation/Detail";
import FeedbackIndex from "@/views/feedback/Index";
import FeedbackDetail from "@/views/feedback/Detail";
configure({
useProxies: "ifavailable",
@ -33,7 +35,9 @@ const router = createBrowserRouter([
children: [
{ index: true, element: <Index /> },
{ path: "reservation/newest", element: <ReservationNewest />},
{ path: "reservation/:reservationId", element: <ReservationDetail />}
{ path: "reservation/:reservationId", element: <ReservationDetail />},
{ path: "feedback", element: <FeedbackIndex />},
{ path: "feedback/:feedbackId", element: <FeedbackDetail />},
]
},
{

@ -0,0 +1,96 @@
import { makeAutoObservable, runInAction } from "mobx";
import * as req from "@/utils/request";
import { prepareUrl } from "@/utils/commons";
import * as config from "@/config";
class Feedback {
constructor(root) {
makeAutoObservable(this, { rootStore: false });
this.root = root;
}
/*
地接社sn
团名
离团时间开始结束
*/
searchFeedbackList(veisn, EOI_Group_Name, TimeStart, TimeEnd) {
this.loading = true;
let url = `/service-Cooperate/Cooperate/SearchFeedbackList`;
url += `?PageSize=5&PageIndex=1&PageTotal=0&veisn=${veisn}&GruopNo=${EOI_Group_Name}&TimeStart=${TimeStart}&TimeEnd=${TimeEnd}`;
fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
result = json.result1;
console.log(result);
runInAction(() => {
this.groupList = result.Result;
// this.groupList = [
// {
// key: "1",
// id: "1",
// referenceNumber: "中华游111029-N111025076",
// arrivalDate: "2023-04-08",
// pax: "5AD 1CH",
// status: "Confirm",
// reservationDate: "2023-04-08 19:31",
// guide: "Bill",
// },
// {
// key: "2",
// id: "3",
// referenceNumber: "中华游111029-N111025076",
// arrivalDate: "2023-04-08",
// pax: "5AD 1CH",
// status: "Confirm",
// reservationDate: "2023-04-08 19:31",
// guide: "Jim",
// },
// {
// key: "3",
// id: "3",
// referenceNumber: "中华游111029-N111025076",
// arrivalDate: "2023-05-08",
// pax: "3AD",
// status: "Confirm",
// reservationDate: "2023-01-08 19:31",
// guide: "Giffigan",
// },
// ];
});
})
.catch(error => {
this.loading = false;
console.log("fetch data failed", error);
});
}
loading = false;
groupList = [
{
EOI_SN: 241147,
EOI_GRI_SN: 331423,
EOI_VEI_SN: 32531,
EOI_ObjSN: 32531,
EOI_Date: "2023-02-02T00:05:31",
EOI_FWks_LastEditTime: "",
EOI_FillWorkers_SN: 0,
EOI_VerifyUser_SN: 0,
EOI_CII_SN: 0,
EOI_VRequestVerify: 0,
TotalCount: 35,
VAS_NewTP: 1,
EOI_FillWorkers_Name: "",
EOI_VerifyUser_Name: "",
GuideMark: 0,
Average: 0,
EOI_Group_Name: "中华游230119-MCJAH221211010(AH)",
City: "胡志明市Ho Chi Minh City",
GriName: "",
PicNum: "0",
FState: "未填写",
},
];
}
export default Feedback;

@ -1,10 +1,12 @@
import { makeAutoObservable } from "mobx";
import Reservation from "./Reservation";
import Feedback from "./Feedback";
import Auth from "./Auth";
class Root {
constructor() {
this.reservationStore = new Reservation(this);
this.feedbackStore = new Feedback(this);
this.authStore = new Auth(this);
makeAutoObservable(this);
}

@ -75,7 +75,7 @@ function App() {
<Menu theme="dark" mode="horizontal" defaultSelectedKeys={[href]} items={
[
{ key: '/reservation/newest', label: <Link to="/reservation/newest">Reservation</Link> },
{ key: '/feedback/list', label: <Link to="/feedback/list">Feedback</Link> },
{ key: '/feedback', label: <Link to="/feedback">Feedback</Link> },
{ key: '/invoice/list', label: <Link to="/invoice/list">Invoice</Link> }
]
} />

@ -0,0 +1,103 @@
import { useParams, useNavigate } from "react-router-dom";
import { useEffect } from 'react';
import { observer } from "mobx-react";
import { toJS } from "mobx";
import moment from "moment";
import { Row, Col, Space, Button, Table, Tag, Typography, DatePicker } from 'antd';
import { useStore } from '../../stores/StoreContext.js';
const { Title } = Typography;
const dataSource = [
{
key: '1',
name: '2',
age: '二',
address: '5月2日',
},
{
key: '2',
name: '胡彦祖',
age: 42,
address: '西湖区湖底公园1号',
},
];
const columns = [
{
title: '天数',
dataIndex: 'name',
key: 'name',
},
{
title: '星期',
dataIndex: 'age',
key: 'age',
},
{
title: '日期',
dataIndex: 'address',
key: 'address',
},
{
title: '始发城市',
dataIndex: 'address',
key: 'address',
},
{
title: '抵达城市',
dataIndex: 'address',
key: 'address',
},
{
title: '交通',
dataIndex: 'address',
key: 'address',
},
{
title: '酒店',
dataIndex: 'address',
key: 'address',
},
{
title: '餐饮 [午、晚]',
dataIndex: 'address',
key: 'address',
},
{
title: '景点及旅游服务安排',
dataIndex: 'address',
key: 'address',
},
];
function Detail() {
const navigate = useNavigate();
const { reservationId } = useParams();
const { reservationStore } = useStore();
const { reservationList } = reservationStore;
useEffect(() => {
console.info('Detail.useEffect: ' + reservationId);
}, [reservationId]);
return (
<Space direction="vertical" style={{ width: '100%' }}>
<Row gutter={{ md: 24 }}>
<Col span={20}>
<Title level={4}>Reservation Detail 中华游111029-N111025076</Title>
</Col>
<Col span={4}>
<Button type="link" onClick={() => navigate('/reservation/newest')}>Return</Button>
</Col>
</Row>
<Row>
<Col span={24}>
<Table dataSource={dataSource} columns={columns} />
</Col>
</Row>
</Space>
);
}
export default observer(Detail);

@ -0,0 +1,83 @@
import { NavLink } from "react-router-dom";
import { useEffect } from "react";
import { observer } from "mobx-react";
import { toJS } from "mobx";
import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, Radio } from "antd";
import { useStore } from "@/stores/StoreContext.js";
const { Title } = Typography;
const groupListColumns = [
{
title: "团名",
dataIndex: "referenceNumber",
key: "Reference number",
render: (text, record) => <NavLink to={`/feedback/${record.EOI_SN}`}>{text}</NavLink>,
},
{
title: "离团日期",
dataIndex: "arrivalDate",
key: "Arrival date",
},
{
title: "城市",
key: "Pax",
dataIndex: "pax",
},
{
title: "导游",
key: "Status",
dataIndex: "status",
},
{
title: "平均分",
key: "Reservation date",
dataIndex: "reservationDate",
},
{
title: "图片数",
key: "Guide",
dataIndex: "guide",
},
{
title: "操作",
key: "Guide",
dataIndex: "guide",
},
];
function Index() {
const { feedbackStore } = useStore();
const { groupList } = feedbackStore;
useEffect(() => {
console.info("Newest.useEffect");
}, []);
return (
<Space direction="vertical" style={{ width: "100%" }}>
<Title level={3}>反馈表</Title>
<Row gutter={16}>
<Col md={24} lg={4} xxl={4}>
<Input placeholder="团号" />
</Col>
<Col md={24} lg={4} xxl={4}>
<DatePicker.RangePicker allowClear={true} inputReadOnly={true} placeholder={["离团日期 从", "截止"]} />
</Col>
<Col md={24} lg={4} xxl={4}>
<Button type="primary" loading={feedbackStore.loading} onClick={() => feedbackStore.searchFeedbackList(32531,'','2023-02-01 00:00','2023-03-30 23:59')}>
搜索
</Button>
</Col>
</Row>
<Row>
<Col md={24} lg={24} xxl={24}>
<Table bordered={true} columns={groupListColumns} dataSource={groupList} />
</Col>
</Row>
</Space>
);
}
export default observer(Index);
Loading…
Cancel
Save