|
@@ -3,7 +3,7 @@ import ajax from 'jquery/src/ajax/xhr.js';
|
|
import $ from 'jquery/src/ajax';
|
|
import $ from 'jquery/src/ajax';
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
import '@/manageCenter/financialManage/distribute/public.less';
|
|
import '@/manageCenter/financialManage/distribute/public.less';
|
|
-import { Button, Spin, DatePicker, Radio, message } from 'antd';
|
|
+import { Button, Spin, DatePicker, Radio, message, Icon } from 'antd';
|
|
import { getToday, ShowModal } from '@/tools';
|
|
import { getToday, ShowModal } from '@/tools';
|
|
import ShowModalDiv from "@/showModal.jsx";
|
|
import ShowModalDiv from "@/showModal.jsx";
|
|
import './index.less';
|
|
import './index.less';
|
|
@@ -127,6 +127,35 @@ const Statistics = React.createClass({
|
|
);
|
|
);
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ clean() {
|
|
|
|
+ this.setState({
|
|
|
|
+ loading: true,
|
|
|
|
+ });
|
|
|
|
+ $.ajax({
|
|
|
|
+ method: "get",
|
|
|
|
+ dataType: "json",
|
|
|
|
+ crossDomain: false,
|
|
|
|
+ url: globalConfig.context + "/api/admin/statistics/salesTeam/clean",
|
|
|
|
+ success: function (data) {
|
|
|
|
+ if (data.error && data.error.length === 0) {
|
|
|
|
+ ShowModal(this);
|
|
|
|
+ this.setState({
|
|
|
|
+ loading: false,
|
|
|
|
+ });
|
|
|
|
+ this.loadData();
|
|
|
|
+ } else {
|
|
|
|
+ message.warning(data.error[0].message);
|
|
|
|
+ }
|
|
|
|
+ }.bind(this),
|
|
|
|
+ }).always(
|
|
|
|
+ function () {
|
|
|
|
+ this.setState({
|
|
|
|
+ loading: false,
|
|
|
|
+ });
|
|
|
|
+ }.bind(this)
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+
|
|
search() {
|
|
search() {
|
|
this.loadData();
|
|
this.loadData();
|
|
},
|
|
},
|
|
@@ -147,24 +176,55 @@ const Statistics = React.createClass({
|
|
return `${url}?rid=${id}#${cd}`
|
|
return `${url}?rid=${id}#${cd}`
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ isTime(second) {
|
|
|
|
+ let time = "0秒"
|
|
|
|
+ if (second > 3600) {
|
|
|
|
+ time = moment.utc(second * 1000).format('h小时m分s秒')
|
|
|
|
+ } else if (second > 60) {
|
|
|
|
+ time = moment.utc(second * 1000).format('m分s秒')
|
|
|
|
+ } else if (second > 0) {
|
|
|
|
+ time = moment.utc(second * 1000).format('s秒')
|
|
|
|
+ }
|
|
|
|
+ return time
|
|
|
|
+ },
|
|
|
|
+
|
|
render() {
|
|
render() {
|
|
const { status, info, data } = this.state
|
|
const { status, info, data } = this.state
|
|
const list = [
|
|
const list = [
|
|
- { color: "#99FFFF", title: "全部签单客户数:", sum: info.signSum, tit: "签单客户数", number: info.rangeSignSum, url: this.getNewUrl("/admin/customer.html", "companySign") },
|
|
+ { type: 0, color: "#99FFFF", title: "全部签单客户数:", sum: info.signSum, tit: "签单客户数", number: info.rangeSignSum, url: this.getNewUrl("/admin/customer.html", "companySign") },
|
|
- { color: "#FFFFCC", title: "全部私有客户数:", sum: info.privateSum, tit: "私有客户数", number: info.rangePrivateSum, url: this.getNewUrl("/admin/customer.html", "companyIntention") },
|
|
+ { type: 0, color: "#FFFFCC", title: "全部私有客户数:", sum: info.privateSum, tit: "私有客户数", number: info.rangePrivateSum, url: this.getNewUrl("/admin/customer.html", "companyIntention") },
|
|
- { color: "#FFCCCC", title: "全部渠道数:", sum: info.channelSum, tit: "私有渠道数", number: info.rangeChannelSum, url: this.getNewUrl("/admin/channelList.html", "channelunit") },
|
|
+ { type: 0, color: "#FFCCCC", title: "全部渠道数:", sum: info.channelSum, tit: "私有渠道数", number: info.rangeChannelSum, url: this.getNewUrl("/admin/channelList.html", "channelunit") },
|
|
- { color: "#99CCFF", title: "全部公出数:", sum: info.publicReleaseSum, tit: "公出企业数", number: info.rangePublicReleaseSum, url: "" },
|
|
+ { type: 0, color: "#99CCFF", title: "全部公出数:", sum: info.publicReleaseSum, tit: "公出企业数", number: info.rangePublicReleaseSum, url: "" },
|
|
- { color: "#99FFCC", title: "全部跟进客户数:", sum: info.followSum, tit: "跟进客户数", number: info.rangeFollowSum, url: this.getNewUrl("/admin/customer.html", "followUpSummaryOrdinary") },
|
|
+ { type: 0, color: "#99FFCC", title: "全部跟进客户数:", sum: info.followSum, tit: "跟进客户数", number: info.rangeFollowSum, url: this.getNewUrl("/admin/customer.html", "followUpSummaryOrdinary") },
|
|
- { color: "#CC99CC", title: "全部订单数:", sum: info.orderSum, tit: "订单数", number: info.rangeOrderSum, url: this.getNewUrl("/admin/order.html", "billing") },
|
|
+ { type: 0, color: "#CC99CC", title: "全部订单数:", sum: info.orderSum, tit: "订单数", number: info.rangeOrderSum, url: this.getNewUrl("/admin/order.html", "billing") },
|
|
- { color: "#99CCCC", title: "全部应收款:", sum: info.receivables, tit: "应收款", number: info.rangeReceivables, url: this.getNewUrl("/admin/order.html", "press") },
|
|
+ { type: 0, color: "#99CCCC", title: "全部应收款:", sum: info.receivables, tit: "应收款", number: info.rangeReceivables, url: this.getNewUrl("/admin/order.html", "press") },
|
|
{
|
|
{
|
|
- color: "#FFCC99", title: "待紧急处理事项",
|
|
+ type: 0, color: "#FFCC99", title: "待紧急处理事项",
|
|
list: [
|
|
list: [
|
|
{ key: "被驳回订单:", value: info.rejectSum, url: this.getNewUrl("/admin/order.html", "reject") },
|
|
{ key: "被驳回订单:", value: info.rejectSum, url: this.getNewUrl("/admin/order.html", "reject") },
|
|
{ key: "待变更订单:", value: info.changeSum, url: this.getNewUrl("/admin/order.html", "contractChangeYxy") },
|
|
{ key: "待变更订单:", value: info.changeSum, url: this.getNewUrl("/admin/order.html", "contractChangeYxy") },
|
|
{ key: "待核对专利:", value: info.projectCheckSum, url: this.getNewUrl("/admin/project.html", "businessManagement") },
|
|
{ key: "待核对专利:", value: info.projectCheckSum, url: this.getNewUrl("/admin/project.html", "businessManagement") },
|
|
{ key: "暂停项目:", value: info.projectStopSum, url: this.getNewUrl("/admin/order.html", "mysuspend") },]
|
|
{ key: "暂停项目:", value: info.projectStopSum, url: this.getNewUrl("/admin/order.html", "mysuspend") },]
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ type: 1, color: "#FFCC99", title: "本人",
|
|
|
|
+ list: [
|
|
|
|
+ { key: "• 拨出次数:", value: info.callSum, url: "" },
|
|
|
|
+ { key: "• 接通次数:", value: info.connectSum, url: "" },
|
|
|
|
+ { key: "• 有效次数:", value: info.validSum, url: "" },
|
|
|
|
+ { key: "• 时长:", value: this.isTime(info.callDurationSum), url: "" },
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: 1, color: "#FFCC99", title: "本团队",
|
|
|
|
+ list: [
|
|
|
|
+ { key: "• 团队人数:", value: info.teamPeopleSum, url: "" },
|
|
|
|
+ { key: "• 拨出次数:", value: info.teamCallSum, url: "" },
|
|
|
|
+ { key: "• 接通次数:", value: info.teamConnectSum, url: "" },
|
|
|
|
+ { key: "• 有效次数:", value: info.teamValidSum, url: "" },
|
|
|
|
+ { key: "• 时长:", value: this.isTime(info.teamCallDurationSum), url: "" },
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
]
|
|
]
|
|
const option = {
|
|
const option = {
|
|
title: {
|
|
title: {
|
|
@@ -290,37 +350,59 @@ const Statistics = React.createClass({
|
|
<Spin spinning={this.state.loading}>
|
|
<Spin spinning={this.state.loading}>
|
|
<div className='plist'>
|
|
<div className='plist'>
|
|
{
|
|
{
|
|
- list.map((item, index) =>
|
|
+ list.map((item, index) => {
|
|
- <div className='plitem' style={{ background: item.color }} key={index}>
|
|
+ return item.type == 0
|
|
- <div className='plititle'>
|
|
+ ? <div className='plitem' style={{ background: item.color }} key={index}>
|
|
- <span style={{ fontWeight: item.title == "待紧急处理事项" && "bold" }}>{item.title}</span>
|
|
+ <div className='plititle'>
|
|
- {/* <span className='plisum'>{item.sum}</span> */}
|
|
+ <span style={{ fontWeight: item.title == "待紧急处理事项" && "bold" }}>{item.title}</span>
|
|
- <a href={globalConfig.context + item.url}>
|
|
+ <a href={globalConfig.context + item.url}>
|
|
- <span className='plisum'>{item.sum}</span>
|
|
+ <span className='plisum'>{item.sum}</span>
|
|
- </a>
|
|
+ </a>
|
|
- </div>
|
|
+ </div>
|
|
- {
|
|
+ {
|
|
- item.title == "待紧急处理事项"
|
|
+ item.title == "待紧急处理事项"
|
|
- ? <div className='list'>
|
|
+ ? <div className='list'>
|
|
|
|
+ {
|
|
|
|
+ item.list.map((t, i) =>
|
|
|
|
+ <div key={i}>
|
|
|
|
+ <span>{t.key}</span>
|
|
|
|
+ <a href={globalConfig.context + t.url}>
|
|
|
|
+ <span style={{ textDecoration: "underline", color: "#0000FF" }}>{t.value}</span>
|
|
|
|
+ </a>
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ </div>
|
|
|
|
+ : <div className='count'>
|
|
|
|
+ <a href={globalConfig.context + item.url}><div className='plinum'>{item.number}</div></a>
|
|
|
|
+ <div className='plitit'>{item.tit}</div>
|
|
|
|
+ </div>
|
|
|
|
+ }
|
|
|
|
+ </div> :
|
|
|
|
+ (item.type == 1 && item.list[0].value !== null)
|
|
|
|
+ ? <div className='plitems' style={{ background: item.color }} key={index}>
|
|
|
|
+ <div className='pleft'>
|
|
|
|
+ <div className='round'><Icon type="phone" style={{ fontSize: 40, color: "#fff" }} /></div>
|
|
|
|
+ <div>{item.title}</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
{
|
|
{
|
|
item.list.map((t, i) =>
|
|
item.list.map((t, i) =>
|
|
<div key={i}>
|
|
<div key={i}>
|
|
<span>{t.key}</span>
|
|
<span>{t.key}</span>
|
|
- <a href={globalConfig.context + t.url}>
|
|
+ <a href="">
|
|
<span style={{ textDecoration: "underline", color: "#0000FF" }}>{t.value}</span>
|
|
<span style={{ textDecoration: "underline", color: "#0000FF" }}>{t.value}</span>
|
|
</a>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|
|
- : <div className='count'>
|
|
+ {/* <div className='refresh' onClick={this.clean}>刷新</div> */}
|
|
- <a href={globalConfig.context + item.url}><div className='plinum'>{item.number}</div></a>
|
|
+ </div> : null
|
|
- <div className='plitit'>{item.tit}</div>
|
|
+ }
|
|
- </div>
|
|
|
|
- }
|
|
|
|
- </div>
|
|
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</Spin>
|
|
</Spin>
|
|
<ReactEcharts option={option} echarts={echarts} />
|
|
<ReactEcharts option={option} echarts={echarts} />
|