|
|
@ -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);
|