公告管理

release
YCC 2 years ago
parent ef6a19e32a
commit f745492a12

@ -23,6 +23,7 @@ import AccountProfile from "@/views/account/Profile";
import FeedbackIndex from "@/views/feedback/Index"; import FeedbackIndex from "@/views/feedback/Index";
import FeedbackDetail from "@/views/feedback/Detail"; import FeedbackDetail from "@/views/feedback/Detail";
import NoticeIndex from "@/views/notice/Index"; import NoticeIndex from "@/views/notice/Index";
import NoticeDetail from "@/views/notice/Detail";
import InvoiceIndex from "@/views/invoice/Index"; import InvoiceIndex from "@/views/invoice/Index";
import InvoiceDetail from "@/views/invoice/Detail"; import InvoiceDetail from "@/views/invoice/Detail";
@ -52,6 +53,7 @@ const router = createBrowserRouter([
{ path: "feedback", element: <FeedbackIndex />}, { path: "feedback", element: <FeedbackIndex />},
{ path: "feedback/:GRI_SN", element: <FeedbackDetail />}, { path: "feedback/:GRI_SN", element: <FeedbackDetail />},
{ path: "notice", element: <NoticeIndex />}, { path: "notice", element: <NoticeIndex />},
{ path: "notice/:CCP_BLID", element: <NoticeDetail />},
{ path: "invoice",element:<InvoiceIndex />}, { path: "invoice",element:<InvoiceIndex />},
{ path: "invoice/detail/:GMDSN/:GSN",element:<InvoiceDetail />}, { path: "invoice/detail/:GMDSN/:GSN",element:<InvoiceDetail />},
] ]

@ -128,7 +128,7 @@ class Feedback {
//提交供应商反馈信息 //提交供应商反馈信息
postFeedbackInfo(VEI_SN, GRI_SN, EOI_SN, info_content) { postFeedbackInfo(VEI_SN, GRI_SN, EOI_SN, info_content) {
let url = `/service-fileServer/FeedbackInfo`; let url = `/service-CooperateSOA/FeedbackInfo`;
let formData = new FormData(); let formData = new FormData();
formData.append("VEI_SN", VEI_SN); formData.append("VEI_SN", VEI_SN);
formData.append("GRI_SN", GRI_SN); formData.append("GRI_SN", GRI_SN);

@ -0,0 +1,71 @@
import { makeAutoObservable, runInAction } from "mobx";
import * as config from "@/config";
class Notice {
constructor(root) {
makeAutoObservable(this, { rootStore: false });
this.root = root;
}
noticeList = []; //公告列表
noticeUnRead = 0; //未读公告数量
noticeInfo = { CCP_BLID: 0, CCP_BLTitle: "", CCP_BLContent: "", CCP_LastEditTime: "" }; //公告详情
/*
LMI_SN 登录用户SN用户sn用来判断是否已读公告
*/
getBulletinList(LMI_SN) {
let url = `/service-Cooperate/Cooperate/GetBulletinList`;
url += `?LMI_SN=${LMI_SN}`;
fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
console.log(json);
runInAction(() => {
this.noticeList = json.Result;
});
})
.catch(error => {
console.log("fetch data failed", error);
});
}
/*
LMI_SN 登录用户sn 用户sn用来设置已读公告请求过一次详情页表示已读
CCP_BLID 公告sn
*/
getNoticeDetail(LMI_SN, CCP_BLID) {
let url = `/service-Cooperate/Cooperate/GetBulletinDetail`;
url += `?LMI_SN=${LMI_SN}&CCP_BLID=${CCP_BLID}`;
fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
console.log(json);
runInAction(() => {
this.noticeUnRead = json.Result.CCP_BulletinCount;
});
})
.catch(error => {
console.log("fetch data failed", error);
});
}
//检查是否有未读公告
getBulletinUnReadCount(LMI_SN) {
let url = `/service-Cooperate/Cooperate/GetBulletinUnReadCount`;
url += `?LMI_SN=${LMI_SN}`;
fetch(config.HT_HOST + url)
.then(response => response.json())
.then(json => {
console.log(json);
runInAction(() => {
this.noticeInfo = json.Result;
});
})
.catch(error => {
console.log("fetch data failed", error);
});
}
}
export default Notice;

