feature/2.0-sales-trade
尹诚诚 3 years ago
parent af57935a08
commit 8989ca4071

@ -74,7 +74,7 @@ const App = () => {
}}>
<Sider collapsible={true} breakpoint="lg">
<Image src={Logo} preview={false} />
<Menu theme="dark" defaultSelectedKeys={["1"]} defaultOpenKeys={["2", "3", "4", "5"]} mode="inline" items={menu_items} />
<Menu theme="dark" defaultSelectedKeys={["1"]} defaultOpenKeys={["2", "5"]} mode="inline" items={menu_items} />
</Sider>
<Layout className="site-layout">
<Content

@ -13,12 +13,6 @@ class DatePickerCharts extends Component {
constructor(props) {
super(props);
//设置全局日期为中国
moment.locale("zh-cn", {
week: {
dow: 1 //周一是每周的第一天
}
});
}

@ -57,18 +57,18 @@ class SaleStore {
fetch(config.HT_HOST + url)
.then((response) => response.json())
.then((json) => {
result.push(...json.result1);
if (!comm.empty(json.result2) && !comm.empty(date_moment.start_date_cp)) {
let diff_days = date_moment.start_date.diff(date_moment.start_date_cp, "days");
for (let item of json.result2) {
result.push({
COLI_Date: moment(item.COLI_Date).add(diff_days, "days").format(config.DATE_FORMAT),
COLI_YJLY: item.COLI_YJLY,
groups: item.groups,
key: item.key,
});
}
}
result.push(...json.result1, ...json.result2);
// if (!comm.empty(json.result2) && !comm.empty(date_moment.start_date_cp)) {
// let diff_days = date_moment.start_date.diff(date_moment.start_date_cp, "days");
// for (let item of json.result2) {
// result.push({
// COLI_Date: moment(item.COLI_Date).add(diff_days, "days").format(config.DATE_FORMAT),
// COLI_YJLY: item.COLI_YJLY,
// groups: item.groups,
// key: item.key,
// });
// }
// }
runInAction(() => {
this.ml_data = result;
this.loading = false;
@ -119,7 +119,7 @@ class SaleStore {
},
{
title: "成行率",
children: [{ title: "", dataIndex: "COLI_CJrate" }],
children: [{ title: comm.formatPercent(json.result1.reduce((a, b) => a + b.COLI_CJCount, 0) / json.result1.reduce((a, b) => a + b.COLI_OrderCount, 0)), dataIndex: "COLI_CJrate" }],
sorter: (a, b) => parseInt(b.COLI_CJrate) - parseInt(a.COLI_CJrate),
},
{
@ -144,6 +144,64 @@ class SaleStore {
},
];
result.dataSource = json.result1;
} else if (this.active_tab_key == "ResponseRateByWL") {
result.columns = [
{
title: "",
children: [
{
title: "",
dataIndex: "OPI_Name",
},
],
},
{
title: "首次报价回复率",
children: [{ title: "", dataIndex: "FirstRspRate" }],
sorter: (a, b) => parseInt(b.FirstRspRate) - parseInt(a.FirstRspRate),
},
{
title: "报价次数",
children: [{ title: json.result1.reduce((a, b) => a + b.PriceTime, 0), dataIndex: "PriceTime" }],
sorter: (a, b) => b.PriceTime - a.PriceTime,
},
{
title: "邮件发送次数",
children: [{ title: json.result1.reduce((a, b) => a + b.mailSendTime, 0), dataIndex: "mailSendTime" }],
sorter: (a, b) => b.mailSendTime - a.mailSendTime,
},
{
title: "WhatsApp客人会话次数",
children: [{ title: json.result1.reduce((a, b) => a + b.WhatsAppGuestChatCount, 0), dataIndex: "WhatsAppGuestChatCount" }],
sorter: (a, b) => b.WhatsAppGuestChatCount - a.WhatsAppGuestChatCount,
},
{
title: "WhatsApp外联会话次数",
children: [{ title: json.result1.reduce((a, b) => a + b.WhatsAppWLChatCount, 0), dataIndex: "WhatsAppWLChatCount" }],
sorter: (a, b) => b.WhatsAppWLChatCount - a.WhatsAppWLChatCount,
},
{
title: "WhatsApp新增客户数",
children: [{ title: json.result1.reduce((a, b) => a + b.WhatsAppNewGuestCount, 0), dataIndex: "WhatsAppNewGuestCount" }],
sorter: (a, b) => b.WhatsAppNewGuestCount - a.WhatsAppNewGuestCount,
},
{
title: "微信客人会话次数",
children: [{ title: json.result1.reduce((a, b) => a + b.WXGuestChatCount, 0), dataIndex: "WXGuestChatCount" }],
sorter: (a, b) => b.WXGuestChatCount - a.WXGuestChatCount,
},
{
title: "微信外联会话次数",
children: [{ title: json.result1.reduce((a, b) => a + b.WXWLChatCount, 0), dataIndex: "WXWLChatCount" }],
sorter: (a, b) => b.WXWLChatCount - a.WXWLChatCount,
},
{
title: "微信新增客户数",
children: [{ title: json.result1.reduce((a, b) => a + b.WXNewGuestCount, 0), dataIndex: "WXNewGuestCount" }],
sorter: (a, b) => b.WXNewGuestCount - a.WXNewGuestCount,
},
];
result.dataSource = json.result1;
} else {
//if (this.active_tab_key == "Country")
//获取类型的项目,去掉重复,作为列名

@ -1,6 +1,6 @@
import React, { useContext, useEffect } from "react";
import { Row, Col, Button, Tabs, Table, Space, Radio, Select } from "antd";
import { ContainerOutlined, SearchOutlined } from "@ant-design/icons";
import { ContainerOutlined, SearchOutlined,UserSwitchOutlined } from "@ant-design/icons";
import { stores_Context } from "../config";
import { Column, Pie } from "@ant-design/charts";
import { observer } from "mobx-react";
@ -134,6 +134,13 @@ const Sale = () => {
</span>
}
key="All"></Tabs.TabPane>
<Tabs.TabPane
tab={
<span>
<UserSwitchOutlined /> 回复率
</span>
}
key="ResponseRateByWL"></Tabs.TabPane>
<Tabs.TabPane
tab={
<span>

Loading…
Cancel
Save