客运的统计分析
parent
e0bb45bf6e
commit
e58f32d2b6
@ -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);
|
||||||
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue