|
@@ -4,7 +4,9 @@ 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 } from 'antd';
|
|
|
|
+import { getToday, ShowModal } from '@/tools';
|
|
import './index.less';
|
|
import './index.less';
|
|
|
|
+
|
|
import ReactEcharts from 'echarts-for-react/lib/core';
|
|
import ReactEcharts from 'echarts-for-react/lib/core';
|
|
import echarts from 'echarts/lib/echarts';
|
|
import echarts from 'echarts/lib/echarts';
|
|
import 'echarts/lib/chart/line';
|
|
import 'echarts/lib/chart/line';
|
|
@@ -22,20 +24,20 @@ const Statistics = React.createClass({
|
|
|
|
|
|
getInitialState() {
|
|
getInitialState() {
|
|
return {
|
|
return {
|
|
- releaseDate: [],
|
|
|
|
- info: {}
|
|
|
|
|
|
+ status: 1,
|
|
|
|
+ releaseDate: getToday(1),
|
|
|
|
+ info: {},
|
|
|
|
+ data: {},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
componentWillMount() {
|
|
componentWillMount() {
|
|
- const now = new Date();
|
|
|
|
- const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000);
|
|
|
|
- console.log("-----------", yesterday)
|
|
|
|
|
|
+ this.loadData();
|
|
|
|
+ this.getData();
|
|
},
|
|
},
|
|
|
|
|
|
loadData() {
|
|
loadData() {
|
|
const { releaseDate } = this.state
|
|
const { releaseDate } = this.state
|
|
- console.log("====", releaseDate)
|
|
|
|
this.setState({
|
|
this.setState({
|
|
loading: true,
|
|
loading: true,
|
|
});
|
|
});
|
|
@@ -70,6 +72,30 @@ const Statistics = React.createClass({
|
|
);
|
|
);
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ getData() {
|
|
|
|
+ $.ajax({
|
|
|
|
+ method: "get",
|
|
|
|
+ dataType: "json",
|
|
|
|
+ crossDomain: false,
|
|
|
|
+ url: globalConfig.context + "/api/admin/statistics/lists",
|
|
|
|
+ success: function (data) {
|
|
|
|
+ if (data.error && data.error.length === 0) {
|
|
|
|
+ this.setState({
|
|
|
|
+ data: data.data,
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ message.warning(data.error[0].message);
|
|
|
|
+ }
|
|
|
|
+ }.bind(this),
|
|
|
|
+ }).always(
|
|
|
|
+ function () {
|
|
|
|
+ this.setState({
|
|
|
|
+ loading: false,
|
|
|
|
+ });
|
|
|
|
+ }.bind(this)
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+
|
|
search() {
|
|
search() {
|
|
this.loadData();
|
|
this.loadData();
|
|
},
|
|
},
|
|
@@ -80,18 +106,18 @@ const Statistics = React.createClass({
|
|
},
|
|
},
|
|
|
|
|
|
render() {
|
|
render() {
|
|
- const { status } = this.state
|
|
|
|
|
|
+ const { status, info, data } = this.state
|
|
const list = [
|
|
const list = [
|
|
- { color: "#99FFFF", title: "全部签单客户数:", sum: 200, tit: "签单客户数", number: 50 },
|
|
|
|
- { color: "#FFFFCC", title: "全部私有客户数:", sum: 200, tit: "私有客户数", number: 50 },
|
|
|
|
- { color: "#FFCCCC", title: "全部渠道数:", sum: 200, tit: "私有渠道数", number: 50 },
|
|
|
|
- { color: "#99CCFF", title: "全部公出数:", sum: 200, tit: "公出企业数", number: 50 },
|
|
|
|
- { color: "#99FFCC", title: "全部跟进客户数:", sum: 200, tit: "跟进客户数", number: 50 },
|
|
|
|
- { color: "#CC99CC", title: "全部订单数:", sum: 200, tit: "订单数", number: 50 },
|
|
|
|
|
|
+ { color: "#99FFFF", title: "全部签单客户数:", sum: info.signSum, tit: "签单客户数", number: info.rangeSignSum },
|
|
|
|
+ { color: "#FFFFCC", title: "全部私有客户数:", sum: info.privateSum, tit: "私有客户数", number: info.rangePrivateSum },
|
|
|
|
+ { color: "#FFCCCC", title: "全部渠道数:", sum: info.channelSum, tit: "私有渠道数", number: info.rangeChannelSum },
|
|
|
|
+ { color: "#99CCFF", title: "全部公出数:", sum: info.publicReleaseSum, tit: "公出企业数", number: info.rangePublicReleaseSum },
|
|
|
|
+ { color: "#99FFCC", title: "全部跟进客户数:", sum: info.followSum, tit: "跟进客户数", number: info.rangeFollowSum },
|
|
|
|
+ { color: "#CC99CC", title: "全部订单数:", sum: info.orderSum, tit: "订单数", number: info.rangeOrderSum },
|
|
{ color: "#99CCCC", title: "全部应收款:", sum: 10.54, tit: "应收款", number: 0.25 },
|
|
{ color: "#99CCCC", title: "全部应收款:", sum: 10.54, tit: "应收款", number: 0.25 },
|
|
{
|
|
{
|
|
color: "#FFCC99", title: "待紧急处理事项", sum: "", tit: "签单客户数", number: "",
|
|
color: "#FFCC99", title: "待紧急处理事项", sum: "", tit: "签单客户数", number: "",
|
|
- list: [{ key: "被驳回订单:", value: 2 }, { key: "待变更订单:", value: 2 }, { key: "待核对订单:", value: 2 }, { key: "暂停项目:", value: 2 },]
|
|
|
|
|
|
+ list: [{ key: "被驳回订单:", value: info.rejectSum }, { key: "待变更订单:", value: info.changeSum }, { key: "待核对订单:", value: info.projectCheckSum }, { key: "暂停项目:", value: info.projectStopSum },]
|
|
},
|
|
},
|
|
]
|
|
]
|
|
const option = {
|
|
const option = {
|
|
@@ -118,7 +144,7 @@ const Statistics = React.createClass({
|
|
xAxis: {
|
|
xAxis: {
|
|
type: 'category',
|
|
type: 'category',
|
|
boundaryGap: false,
|
|
boundaryGap: false,
|
|
- data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
|
|
|
|
|
+ data: data.dates
|
|
},
|
|
},
|
|
yAxis: {
|
|
yAxis: {
|
|
type: 'value'
|
|
type: 'value'
|
|
@@ -127,32 +153,32 @@ const Statistics = React.createClass({
|
|
{
|
|
{
|
|
name: '签单客户数',
|
|
name: '签单客户数',
|
|
type: 'line',
|
|
type: 'line',
|
|
- data: [1, 2, 0, 2, 5, 3, 9]
|
|
|
|
|
|
+ data: data.signList
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '私有客户数',
|
|
name: '私有客户数',
|
|
type: 'line',
|
|
type: 'line',
|
|
- data: [0, 0, 1, 2, 3, 4, 5]
|
|
|
|
|
|
+ data: data.privateList
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '私有渠道数',
|
|
name: '私有渠道数',
|
|
type: 'line',
|
|
type: 'line',
|
|
- data: [1, 2, 5, 4, 8, 9, 1]
|
|
|
|
|
|
+ data: data.channelList
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '公出企业数',
|
|
name: '公出企业数',
|
|
type: 'line',
|
|
type: 'line',
|
|
- data: [1, 2, 5, 7, 8, 5, 2]
|
|
|
|
|
|
+ data: data.publicReleaseList
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '跟进客户数',
|
|
name: '跟进客户数',
|
|
type: 'line',
|
|
type: 'line',
|
|
- data: [0, 4, 6, 3, 2, 7, 9]
|
|
|
|
|
|
+ data: data.userFollowList
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '订单数',
|
|
name: '订单数',
|
|
type: 'line',
|
|
type: 'line',
|
|
- data: [1, 2, 3, 5, 8, 6, 7]
|
|
|
|
|
|
+ data: data.orderList
|
|
}
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
@@ -162,12 +188,22 @@ const Statistics = React.createClass({
|
|
<span style={{ fontWeight: 900, fontSize: 16 }}>数据统计</span>
|
|
<span style={{ fontWeight: 900, fontSize: 16 }}>数据统计</span>
|
|
</div>
|
|
</div>
|
|
<div className="user-search">
|
|
<div className="user-search">
|
|
- <RadioGroup defaultValue="a"
|
|
|
|
|
|
+ <RadioGroup value={status}
|
|
onChange={e => {
|
|
onChange={e => {
|
|
this.setState({
|
|
this.setState({
|
|
status: e.target.value
|
|
status: e.target.value
|
|
})
|
|
})
|
|
- console.log("e==", e.target.value)
|
|
|
|
|
|
+ if (e.target.value == 0) {
|
|
|
|
+ this.setState({
|
|
|
|
+ releaseDate: []
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.setState({
|
|
|
|
+ releaseDate: getToday(e.target.value)
|
|
|
|
+ }, () => {
|
|
|
|
+ this.loadData()
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}}
|
|
}}
|
|
>
|
|
>
|
|
<RadioButton value={1}>今日</RadioButton>
|
|
<RadioButton value={1}>今日</RadioButton>
|
|
@@ -179,29 +215,30 @@ const Statistics = React.createClass({
|
|
</RadioGroup>
|
|
</RadioGroup>
|
|
{
|
|
{
|
|
status == 0 &&
|
|
status == 0 &&
|
|
- <RangePicker
|
|
|
|
- style={{ width: 200, marginLeft: 15 }}
|
|
|
|
- value={[
|
|
|
|
- this.state.releaseDate[0]
|
|
|
|
- ? moment(this.state.releaseDate[0])
|
|
|
|
- : null,
|
|
|
|
- this.state.releaseDate[1]
|
|
|
|
- ? moment(this.state.releaseDate[1])
|
|
|
|
- : null,
|
|
|
|
- ]}
|
|
|
|
- onChange={(data, dataString) => {
|
|
|
|
- this.setState({ releaseDate: dataString })
|
|
|
|
- }}
|
|
|
|
- />
|
|
|
|
|
|
+ <span>
|
|
|
|
+ <RangePicker
|
|
|
|
+ style={{ width: 200, marginLeft: 15 }}
|
|
|
|
+ value={[
|
|
|
|
+ this.state.releaseDate[0]
|
|
|
|
+ ? moment(this.state.releaseDate[0])
|
|
|
|
+ : null,
|
|
|
|
+ this.state.releaseDate[1]
|
|
|
|
+ ? moment(this.state.releaseDate[1])
|
|
|
|
+ : null,
|
|
|
|
+ ]}
|
|
|
|
+ onChange={(data, dataString) => {
|
|
|
|
+ this.setState({ releaseDate: dataString })
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
|
|
+ <Button style={{ margin: "0 15px" }} type="primary" onClick={this.search}>搜索</Button>
|
|
|
|
+ <Button onClick={this.reset}>重置</Button>
|
|
|
|
+ </span>
|
|
}
|
|
}
|
|
- <Button style={{ marginLeft: 15 }} type="primary" onClick={this.search}>搜索</Button>
|
|
|
|
- <Button onClick={this.reset}>重置</Button>
|
|
|
|
</div>
|
|
</div>
|
|
<div className="patent-table">
|
|
<div className="patent-table">
|
|
{/* <Spin spinning={this.state.loading}>
|
|
{/* <Spin spinning={this.state.loading}>
|
|
|
|
|
|
</Spin> */}
|
|
</Spin> */}
|
|
- <ReactEcharts option={option} echarts={echarts} />
|
|
|
|
<div className='plist'>
|
|
<div className='plist'>
|
|
{
|
|
{
|
|
list.map((item, index) =>
|
|
list.map((item, index) =>
|
|
@@ -231,6 +268,7 @@ const Statistics = React.createClass({
|
|
)
|
|
)
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|
|
|
|
+ <ReactEcharts option={option} echarts={echarts} />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|