完成查询目的接团信息

feature/2.0-sales-trade
Jimmy Liow 3 years ago
parent b92c107522
commit 5980f76fde

@ -15,6 +15,7 @@ import Wechat_session from "./charts/Wechat_session";
import WhatsApp_session from "./charts/WhatsApp_session";
import AgentGroupCount from "./views/AgentGroupCount";
import AgentGroupList from "./views/AgentGroupList";
import DestinationGroupCount from "./views/DestinationGroupCount";
import Credit_card_bill from "./views/Credit_card_bill";
import exchange_rate from "./charts/ExchangeRate";
import Sale from "./views/Sale";
@ -72,6 +73,7 @@ const App = () => {
icon: <WechatOutlined />,
children: [
{ key: 61, label: <NavLink to="/agent/group/count">地接社接团</NavLink> },
{ key: 62, label: <NavLink to="/destination/group/count">目的地接团</NavLink> },
],
}
];
@ -106,6 +108,7 @@ const App = () => {
<Route path="/whatsapp_session" element={<WhatsApp_session />} />
<Route path="/wechat_session" element={<Wechat_session />} />
<Route path="/agent/group/count" element={<AgentGroupCount />} />
<Route path="/destination/group/count" element={<DestinationGroupCount />} />
<Route path="/agent/:agentId/group/list" element={<AgentGroupList />} />
</Route>
<Route element={<ProtectedRoute auth={["admin", "director_bu", "financial"]} />}>

@ -36,7 +36,7 @@ class CustomerServices {
});
}
fetchAgentGroupList() {
fetchAgentGroupCount() {
this.inProgress = true;
const fetchUrl = prepareUrl(config.HT_HOST + '/service-web/QueryData/GetAgentGroupInfoALL')
.append('DateType', this.dateType)
@ -274,6 +274,82 @@ class CustomerServices {
});
}
fetchDestinationGroupCount() {
this.inProgress = true;
const fetchUrl = prepareUrl(config.HT_HOST + '/service-web/QueryData/GetdistGroupInfoAll')
.append('DateType', this.dateType)
.append('Date1', this.startDateString)
.append('Date2', this.endDateString)
.append('OldDate1', this.startDateString)
.append('OldDate2', this.endDateString)
.append('DepList', this.selectedTeam)
.append('Country', this.selectedCountry)
.build();
req.fetchJSON(fetchUrl)
.then(json => {
if (json.errcode === 0) {
runInAction(() => {
this.destinationGroupCount = json.result1;
const total1 = json.total1;
this.destinationGroupCountColumns = [
{
title: '城市',
dataIndex: 'COLD_ServiceCityName',
children: [{
dataIndex: 'COLD_ServiceCityName',
render: (text, record) => <NavLink to={`/destination/${record.COLD_ServiceCity}/group/list`}>{record.COLD_ServiceCityName}</NavLink>
}
]
},
{
title: '团数',
dataIndex: 'GroupCount',
sorter: (a, b) => a.GroupCount - b.GroupCount,
children: [{
title: total1.GroupCount,
dataIndex: 'GroupCount'
}
]
},
{
title: '人数',
dataIndex: 'PersonNum',
sorter: (a, b) => a.PersonNum - b.PersonNum,
children: [{
title: total1.PersonNum,
dataIndex: 'PersonNum'
}
]
},
{
title: '团天数',
dataIndex: 'GroupDays',
sorter: (a, b) => a.GroupDays - b.GroupDays,
children: [{
title: total1.GroupDays,
dataIndex: 'GroupDays'
}
]
},
{
title: '交易额',
dataIndex: 'TotalCost',
sorter: (a, b) => a.TotalCost - b.TotalCost,
children: [{
title: total1.totalcost,
dataIndex: 'TotalCost'
}
]
}
];
});
}
})
.then(() => {
this.inProgress = false;
});
}
selectDateRange(startDate, endDate) {
this.startDate = startDate;
this.endDate = endDate;
@ -313,6 +389,9 @@ class CustomerServices {
groupListColumns = [];
destinationGroupCount = [];
destinationGroupCountColumns =[];
agentGroupList = [{
EOI_ObjSN: 1,
VendorName: '---',

@ -24,7 +24,7 @@ const AgentGroupCount = () => {
}, []);
const handleSearchClick = () => {
customerServicesStore.fetchAgentGroupList();
customerServicesStore.fetchAgentGroupCount();
}
const renderAgentItem = (agent) => {

@ -0,0 +1,148 @@
import React, {useContext, useEffect} from 'react';
import { Row, Col, Typography, Space, DatePicker, Button, Select, Table, Divider } from 'antd';
import {
SearchOutlined,
} from '@ant-design/icons';
import { stores_Context } from '../config'
import * as config from "../config";
import { observer } from 'mobx-react';
import 'moment/locale/zh-cn';
import moment from "moment";
import zhCNlocale from 'antd/es/date-picker/locale/zh_CN';
import { utils, writeFileXLSX } from "xlsx";
const DestinationGroupCount = () => {
const {customerServicesStore} = useContext(stores_Context);
const agentList = customerServicesStore.agentList;
const destinationGroupCount = customerServicesStore.destinationGroupCount;
const destinationGroupCountColumns = customerServicesStore.destinationGroupCountColumns;
const {startDate, endDate, dateType, inProgress} = customerServicesStore;
useEffect(() => {
customerServicesStore.selectCountry('china');
}, []);
const handleSearchClick = () => {
customerServicesStore.fetchDestinationGroupCount();
}
const renderAgentItem = (agent) => {
return (
<Select.Option key={agent.CAV_VEI_SN} value={agent.CAV_VEI_SN}>
{agent.VEI2_CompanyBN}
</Select.Option>
);
}
return (
<>
<Space direction="vertical" style={{ width: '100%' }}>
<Row gutter={{ md: 24 }} justify="end">
<Col span={4}>
<Select
style={{ width: "95%" }}
value={customerServicesStore.selectedTeam}
onChange={(value) => customerServicesStore.selectTeam(value)}
>
<Select.Option key="0" value="">所有小组</Select.Option>
<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 key="33" value="10,18,16,30">孵化学院</Select.Option>
<Select.Option key="1" value="1">CH直销</Select.Option>
<Select.Option key="2" value="2">CH大客户</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>
</Col>
<Col span={4}>
<Select value={customerServicesStore.selectedCountry} style={{ width: "95%" }} onChange={(value) => customerServicesStore.selectCountry(value)}>
<Select.Option key="china" value="china">
国内
</Select.Option>
<Select.Option key="foreign" value="foreign">
国外
</Select.Option>
</Select>
</Col>
<Col span={4}>
<Select value={dateType} style={{ width: "95%" }} onChange={(value) => customerServicesStore.selectDateType(value)}>
<Select.Option key="startDate" value="startDate">
走团日期
</Select.Option>
<Select.Option key="ConfirmDate" value="ConfirmDate">
成团日期
</Select.Option>
</Select>
</Col>
<Col span={4}>
<DatePicker.RangePicker
format={config.DATE_FORMAT} locale={zhCNlocale}
allowClear={false}
value={[startDate, endDate]}
onChange={(dates) => { customerServicesStore.selectDateRange(dates[0], dates[1]) }}
ranges={{
'本周': [moment().startOf('week'), moment().endOf('week')],
'上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')],
'本月': [moment().startOf('month'), moment().endOf('month')],
'上个月': [moment().subtract(1, 'months').startOf('month'), moment(new Date()).subtract(1, 'months').endOf('month')],
'近30天': [moment().subtract(30, 'days'), moment()],
'近三个月': [moment().subtract(2, 'month').startOf('month'), moment().endOf('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')],
}}
/>
</Col>
<Col span={4}>
<Button
type="primary"
icon={<SearchOutlined />}
loading={inProgress}
onClick={() => {
handleSearchClick();
}}>
统计
</Button>
</Col>
</Row>
<Row>
<Col span={24}>
<Typography.Title level={3}>目的地团信息</Typography.Title>
<Table
id="destinationGroupCount"
dataSource={destinationGroupCount}
columns={destinationGroupCountColumns}
size="small"
rowKey={(record) => record.key}
loading={inProgress}
pagination={false}
scroll={{ x: "100%" }}
/>
<Divider orientation="right" plain>
<a
onClick={() => {
const wb = utils.table_to_book(document.getElementById("destinationGroupCount").getElementsByTagName("table")[0]);
writeFileXLSX(wb, "目的地团信息.xlsx");
}}>
导出excel
</a>
</Divider>
</Col>
</Row>
</Space>
</>
);
}
export default observer(DestinationGroupCount);
Loading…
Cancel
Save