diff --git a/src/App.js b/src/App.js index 6807383..f209d8f 100644 --- a/src/App.js +++ b/src/App.js @@ -16,6 +16,7 @@ import WhatsApp_session from "./charts/WhatsApp_session"; import AgentGroupCount from "./views/AgentGroupCount"; import AgentGroupList from "./views/AgentGroupList"; import DestinationGroupCount from "./views/DestinationGroupCount"; +import DestinationGroupList from "./views/DestinationGroupList"; import Credit_card_bill from "./views/Credit_card_bill"; import exchange_rate from "./charts/ExchangeRate"; import Sale from "./views/Sale"; @@ -109,7 +110,8 @@ const App = () => { } /> } /> } /> - } /> + } /> + } /> }> } /> diff --git a/src/stores/CustomerServices.js b/src/stores/CustomerServices.js index 3d2fc54..5689b40 100644 --- a/src/stores/CustomerServices.js +++ b/src/stores/CustomerServices.js @@ -350,6 +350,97 @@ 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) + .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.destinationGroupList = json.result1; + if (json.result1.length > 0) { + // this.destinationName = json.result1[0].VendorName; + } + const total1 = json.total1; + this.destinationGroupListColumns = [ + { + title: '团名', + dataIndex: 'GRI_Name', + children: [{ + title: '', + dataIndex: 'GRI_Name' + } + ] + }, + { + title: '人数', + dataIndex: 'COLI_PersonNum', + sorter: (a, b) => a.COLI_PersonNum - b.COLI_PersonNum, + children: [{ + title: total1.COLI_PersonNum, + dataIndex: 'COLI_PersonNum' + } + ] + }, + { + title: '天数', + dataIndex: 'COLI_Days', + sorter: (a, b) => a.COLI_Days - b.COLI_Days, + children: [{ + title: total1.COLI_Days, + dataIndex: 'COLI_Days' + } + ] + }, + { + title: '交易额', + dataIndex: 'COLD_TotalCost', + sorter: (a, b) => a.COLD_TotalCost - b.COLD_TotalCost, + children: [{ + title: total1.COLD_TotalCost, + dataIndex: 'COLD_TotalCost' + } + ] + }, + { + title: '确认日期', + dataIndex: 'COLI_ConfirmDate', + children: [{ + title: '-', + dataIndex: 'COLI_ConfirmDate' + } + ] + }, + { + title: '出发日期', + dataIndex: 'COLI_OrderStartDate', + children: [{ + title: '-', + dataIndex: 'COLI_OrderStartDate' + } + ] + } + ]; + }); + } + }) + .then(() => { + this.inProgress = false; + }); + } + selectDateRange(startDate, endDate) { this.startDate = startDate; this.endDate = endDate; diff --git a/src/views/DestinationGroupList.js b/src/views/DestinationGroupList.js new file mode 100644 index 0000000..0fcfb15 --- /dev/null +++ b/src/views/DestinationGroupList.js @@ -0,0 +1,142 @@ +import React, {useContext, useEffect} from 'react'; +import {Row, Col, Typography, Space, DatePicker, Button, Select, Table, List} from 'antd'; +import { + SearchOutlined, +} from '@ant-design/icons'; +import {stores_Context} from '../config' +import * as config from "../config"; +import {observer} from 'mobx-react'; +import { NavLink, useParams } from "react-router-dom"; +import 'moment/locale/zh-cn'; +import moment from "moment"; +import zhCNlocale from 'antd/es/date-picker/locale/zh_CN'; + +const DestinationGroupList = () => { + + const {destinationId} = useParams(); + const { customerServicesStore } = useContext(stores_Context); + + useEffect(() => { + customerServicesStore.fetchGroupListByDestinationId(destinationId); + }, []); + + const destinationGroupList = customerServicesStore.destinationGroupList; + const destinationGroupListColumns = customerServicesStore.destinationGroupListColumns; + const {startDate, endDate, dateType, inProgress} = customerServicesStore; + + return ( + <> + + + + 返回 + + + + + + + + + {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')], + }} + /> + + + + + + + + {customerServicesStore.agentCompany} + record.key} + loading={inProgress} + pagination={false} + scroll={{ x: "100%" }} + expandable={{ + expandedRowRender: (record) => ( + + + + + + + + + + ), + }} + /> + + + + + ); +} + +export default observer(DestinationGroupList);