客运的统计分析

feature/2.0-sales-trade
尹诚诚 3 years ago
parent e0bb45bf6e
commit e58f32d2b6

@ -5,6 +5,7 @@ import {
TeamOutlined, TeamOutlined,
DashboardOutlined, DashboardOutlined,
FileProtectOutlined, FileProtectOutlined,
CustomerServiceTwoTone,
} from '@ant-design/icons'; } from '@ant-design/icons';
import {Layout, Menu, Image} from 'antd'; import {Layout, Menu, Image} from 'antd';
import {BrowserRouter, Route, Routes, NavLink} from "react-router-dom" import {BrowserRouter, Route, Routes, NavLink} from "react-router-dom"
@ -12,17 +13,14 @@ import Home from "./views/Home"
import Dashboard from "./views/Dashboard" import Dashboard from "./views/Dashboard"
import Orders from "./views/Orders" import Orders from "./views/Orders"
import Orders_sub from "./views/Orders_sub" import Orders_sub from "./views/Orders_sub"
import Orders_index from "./charts/Orders" import Customer_care_inchina from "./charts/Customer_care_inchina"
import Customer_care_potential from "./charts/Customer_care_potential"
import Customer_care_regular from "./charts/Customer_care_regular"
import Logo from './logo.png' import Logo from './logo.png'
class App extends Component { class App extends Component {
constructor(props) {
super(props);
this.stores = this.props.stores;
}
render() { render() {
const {Content, Footer, Sider} = Layout; const {Content, Footer, Sider} = Layout;
@ -30,7 +28,14 @@ class App extends Component {
const menu_items = [ const menu_items = [
{key: 1, label: <NavLink to="/">主页</NavLink>, icon: <HomeOutlined/>}, {key: 1, label: <NavLink to="/">主页</NavLink>, icon: <HomeOutlined/>},
{key: 2, label: <NavLink to="/orders">订单数据</NavLink>, icon: <FileProtectOutlined/>,}, {key: 2, label: <NavLink to="/orders">订单数据</NavLink>, icon: <FileProtectOutlined/>,},
{key: 3, label: <NavLink to="/dashboard">仪表盘</NavLink>, icon: <DashboardOutlined/>}, {
key: 3, label: '客运', icon: <CustomerServiceTwoTone/>,
children: [
{key: 31, label: <NavLink to="/customer_care_potential">潜力客户</NavLink>},
{key: 32, label: <NavLink to="/customer_care_regular">老客户</NavLink>},
{key: 33, label: <NavLink to="/customer_care_inchina">在华客户</NavLink>},
]
},
{ {
key: 4, key: 4,
label: '财务', label: '财务',
@ -40,6 +45,7 @@ class App extends Component {
{key: 41, label: <NavLink to="/order">信用卡账单</NavLink>}, {key: 41, label: <NavLink to="/order">信用卡账单</NavLink>},
] ]
}, },
{key: 5, label: <NavLink to="/dashboard">仪表盘</NavLink>, icon: <DashboardOutlined/>},
]; ];
@ -53,7 +59,7 @@ class App extends Component {
<Sider collapsible={false} defaultCollapsed={false} breakpoint="lg" <Sider collapsible={false} defaultCollapsed={false} breakpoint="lg"
collapsedWidth="0"> collapsedWidth="0">
<Image src={Logo} preview={false}/> <Image src={Logo} preview={false}/>
<Menu theme="dark" defaultSelectedKeys={['1']} mode="inline" items={menu_items}/> <Menu theme="dark" defaultSelectedKeys={['1']} defaultOpenKeys={['3']} mode="inline" items={menu_items}/>
</Sider> </Sider>
<Layout className="site-layout"> <Layout className="site-layout">
<Content style={{ <Content style={{
@ -63,7 +69,11 @@ class App extends Component {
<Routes> <Routes>
<Route path="/" element={<Home/>}/> <Route path="/" element={<Home/>}/>
<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="/customer_care_inchina" element={<Customer_care_inchina/>}/>
<Route path="/customer_care_regular" element={<Customer_care_regular/>}/>
<Route path="/customer_care_potential" element={<Customer_care_potential/>}/>
<Route path="/dashboard" element={<Dashboard/>}/> <Route path="/dashboard" element={<Dashboard/>}/>
</Routes> </Routes>
</Content> </Content>

@ -0,0 +1,191 @@
import React, {useContext, useEffect} from 'react';
import {Row, Col, Button, Divider, Table, Space, Radio} from 'antd';
import {
ContainerOutlined,
SearchOutlined,
} from '@ant-design/icons';
import {stores_Context} from '../config'
import {Line} from "@ant-design/charts";
import {observer} from 'mobx-react';
import DatePickerCharts from '../charts/DatePickerCharts'
import {NavLink, useParams} from "react-router-dom";
import * as comm from "../utils/commons";
import * as config from "../config";
import SiteSelect from "../charts/SiteSelect";
import GroupSelect from "../charts/GroupSelect";
const Customer_care_inchina = () => {
const {orders_store, date_picker_store, customer_store} = useContext(stores_Context);
const inchina_data = customer_store.inchina_data;
useEffect(() => {
}, [])
return (
<div>
<Row>
<Col span={12}>
<h2>在华客人</h2>
</Col>
<Col span={11}>
<Row>
<Col span={6}>
<SiteSelect store={inchina_data} show_all={true}/>
</Col>
<Col span={18}> <GroupSelect store={inchina_data}/></Col>
<Col span={10}>
<DatePickerCharts hide_vs={true}/>
</Col>
<Col span={14}>
<Space>
<Radio.Group value={inchina_data.date_type}
onChange={inchina_data.onChange_datetype}>
<Radio value="applyDate">预定日期</Radio>
<Radio value="startDate">出发日期</Radio>
</Radio.Group>
<Button type="primary" icon={<SearchOutlined/>} loading={inchina_data.loading}
onClick={() => {
inchina_data.show_detail = false;
inchina_data.inchina_customer_order();
}}>统计</Button>
<Button type="primary" icon={<SearchOutlined/>} loading={inchina_data.loading_detail}
onClick={() => {
inchina_data.show_detail = true;
inchina_data.inchina_customer_order();
}}>详情</Button>
</Space>
</Col>
</Row>
</Col>
<Col span={1}></Col>
<Col span={24}>
<Table dataSource={inchina_data.data} columns={
[
{
title: '统计条目',
dataIndex: 'ItemName',
key: 'ItemName',
},
{
title: '订单数',
dataIndex: 'OrderNum',
key: 'OrderNum',
},
{
title: '成行数',
dataIndex: 'SUCOrderNum',
key: 'SUCOrderNum',
},
{
title: '成行率',
dataIndex: 'SUCRate',
key: 'SUCRate',
render: (text, record) => <span>{text * 100}%</span>
},
{
title: '毛利',
dataIndex: 'ML',
key: 'ML',
},
{
title: '人数(含成人+儿童)',
dataIndex: 'PersonNum',
key: 'PersonNum',
},
]
} size="small" pagination={false} rowKey={record => record.OrderNum}
/>
</Col>
<Col span={24}>
<Divider orientation="right"><a
onClick={() => inchina_data.onChange_show_detail_table()}>{inchina_data.show_detail_table ? '隐藏列表' : '显示列表'}</a> |
导出excel</Divider>
{inchina_data.show_detail_table ?
<Table dataSource={inchina_data.data_detail} columns={
[
{
title: '订单号',
dataIndex: 'COLI_ID',
key: 'COLI_ID',
},
{
title: '预定日期',
dataIndex: 'COLI_ApplyDate',
key: 'COLI_ApplyDate',
},
{
title: '订单状态',
dataIndex: 'OrderState',
key: 'OrderState',
},
{
title: '毛利',
dataIndex: 'ML',
key: 'ML',
},
{
title: '人数',
dataIndex: 'PersonNum',
key: 'PersonNum',
},
{
title: '天数',
dataIndex: 'COLI_Days',
key: 'COLI_Days',
},
{
title: '人天数',
dataIndex: 'CGI_PersonDays',
key: 'CGI_PersonDays',
},
{
title: '走团日期',
dataIndex: 'COLI_OrderStartDate',
key: 'COLI_OrderStartDate',
},
{
title: '小组',
dataIndex: 'Department',
key: 'Department',
},
{
title: '老客户',
dataIndex: 'COLI_IsOld',
key: 'COLI_IsOld',
},
{
title: '老客户推荐',
dataIndex: 'COLI_IsCusCommend',
key: 'COLI_IsCusCommend',
},
{
title: '网站',
dataIndex: 'COLI_WebCode',
key: 'COLI_WebCode',
},
{
title: '来源',
dataIndex: 'SourceType',
key: 'SourceType',
},
{
title: '在华',
dataIndex: 'ZH',
key: 'ZH',
},
]
} size="small"
rowKey={record => record.COLI_ID}
/>
: ''}
</Col>
</Row>
</div>
);
}
export default observer(Customer_care_inchina);

@ -0,0 +1,187 @@
import React, {useContext, useEffect} from 'react';
import {Row, Col, Button, Divider, Table, Space, Radio} from 'antd';
import {
ContainerOutlined,
SearchOutlined,
} from '@ant-design/icons';
import {stores_Context} from '../config'
import {Line} from "@ant-design/charts";
import {observer} from 'mobx-react';
import DatePickerCharts from '../charts/DatePickerCharts'
import {NavLink, useParams} from "react-router-dom";
import * as comm from "../utils/commons";
import * as config from "../config";
import SiteSelect from "../charts/SiteSelect";
import GroupSelect from "../charts/GroupSelect";
const Customer_care_potential = () => {
const {orders_store, date_picker_store, customer_store} = useContext(stores_Context);
const potential_data = customer_store.potential_data;
useEffect(() => {
}, [])
return (
<div>
<Row>
<Col span={12}>
<h2>潜力客户</h2>
</Col>
<Col span={11}>
<Row>
<Col span={6}>
<SiteSelect store={potential_data} show_all={true}/>
</Col>
<Col span={18}> <GroupSelect store={potential_data}/></Col>
<Col span={10}>
<DatePickerCharts hide_vs={true}/>
</Col>
<Col span={14}>
<Space>
<Radio.Group value={potential_data.date_type}
onChange={potential_data.onChange_datetype}>
<Radio value="applyDate">预定日期</Radio>
<Radio value="startDate">出发日期</Radio>
</Radio.Group>
<Button type="primary" icon={<SearchOutlined/>} loading={potential_data.loading}
onClick={() => {
potential_data.show_detail = false;
potential_data.potential_customer_order();
}}>统计</Button>
<Button type="primary" icon={<SearchOutlined/>} loading={potential_data.loading_detail}
onClick={() => {
potential_data.show_detail = true;
potential_data.potential_customer_order();
}}>详情</Button>
</Space>
</Col>
</Row>
</Col>
<Col span={1}></Col>
<Col span={24}>
<Table dataSource={potential_data.data} columns={
[
{
title: '订单数',
dataIndex: 'OrderNum',
key: 'OrderNum',
},
{
title: '成行数',
dataIndex: 'SUCOrderNum',
key: 'SUCOrderNum',
},
{
title: '成行率',
dataIndex: 'SUCRate',
key: 'SUCRate',
render: (text, record) => <span>{text * 100}%</span>
},
{
title: '毛利',
dataIndex: 'ML',
key: 'ML',
},
{
title: '人数(含成人+儿童)',
dataIndex: 'PersonNum',
key: 'PersonNum',
},
]
} size="small" pagination={false} rowKey={record => record.OrderNum}
/>
</Col>
<Col span={24}>
<Divider orientation="right"><a
onClick={() => potential_data.onChange_show_detail_table()}>{potential_data.show_detail_table ? '隐藏列表' : '显示列表'}</a> |
导出excel</Divider>
{potential_data.show_detail_table ?
<Table dataSource={potential_data.data_detail} columns={
[
{
title: '订单号',
dataIndex: 'COLI_ID',
key: 'COLI_ID',
},
{
title: '预定日期',
dataIndex: 'COLI_ApplyDate',
key: 'COLI_ApplyDate',
},
{
title: '订单状态',
dataIndex: 'OrderState',
key: 'OrderState',
},
{
title: '毛利',
dataIndex: 'ML',
key: 'ML',
},
{
title: '人数',
dataIndex: 'PersonNum',
key: 'PersonNum',
},
{
title: '天数',
dataIndex: 'COLI_Days',
key: 'COLI_Days',
},
{
title: '人天数',
dataIndex: 'CGI_PersonDays',
key: 'CGI_PersonDays',
},
{
title: '走团日期',
dataIndex: 'COLI_OrderStartDate',
key: 'COLI_OrderStartDate',
},
{
title: '小组',
dataIndex: 'Department',
key: 'Department',
},
{
title: '老客户',
dataIndex: 'COLI_IsOld',
key: 'COLI_IsOld',
},
{
title: '老客户推荐',
dataIndex: 'COLI_IsCusCommend',
key: 'COLI_IsCusCommend',
},
{
title: '网站',
dataIndex: 'COLI_WebCode',
key: 'COLI_WebCode',
},
{
title: '来源',
dataIndex: 'SourceType',
key: 'SourceType',
},
{
title: '在华',
dataIndex: 'ZH',
key: 'ZH',
},
]
} size="small"
rowKey={record => record.COLI_ID}
/>
: ''}
</Col>
</Row>
</div>
);
}
export default observer(Customer_care_potential);

@ -0,0 +1,192 @@
import React, {useContext, useEffect} from 'react';
import {Row, Col, Button, Divider, Table, Space, Radio} from 'antd';
import {
ContainerOutlined,
SearchOutlined,
} from '@ant-design/icons';
import {stores_Context} from '../config'
import {Line} from "@ant-design/charts";
import {observer} from 'mobx-react';
import DatePickerCharts from '../charts/DatePickerCharts'
import {NavLink, useParams} from "react-router-dom";
import * as comm from "../utils/commons";
import * as config from "../config";
import SiteSelect from "../charts/SiteSelect";
import GroupSelect from "../charts/GroupSelect";
const Customer_care_regular = () => {
const {orders_store, date_picker_store, customer_store} = useContext(stores_Context);
const regular_data = customer_store.regular_data;
useEffect(() => {
}, [])
return (
<div>
<Row>
<Col span={12}>
<h2>老客户</h2>
</Col>
<Col span={11}>
<Row>
<Col span={6}>
<SiteSelect store={regular_data} show_all={true}/>
</Col>
<Col span={18}> <GroupSelect store={regular_data}/></Col>
<Col span={10}>
<DatePickerCharts hide_vs={true}/>
</Col>
<Col span={14}>
<Space>
<Radio.Group value={regular_data.date_type}
onChange={regular_data.onChange_datetype}>
<Radio value="applyDate">预定日期</Radio>
<Radio value="startDate">出发日期</Radio>
</Radio.Group>
<Button type="primary" icon={<SearchOutlined/>} loading={regular_data.loading}
onClick={() => {
regular_data.show_detail = false;
regular_data.regular_customer_order();
}}>统计</Button>
<Button type="primary" icon={<SearchOutlined/>} loading={regular_data.loading_detail}
onClick={() => {
regular_data.show_detail = true;
regular_data.regular_customer_order();
}}>详情</Button>
</Space>
</Col>
</Row>
</Col>
<Col span={1}></Col>
<Col span={24}>
<Table dataSource={regular_data.data} columns={
[
{
title: '统计条目',
dataIndex: 'ItemName',
key: 'ItemName',
},
{
title: '订单数',
dataIndex: 'OrderNum',
key: 'OrderNum',
},
{
title: '成行数',
dataIndex: 'SUCOrderNum',
key: 'SUCOrderNum',
},
{
title: '成行率',
dataIndex: 'SUCRate',
key: 'SUCRate',
render: (text, record) => <span>{text * 100}%</span>
},
{
title: '毛利',
dataIndex: 'ML',
key: 'ML',
},
{
title: '人数(含成人+儿童)',
dataIndex: 'PersonNum',
key: 'PersonNum',
},
]
} size="small" pagination={false} rowKey={record => record.OrderNum}
/>
</Col>
<Col span={24}>
<Divider orientation="right"><a
onClick={() => regular_data.onChange_show_detail_table()}>{regular_data.show_detail_table ? '隐藏列表' : '显示列表'}</a> |
导出excel</Divider>
{regular_data.show_detail_table ?
<Table dataSource={regular_data.data_detail} columns={
[
{
title: '订单号',
dataIndex: 'COLI_ID',
key: 'COLI_ID',
},
{
title: '预定日期',
dataIndex: 'COLI_ApplyDate',
key: 'COLI_ApplyDate',
},
{
title: '订单状态',
dataIndex: 'OrderState',
key: 'OrderState',
},
{
title: '毛利',
dataIndex: 'ML',
key: 'ML',
},
{
title: '人数',
dataIndex: 'PersonNum',
key: 'PersonNum',
},
{
title: '天数',
dataIndex: 'COLI_Days',
key: 'COLI_Days',
},
{
title: '人天数',
dataIndex: 'CGI_PersonDays',
key: 'CGI_PersonDays',
},
{
title: '走团日期',
dataIndex: 'COLI_OrderStartDate',
key: 'COLI_OrderStartDate',
},
{
title: '小组',
dataIndex: 'Department',
key: 'Department',
},
{
title: '老客户',
dataIndex: 'COLI_IsOld',
key: 'COLI_IsOld',
},
{
title: '老客户推荐',
dataIndex: 'COLI_IsCusCommend',
key: 'COLI_IsCusCommend',
},
{
title: '网站',
dataIndex: 'COLI_WebCode',
key: 'COLI_WebCode',
},
{
title: '来源',
dataIndex: 'SourceType',
key: 'SourceType',
},
{
title: '在华',
dataIndex: 'ZH',
key: 'ZH',
},
]
} size="small"
rowKey={record => record.COLI_ID}
/>
: ''}
</Col>
</Row>
</div>
);
}
export default observer(Customer_care_regular);

@ -1,6 +1,6 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Select} from 'antd'; import {Select} from 'antd';
import { observer } from 'mobx-react'; import {observer} from 'mobx-react';
class SiteSelect extends Component { class SiteSelect extends Component {
@ -10,7 +10,7 @@ class SiteSelect extends Component {
render() { render() {
const store=this.props.store; const store = this.props.store;
return ( return (
<div> <div>
<Select <Select
@ -20,7 +20,7 @@ class SiteSelect extends Component {
defaultValue={store.webcode} defaultValue={store.webcode}
onChange={store.handleChange_webcode} onChange={store.handleChange_webcode}
> >
{/*<Select.Option key="1" value="ALL">ALL</Select.Option>*/} {this.props.show_all ? <Select.Option key="1" value="ALL">ALL</Select.Option> : ''}
<Select.Option key="2" value="CHT">CHT</Select.Option> <Select.Option key="2" value="CHT">CHT</Select.Option>
<Select.Option key="8" value="AH">AH</Select.Option> <Select.Option key="8" value="AH">AH</Select.Option>
<Select.Option key="9" value="GH">GH</Select.Option> <Select.Option key="9" value="GH">GH</Select.Option>

@ -0,0 +1,249 @@
import {makeAutoObservable, runInAction} from "mobx";
import * as config from "../config";
class CustomerStore {
constructor(rootStore) {
this.rootStore = rootStore;
makeAutoObservable(this);
}
// 潜力客户 beign
potential_customer_order() {
const date_picker_store = this.rootStore.date_picker_store;
let url = '/service-tourdesign/PotentialCusOrder'
url += '?Website=' + this.potential_data.webcode + '&DEI_SNList=' + this.potential_data.groups.toString();
if (this.potential_data.date_type == 'applyDate') {
url += '&ApplydateCheck=1&EntrancedateCheck=0';
} else {
url += '&ApplydateCheck=0&EntrancedateCheck=1';
}
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';
if (this.potential_data.show_detail) {
url += '&IsDetail=1'
this.potential_data.loading_detail = true;
this.potential_data.show_detail_table = true;
} else {
url += '&IsDetail=0'
this.potential_data.loading = true;
}
fetch(config.HT_HOST + url)
.then((response) => response.json())
.then((json) => {
runInAction(() => {
if (this.potential_data.show_detail) {
this.potential_data.data_detail = json;
} else {
this.potential_data.data = json;
}
this.potential_data.loading = false;
this.potential_data.loading_detail = false;
})
})
.catch((error) => {
this.potential_data.loading = false;
this.potential_data.loading_detail = false;
console.log('fetch data failed', error);
});
}
handleChange_webcode = (value) => {
this.potential_data.webcode = value;
};
handleChange_group_select(value) {
this.potential_data.groups = value;
};
onChange_datetype(e) {
this.potential_data.date_type = e.target.value;
};
onChange_show_detail_table() {
this.potential_data.show_detail_table = !this.potential_data.show_detail_table;
}
potential_data = {
loading: false,
loading_detail: false,
show_detail: false,
show_detail_table: false,
data: [],
data_detail: [],
webcode: 'GHKYHW',
site_select_mode: false,//站点是否多选
group_select_mode: 'multiple',//是否多选分组
groups: ['1', '2', '28', '7'],
date_type: 'applyDate',
handleChange: this.handleChange_group_select.bind(this),
onChange_datetype: this.onChange_datetype.bind(this),
potential_customer_order: this.potential_customer_order.bind(this),
onChange_show_detail_table: this.onChange_show_detail_table.bind(this),
handleChange_webcode: this.handleChange_webcode.bind(this),
}
// 潜力客户 end
// 老客户 beign
regular_customer_order() {
const date_picker_store = this.rootStore.date_picker_store;
let url = '/service-tourdesign/RegularCusOrder'
url += '?Website=' + this.regular_data.webcode + '&DEI_SNList=' + this.regular_data.groups.toString();
if (this.regular_data.date_type == 'applyDate') {
url += '&ApplydateCheck=1&EntrancedateCheck=0';
} else {
url += '&ApplydateCheck=0&EntrancedateCheck=1';
}
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';
if (this.regular_data.show_detail) {
url += '&IsDetail=1'
this.regular_data.loading_detail = true;
this.regular_data.show_detail_table = true;
} else {
url += '&IsDetail=0'
this.regular_data.loading = true;
}
fetch(config.HT_HOST + url)
.then((response) => response.json())
.then((json) => {
runInAction(() => {
if (this.regular_data.show_detail) {
this.regular_data.data_detail = json;
} else {
this.regular_data.data = json;
}
this.regular_data.loading = false;
this.regular_data.loading_detail = false;
})
})
.catch((error) => {
this.regular_data.loading = false;
this.regular_data.loading_detail = false;
console.log('fetch data failed', error);
});
}
handleChange_webcode_regular = (value) => {
this.regular_data.webcode = value;
};
handleChange_group_select_regular(value) {
this.regular_data.groups = value;
};
onChange_datetype_regular(e) {
this.regular_data.date_type = e.target.value;
};
onChange_show_detail_table_regular() {
this.regular_data.show_detail_table = !this.regular_data.show_detail_table;
}
regular_data = {
loading: false,
loading_detail: false,
show_detail: false,
show_detail_table: false,
data: [],
data_detail: [],
webcode: 'ALL',
site_select_mode: false,//站点是否多选
group_select_mode: 'multiple',//是否多选分组
groups: ['1', '2', '28', '7'],
date_type: 'applyDate',
handleChange: this.handleChange_group_select_regular.bind(this),
onChange_datetype: this.onChange_datetype_regular.bind(this),
regular_customer_order: this.regular_customer_order.bind(this),
onChange_show_detail_table: this.onChange_show_detail_table_regular.bind(this),
handleChange_webcode: this.handleChange_webcode_regular.bind(this),
}
// 老客户 end
// 老客户 beign
inchina_customer_order() {
const date_picker_store = this.rootStore.date_picker_store;
let url = '/service-tourdesign/RegularCusOrder'
url += '?Website=' + this.inchina_data.webcode + '&DEI_SNList=' + this.inchina_data.groups.toString();
if (this.inchina_data.date_type == 'applyDate') {
url += '&ApplydateCheck=1&EntrancedateCheck=0';
} else {
url += '&ApplydateCheck=0&EntrancedateCheck=1';
}
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';
if (this.inchina_data.show_detail) {
url += '&IsDetail=1'
this.inchina_data.loading_detail = true;
this.inchina_data.show_detail_table = true;
} else {
url += '&IsDetail=0'
this.inchina_data.loading = true;
}
fetch(config.HT_HOST + url)
.then((response) => response.json())
.then((json) => {
runInAction(() => {
if (this.inchina_data.show_detail) {
this.inchina_data.data_detail = json;
} else {
this.inchina_data.data = json;
}
this.inchina_data.loading = false;
this.inchina_data.loading_detail = false;
})
})
.catch((error) => {
this.inchina_data.loading = false;
this.inchina_data.loading_detail = false;
console.log('fetch data failed', error);
});
}
handleChange_webcode_inchina = (value) => {
this.inchina_data.webcode = value;
};
handleChange_group_select_inchina(value) {
this.inchina_data.groups = value;
};
onChange_datetype_inchina(e) {
this.inchina_data.date_type = e.target.value;
};
onChange_show_detail_table_inchina() {
this.inchina_data.show_detail_table = !this.inchina_data.show_detail_table;
}
inchina_data = {
loading: false,
loading_detail: false,
show_detail: false,
show_detail_table: false,
data: [],
data_detail: [],
webcode: 'ALL',
site_select_mode: false,//站点是否多选
group_select_mode: 'multiple',//是否多选分组
groups: ['1', '2', '28', '7'],
date_type: 'applyDate',
handleChange: this.handleChange_group_select_inchina.bind(this),
onChange_datetype: this.onChange_datetype_inchina.bind(this),
inchina_customer_order: this.inchina_customer_order.bind(this),
onChange_show_detail_table: this.onChange_show_detail_table_inchina.bind(this),
handleChange_webcode: this.handleChange_webcode_inchina.bind(this),
}
// 老客户 end
}
export default CustomerStore;

@ -2,6 +2,7 @@ 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";
import CustomerStore from "./CustomerStore";
class Index { class Index {
@ -9,16 +10,10 @@ class Index {
this.dashboard_store = new DashboardStore(this); this.dashboard_store = new DashboardStore(this);
this.orders_store = new OrdersStore(this); this.orders_store = new OrdersStore(this);
this.date_picker_store = new DatePickerStore(this); this.date_picker_store = new DatePickerStore(this);
this.customer_store = new CustomerStore(this);
makeAutoObservable(this); makeAutoObservable(this);
} }
goBack() {
this.history.goBack();
}
dashboard_store={}
orders_store={}
date_picker_store={}
animating = false;
} }
export default Index; export default Index;
Loading…
Cancel
Save