diff --git a/src/App.js b/src/App.js index 8a8ba9e..3242d8b 100644 --- a/src/App.js +++ b/src/App.js @@ -13,6 +13,7 @@ import Customer_care_potential from "./charts/Customer_care_potential"; import Customer_care_regular from "./charts/Customer_care_regular"; import Wechat_session from "./charts/Wechat_session"; import WhatsApp_session from "./charts/WhatsApp_session"; +import AgentGroup from "./charts/AgentGroup"; import Credit_card_bill from "./views/Credit_card_bill"; import exchange_rate from "./charts/ExchangeRate"; import Sale from "./views/Sale"; @@ -53,6 +54,7 @@ const App = () => { { key: 33, label: 在华客户 }, { key: 34, label: 微信会话存档 }, { key: 35, label: WhatsApp会话存档 }, + { key: 36, label: 地接社接团 }, ], }, { @@ -95,6 +97,7 @@ const App = () => { } /> } /> } /> + } /> }> } /> diff --git a/src/charts/AgentGroup.js b/src/charts/AgentGroup.js new file mode 100644 index 0000000..da31769 --- /dev/null +++ b/src/charts/AgentGroup.js @@ -0,0 +1,122 @@ +import React, {Component} from 'react'; +import {Row, Col, List, Typography, Space, DatePicker, Button, Select, Table} from 'antd'; +import { + ContainerOutlined, CarryOutOutlined, + SmileOutlined, TagsOutlined, GlobalOutlined, + SearchOutlined, +} from '@ant-design/icons'; +import {stores_Context} from '../config' +import * as config from "../config"; +import {Line} from "@ant-design/charts"; +import {observer} from 'mobx-react'; +import 'moment/locale/zh-cn'; +import moment from "moment"; +import zhCNlocale from 'antd/es/date-picker/locale/zh_CN'; + +class AgentGroup extends Component { + + static contextType = stores_Context; + + state = { + selectedRowKeys: [], + }; + + constructor(props) { + super(props); + } + + componentDidMount() { + console.info('AgentGroup.componentDidMount'); + // const {customerServicesStore} = this.context; + // customerServicesStore.fetchAgentList(); + } + + handleSearchClick() { + const {customerServicesStore} = this.context; + customerServicesStore.fetchAgentList(); + } + + render() { + const {customerServicesStore} = this.context; + const agentList = customerServicesStore.agentList; + const agentListColumns = customerServicesStore.agentListColumns; + const groupList = customerServicesStore.groupList; + const groupListColumns = customerServicesStore.groupListColumns; + const {startDate, endDate, dateType} = 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')], + }} + /> + + + + + + + + 地接社团信息 + record.key} + loading={false} + pagination={false} + scroll={{ x: "100%" }} + onRow={(agent) => ({ + onClick: () => { + customerServicesStore.selectAgent(agent); + }, + })} + /> + + + + + {customerServicesStore.selectedAgent.VendorName} +
record.key} loading={false} pagination={false} scroll={{ x: "100%" }} /> + + + + + ); + } +} + +export default observer(AgentGroup); \ No newline at end of file diff --git a/src/stores/CustomerServices.js b/src/stores/CustomerServices.js new file mode 100644 index 0000000..5a4c295 --- /dev/null +++ b/src/stores/CustomerServices.js @@ -0,0 +1,181 @@ +import {makeAutoObservable, runInAction} from "mobx" +import moment from "moment"; +import * as config from "../config"; +import * as req from '../utils/request'; + +class CustomerServices { + + constructor(rootStore) { + this.rootStore = rootStore; + this.startDate = moment().startOf('week').subtract(7, 'days'); + this.endDate = moment().endOf('week').subtract(7, 'days'); + this.startDateString = this.startDate.format(config.DATE_FORMAT); + this.endDateString = this.endDate.format(config.DATE_FORMAT) + '%2023:59'; + this.dateType = 'startDate'; + this.selectedAgent = {VendorName: '请选择地接社'}; + makeAutoObservable(this); + } + + fetchAgentList() { + + req.fetchJSON(config.HT_HOST + '/service-web/QueryData/GetAgentGroupInfoALL?DateType=' + this.dateType + '&Date1=' + this.startDateString + '&Date2=' + this.endDateString + '&OldDate1=' + this.startDateString + '&OldDate2=' + this.endDateString) + .then(json => { + console.info(json); + if (json.errcode === 0) { + runInAction(() => { + this.agentList = json.result1; + }); + } + }); + } + + fetchGroupListByAgent() { + + req.fetchJSON(config.HT_HOST + '/service-web/QueryData/GetAgentGroupInfo?VEI_SN=' + this.selectedAgent.EOI_ObjSN + '&DateType=' + this.dateType + '&Date1=' + this.startDateString + '&Date2=' + this.endDateString + '&OldDate1=' + this.startDateString + '&OldDate2=' + this.endDateString) + .then(json => { + console.info(json); + if (json.errcode === 0) { + runInAction(() => { + this.groupList = json.result1; + }); + } + }); + } + + selectDateRange(startDate, endDate) { + this.startDate = startDate; + this.endDate = endDate; + this.startDateString = startDate.format(config.DATE_FORMAT); + this.endDateString = endDate.format(config.DATE_FORMAT) + '%2023:59'; + } + + selectDateType(dateType) { + this.dateType = dateType; + } + + selectAgent(agent) { + this.selectedAgent = agent; + this.fetchGroupListByAgent(); + } + + startDate; + endDate; + startDateString; + endDateString; + dateType; + selectedAgent; + + groupList = [{ + EOI_ObjSN: 1, + GRI_SN: '---', + GRI_Name: 0, + COLI_PersonNum: 0, + COLI_Days: 0, + PassCity: 0, + VendorName: 0, + GuideName: '-', + Good: 0, + Bad: '-', + ECI_Content: '-', + totalcost: 0, + key: 1 + }]; + + groupListColumns = [ + { + title: '团名', + dataIndex: 'GRI_Name' + }, + { + title: '人数', + dataIndex: 'COLI_PersonNum' + }, + { + title: '天数', + dataIndex: 'COLI_Days' + }, + { + title: '经过城市', + dataIndex: 'PassCity' + }, + { + title: '地接社名称', + dataIndex: 'VendorName' + }, + { + title: '导游', + dataIndex: 'GuideName' + }, + { + title: '好评', + dataIndex: 'Good' + }, + { + title: '差评', + dataIndex: 'Bad' + }, + { + title: '评论内容', + dataIndex: 'ECI_Content' + }, + { + title: '交易额', + dataIndex: 'totalcost' + } + ]; + + agentList = [{ + EOI_ObjSN: 1, + VendorName: '---', + GroupCount: 0, + PersonNum: 0, + GroupDays: 0, + totalcost: 0, + GoodCount: 0, + GoodRate: '-', + BadCount: 0, + BadRate: '-', + key: 1 + }]; + + agentListColumns = [ + { + title: '地接社名称', + dataIndex: 'VendorName' + }, + { + title: '团数', + dataIndex: 'GroupCount' + }, + { + title: '人数', + dataIndex: 'PersonNum' + }, + { + title: '团天数', + dataIndex: 'GroupDays' + }, + { + title: '交易额', + dataIndex: 'totalcost' + }, + { + title: '好评数', + dataIndex: 'GoodCount' + }, + { + title: '好评率', + dataIndex: 'GoodRate' + }, + { + title: '差评数', + dataIndex: 'BadCount' + }, + { + title: '差评率', + dataIndex: 'BadRate' + } + ]; +} + +export default CustomerServices; \ No newline at end of file diff --git a/src/stores/Index.js b/src/stores/Index.js index cd5a43c..47b66b8 100644 --- a/src/stores/Index.js +++ b/src/stores/Index.js @@ -9,7 +9,7 @@ import FinancialStore from "./FinancialStore"; import SaleStore from "./SaleStore"; import WechatStore from "./Wechat"; import WhatsAppStore from "./WhatsApp"; - +import CustomerServicesStore from "./CustomerServices"; class Index { constructor() { @@ -23,6 +23,7 @@ class Index { this.sale_store = new SaleStore(this); this.wechatStore = new WechatStore(this); this.whatsAppStore = new WhatsAppStore(this); + this.customerServicesStore = new CustomerServicesStore(this); makeAutoObservable(this); }