eslint autofix .

feature/2.0-sales-trade
lyt 2 years ago committed by lot
parent 0ec6966e75
commit 1ab0c7d0c7

@ -1,30 +1,40 @@
import "./App.css"; import './App.css';
import React, { useContext } from "react"; import React, { useContext } from 'react';
import { HomeOutlined, TeamOutlined, DashboardOutlined, FileProtectOutlined, CustomerServiceTwoTone, SnippetsTwoTone, DollarOutlined, AreaChartOutlined, WechatOutlined, UserOutlined } from "@ant-design/icons"; import {
import { Layout, Menu, Image, Spin } from "antd"; HomeOutlined,
import { BrowserRouter, Route, Routes, NavLink } from "react-router-dom"; TeamOutlined,
import Home from "./views/Home"; DashboardOutlined,
import Dashboard from "./views/Dashboard"; FileProtectOutlined,
import Orders from "./views/Orders"; CustomerServiceTwoTone,
import Orders_sub from "./views/Orders_sub"; SnippetsTwoTone,
import ProtectedRoute from "./views/ProtectedRoute"; DollarOutlined,
import Customer_care_inchina from "./charts/Customer_care_inchina"; AreaChartOutlined,
import Customer_care_potential from "./charts/Customer_care_potential"; WechatOutlined,
import Customer_care_regular from "./charts/Customer_care_regular"; UserOutlined,
import Wechat_session from "./charts/Wechat_session"; } from '@ant-design/icons';
import WhatsApp_session from "./charts/WhatsApp_session"; import { Layout, Menu, Image, Spin } from 'antd';
import AgentGroupCount from "./views/AgentGroupCount"; import { BrowserRouter, Route, Routes, NavLink } from 'react-router-dom';
import AgentGroupList from "./views/AgentGroupList"; import Home from './views/Home';
import DestinationGroupCount from "./views/DestinationGroupCount"; import Dashboard from './views/Dashboard';
import DestinationGroupList from "./views/DestinationGroupList"; import Orders from './views/Orders';
import Credit_card_bill from "./views/Credit_card_bill"; import Orders_sub from './views/Orders_sub';
import exchange_rate from "./charts/ExchangeRate"; import ProtectedRoute from './views/ProtectedRoute';
import Sale from "./views/Sale"; import Customer_care_inchina from './charts/Customer_care_inchina';
import Sale_sub from "./views/Sale_sub"; import Customer_care_potential from './charts/Customer_care_potential';
import Logo from "./logo.png"; import Customer_care_regular from './charts/Customer_care_regular';
import { stores_Context } from "./config"; import Wechat_session from './charts/Wechat_session';
import { observer } from "mobx-react"; import WhatsApp_session from './charts/WhatsApp_session';
import ExchangeRate from "./charts/ExchangeRate"; import AgentGroupCount from './views/AgentGroupCount';
import AgentGroupList from './views/AgentGroupList';
import DestinationGroupCount from './views/DestinationGroupCount';
import DestinationGroupList from './views/DestinationGroupList';
import Credit_card_bill from './views/Credit_card_bill';
import Sale from './views/Sale';
import Sale_sub from './views/Sale_sub';
import Logo from './logo.png';
import { stores_Context } from './config';
import { observer } from 'mobx-react';
import ExchangeRate from './charts/ExchangeRate';
const App = () => { const App = () => {
const { Content, Footer, Sider } = Layout; const { Content, Footer, Sider } = Layout;
@ -34,75 +44,127 @@ const App = () => {
{ key: 1, label: <NavLink to="/">主页</NavLink>, icon: <HomeOutlined /> }, { key: 1, label: <NavLink to="/">主页</NavLink>, icon: <HomeOutlined /> },
{ {
key: 2, key: 2,
label: "市场", label: '市场',
icon: <AreaChartOutlined />, icon: <AreaChartOutlined />,
children: [ children: [
{ key: 21, label: <NavLink to="/orders">订单数据</NavLink>, icon: <FileProtectOutlined /> }, {
{ key: 22, label: <NavLink to="/dashboard">仪表盘</NavLink>, icon: <DashboardOutlined /> }, key: 21,
label: <NavLink to="/orders">订单数据</NavLink>,
icon: <FileProtectOutlined />,
},
{
key: 22,
label: <NavLink to="/dashboard">仪表盘</NavLink>,
icon: <DashboardOutlined />,
},
], ],
}, },
{ {
key: 5, key: 5,
label: "销售", label: '销售',
icon: <SnippetsTwoTone />, icon: <SnippetsTwoTone />,
children: [{ key: 51, label: <NavLink to="/sale">业绩数据</NavLink> }], children: [{ key: 51, label: <NavLink to="/sale">业绩数据</NavLink> }],
}, },
{ {
key: 3, key: 3,
label: "客运", label: '客运',
icon: <WechatOutlined />, icon: <WechatOutlined />,
children: [ children: [
{ key: 31, label: <NavLink to="/customer_care_potential">潜力客户</NavLink> }, {
{ key: 32, label: <NavLink to="/customer_care_regular">老客户</NavLink> }, key: 31,
{ key: 33, label: <NavLink to="/customer_care_inchina">在华客户</NavLink> }, label: <NavLink to="/customer_care_potential">潜力客户</NavLink>,
{ key: 34, label: <NavLink to="/wechat_session">微信会话存档</NavLink> }, },
{ key: 35, label: <NavLink to="/whatsapp_session">WhatsApp会话存档</NavLink> }, {
key: 32,
label: <NavLink to="/customer_care_regular">老客户</NavLink>,
},
{
key: 33,
label: <NavLink to="/customer_care_inchina">在华客户</NavLink>,
},
{
key: 34,
label: <NavLink to="/wechat_session">微信会话存档</NavLink>,
},
{
key: 35,
label: <NavLink to="/whatsapp_session">WhatsApp会话存档</NavLink>,
},
], ],
}, },
{ {
key: 4, key: 4,
label: "财务", label: '财务',
icon: <DollarOutlined />, icon: <DollarOutlined />,
children: [ children: [
{ key: 41, label: <NavLink to="/credit_card_bill">信用卡账单</NavLink> }, {
key: 41,
label: <NavLink to="/credit_card_bill">信用卡账单</NavLink>,
},
{ key: 42, label: <NavLink to="/exchange_rate">汇率</NavLink> }, { key: 42, label: <NavLink to="/exchange_rate">汇率</NavLink> },
], ],
}, },
{ {
key: 6, key: 6,
label: "客服", label: '客服',
icon: <WechatOutlined />, icon: <WechatOutlined />,
children: [ children: [
{ key: 61, label: <NavLink to="/agent/group/count">地接社接团</NavLink> }, {
{ key: 62, label: <NavLink to="/destination/group/count">目的地接团</NavLink> }, key: 61,
label: <NavLink to="/agent/group/count">地接社接团</NavLink>,
},
{
key: 62,
label: <NavLink to="/destination/group/count">目的地接团</NavLink>,
},
], ],
} },
]; ];
return ( return (
<BrowserRouter> <BrowserRouter>
<Layout <Layout
hasSider
style={{
minHeight: '100vh',
}}
>
<Sider
collapsible={true}
breakpoint="lg"
style={{ style={{
minHeight: "100vh", overflow: 'auto',
}}> height: '100vh',
<Sider collapsible={true} breakpoint="lg"> position: 'sticky',
left: 0,
top: 0,
bottom: 0,
}}
>
<Image src={Logo} preview={false} /> <Image src={Logo} preview={false} />
<Menu theme="dark" defaultSelectedKeys={["1"]} defaultOpenKeys={["2", "5"]} mode="inline" items={menu_items} /> <Menu
theme="dark"
defaultSelectedKeys={['1']}
defaultOpenKeys={['2', '5']}
mode="inline"
items={menu_items}
/>
</Sider> </Sider>
<Layout className="site-layout"> <Layout className="site-layout">
<Content <Content
style={{ style={{
padding: 16, padding: 16,
minHeight: 480, minHeight: 480,
}}> }}
>
<Routes> <Routes>
<Route path="/" element={<Home />} /> <Route path="/" element={<Home />} />
<Route element={<ProtectedRoute auth={["admin", "director_bu", "marketing"]} />}> <Route element={<ProtectedRoute auth={['admin', 'director_bu', 'marketing']} />}>
<Route path="/orders" element={<Orders />} /> <Route path="/orders" element={<Orders />} />
<Route path="/orders_sub/:ordertype/:ordertype_sub/:ordertype_title" element={<Orders_sub />} /> <Route path="/orders_sub/:ordertype/:ordertype_sub/:ordertype_title" element={<Orders_sub />} />
<Route path="/dashboard" element={<Dashboard />} /> <Route path="/dashboard" element={<Dashboard />} />
</Route> </Route>
<Route element={<ProtectedRoute auth={["admin", "director_bu", "customer_care"]} />}> <Route element={<ProtectedRoute auth={['admin', 'director_bu', 'customer_care']} />}>
<Route path="/customer_care_inchina" element={<Customer_care_inchina />} /> <Route path="/customer_care_inchina" element={<Customer_care_inchina />} />
<Route path="/customer_care_regular" element={<Customer_care_regular />} /> <Route path="/customer_care_regular" element={<Customer_care_regular />} />
<Route path="/customer_care_potential" element={<Customer_care_potential />} /> <Route path="/customer_care_potential" element={<Customer_care_potential />} />
@ -113,11 +175,11 @@ const App = () => {
<Route path="/agent/:agentId/group/list" element={<AgentGroupList />} /> <Route path="/agent/:agentId/group/list" element={<AgentGroupList />} />
<Route path="/destination/:destinationId/group/list" element={<DestinationGroupList />} /> <Route path="/destination/:destinationId/group/list" element={<DestinationGroupList />} />
</Route> </Route>
<Route element={<ProtectedRoute auth={["admin", "director_bu", "financial"]} />}> <Route element={<ProtectedRoute auth={['admin', 'director_bu', 'financial']} />}>
<Route path="/credit_card_bill" element={<Credit_card_bill />} /> <Route path="/credit_card_bill" element={<Credit_card_bill />} />
<Route path="/exchange_rate" element={<ExchangeRate />} /> <Route path="/exchange_rate" element={<ExchangeRate />} />
</Route> </Route>
<Route element={<ProtectedRoute auth={["admin", "director_bu", "sale"]} />}> <Route element={<ProtectedRoute auth={['admin', 'director_bu', 'sale']} />}>
<Route path="/sale" element={<Sale />} /> <Route path="/sale" element={<Sale />} />
<Route path="/sale_sub/:type_sub" element={<Sale_sub />} /> <Route path="/sale_sub/:type_sub" element={<Sale_sub />} />
</Route> </Route>
@ -125,9 +187,11 @@ const App = () => {
</Content> </Content>
<Footer <Footer
style={{ style={{
textAlign: "center", textAlign: 'center',
}}> }}
<UserOutlined /> {auth_store.user.name} ({auth_store.user.userid})<br /> >
<UserOutlined /> {auth_store.user.name} ({auth_store.user.userid})
<br />
Hainatravel Dashboard ©2022 Created by IT Hainatravel Dashboard ©2022 Created by IT
</Footer> </Footer>
</Layout> </Layout>

@ -1,18 +1,20 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Row, Col, Button, Tabs, Table, Space } from 'antd'; import { Row, Col, Button, Tabs, Table, Space } from 'antd';
import { import {
ContainerOutlined, CarryOutOutlined, ContainerOutlined,
SmileOutlined, TagsOutlined, GlobalOutlined, CarryOutOutlined,
SmileOutlined,
TagsOutlined,
GlobalOutlined,
SearchOutlined, SearchOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import {stores_Context} from '../config' import { stores_Context } from '../config';
import {Line} from "@ant-design/charts"; import { Line } from '@ant-design/charts';
import SiteSelect from "./SiteSelect"; import SiteSelect from './SiteSelect';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import DatePickerCharts from './DatePickerCharts' import DatePickerCharts from './DatePickerCharts';
class Orders extends Component { class Orders extends Component {
static contextType = stores_Context; static contextType = stores_Context;
constructor(props) { constructor(props) {
@ -51,7 +53,7 @@ class Orders extends Component {
}, },
}, },
}, },
} };
return ( return (
<div> <div>
@ -59,9 +61,16 @@ class Orders extends Component {
<div> <div>
<Space> <Space>
<DatePickerCharts hide_vs={true} /> <DatePickerCharts hide_vs={true} />
<Button type="primary" icon={<SearchOutlined/>} loading={orders_data.loading} onClick={() => { <Button
type="primary"
icon={<SearchOutlined />}
loading={orders_data.loading}
onClick={() => {
orders_data.getOrderCount_all(); orders_data.getOrderCount_all();
}}>统计</Button> }}
>
统计
</Button>
</Space> </Space>
</div> </div>
<br /> <br />

@ -19,7 +19,7 @@ class AuthStore {
if (Object.keys(requireds).length == 0) { if (Object.keys(requireds).length == 0) {
return true; return true;
} }
let has_permission = requireds.filter(item => this.auth.includes(item)); const has_permission = requireds.filter(item => this.auth.includes(item));
if (Object.keys(has_permission).length !== 0) { if (Object.keys(has_permission).length !== 0) {
return true; return true;
} }
@ -28,14 +28,14 @@ class AuthStore {
// 请求权限 // 请求权限
get_auth() { get_auth() {
let _this = this; const _this = this;
const CORPID = "ding48bce8fd3957c96b"; // 企业的id const CORPID = "ding48bce8fd3957c96b"; // 企业的id
dd.runtime.permission.requestAuthCode({ dd.runtime.permission.requestAuthCode({
corpId: CORPID, corpId: CORPID,
onSuccess: function (res) { onSuccess: function (res) {
console.log(res); console.log(res);
let code = res.code; const code = res.code;
let url = "/dingtalk/dingtalkwork/Getusers_auth?code=" + code; const url = "/dingtalk/dingtalkwork/Getusers_auth?code=" + code;
// 请求获取HT接口获取用户权限和用户信息 // 请求获取HT接口获取用户权限和用户信息
fetch(config.HT_HOST + url) fetch(config.HT_HOST + url)
.then(response => response.json()) .then(response => response.json())

@ -14,19 +14,19 @@ class ChatSessionStore {
wechat_data = { wechat_data = {
counselors: [],// 顾问列表 counselors: [],// 顾问列表
customers: [],// 客户列表 customers: [],// 客户列表
} };
// 请求权限 // 请求权限
get_auth() { get_auth() {
let _this = this; const _this = this;
const CORPID = 'ding48bce8fd3957c96b';// 企业的id const CORPID = 'ding48bce8fd3957c96b';// 企业的id
dd.runtime.permission.requestAuthCode({ dd.runtime.permission.requestAuthCode({
corpId: CORPID, corpId: CORPID,
onSuccess: function (res) { onSuccess: function (res) {
console.log(res); console.log(res);
let code = res.code; const code = res.code;
let url = '/dingtalk/dingtalkwork/Getusers_auth?code=' + code; const url = '/dingtalk/dingtalkwork/Getusers_auth?code=' + code;
// 请求获取HT接口获取用户权限和用户信息 // 请求获取HT接口获取用户权限和用户信息
fetch(config.HT_HOST + url) fetch(config.HT_HOST + url)
.then((response) => response.json()) .then((response) => response.json())
@ -34,14 +34,14 @@ class ChatSessionStore {
runInAction(() => { runInAction(() => {
_this.user = json.result; _this.user = json.result;
_this.auth = json.result.authlist; _this.auth = json.result.authlist;
}) });
}) })
.catch((error) => { .catch((error) => {
console.log('fetch data failed', error); console.log('fetch data failed', error);
}); });
}, },
onFail: function (err) { onFail: function (err) {
console.log(err) console.log(err);
} }
}); });
} }

@ -1,4 +1,4 @@
import {makeAutoObservable, runInAction} from "mobx" import {makeAutoObservable, runInAction} from "mobx";
import moment from "moment"; import moment from "moment";
import { NavLink } from "react-router-dom"; import { NavLink } from "react-router-dom";
import * as config from "../config"; import * as config from "../config";
@ -512,7 +512,7 @@ class CustomerServices {
if (record.EOI_ObjSN === -1) { if (record.EOI_ObjSN === -1) {
return text; return text;
} else { } else {
return <a>{text}</a> return <a>{text}</a>;
} }
} }
}, },

@ -14,7 +14,7 @@ class CustomerStore {
potential_customer_order(get_detail = false) { potential_customer_order(get_detail = false) {
this.potential_data.loading = true; this.potential_data.loading = true;
const date_picker_store = this.rootStore.date_picker_store; const date_picker_store = this.rootStore.date_picker_store;
let url = '/service-tourdesign/PotentialCusOrder' let url = '/service-tourdesign/PotentialCusOrder';
url += '?Website=' + this.potential_data.webcode + '&DEI_SNList=' + this.potential_data.groups.toString(); url += '?Website=' + this.potential_data.webcode + '&DEI_SNList=' + this.potential_data.groups.toString();
if (this.potential_data.date_type == 'applyDate') { if (this.potential_data.date_type == 'applyDate') {
url += '&ApplydateCheck=1&EntrancedateCheck=0&ConfirmDateCheck=0'; url += '&ApplydateCheck=1&EntrancedateCheck=0&ConfirmDateCheck=0';
@ -27,9 +27,9 @@ class CustomerStore {
url += '&EntrancedateStart=' + date_picker_store.start_date.format(config.DATE_FORMAT) + '&EntrancedateEnd=' + date_picker_store.end_date.format(config.DATE_FORMAT) + '%2023:59:59'; url += '&EntrancedateStart=' + date_picker_store.start_date.format(config.DATE_FORMAT) + '&EntrancedateEnd=' + date_picker_store.end_date.format(config.DATE_FORMAT) + '%2023:59:59';
url += '&ConfirmdateStart=' + date_picker_store.start_date.format(config.DATE_FORMAT) + '&ConfirmdateEnd=' + date_picker_store.end_date.format(config.DATE_FORMAT) + '%2023:59:59'; url += '&ConfirmdateStart=' + date_picker_store.start_date.format(config.DATE_FORMAT) + '&ConfirmdateEnd=' + date_picker_store.end_date.format(config.DATE_FORMAT) + '%2023:59:59';
if (get_detail) { if (get_detail) {
url += '&IsDetail=1' url += '&IsDetail=1';
} else { } else {
url += '&IsDetail=0' url += '&IsDetail=0';
} }
fetch(config.HT_HOST + url) fetch(config.HT_HOST + url)
.then((response) => response.json()) .then((response) => response.json())
@ -41,7 +41,7 @@ class CustomerStore {
this.potential_data.data = json; this.potential_data.data = json;
} }
this.potential_data.loading = false; this.potential_data.loading = false;
}) });
}) })
.catch((error) => { .catch((error) => {
this.potential_data.loading = false; this.potential_data.loading = false;
@ -79,7 +79,7 @@ class CustomerStore {
potential_customer_order: this.potential_customer_order.bind(this), potential_customer_order: this.potential_customer_order.bind(this),
onChange_show_detail_table: this.onChange_show_detail_table.bind(this), onChange_show_detail_table: this.onChange_show_detail_table.bind(this),
handleChange_webcode: this.handleChange_webcode.bind(this), handleChange_webcode: this.handleChange_webcode.bind(this),
} };
// 潜力客户 end // 潜力客户 end
@ -87,7 +87,7 @@ class CustomerStore {
regular_customer_order(get_detail = false) { regular_customer_order(get_detail = false) {
this.regular_data.loading = true; this.regular_data.loading = true;
const date_picker_store = this.rootStore.date_picker_store; const date_picker_store = this.rootStore.date_picker_store;
let url = '/service-tourdesign/RegularCusOrder' let url = '/service-tourdesign/RegularCusOrder';
url += '?Website=' + this.regular_data.webcode + '&DEI_SNList=' + this.regular_data.groups.toString(); url += '?Website=' + this.regular_data.webcode + '&DEI_SNList=' + this.regular_data.groups.toString();
if (this.regular_data.date_type == 'applyDate') { if (this.regular_data.date_type == 'applyDate') {
url += '&ApplydateCheck=1&EntrancedateCheck=0&ConfirmDateCheck=0'; url += '&ApplydateCheck=1&EntrancedateCheck=0&ConfirmDateCheck=0';
@ -100,9 +100,9 @@ class CustomerStore {
url += '&EntrancedateStart=' + date_picker_store.start_date.format(config.DATE_FORMAT) + '&EntrancedateEnd=' + date_picker_store.end_date.format(config.DATE_FORMAT) + '%2023:59:59'; url += '&EntrancedateStart=' + date_picker_store.start_date.format(config.DATE_FORMAT) + '&EntrancedateEnd=' + date_picker_store.end_date.format(config.DATE_FORMAT) + '%2023:59:59';
url += '&ConfirmdateStart=' + date_picker_store.start_date.format(config.DATE_FORMAT) + '&ConfirmdateEnd=' + date_picker_store.end_date.format(config.DATE_FORMAT) + '%2023:59:59'; url += '&ConfirmdateStart=' + date_picker_store.start_date.format(config.DATE_FORMAT) + '&ConfirmdateEnd=' + date_picker_store.end_date.format(config.DATE_FORMAT) + '%2023:59:59';
if (get_detail) { if (get_detail) {
url += '&IsDetail=1' url += '&IsDetail=1';
} else { } else {
url += '&IsDetail=0' url += '&IsDetail=0';
} }
fetch(config.HT_HOST + url) fetch(config.HT_HOST + url)
.then((response) => response.json()) .then((response) => response.json())
@ -114,7 +114,7 @@ class CustomerStore {
this.regular_data.data = json; this.regular_data.data = json;
} }
this.regular_data.loading = false; this.regular_data.loading = false;
}) });
}) })
.catch((error) => { .catch((error) => {
this.regular_data.loading = false; this.regular_data.loading = false;
@ -152,7 +152,7 @@ class CustomerStore {
regular_customer_order: this.regular_customer_order.bind(this), regular_customer_order: this.regular_customer_order.bind(this),
onChange_show_detail_table: this.onChange_show_detail_table_regular.bind(this), onChange_show_detail_table: this.onChange_show_detail_table_regular.bind(this),
handleChange_webcode: this.handleChange_webcode_regular.bind(this), handleChange_webcode: this.handleChange_webcode_regular.bind(this),
} };
// 老客户 end // 老客户 end
@ -160,7 +160,7 @@ class CustomerStore {
inchina_customer_order(get_detail = false) { inchina_customer_order(get_detail = false) {
this.inchina_data.loading = true; this.inchina_data.loading = true;
const date_picker_store = this.rootStore.date_picker_store; const date_picker_store = this.rootStore.date_picker_store;
let url = '/service-tourdesign/RegularCusInChinaOrder' let url = '/service-tourdesign/RegularCusInChinaOrder';
url += '?Website=' + this.inchina_data.webcode + '&DEI_SNList=' + this.inchina_data.groups.toString(); url += '?Website=' + this.inchina_data.webcode + '&DEI_SNList=' + this.inchina_data.groups.toString();
if (this.inchina_data.date_type == 'applyDate') { if (this.inchina_data.date_type == 'applyDate') {
url += '&ApplydateCheck=1&EntrancedateCheck=0&ConfirmDateCheck=0'; url += '&ApplydateCheck=1&EntrancedateCheck=0&ConfirmDateCheck=0';
@ -170,9 +170,9 @@ class CustomerStore {
url += '&ApplydateCheck=0&EntrancedateCheck=1&ConfirmDateCheck=0'; url += '&ApplydateCheck=0&EntrancedateCheck=1&ConfirmDateCheck=0';
} }
if (get_detail) { if (get_detail) {
url += '&IsDetail=1' url += '&IsDetail=1';
} else { } else {
url += '&IsDetail=0' url += '&IsDetail=0';
} }
url += '&ApplydateStart=' + date_picker_store.start_date.format(config.DATE_FORMAT) + '&ApplydateEnd=' + date_picker_store.end_date.format(config.DATE_FORMAT) + '%2023:59:59'; url += '&ApplydateStart=' + date_picker_store.start_date.format(config.DATE_FORMAT) + '&ApplydateEnd=' + date_picker_store.end_date.format(config.DATE_FORMAT) + '%2023:59:59';
url += '&EntrancedateStart=' + date_picker_store.start_date.format(config.DATE_FORMAT) + '&EntrancedateEnd=' + date_picker_store.end_date.format(config.DATE_FORMAT) + '%2023:59:59'; url += '&EntrancedateStart=' + date_picker_store.start_date.format(config.DATE_FORMAT) + '&EntrancedateEnd=' + date_picker_store.end_date.format(config.DATE_FORMAT) + '%2023:59:59';
@ -187,7 +187,7 @@ class CustomerStore {
this.inchina_data.data = json; this.inchina_data.data = json;
} }
this.inchina_data.loading = false; this.inchina_data.loading = false;
}) });
}) })
.catch((error) => { .catch((error) => {
this.inchina_data.loading = false; this.inchina_data.loading = false;
@ -225,7 +225,7 @@ class CustomerStore {
inchina_customer_order: this.inchina_customer_order.bind(this), inchina_customer_order: this.inchina_customer_order.bind(this),
onChange_show_detail_table: this.onChange_show_detail_table_inchina.bind(this), onChange_show_detail_table: this.onChange_show_detail_table_inchina.bind(this),
handleChange_webcode: this.handleChange_webcode_inchina.bind(this), handleChange_webcode: this.handleChange_webcode_inchina.bind(this),
} };
// 在华客人 end // 在华客人 end
} }

@ -131,7 +131,7 @@ class DashboardStore {
fetch(config.HT_HOST + url) fetch(config.HT_HOST + url)
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
let table_data = []; const table_data = [];
json && json &&
json.map((item, index) => { json.map((item, index) => {
table_data.push({ table_data.push({

@ -1,4 +1,4 @@
import {makeAutoObservable} from "mobx" import {makeAutoObservable} from "mobx";
import moment from "moment"; import moment from "moment";
class DatePickerStore { class DatePickerStore {
@ -16,7 +16,7 @@ class DatePickerStore {
onChange_dataPicker = (dates) => { onChange_dataPicker = (dates) => {
this.start_date = dates[0]; this.start_date = dates[0];
this.end_date = dates[1]; this.end_date = dates[1];
} };
onChange_dataPicker_cp = (dates) => { onChange_dataPicker_cp = (dates) => {
if (dates) { if (dates) {
@ -26,7 +26,7 @@ class DatePickerStore {
this.start_date_cp = false; this.start_date_cp = false;
this.end_date_cp = false; this.end_date_cp = false;
} }
} };
// 计算上一个时间段 // 计算上一个时间段
previous_date() { previous_date() {

@ -1,7 +1,7 @@
import {makeAutoObservable, runInAction} from "mobx"; import {makeAutoObservable, runInAction} from "mobx";
import * as dd from 'dingtalk-jsapi'; import * as dd from 'dingtalk-jsapi';
import * as config from "../config"; import * as config from "../config";
import * as comm from '../utils/commons' import * as comm from '../utils/commons';
// 财务管理 // 财务管理
@ -18,7 +18,7 @@ class FinancialStore {
bill_type_mode: false, bill_type_mode: false,
bill_types: ['ALL'], bill_types: ['ALL'],
bt_handleChange: this.bt_handleChange.bind(this), bt_handleChange: this.bt_handleChange.bind(this),
} };
bt_handleChange(value) { bt_handleChange(value) {
this.bill_type_data.bill_types = value; this.bill_type_data.bill_types = value;
@ -26,13 +26,13 @@ class FinancialStore {
get_bill_types() { get_bill_types() {
const date_picker_store = this.rootStore.date_picker_store; const date_picker_store = this.rootStore.date_picker_store;
let url = '/service-web/QueryData/GetCreditCardBillType'; const url = '/service-web/QueryData/GetCreditCardBillType';
fetch(config.HT_HOST + url) fetch(config.HT_HOST + url)
.then((response) => response.json()) .then((response) => response.json())
.then((json) => { .then((json) => {
runInAction(() => { runInAction(() => {
this.bill_type_data.data = json.billtype; this.bill_type_data.data = json.billtype;
}) });
}) })
.catch((error) => { .catch((error) => {
console.log('fetch data failed', error); console.log('fetch data failed', error);
@ -54,7 +54,7 @@ class FinancialStore {
} }
set_table_handleChange = (pagination, filters, sorter) => { set_table_handleChange = (pagination, filters, sorter) => {
let filters_arr = Object.values(filters); const filters_arr = Object.values(filters);
if (!comm.empty(filters_arr)) { if (!comm.empty(filters_arr)) {
this.set_bill_filtered(filters_arr[0]); this.set_bill_filtered(filters_arr[0]);
} }
@ -99,7 +99,7 @@ class FinancialStore {
.then((json) => { .then((json) => {
runInAction(() => { runInAction(() => {
this.credit_card_data.data = json; this.credit_card_data.data = json;
}) });
}) })
.catch((error) => { .catch((error) => {
console.log('fetch data failed', error); console.log('fetch data failed', error);
@ -120,7 +120,7 @@ class FinancialStore {
.then((json) => { .then((json) => {
runInAction(() => { runInAction(() => {
this.credit_card_data.data_by_type = json; this.credit_card_data.data_by_type = json;
}) });
}) })
.catch((error) => { .catch((error) => {
console.log('fetch data failed', error); console.log('fetch data failed', error);

@ -1,4 +1,4 @@
import {makeAutoObservable} from "mobx" import {makeAutoObservable} from "mobx";
import OrdersStore from "./OrdersStore"; import OrdersStore from "./OrdersStore";
import DashboardStore from "./DashboardStore"; import DashboardStore from "./DashboardStore";
import DatePickerStore from "./DatePickerStore"; import DatePickerStore from "./DatePickerStore";

@ -37,8 +37,8 @@ class OrdersStore {
// 计算两个时间段的有多少天 // 计算两个时间段的有多少天
get diff_count_day() { get diff_count_day() {
const date_picker_store = this.rootStore.date_picker_store; const date_picker_store = this.rootStore.date_picker_store;
let _start_date = moment(date_picker_store.start_date.format(config.DATE_FORMAT)); const _start_date = moment(date_picker_store.start_date.format(config.DATE_FORMAT));
let _end_date = moment(date_picker_store.end_date.format(config.DATE_FORMAT)); const _end_date = moment(date_picker_store.end_date.format(config.DATE_FORMAT));
return _end_date.diff(_start_date, "days") + 1; return _end_date.diff(_start_date, "days") + 1;
} }
@ -51,6 +51,7 @@ class OrdersStore {
handleChange_webcode = value => { handleChange_webcode = value => {
this.webcode = value; this.webcode = value;
}; };
// 是否包含门票 // 是否包含门票
handleChange_include_tickets = value => { handleChange_include_tickets = value => {
this.include_tickets = value; this.include_tickets = value;
@ -67,8 +68,8 @@ class OrdersStore {
// 比如2022-10-01~2022-10-30 vs 2021-10-01~2021-10-30 则需要在2021年的时间段加365天的时间映射成2022起始时间段 // 比如2022-10-01~2022-10-30 vs 2021-10-01~2021-10-30 则需要在2021年的时间段加365天的时间映射成2022起始时间段
// 相差的天数用a.diff(b, 'days')计算 // 相差的天数用a.diff(b, 'days')计算
format_data_source(data_source, start_date, end_date) { format_data_source(data_source, start_date, end_date) {
let result = []; const result = [];
for (let item of data_source.ordercount1) { for (const item of data_source.ordercount1) {
if (result[item.ApplyDate]) { if (result[item.ApplyDate]) {
result[item.ApplyDate].yField += item.orderCount; result[item.ApplyDate].yField += item.orderCount;
} else { } else {
@ -81,12 +82,12 @@ class OrdersStore {
} }
if (data_source.ordercount2 && end_date) { if (data_source.ordercount2 && end_date) {
// 不能直接用diff计算因为日期是含有时间的会导致计算差一天先转成格式化的日期再比较 // 不能直接用diff计算因为日期是含有时间的会导致计算差一天先转成格式化的日期再比较
let _start_date = moment(start_date.format(config.DATE_FORMAT)); const _start_date = moment(start_date.format(config.DATE_FORMAT));
let _end_date = moment(end_date.format(config.DATE_FORMAT)); const _end_date = moment(end_date.format(config.DATE_FORMAT));
let diff_days = _start_date.diff(_end_date, "days"); const diff_days = _start_date.diff(_end_date, "days");
for (let item of data_source.ordercount2) { for (const item of data_source.ordercount2) {
let ApplyDate = moment(item.ApplyDate).add(diff_days, "days").format(config.DATE_FORMAT); const ApplyDate = moment(item.ApplyDate).add(diff_days, "days").format(config.DATE_FORMAT);
let ApplyDate_key = ApplyDate + "_";//这个作为key const ApplyDate_key = ApplyDate + "_";// 这个作为key
if (result[ApplyDate_key]) { if (result[ApplyDate_key]) {
result[ApplyDate_key].yField += item.orderCount; result[ApplyDate_key].yField += item.orderCount;
} else { } else {

@ -37,6 +37,7 @@ class SaleStore {
group_handleChange(value) { group_handleChange(value) {
this.groups = value; this.groups = value;
} }
// 选择站点 // 选择站点
handleChange_webcode = value => { handleChange_webcode = value => {
this.webcode = value; this.webcode = value;
@ -56,6 +57,7 @@ class SaleStore {
onChange_Country(value) { onChange_Country(value) {
this.filter_country = value; this.filter_country = value;
} }
// 选择成员关系 // 选择成员关系
onChange_GuestGroupType(value) { onChange_GuestGroupType(value) {
this.filter_guest_type = value; this.filter_guest_type = value;
@ -105,7 +107,7 @@ class SaleStore {
// 按类型获取业绩 // 按类型获取业绩
get_department_order_ml_by_type(date_moment) { get_department_order_ml_by_type(date_moment) {
let result = { dataSource: [], columns: [] }; const result = { dataSource: [], columns: [] };
const date1_start = date_moment.start_date.format(config.DATE_FORMAT); const date1_start = date_moment.start_date.format(config.DATE_FORMAT);
const date1_end = date_moment.end_date.format(config.DATE_FORMAT); const date1_end = date_moment.end_date.format(config.DATE_FORMAT);
const date2_start = comm.empty(date_moment.start_date_cp) ? "" : date_moment.start_date_cp.format(config.DATE_FORMAT); const date2_start = comm.empty(date_moment.start_date_cp) ? "" : date_moment.start_date_cp.format(config.DATE_FORMAT);
@ -281,18 +283,18 @@ class SaleStore {
} else { } else {
// if (this.active_tab_key == "Country") // if (this.active_tab_key == "Country")
// 获取类型的项目,去掉重复,作为列名 // 获取类型的项目,去掉重复,作为列名
let type_name_arr = []; const type_name_arr = [];
json.result1.map(item => { json.result1.map(item => {
type_name_arr[item.SubTypeSN] = { SubTypeSN: item.SubTypeSN, SubTypeName: item.SubTypeName }; type_name_arr[item.SubTypeSN] = { SubTypeSN: item.SubTypeSN, SubTypeName: item.SubTypeName };
}); });
let type_data = []; const type_data = [];
let type_data_arr = []; const type_data_arr = [];
for (let item of json.result1) { for (const item of json.result1) {
let op_sn = "OP_" + item.OPI_SN; //顾问的SN const op_sn = "OP_" + item.OPI_SN; // 顾问的SN
let items = json.result1.filter(d => d.OPI_SN == item.OPI_SN); //筛选出有当前顾问的记录 const items = json.result1.filter(d => d.OPI_SN == item.OPI_SN); // 筛选出有当前顾问的记录
let total_data_value = items.length ? items.reduce((a, b) => a + b.COLI_YJLY, 0) : ""; //记录累加 const total_data_value = items.length ? items.reduce((a, b) => a + b.COLI_YJLY, 0) : ""; // 记录累加
if (comm.empty(type_data[op_sn])) { if (comm.empty(type_data[op_sn])) {
type_data[op_sn] = [{ key: item.OPI_SN }, { T_name: item.OPI_Name }, { T_total: total_data_value }]; type_data[op_sn] = [{ key: item.OPI_SN }, { T_name: item.OPI_Name }, { T_total: total_data_value }];
} }
@ -312,9 +314,9 @@ class SaleStore {
{ title: "合计", children: [{ title: type_data_arr.reduce((a, b) => a + b.T_total, 0), dataIndex: "T_total" }], sorter: (a, b) => b.T_total - a.T_total } { title: "合计", children: [{ title: type_data_arr.reduce((a, b) => a + b.T_total, 0), dataIndex: "T_total" }], sorter: (a, b) => b.T_total - a.T_total }
); );
Object.values(type_name_arr).map((item, index) => { Object.values(type_name_arr).map((item, index) => {
let data_index = "T_" + item.SubTypeSN; const data_index = "T_" + item.SubTypeSN;
let items = type_data_arr.filter(d => d[data_index]); //筛选出有对应类型的记录 const items = type_data_arr.filter(d => d[data_index]); // 筛选出有对应类型的记录
let total_data_value = items.length ? items.reduce((a, b) => a + b[data_index], 0) : ""; //记录累加 const total_data_value = items.length ? items.reduce((a, b) => a + b[data_index], 0) : ""; // 记录累加
result.columns.push({ result.columns.push({
title: item.SubTypeName, title: item.SubTypeName,
children: [{ title: total_data_value, dataIndex: data_index }], children: [{ title: total_data_value, dataIndex: data_index }],
@ -338,7 +340,7 @@ class SaleStore {
// 子维度查询 // 子维度查询
get_department_order_ml_by_type_sub(date_moment, type_sub) { get_department_order_ml_by_type_sub(date_moment, type_sub) {
this.spinning = true; this.spinning = true;
let result = { dataSource: [], columns: [] }; const result = { dataSource: [], columns: [] };
const date1_start = date_moment.start_date.format(config.DATE_FORMAT); const date1_start = date_moment.start_date.format(config.DATE_FORMAT);
const date1_end = date_moment.end_date.format(config.DATE_FORMAT); const date1_end = date_moment.end_date.format(config.DATE_FORMAT);
const date2_start = comm.empty(date_moment.start_date_cp) ? "" : date_moment.start_date_cp.format(config.DATE_FORMAT); const date2_start = comm.empty(date_moment.start_date_cp) ? "" : date_moment.start_date_cp.format(config.DATE_FORMAT);
@ -389,10 +391,10 @@ class SaleStore {
}, },
]; ];
// 数据处理,把相同类型放入同一个数组 // 数据处理,把相同类型放入同一个数组
let type_data = []; const type_data = [];
!comm.empty(json.result1) && !comm.empty(json.result1) &&
Object.values(json.result1).map(item => { Object.values(json.result1).map(item => {
let subtype_sn = "type_" + item.subType; const subtype_sn = "type_" + item.subType;
if (comm.empty(type_data[subtype_sn])) { if (comm.empty(type_data[subtype_sn])) {
type_data[subtype_sn] = { subType: item.subType, subType_name: item.subTypeVal, data: [item] }; type_data[subtype_sn] = { subType: item.subType, subType_name: item.subTypeVal, data: [item] };
} else { } else {

@ -1,4 +1,4 @@
import {makeAutoObservable, runInAction} from "mobx" import {makeAutoObservable, runInAction} from "mobx";
import * as config from "../config"; import * as config from "../config";
import * as req from '../utils/request'; import * as req from '../utils/request';

@ -1,4 +1,4 @@
import {makeAutoObservable, runInAction} from "mobx" import {makeAutoObservable, runInAction} from "mobx";
import * as config from "../config"; import * as config from "../config";
import * as req from '../utils/request'; import * as req from '../utils/request';

@ -50,8 +50,8 @@ export function formatPrice(price) {
// 千分符的金额转成数字默认为0 // 千分符的金额转成数字默认为0
export function price_to_number(price) { export function price_to_number(price) {
let num_string = (price + "").replace(/,/g, ""); const num_string = (price + "").replace(/,/g, "");
let number = parseFloat(num_string); const number = parseFloat(num_string);
return isNaN(number) ? 0 : number; return isNaN(number) ? 0 : number;
} }
@ -128,7 +128,7 @@ export class UrlBuilder {
append(name, value) { append(name, value) {
if (isNotEmpty(value)) { if (isNotEmpty(value)) {
this.paramList.push({ name: name, value: value }); this.paramList.push({ name, value });
} }
return this; return this;
} }
@ -180,10 +180,10 @@ export function debounce(fn, delay = 500) {
} }
export function throttle(fn, delay, atleast) { export function throttle(fn, delay, atleast) {
let timeout = null, let timeout = null;
startTime = new Date(); let startTime = new Date();
return function () { return function () {
let curTime = new Date(); const curTime = new Date();
clearTimeout(timeout); clearTimeout(timeout);
if (curTime - startTime >= atleast) { if (curTime - startTime >= atleast) {
fn(); fn();
@ -228,13 +228,13 @@ export function show_vs_tag(vs, vs_diff, data1, data2) {
// 数组去掉重复 // 数组去掉重复
export function unique(arr) { export function unique(arr) {
let x = new Set(arr); const x = new Set(arr);
return [...x]; return [...x];
} }
export function getWeek(date) { export function getWeek(date) {
// 参数时间戳 // 参数时间戳
let week = moment(date).day(); const week = moment(date).day();
switch (week) { switch (week) {
case 1: case 1:
return "周一"; return "周一";
@ -255,10 +255,10 @@ export function getWeek(date) {
// 把非数字下标的数组设置下标因为非数字数组的length为0导致读取失败 // 把非数字下标的数组设置下标因为非数字数组的length为0导致读取失败
export function set_array_index(result) { export function set_array_index(result) {
let result_array = []; const result_array = [];
let result_keys = Object.keys(result); const result_keys = Object.keys(result);
result_keys.sort(); // 必须做一次排序用for in循环会导致顺序错误 result_keys.sort(); // 必须做一次排序用for in循环会导致顺序错误
for (let key of result_keys) { for (const key of result_keys) {
result_array.push(result[key]); result_array.push(result[key]);
} }
return result_array; return result_array;

@ -1,18 +1,15 @@
import React, { useContext, useEffect } from 'react'; import React, { useContext, useEffect } from 'react';
import { Row, Col, Typography, Space, DatePicker, Button, Select, Table, Divider } from 'antd'; import { Row, Col, Typography, Space, DatePicker, Button, Select, Table, Divider } from 'antd';
import { import { SearchOutlined } from '@ant-design/icons';
SearchOutlined, import { stores_Context } from '../config';
} from '@ant-design/icons'; import * as config from '../config';
import { stores_Context } from '../config'
import * as config from "../config";
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
import moment from "moment"; import moment from 'moment';
import zhCNlocale from 'antd/es/date-picker/locale/zh_CN'; import zhCNlocale from 'antd/es/date-picker/locale/zh_CN';
import { utils, writeFileXLSX } from "xlsx"; import { utils, writeFileXLSX } from 'xlsx';
const AgentGroupCount = () => { const AgentGroupCount = () => {
const { customerServicesStore } = useContext(stores_Context); const { customerServicesStore } = useContext(stores_Context);
const agentList = customerServicesStore.agentList; const agentList = customerServicesStore.agentList;
const agentGroupList = customerServicesStore.agentGroupList; const agentGroupList = customerServicesStore.agentGroupList;
@ -25,7 +22,7 @@ const AgentGroupCount = () => {
const handleSearchClick = () => { const handleSearchClick = () => {
customerServicesStore.fetchAgentGroupCount(); customerServicesStore.fetchAgentGroupCount();
} };
const renderAgentItem = (agent) => { const renderAgentItem = (agent) => {
return ( return (
@ -33,7 +30,7 @@ const AgentGroupCount = () => {
{agent.VEI2_CompanyBN} {agent.VEI2_CompanyBN}
</Select.Option> </Select.Option>
); );
} };
return ( return (
<> <>
@ -42,7 +39,7 @@ const AgentGroupCount = () => {
<Col span={4}> <Col span={4}>
<Select <Select
value={customerServicesStore.selectedAgent} value={customerServicesStore.selectedAgent}
style={{ width: "95%" }} style={{ width: '95%' }}
showSearch showSearch
onSearch={(value) => { onSearch={(value) => {
console.log('search:', value); console.log('search:', value);
@ -50,40 +47,85 @@ const AgentGroupCount = () => {
filterOption={(input, option) => { filterOption={(input, option) => {
return option.children.indexOf(input) > -1; return option.children.indexOf(input) > -1;
}} }}
onChange={(value) => customerServicesStore.selectAgent(value)}> onChange={(value) => customerServicesStore.selectAgent(value)}
<Select.Option key="0" value="">所有地接社</Select.Option> >
<Select.Option key="0" value="">
所有地接社
</Select.Option>
{agentList.map(renderAgentItem)} {agentList.map(renderAgentItem)}
</Select> </Select>
</Col> </Col>
<Col span={4}> <Col span={4}>
<Select <Select
style={{ width: "95%" }} style={{ width: '95%' }}
value={customerServicesStore.selectedTeam} value={customerServicesStore.selectedTeam}
onChange={(value) => customerServicesStore.selectTeam(value)} onChange={(value) => customerServicesStore.selectTeam(value)}
> >
<Select.Option key="0" value="">所有小组</Select.Option> <Select.Option key="0" value="">
<Select.Option key="31" value="1,2,28,7">GH事业部</Select.Option> 所有小组
<Select.Option key="32" value="8,9,11,12,20,21">国际事业部</Select.Option> </Select.Option>
<Select.Option key="33" value="10,18,16,30">孵化学院</Select.Option> <Select.Option key="31" value="1,2,28,7">
<Select.Option key="1" value="1">CH直销</Select.Option> GH事业部
<Select.Option key="2" value="2">CH大客户</Select.Option> </Select.Option>
<Select.Option key="28" value="28">AH</Select.Option> <Select.Option key="32" value="8,9,11,12,20,21">
<Select.Option key="7" value="7">市场推广</Select.Option> 国际事业部
<Select.Option key="8" value="8">德语</Select.Option> </Select.Option>
<Select.Option key="9" value="9">日语</Select.Option> <Select.Option key="33" value="10,18,16,30">
<Select.Option key="11" value="11">法语</Select.Option> 孵化学院
<Select.Option key="12" value="12">西语</Select.Option> </Select.Option>
<Select.Option key="20" value="20">俄语</Select.Option> <Select.Option key="1" value="1">
<Select.Option key="21" value="21">意语</Select.Option> CH直销
<Select.Option key="10" value="10">商旅</Select.Option> </Select.Option>
<Select.Option key="18" value="18">CT</Select.Option> <Select.Option key="2" value="2">
<Select.Option key="16" value="16">APP</Select.Option> CH大客户
<Select.Option key="30" value="30">Trippest</Select.Option> </Select.Option>
<Select.Option key="31" value="31">花梨鹰</Select.Option> <Select.Option key="28" value="28">
AH
</Select.Option>
<Select.Option key="7" value="7">
市场推广
</Select.Option>
<Select.Option key="8" value="8">
德语
</Select.Option>
<Select.Option key="9" value="9">
日语
</Select.Option>
<Select.Option key="11" value="11">
法语
</Select.Option>
<Select.Option key="12" value="12">
西语
</Select.Option>
<Select.Option key="20" value="20">
俄语
</Select.Option>
<Select.Option key="21" value="21">
意语
</Select.Option>
<Select.Option key="10" value="10">
商旅
</Select.Option>
<Select.Option key="18" value="18">
CT
</Select.Option>
<Select.Option key="16" value="16">
APP
</Select.Option>
<Select.Option key="30" value="30">
Trippest
</Select.Option>
<Select.Option key="31" value="31">
花梨鹰
</Select.Option>
</Select> </Select>
</Col> </Col>
<Col span={4}> <Col span={4}>
<Select value={customerServicesStore.selectedCountry} style={{ width: "95%" }} onChange={(value) => customerServicesStore.selectCountry(value)}> <Select
value={customerServicesStore.selectedCountry}
style={{ width: '95%' }}
onChange={(value) => customerServicesStore.selectCountry(value)}
>
<Select.Option key="ALL" value=""> <Select.Option key="ALL" value="">
所有国家 所有国家
</Select.Option> </Select.Option>
@ -96,7 +138,11 @@ const AgentGroupCount = () => {
</Select> </Select>
</Col> </Col>
<Col span={4}> <Col span={4}>
<Select value={dateType} style={{ width: "95%" }} onChange={(value) => customerServicesStore.selectDateType(value)}> <Select
value={dateType}
style={{ width: '95%' }}
onChange={(value) => customerServicesStore.selectDateType(value)}
>
<Select.Option key="startDate" value="startDate"> <Select.Option key="startDate" value="startDate">
走团日期 走团日期
</Select.Option> </Select.Option>
@ -107,19 +153,28 @@ const AgentGroupCount = () => {
</Col> </Col>
<Col span={4}> <Col span={4}>
<DatePicker.RangePicker <DatePicker.RangePicker
format={config.DATE_FORMAT} locale={zhCNlocale} format={config.DATE_FORMAT}
locale={zhCNlocale}
allowClear={false} allowClear={false}
value={[startDate, endDate]} value={[startDate, endDate]}
onChange={(dates) => { customerServicesStore.selectDateRange(dates[0], dates[1]) }} onChange={(dates) => {
customerServicesStore.selectDateRange(dates[0], dates[1]);
}}
ranges={{ ranges={{
'本周': [moment().startOf('week'), moment().endOf('week')], '本周': [moment().startOf('week'), moment().endOf('week')],
'上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')], '上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')],
'本月': [moment().startOf('month'), moment().endOf('month')], '本月': [moment().startOf('month'), moment().endOf('month')],
'上个月': [moment().subtract(1, 'months').startOf('month'), moment(new Date()).subtract(1, 'months').endOf('month')], '上个月': [
moment().subtract(1, 'months').startOf('month'),
moment(new Date()).subtract(1, 'months').endOf('month'),
],
'近30天': [moment().subtract(30, 'days'), moment()], '近30天': [moment().subtract(30, 'days'), moment()],
'近三个月': [moment().subtract(2, 'month').startOf('month'), moment().endOf('month')], '近三个月': [moment().subtract(2, 'month').startOf('month'), moment().endOf('month')],
'今年': [moment().startOf('year').subtract(1, 'month'), moment().endOf('year').subtract(1, 'month')], '今年': [moment().startOf('year').subtract(1, 'month'), moment().endOf('year').subtract(1, 'month')],
'去年': [moment().subtract(1, 'year').startOf('year').subtract(1, 'month'), moment().subtract(1, 'year').endOf('year').subtract(1, 'month')], '去年': [
moment().subtract(1, 'year').startOf('year').subtract(1, 'month'),
moment().subtract(1, 'year').endOf('year').subtract(1, 'month'),
],
}} }}
/> />
</Col> </Col>
@ -130,7 +185,8 @@ const AgentGroupCount = () => {
loading={inProgress} loading={inProgress}
onClick={() => { onClick={() => {
handleSearchClick(); handleSearchClick();
}}> }}
>
统计 统计
</Button> </Button>
</Col> </Col>
@ -146,14 +202,17 @@ const AgentGroupCount = () => {
rowKey={(record) => record.key} rowKey={(record) => record.key}
loading={inProgress} loading={inProgress}
pagination={false} pagination={false}
scroll={{ x: "100%" }} scroll={{ x: '100%' }}
/> />
<Divider orientation="right" plain> <Divider orientation="right" plain>
<a <a
onClick={() => { onClick={() => {
const wb = utils.table_to_book(document.getElementById("agentGroupList").getElementsByTagName("table")[0]); const wb = utils.table_to_book(
writeFileXLSX(wb, "地接社团信息.xlsx"); document.getElementById('agentGroupList').getElementsByTagName('table')[0]
}}> );
writeFileXLSX(wb, '地接社团信息.xlsx');
}}
>
导出excel 导出excel
</a> </a>
</Divider> </Divider>
@ -162,6 +221,6 @@ const AgentGroupCount = () => {
</Space> </Space>
</> </>
); );
} };
export default observer(AgentGroupCount); export default observer(AgentGroupCount);
Loading…
Cancel
Save