perf:客服-目的地:增加国籍统计

main
ZJYHX 1 month ago
parent 73e1dcdb4c
commit 108becd2cd

@ -437,6 +437,95 @@ class CustomerServices {
}); });
} }
fetchDistGroupInfoByCountry(destinationId) {
this.nationality_count_data.loading = true;
const fetchUrl = prepareUrl(config.HT_HOST + '/service-web/QueryData/GetDistGroupInfoALLByCountry')
.append('city', destinationId)
.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)
.append('OrderStatus', this.selectedOrderStatus)
.build();
req.fetchJSON(fetchUrl)
.then((json) => {
if (json.errcode === 0) {
runInAction(() => {
const splitTotalList = groupBy(json.result1, row => row.COLD_ServiceCity === -1 ? '0' : '1');
this.nationality_count_data.destinationGroupByCountryList = splitTotalList['1'];
const total1 = splitTotalList['0']?.[0] || {};
this.nationality_count_data.destinationGroupByCountryListColumns =[
{
title: '国籍',
dataIndex: 'COLD_ServiceCityName',
children: [{
title: total1.COLD_ServiceCityName,
dataIndex: 'COLD_ServiceCityName'
}
]
},
{
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'
}
]
},
{
title: '报价',
dataIndex: 'TotalPrice',
sorter: (a, b) => a.TotalPrice - b.TotalPrice,
children: [{
title: total1.TotalPrice,
dataIndex: 'TotalPrice'
}
]
}
];
});
}
})
.then(() => {
this.nationality_count_data.loading = false;
});
}
fetchDestinationGroupCount() { fetchDestinationGroupCount() {
this.inProgress = true; this.inProgress = true;
const fetchUrl = prepareUrl(config.HT_HOST + '/service-web/QueryData/GetdistGroupInfoAll') const fetchUrl = prepareUrl(config.HT_HOST + '/service-web/QueryData/GetdistGroupInfoAll')
@ -627,8 +716,6 @@ class CustomerServices {
fetchGroupListByDestinationId(destinationId) { fetchGroupListByDestinationId(destinationId) {
this.inProgress = true; this.inProgress = true;
this.destinationName = '...'; this.destinationName = '...';
this.destinationGroupList = [];
this.destinationGroupListColumns = [];
const fetchUrl = prepareUrl(config.HT_HOST + '/service-web/QueryData/GetdistGroupInfo') const fetchUrl = prepareUrl(config.HT_HOST + '/service-web/QueryData/GetdistGroupInfo')
.append('city', destinationId) .append('city', destinationId)
.append('DateType', this.dateType) .append('DateType', this.dateType)
@ -780,6 +867,15 @@ class CustomerServices {
destinationGroupCount = []; destinationGroupCount = [];
destinationGroupCountColumns =[]; destinationGroupCountColumns =[];
destinationGroupList = [];
destinationGroupListColumns = [];
// 国籍统计
nationality_count_data = {
loading: false,
destinationGroupByCountryList:[],
destinationGroupByCountryListColumns:[]
};
agentGroupList = [{ agentGroupList = [{
EOI_ObjSN: 1, EOI_ObjSN: 1,
VendorName: '---', VendorName: '---',

@ -1,21 +1,24 @@
import { useContext, useEffect } from 'react'; import { useContext, useEffect } from 'react';
import { Row, Col, Space, Table, List } from 'antd'; import { Row, Col, Space, Table, List, Typography, Divider } from 'antd';
import { stores_Context } from '../config'; import { stores_Context } from '../config';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import { NavLink, useParams } from 'react-router-dom'; import { NavLink, useParams } from 'react-router-dom';
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
import SearchForm from './../components/search/SearchForm'; import SearchForm from './../components/search/SearchForm';
import { TableExportBtn } from './../components/Data';
const DestinationGroupList = () => { const DestinationGroupList = () => {
const { destinationId } = useParams(); const { destinationId } = useParams();
const { customerServicesStore, date_picker_store } = useContext(stores_Context); const { customerServicesStore, date_picker_store } = useContext(stores_Context);
useEffect(() => { useEffect(() => {
customerServicesStore.fetchDistGroupInfoByCountry(destinationId);
customerServicesStore.fetchGroupListByDestinationId(destinationId); customerServicesStore.fetchGroupListByDestinationId(destinationId);
}, []); }, []);
const destinationGroupList = customerServicesStore.destinationGroupList; const destinationGroupList = customerServicesStore.destinationGroupList;
const destinationGroupListColumns = customerServicesStore.destinationGroupListColumns; const destinationGroupListColumns = customerServicesStore.destinationGroupListColumns;
const nationality_count_data = customerServicesStore.nationality_count_data;
const { inProgress } = customerServicesStore; const { inProgress } = customerServicesStore;
return ( return (
@ -45,11 +48,31 @@ const DestinationGroupList = () => {
onSubmit={(_err, obj, form) => { onSubmit={(_err, obj, form) => {
customerServicesStore.setSearchValues(obj, form); customerServicesStore.setSearchValues(obj, form);
customerServicesStore.fetchGroupListByDestinationId(destinationId); customerServicesStore.fetchGroupListByDestinationId(destinationId);
customerServicesStore.fetchDistGroupInfoByCountry(destinationId);
customerServicesStore.fetchDestinationGroupCount(); customerServicesStore.fetchDestinationGroupCount();
}} }}
/> />
</Col> </Col>
</Row> </Row>
<Row>
<Col span={24}>
<Typography.Title level={3}>国籍统计</Typography.Title>
<Divider orientation="right" plain>
<TableExportBtn label={'国籍统计'} {...{ columns: nationality_count_data.destinationGroupByCountryListColumns, dataSource: nationality_count_data.destinationGroupByCountryList }} />
</Divider>
<Table
sticky
id="destinationGroupByCountry"
dataSource={nationality_count_data.destinationGroupByCountryList}
columns={nationality_count_data.destinationGroupByCountryListColumns}
size="small"
rowKey={(record) => record.key}
loading={nationality_count_data.loading}
pagination={false}
scroll={{ x: 1000 }}
/>
</Col>
</Row>
<Row> <Row>
<Col span={24}> <Col span={24}>
<Table <Table

Loading…
Cancel
Save