Merge branch 'main' of github.com:hainatravel/dashboard into main

feature/2.0-sales-trade
尹诚诚 3 years ago
commit ab04a58644

@ -13,6 +13,7 @@ import Customer_care_potential from "./charts/Customer_care_potential";
import Customer_care_regular from "./charts/Customer_care_regular"; import Customer_care_regular from "./charts/Customer_care_regular";
import Wechat_session from "./charts/Wechat_session"; import Wechat_session from "./charts/Wechat_session";
import WhatsApp_session from "./charts/WhatsApp_session"; import WhatsApp_session from "./charts/WhatsApp_session";
import AgentGroup from "./charts/AgentGroup";
import Credit_card_bill from "./views/Credit_card_bill"; import Credit_card_bill from "./views/Credit_card_bill";
import exchange_rate from "./charts/ExchangeRate"; import exchange_rate from "./charts/ExchangeRate";
import Sale from "./views/Sale"; import Sale from "./views/Sale";
@ -53,6 +54,7 @@ const App = () => {
{ key: 33, label: <NavLink to="/customer_care_inchina">在华客户</NavLink> }, { key: 33, label: <NavLink to="/customer_care_inchina">在华客户</NavLink> },
{ key: 34, label: <NavLink to="/wechat_session">微信会话存档</NavLink> }, { key: 34, label: <NavLink to="/wechat_session">微信会话存档</NavLink> },
{ key: 35, label: <NavLink to="/whatsapp_session">WhatsApp会话存档</NavLink> }, { key: 35, label: <NavLink to="/whatsapp_session">WhatsApp会话存档</NavLink> },
{ key: 36, label: <NavLink to="/AgentGroup">地接社接团</NavLink> },
], ],
}, },
{ {
@ -95,6 +97,7 @@ const App = () => {
<Route path="/customer_care_potential" element={<Customer_care_potential />} /> <Route path="/customer_care_potential" element={<Customer_care_potential />} />
<Route path="/whatsapp_session" element={<WhatsApp_session />} /> <Route path="/whatsapp_session" element={<WhatsApp_session />} />
<Route path="/wechat_session" element={<Wechat_session />} /> <Route path="/wechat_session" element={<Wechat_session />} />
<Route path="/agentgroup" element={<AgentGroup />} />
</Route> </Route>
<Route element={<ProtectedRoute auth={["admin", "director_bu", "financial"]} />}> <Route element={<ProtectedRoute auth={["admin", "director_bu", "financial"]} />}>
<Route path="/credit_card_bill" element={<Credit_card_bill />} /> <Route path="/credit_card_bill" element={<Credit_card_bill />} />

@ -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 (
<>
<Space direction="vertical" style={{width: '100%'}}>
<Row gutter={{md: 24}}>
<Col md={8} lg={7} xxl={6}>
<Select value={dateType} style={{ width: "95%" }} onChange={(value) => customerServicesStore.selectDateType(value)}>
<Select.Option key="1" value="startDate">
走团日期
</Select.Option>
<Select.Option key="2" value="ConfirmDate">
成团日期
</Select.Option>
</Select>
</Col>
<Col span={8}>
<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 md={8}>
<Button
type="primary"
icon={<SearchOutlined />}
loading={false}
onClick={() => {
this.handleSearchClick();
}}>
统计
</Button>
</Col>
</Row>
<Row>
<Col span={24}>
<Typography.Title level={3}>地接社团信息</Typography.Title>
<Table
dataSource={agentList}
columns={agentListColumns}
size="small"
rowKey={(record) => record.key}
loading={false}
pagination={false}
scroll={{ x: "100%" }}
onRow={(agent) => ({
onClick: () => {
customerServicesStore.selectAgent(agent);
},
})}
/>
</Col>
</Row>
<Row>
<Col span={24}>
<Typography.Title level={3}>{customerServicesStore.selectedAgent.VendorName}</Typography.Title>
<Table dataSource={groupList} columns={groupListColumns} size="small" rowKey={(record) => record.key} loading={false} pagination={false} scroll={{ x: "100%" }} />
</Col>
</Row>
</Space>
</>
);
}
}
export default observer(AgentGroup);

@ -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;

@ -9,7 +9,7 @@ import FinancialStore from "./FinancialStore";
import SaleStore from "./SaleStore"; import SaleStore from "./SaleStore";
import WechatStore from "./Wechat"; import WechatStore from "./Wechat";
import WhatsAppStore from "./WhatsApp"; import WhatsAppStore from "./WhatsApp";
import CustomerServicesStore from "./CustomerServices";
class Index { class Index {
constructor() { constructor() {
@ -23,6 +23,7 @@ class Index {
this.sale_store = new SaleStore(this); this.sale_store = new SaleStore(this);
this.wechatStore = new WechatStore(this); this.wechatStore = new WechatStore(this);
this.whatsAppStore = new WhatsAppStore(this); this.whatsAppStore = new WhatsAppStore(this);
this.customerServicesStore = new CustomerServicesStore(this);
makeAutoObservable(this); makeAutoObservable(this);
} }

Loading…
Cancel
Save