diff --git a/src/main.jsx b/src/main.jsx
index daccdf7..e41d24e 100644
--- a/src/main.jsx
+++ b/src/main.jsx
@@ -9,6 +9,7 @@ import RootStore from "@/stores/Root";
import { StoreContext } from '@/stores/StoreContext';
import "@/assets/global.css";
import App from "@/views/App";
+import Standlone from "@/views/Standlone";
import Login from "@/views/Login";
import SignOut from "@/views/SignOut";
import Index from "@/views/index";
@@ -20,6 +21,8 @@ import ReservationNameCard from "@/views/reservation/NameCard";
import FeedbackIndex from "@/views/feedback/Index";
import FeedbackDetail from "@/views/feedback/Detail";
import NoticeIndex from "@/views/notice/Index";
+import InvoiceIndex from "@/views/invoice/Index";
+import InvoiceDetail from "@/views/invoice/Detail";
configure({
@@ -45,10 +48,12 @@ const router = createBrowserRouter([
{ path: "feedback", element: },
{ path: "feedback/:GRI_SN", element: },
{ path: "notice", element: },
+ { path: "invoice",element:},
+ { path: "invoice/detial/:GMDSN/:GSN",element:},
]
},
{
- element: ,
+ element: ,
children: [
{ path: "/login", element: },
{ path: "/sign-out", element: }
diff --git a/src/stores/Auth.js b/src/stores/Auth.js
index b3e1e0a..1ad725a 100644
--- a/src/stores/Auth.js
+++ b/src/stores/Auth.js
@@ -1,4 +1,7 @@
-import { makeAutoObservable } from "mobx";
+import { makeAutoObservable, runInAction } from "mobx";
+import { fetchJSON } from '@/utils/request';
+import { HT_HOST } from "@/config";
+import { prepareUrl } from '@/utils/commons';
class Auth {
@@ -7,10 +10,56 @@ class Auth {
this.root = root;
}
+ valdateUserPassword(usr, pwd) {
+ const fetchUrl = prepareUrl(HT_HOST + '/service-Cooperate/Cooperate/Login')
+ .append('username', usr)
+ .append('password', pwd)
+ .build();
+
+ return fetchJSON(fetchUrl)
+ .then(json => {
+ if (json.errcode == 0) {
+ runInAction(() => {
+ this.login = {
+ userId: json.Result.WU_LMI_SN,
+ username: json.Result.WU_UserName,
+ }
+ });
+ } else {
+ throw new Error(json.errmsg + ': ' + json.errcode);
+ }
+ });
+ }
+
+ fetchUserDetail(userId) {
+ const fetchUrl = prepareUrl(HT_HOST + '/service-Cooperate/Cooperate/GetLinkManInfo')
+ .append('LMI_SN', userId)
+ .build();
+
+ return fetchJSON(fetchUrl)
+ .then(json => {
+ if (json.errcode == 0) {
+ runInAction(() => {
+ this.login = {
+ userId: json.Result.LMI_SN,
+ username: json.Result.LoginName,
+ travelAgencyId: json.Result.LMI_VEI_SN,
+ travelAgencyName: json.Result.VName,
+ cityId: json.Result.citysn
+ }
+ });
+ } else {
+ throw new Error(json.errmsg + ': ' + json.errcode);
+ }
+ });
+ }
+
login = {
userId: 1,
- username: 'Vu Xuan Giang(ANP)',
- travelAgencyId: 32531 //30008供应商id对应HT的VEI_SN
+ username: 'Vu Xuan Giang',
+ travelAgencyId: 32531, //30008供应商id对应HT的VEI_SN
+ travelAgencyName: 'ANP',
+ cityId: 0
}
}
diff --git a/src/stores/Invoice.js b/src/stores/Invoice.js
new file mode 100644
index 0000000..5f0526f
--- /dev/null
+++ b/src/stores/Invoice.js
@@ -0,0 +1,109 @@
+import { makeAutoObservable,runInAction } from "mobx";
+import { fetchJSON } from "@/utils/request";
+import { prepareUrl } from '@/utils/commons';
+import { HT_HOST } from "@/config";
+
+class Invoice {
+ constructor(root) {
+ makeAutoObservable(this, { rootStore: false });
+ this.root = root;
+ }
+
+ invoiceList = []; //账单列表
+
+
+
+ fetchInvoiceList(PageIndex,OrderType,GroupNo,DateStart,DateEnd,Orderbytype,TimeType,limitmarket,mddgroup,SecuryGroup){
+ this.invoicePage.current=PageIndex;
+ const totalNum = PageIndex == 1 ? 0 : this.invoicePage.total;
+ //组合param
+ const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTSearchGMBPageList')
+ .append('VEI_SN', this.root.authStore.login.travelAgencyId)
+ .append('OrderType',OrderType)
+ .append('GroupNo',GroupNo)
+ .append('DateStart',DateStart)
+ .append('DateEnd',DateEnd)
+ .append('Orderbytype',Orderbytype)
+ .append('TimeType',TimeType)
+ .append('limitmarket',limitmarket)
+ .append('mddgroup',mddgroup)
+ .append('SecuryGroup',SecuryGroup)
+ .append('TotalNum', totalNum)
+ .append('PageSize', this.invoicePage.size)
+ .append('PageIndex', this.invoicePage.current)
+ .build();
+
+ return fetchJSON(fetchUrl)
+ .then(json => {
+ runInAction(()=>{
+ if (json.errcode==0){
+ this.invoiceList = json.result.map((data,index)=>{
+ return{
+ key:GSMSN,
+ gmd_gri_sn : data.gmd_gri_sn,
+ gmd_vei_sn : data.gmd_vei_sn,
+ GetDate : data.GetDate,
+ GMD_FillWorkers_SN : data.GMD_FillWorkers_SN,
+ GMD_FWks_LastEditTime : data.GMD_FWks_LastEditTime,
+ GMD_VerifyUser_SN : data.GMD_VerifyUser_SN,
+ GMD_Dealed : data.GMD_Dealed,
+ GMD_VRequestVerify : data.GMD_VRequestVerify,
+ LeftGDate : data.LeftGDate,
+ GMD_FillWorkers_Name : data.GMD_FillWorkers_Name,
+ GroupName : data.GroupName,
+ AllMoney : data.AllMoney,
+ PersonNum : data.PersonNum,
+ VName : data.VName
+ }
+
+ });
+ this.invoicePage.total = json.result[0].TotalCount;
+ }else{
+ throw new Error(json.errmsg + ': ' + json.errcode);
+ }
+
+ });
+
+ });
+
+
+ }
+
+
+ invoicePage = {
+ current:1,
+ size:10,
+ total:0
+ }
+
+ /* 测试数据 */
+ //账单列表范例数据
+ testData=
+ [
+ {
+ "GSMSN":449865,
+ "gmd_gri_sn":334233,
+ "gmd_vei_sn":628,
+ "GetDate":"2023-04-2 00:33:33",
+ "GMD_FillWorkers_SN":8617,
+ "GMD_FWks_LastEditTime":"2023-04-26 12:33:33",
+ "GMD_VerifyUser_SN":8928,
+ "GMD_Dealed":1,
+ "GMD_VRequestVerify":1,
+ "TotalCount":22,
+ "LeftGDate":"2023-03-30 00:00:00",
+ "GMD_FillWorkers_Name":"",
+ "GroupName":" 中华游230501-CA230402033",
+ "AllMoney":3539,
+ "PersonNum":"1大1小",
+ "VName":""
+ }
+ ]
+
+}
+
+export default Invoice;
+
+
+
+
diff --git a/src/stores/Reservation.js b/src/stores/Reservation.js
index 3edbe85..7c02b8d 100644
--- a/src/stores/Reservation.js
+++ b/src/stores/Reservation.js
@@ -1,5 +1,5 @@
import { makeAutoObservable, runInAction } from "mobx";
-import { fetchJSON } from '@/utils/request';
+import { fetchJSON, postForm } from '@/utils/request';
import { HT_HOST } from "@/config";
import { prepareUrl } from '@/utils/commons';
@@ -31,7 +31,7 @@ class Reservation {
this.reservationList = json.Result.map((data, index) => {
return {
key: data.vas_gri_sn,
- referenceId: data.vas_gri_sn,
+ reservationId: data.vas_gri_sn,
referenceNumber: data.GriName,
arrivalDate: data.GetGDate,
pax: data.PersonNum,
@@ -96,11 +96,10 @@ class Reservation {
this.cityList = json.Result.map((data, index) => {
return {
key: data.CII_SN,
+ cityId: data.CII_SN,
cityName: data.CityName,
tourGuideId: data.TGI_SN,
- tourGuide: data.GuideName,
- reservationId: reservationId,
- travelAgencyId: this.root.authStore.login.travelAgencyId,
+ tourGuide: data.GuideName
}
});
} else {
@@ -110,17 +109,17 @@ class Reservation {
});
}
- setupCityGuide() {
+ setupCityGuide(cityId, guideId) {
let formData = new FormData();
- formData.append('GRI_SN', 1);
- formData.append('VEI_SN', 1);
- formData.append('TGI_SN', 1);
- formData.append('CII_SN', 1);
- formData.append('GetDate', '2023-06-01');
- formData.append('LMI_SN', 1);
+ formData.append('GRI_SN', this.selectedReservation.reservationId);
+ formData.append('VEI_SN', this.root.authStore.login.travelAgencyId);
+ formData.append('TGI_SN', cityId);
+ formData.append('CII_SN', guideId);
+ formData.append('GetDate', this.selectedReservation.reservationDate);
+ formData.append('LMI_SN', this.root.authStore.login.userId);
const postUrl = HT_HOST + '/service-cusservice/PTAddGuide';
- return req.postForm(postUrl, formData)
+ return postForm(postUrl, formData)
.then(json => {
console.info(json);
});
@@ -149,9 +148,15 @@ class Reservation {
});
}
+ editReservation(reservation) {
+ this.selectedReservation = reservation;
+ }
+
guideList = [];
cityList = [];
+ selectedReservation = null;
+
reservationList = [];
reservationDetail = {
diff --git a/src/stores/Root.js b/src/stores/Root.js
index 2e6379d..4398819 100644
--- a/src/stores/Root.js
+++ b/src/stores/Root.js
@@ -2,12 +2,14 @@ import { makeAutoObservable } from "mobx";
import Reservation from "./Reservation";
import Feedback from "./Feedback";
import Auth from "./Auth";
+import Invoice from "./Invoice";
class Root {
constructor() {
this.reservationStore = new Reservation(this);
this.feedbackStore = new Feedback(this);
this.authStore = new Auth(this);
+ //this.invoice = new Invoice(this);
makeAutoObservable(this);
}
}
diff --git a/src/views/App.jsx b/src/views/App.jsx
index 2236ced..ff1765d 100644
--- a/src/views/App.jsx
+++ b/src/views/App.jsx
@@ -76,7 +76,7 @@ function App() {
items={[
{ key: "/reservation/newest", label: Reservation },
{ key: "/feedback", label: Feedback },
- { key: "/invoice/list", label: Invoice },
+ { key: "/invoice", label: Invoice },
{ key: "/notice", label: Notice },
]}
/>
diff --git a/src/views/Login.jsx b/src/views/Login.jsx
index 827a94b..794b571 100644
--- a/src/views/Login.jsx
+++ b/src/views/Login.jsx
@@ -1,109 +1,90 @@
-import { Button, Checkbox, Form, Input, Row, Typography, Layout } from 'antd';
-const { Header, Footer, Sider, Content } = Layout;
-const { Title } = Typography;
-const headerStyle = {
- textAlign: 'center',
- // color: '#fff',
- height: 64,
- paddingInline: 50,
- lineHeight: '64px',
- backgroundColor: '#f5f5f5',
-};
-const contentStyle = {
- textAlign: 'center',
- minHeight: 600,
- lineHeight: '120px',
- // color: '#fff',
- // backgroundColor: '#108ee9',
-};
-const footerStyle = {
- textAlign: 'center',
- // color: '#fff',
- // backgroundColor: '#7dbcea',
-};
-const onFinish = (values) => {
- console.log('Success:', values);
-};
-const onFinishFailed = (errorInfo) => {
- console.log('Failed:', errorInfo);
-};
-const Login = () => (
-
-
- Global Highlights Hub
-
-
-
-
-
-
+import { Button, Checkbox, Form, Input, Row, App } from 'antd';
+import { useStore } from '@/stores/StoreContext.js';
-
-
-
-
- Remember me
-
+function Login() {
+ const { authStore } = useStore();
+ const { notification } = App.useApp();
-
-
-
-
-
-
-
-
+ const onFinish = (values) => {
+ console.log('Success:', values);
+ authStore.valdateUserPassword(values.username, values.password);
+ };
+
+ const onFinishFailed = (errorInfo) => {
+ console.log('Failed:', errorInfo);
+ };
+
+ return (
+
+
+
+
+
+
+
+
+
+
+ Remember me
+
+
+
+
+
+
+
+ );
+}
-);
export default Login;
\ No newline at end of file
diff --git a/src/views/Standlone.jsx b/src/views/Standlone.jsx
new file mode 100644
index 0000000..93333f7
--- /dev/null
+++ b/src/views/Standlone.jsx
@@ -0,0 +1,57 @@
+import { Outlet, Link, useHref, useLocation } from "react-router-dom";
+import { useEffect } from "react";
+import { observer } from "mobx-react";
+import { Layout, Menu, ConfigProvider, theme, Typography, Space, Row, Col, Alert, App as AntApp } from "antd";
+import { DownOutlined } from "@ant-design/icons";
+import "antd/dist/reset.css";
+import AppLogo from "@/assets/logo-gh.png";
+import { useStore } from "@/stores/StoreContext.js";
+
+const { Title } = Typography;
+const { Header, Content, Footer } = Layout;
+
+function Standlone() {
+ const { authStore } = useStore();
+
+ const {
+ token: { colorBgContainer },
+ } = theme.useToken();
+
+ return (
+
+
+
+
+
+
+
+
+ Global Highlights Hub
+
+
+
+
+
+
+
+
+
+ );
+}
+
+export default observer(Standlone);
diff --git a/src/views/feedback/Index.jsx b/src/views/feedback/Index.jsx
index 030e4eb..e1c06e3 100644
--- a/src/views/feedback/Index.jsx
+++ b/src/views/feedback/Index.jsx
@@ -37,6 +37,8 @@ const feedbackListColumns = [
];
function Index() {
+
+
const { feedbackStore, authStore } = useStore();
const { feedbackList } = feedbackStore;
const [selectedDateRange, onDateRangeChange] = useState([config.DATE_PRESETS[0].value]);
diff --git a/src/views/invoice/Detail.jsx b/src/views/invoice/Detail.jsx
new file mode 100644
index 0000000..c29c5e1
--- /dev/null
+++ b/src/views/invoice/Detail.jsx
@@ -0,0 +1,23 @@
+import { useParams, useNavigate } from "react-router-dom";
+import { useEffect, useState } from "react";
+import { observer } from "mobx-react";
+
+function Detail() {
+ const navigate = useNavigate();
+ const {GMDSN,GSN} = useParams();
+
+
+ useEffect(() => {
+ setDataLoading(true);
+
+
+ },[GMDSN,GSN]);
+
+
+
+
+}
+
+
+export default observer(Detail);
+
diff --git a/src/views/invoice/Index.jsx b/src/views/invoice/Index.jsx
new file mode 100644
index 0000000..8d53ea3
--- /dev/null
+++ b/src/views/invoice/Index.jsx
@@ -0,0 +1,20 @@
+import { NavLink } from "react-router-dom";
+import { useEffect, useState } from "react";
+import { observer } from "mobx-react";
+import { toJS } from "mobx";
+import { Row, Col, Space, Button, Table, Input, DatePicker } from "antd";
+import { useStore } from "@/stores/StoreContext.js";
+import * as config from "@/config";
+
+function Index() {
+
+ return (
+
+ "账单列表!"
+
+ )
+
+}
+
+
+export default observer(Index);
diff --git a/src/views/reservation/Newest.jsx b/src/views/reservation/Newest.jsx
index ae9a073..4fcfa87 100644
--- a/src/views/reservation/Newest.jsx
+++ b/src/views/reservation/Newest.jsx
@@ -13,7 +13,7 @@ function Newest() {
title: 'Reference number',
dataIndex: 'referenceNumber',
key: 'Reference number',
- render: (text, record) => {text},
+ render: (text, record) => {text},
},
{
title: 'Arrival date',
@@ -71,11 +71,12 @@ function Newest() {
allowClear
placeholder="Select a guide"
optionFilterProp="children"
- onChange={(value) => {
+ onChange={(guideId) => {
console.log(`selected:`);
- console.log(value);
+ console.log(guideId);
console.log(`city:`);
console.log(city);
+ reservationStore.setupCityGuide(city.cityId, guideId);
}}
onSearch={(value) => {
console.log('search:', value);
@@ -105,8 +106,9 @@ function Newest() {
const showCityGuideModal = (reservation) => {
setDataLoading(true);
setIsModalOpen(true);
+ reservationStore.editReservation(reservation);
reservationStore.fetchGuideList();
- reservationStore.fetchCityList(reservation.referenceId)
+ reservationStore.fetchCityList(reservation.reservationId)
.catch(ex => {
notification.error({
message: `Notification`,