diff --git a/src/stores/CustomerServices.js b/src/stores/CustomerServices.js index c932353..22a643e 100644 --- a/src/stores/CustomerServices.js +++ b/src/stores/CustomerServices.js @@ -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() { this.inProgress = true; const fetchUrl = prepareUrl(config.HT_HOST + '/service-web/QueryData/GetdistGroupInfoAll') @@ -627,8 +716,6 @@ class CustomerServices { fetchGroupListByDestinationId(destinationId) { this.inProgress = true; this.destinationName = '...'; - this.destinationGroupList = []; - this.destinationGroupListColumns = []; const fetchUrl = prepareUrl(config.HT_HOST + '/service-web/QueryData/GetdistGroupInfo') .append('city', destinationId) .append('DateType', this.dateType) @@ -780,6 +867,15 @@ class CustomerServices { destinationGroupCount = []; destinationGroupCountColumns =[]; + destinationGroupList = []; + destinationGroupListColumns = []; + // 国籍统计 + nationality_count_data = { + loading: false, + destinationGroupByCountryList:[], + destinationGroupByCountryListColumns:[] + }; + agentGroupList = [{ EOI_ObjSN: 1, VendorName: '---', diff --git a/src/views/DestinationGroupList.jsx b/src/views/DestinationGroupList.jsx index 9d26c39..d9a8385 100644 --- a/src/views/DestinationGroupList.jsx +++ b/src/views/DestinationGroupList.jsx @@ -1,21 +1,24 @@ 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 { observer } from 'mobx-react'; import { NavLink, useParams } from 'react-router-dom'; import 'moment/locale/zh-cn'; import SearchForm from './../components/search/SearchForm'; +import { TableExportBtn } from './../components/Data'; const DestinationGroupList = () => { const { destinationId } = useParams(); const { customerServicesStore, date_picker_store } = useContext(stores_Context); useEffect(() => { + customerServicesStore.fetchDistGroupInfoByCountry(destinationId); customerServicesStore.fetchGroupListByDestinationId(destinationId); }, []); const destinationGroupList = customerServicesStore.destinationGroupList; const destinationGroupListColumns = customerServicesStore.destinationGroupListColumns; + const nationality_count_data = customerServicesStore.nationality_count_data; const { inProgress } = customerServicesStore; return ( @@ -45,11 +48,31 @@ const DestinationGroupList = () => { onSubmit={(_err, obj, form) => { customerServicesStore.setSearchValues(obj, form); customerServicesStore.fetchGroupListByDestinationId(destinationId); + customerServicesStore.fetchDistGroupInfoByCountry(destinationId); customerServicesStore.fetchDestinationGroupCount(); }} /> + + + 国籍统计 + + + + record.key} + loading={nationality_count_data.loading} + pagination={false} + scroll={{ x: 1000 }} + /> + +