@ -1,6 +1,7 @@
import { makeAutoObservable } from "mobx"; import { makeAutoObservable } from "mobx";
import Reservation from "./Reservation"; import Reservation from "./Reservation";
import Feedback from "./Feedback"; import Feedback from "./Feedback";
import Notice from "./Notice";
import Auth from "./Auth"; import Auth from "./Auth";
import Invoice from "./Invoice"; import Invoice from "./Invoice";
@ -8,6 +9,7 @@ class Root {
constructor() { constructor() {
this.reservationStore = new Reservation(this); this.reservationStore = new Reservation(this);
this.feedbackStore = new Feedback(this); this.feedbackStore = new Feedback(this);
this.noticeStore = new Notice(this);
this.authStore = new Auth(this); this.authStore = new Auth(this);
this.invoiceStore = new Invoice(this); this.invoiceStore = new Invoice(this);
makeAutoObservable(this); makeAutoObservable(this);

@ -1,7 +1,7 @@
import { Outlet, Link, useHref, useLocation, NavLink } from "react-router-dom"; import { Outlet, Link, useHref, useLocation, NavLink } from "react-router-dom";
import { useEffect } from "react"; import { useEffect } from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { Layout, Menu, ConfigProvider, theme, Dropdown, Space, Row, Col, Alert, Typography, Divider, App as AntApp } from "antd"; import { Layout, Menu, ConfigProvider, theme, Dropdown, Space, Row, Col, Badge, Typography, Divider, App as AntApp } from "antd";
import { DownOutlined } from "@ant-design/icons"; import { DownOutlined } from "@ant-design/icons";
import "antd/dist/reset.css"; import "antd/dist/reset.css";
import AppLogo from "@/assets/logo-gh.png"; import AppLogo from "@/assets/logo-gh.png";
@ -28,8 +28,8 @@ const items = [
}, },
]; ];
function App() { function App() {
const { authStore } = useStore(); const { authStore, noticeStore } = useStore();
const { noticeUnRead } = noticeStore;
const href = useHref(); const href = useHref();
useEffect(() => { useEffect(() => {
// Check location // Check location
@ -61,7 +61,7 @@ function App() {
minHeight: "100vh", minHeight: "100vh",
}}> }}>
<Header className="header" style={{ position: "sticky", top: 0, zIndex: 1, width: "100%" }}> <Header className="header" style={{ position: "sticky", top: 0, zIndex: 1, width: "100%" }}>
<Row gutter={{ md: 24 }} justify="end" align="middle"> <Row gutter={{ md: 24 }} justify="end" align="middle">
<Col span={16}> <Col span={16}>
<NavLink to="/"> <NavLink to="/">
<img src={AppLogo} className="logo" alt="App logo" /> <img src={AppLogo} className="logo" alt="App logo" />
@ -74,12 +74,22 @@ function App() {
{ key: "reservation", label: <Link to="/reservation/newest">Reservation</Link> }, { key: "reservation", label: <Link to="/reservation/newest">Reservation</Link> },
{ key: "invoice", label: <Link to="/invoice">Invoice</Link> }, { key: "invoice", label: <Link to="/invoice">Invoice</Link> },
{ key: "feedback", label: <Link to="/feedback">Feedback</Link> }, { key: "feedback", label: <Link to="/feedback">Feedback</Link> },
{ key: "notice", label: <Link to="/notice">Notice</Link> }, {
key: "notice",
label: (
<Link to="/notice">
Notice
{noticeUnRead ? <Badge dot /> : ""}
</Link>
),
},
]} ]}
/> />
</Col> </Col>
<Col span={4}> <Col span={4}>
<Title level={3} style={{color: 'white', marginBottom: '0', display: 'flex', justifyContent: 'end'}}>{authStore.login.travelAgencyName}</Title> <Title level={3} style={{ color: "white", marginBottom: "0", display: "flex", justifyContent: "end" }}>
{authStore.login.travelAgencyName}
</Title>
</Col> </Col>
<Col span={4}> <Col span={4}>
<Dropdown <Dropdown
@ -97,8 +107,6 @@ function App() {
</Row> </Row>
</Header> </Header>
<Alert message={<NavLink to="/notice">公告 查看后不再显示或者一直显示或者放到页面底部</NavLink>} description="" type="info" banner closable />
<Content <Content
style={{ style={{
padding: 24, padding: 24,

@ -5,8 +5,6 @@ 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, Radio } from "antd";
import { useStore } from "@/stores/StoreContext.js"; import { useStore } from "@/stores/StoreContext.js";
import * as config from "@/config"; import * as config from "@/config";
import * as comm from "@/utils/commons";
import dayjs from "dayjs";
const { Title } = Typography; const { Title } = Typography;
const feedbackListColumns = [ const feedbackListColumns = [
@ -51,10 +49,10 @@ function Index() {
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(() => {
console.info("feedback.useEffect"); feedbackStore.searchFeedbackList(authStore.login.travelAgencyId, referenceNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT) + " 23:59");
}, []); }, []);
return ( return (

@ -0,0 +1,40 @@
import { NavLink, useParams } 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, Typography, Badge, Divider } from "antd";
import { useStore } from "@/stores/StoreContext.js";
import * as config from "@/config";
import * as comm from "@/utils/commons";
import dayjs from "dayjs";
const { Title, Paragraph, Text } = Typography;
function Detail() {
const { noticeStore, authStore } = useStore();
const { noticeInfo } = noticeStore;
const { CCP_BLID } = useParams();
useEffect(() => {
console.info("notice detail .useEffect " + CCP_BLID);
noticeStore.getNoticeDetail(authStore.login.userId, CCP_BLID);
}, []);
return (
<Space direction="vertical" style={{ width: "100%" }}>
<Row gutter={16}>
<Col span={4}></Col>
<Col span={16}>
<Title level={1}>{noticeInfo.CCP_BLTitle}</Title>
<Divider orientation="right">{noticeInfo.CCP_LastEditTime}</Divider>
<Paragraph>{noticeInfo.CCP_BLContent}</Paragraph>
</Col>
<Col span={4}>
<NavLink to="/notice">Back</NavLink>
</Col>
</Row>
</Space>
);
}
export default observer(Detail);

@ -2,7 +2,7 @@ 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, Badge, List } from "antd";
import { useStore } from "@/stores/StoreContext.js"; import { useStore } from "@/stores/StoreContext.js";
import * as config from "@/config"; import * as config from "@/config";
import * as comm from "@/utils/commons"; import * as comm from "@/utils/commons";
@ -11,44 +11,27 @@ import dayjs from "dayjs";
const { Title, Paragraph, Text } = Typography; const { Title, Paragraph, Text } = Typography;
function Index() { function Index() {
const { feedbackStore } = useStore(); const { noticeStore, authStore } = useStore();
const { noticeList } = noticeStore;
useEffect(() => { useEffect(() => {
console.info("feedback.useEffect"); console.info("notice.useEffect");
noticeStore.getBulletinList(authStore.login.userId);
}, []); }, []);
const [ellipsis, setEllipsis] = useState(true);
return ( return (
<Space direction="vertical" style={{ width: "100%" }}> <Space direction="vertical" style={{ width: "100%" }}>
<Row gutter={16}> <Row gutter={16}>
<Col span={4}></Col> <Col span={4}></Col>
<Col span={18}> <Col span={16}>
<Title level={2}>Guidelines and Resources</Title> <List
<Paragraph ellipsis={{ expandable: true, rows: 5 }}> dataSource={toJS(noticeList)}
We supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help people create their product prototypes beautifully and We renderItem={item => (
supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help people create their product prototypes beautifully and We <List.Item>
supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help people create their product prototypes beautifully and We <Typography.Text>[{item.CCP_LastEditTime}]</Typography.Text>
supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help people create their product prototypes beautifully and <NavLink to={`/notice/${item.CCP_BLID}`}> {item.CCP_BLTitle}</NavLink> {item.IsRead ? "" : <Badge dot />}
efficiently. efficiently. We supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help people create their product </List.Item>
prototypes beautifully and We supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help people create their product )}></List>
prototypes beautifully and efficiently. efficiently. We supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help
people create their product prototypes beautifully and We supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help
people create their product prototypes beautifully and efficiently. efficiently. efficiently. efficiently.
</Paragraph>
<Title level={2}>第二个公告</Title>
<Paragraph ellipsis={{ expandable: true, rows: 5 }}>
We supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help people create their product prototypes beautifully and We
supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help people create their product prototypes beautifully and We
supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help people create their product prototypes beautifully and We
supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help people create their product prototypes beautifully and
efficiently. efficiently. We supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help people create their product
prototypes beautifully and We supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help people create their product
prototypes beautifully and efficiently. efficiently. We supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help
people create their product prototypes beautifully and We supply a series of design principles, practical patterns and high quality design resources (<Text code>Sketch</Text> and <Text code>Axure</Text>), to help
people create their product prototypes beautifully and efficiently. efficiently. efficiently. efficiently.
</Paragraph>
</Col> </Col>
<Col span={4}></Col> <Col span={4}></Col>
</Row> </Row>

Loading…
Cancel
Save