|
@@ -1,5 +1,5 @@
|
|
|
import React from 'react';
|
|
|
-import { Select, Spin, Input, Table, Button } from 'antd';
|
|
|
+import { Select, Spin, Input, Table, Button ,DatePicker} from 'antd';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import './report.less';
|
|
@@ -7,17 +7,26 @@ import { post } from '../../../dataDic.js';
|
|
|
|
|
|
const PersonalReport = React.createClass({
|
|
|
loadData(totalArr) {
|
|
|
- let total=totalArr.data[0] ;
|
|
|
+ if(this.state.selTime){
|
|
|
+ var newTime=this.state.selTime;
|
|
|
+ var timeArr=newTime.split('-');
|
|
|
+ var txtTime=timeArr[0]+'年'+timeArr[1]+'月'+timeArr[2]+'日';
|
|
|
+ this.setState({
|
|
|
+ timeState:true,
|
|
|
+ txtTime:txtTime,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ let total=totalArr;
|
|
|
this.setState({
|
|
|
loading: true
|
|
|
});
|
|
|
$.ajax({
|
|
|
- method: "post",
|
|
|
+ method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/organization/selectSuperId",
|
|
|
+ url: globalConfig.context + "/api/admin/report/sales/department",
|
|
|
data: {
|
|
|
-
|
|
|
+ date:this.state.selTime?(this.state.selTime+' '+'00:00:00'):'',
|
|
|
},
|
|
|
success: function(data) {
|
|
|
let thedata = data.data;
|
|
@@ -34,42 +43,30 @@ const PersonalReport = React.createClass({
|
|
|
key: index,
|
|
|
theNumber:false,
|
|
|
nub:nub,
|
|
|
- name: item.name,
|
|
|
id: item.id,
|
|
|
-// departmentName:item.departmentName,//部门
|
|
|
-// position:item.position, //职务
|
|
|
-// enrollTime:item.enrollTime,// 入职时间
|
|
|
-// dailyOrderCount:values.daily.orderCount,//日签单业绩
|
|
|
-// dailyOrderAmount:values.daily.orderAmount,//日签单业绩
|
|
|
-// weeklyOrderCount:values.weekly.orderCount,//周签单业绩
|
|
|
-// weeklyOrderAmount:values.weekly.orderAmount,//周签单业绩
|
|
|
-// monthlyOrderCount:values.monthly.orderCount,//月签单业绩
|
|
|
-// monthlyOrderAmount:values.monthly.orderAmount,//月签单业绩
|
|
|
-// quarterlyOrderCount:values.quarterly.orderCount,//季签单业绩
|
|
|
-// quarterlyOrderAmount:values.quarterly.orderAmount,//季签单业绩
|
|
|
-// annuallyOrderCount:values. annually.orderCount,//年签单业绩
|
|
|
-// annuallyOrderAmount:values. annually.orderAmount,//年签单业绩
|
|
|
- departmentName:item.name,//部门
|
|
|
- position:item.name, //职务
|
|
|
- enrollTime:item.name,// 入职时间
|
|
|
- dailyOrderCount:nub,//日签单业绩
|
|
|
- dailyOrderAmount:nub,//日签单业绩
|
|
|
- weeklyOrderCount:nub,//周签单业绩
|
|
|
- weeklyOrderAmount:nub,//周签单业绩
|
|
|
- monthlyOrderCount:nub,//月签单业绩
|
|
|
- monthlyOrderAmount:nub,//月签单业绩
|
|
|
- quarterlyOrderCount:nub,//季签单业绩
|
|
|
- quarterlyOrderAmount:nub,//季签单业绩
|
|
|
- annuallyOrderCount:nub,//年签单业绩
|
|
|
- annuallyOrderAmount:nub,//年签单业绩
|
|
|
+ departmentName:item.departmentName,//部门
|
|
|
+ managerName:item.managerName,//负责人
|
|
|
+ memberCount:item.memberCount, //部门人数
|
|
|
+ enrollTime:item.enrollTime,// 入职时间
|
|
|
+ dailyOrderCount:item.values.daily.orderCount,//日签单业绩
|
|
|
+ dailyOrderAmount:item.values.daily.orderAmount,//日签单业绩
|
|
|
+ weeklyOrderCount:item.values.weekly.orderCount,//周签单业绩
|
|
|
+ weeklyOrderAmount:item.values.weekly.orderAmount,//周签单业绩
|
|
|
+ monthlyOrderCount:item.values.monthly.orderCount,//月签单业绩
|
|
|
+ monthlyOrderAmount:item.values.monthly.orderAmount,//月签单业绩
|
|
|
+ quarterlyOrderCount:item.values.quarterly.orderCount,//季签单业绩
|
|
|
+ quarterlyOrderAmount:item.values.quarterly.orderAmount,//季签单业绩
|
|
|
+ annuallyOrderCount:item.values.annually.orderCount,//年签单业绩
|
|
|
+ annuallyOrderAmount:item.values.annually.orderAmount,//年签单业绩
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
theArr.push(
|
|
|
{
|
|
|
key:9999999,
|
|
|
theNumber:true,
|
|
|
- name:'合计',
|
|
|
+ departmentName:'合计',
|
|
|
dailyOrderCount:total.dailyTotalCount,//日签单业绩
|
|
|
dailyOrderAmount:total.dailyTotalAmount,//日签单业绩
|
|
|
weeklyOrderCount:total.weeklyTotalCount,//周签单业绩
|
|
@@ -83,6 +80,7 @@ const PersonalReport = React.createClass({
|
|
|
}
|
|
|
)
|
|
|
this.setState({
|
|
|
+
|
|
|
dataSource: theArr,
|
|
|
})
|
|
|
}.bind(this),
|
|
@@ -97,19 +95,15 @@ const PersonalReport = React.createClass({
|
|
|
loading: true
|
|
|
});
|
|
|
$.ajax({
|
|
|
- method: "post",
|
|
|
+ method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/organization/selectSuperId",
|
|
|
+ url: globalConfig.context + "/api/admin/report/sales/total",
|
|
|
data: {
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
success: function(data) {
|
|
|
- //let thedata = data.data;
|
|
|
- let thedata = {data:[
|
|
|
- {dailyTotalCount:1227,dailyTotalAmount:1233,weeklyTotalCount:1025,weeklyTotalAmount:127,monthlyTotalCount:122,
|
|
|
- monthlyTotalAmount:922,quarterlyTotalCount:772,quarterlyTotalAmount:122,annuallyTotalCount:522,annuallyTotalAmount:2222,}
|
|
|
- ]}
|
|
|
+ let thedata = data.data;
|
|
|
let theArr = [];
|
|
|
if(!thedata) {
|
|
|
if(data.error && data.error.length) {
|
|
@@ -165,6 +159,13 @@ const PersonalReport = React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
+ //时间选择
|
|
|
+ selTime(value,index){
|
|
|
+ this.setState({
|
|
|
+ Dtime:value,
|
|
|
+ selTime:index
|
|
|
+ })
|
|
|
+ },
|
|
|
getInitialState() {
|
|
|
return {
|
|
|
selectedRowKeys: [],
|
|
@@ -172,6 +173,9 @@ const PersonalReport = React.createClass({
|
|
|
loading: false,
|
|
|
visible: false,
|
|
|
showDesc: false,
|
|
|
+ timeState:false,
|
|
|
+ Dtime:undefined,
|
|
|
+ selTime:'',
|
|
|
columns: [
|
|
|
{
|
|
|
title: '序号',
|
|
@@ -196,8 +200,8 @@ const PersonalReport = React.createClass({
|
|
|
},
|
|
|
{
|
|
|
title: '部门',
|
|
|
- dataIndex: 'name',
|
|
|
- key: 'name',
|
|
|
+ dataIndex: 'departmentName',
|
|
|
+ key: 'departmentName',
|
|
|
width:100,
|
|
|
fixed:true,
|
|
|
render:(text,record)=>{
|
|
@@ -218,8 +222,8 @@ const PersonalReport = React.createClass({
|
|
|
title: '负责人',
|
|
|
width:100,
|
|
|
fixed:true,
|
|
|
- dataIndex: 'departmentName',
|
|
|
- key: 'departmentName',
|
|
|
+ dataIndex: 'managerName',
|
|
|
+ key: 'managerName',
|
|
|
render:(text,record)=>{
|
|
|
if(!record.theNumber){
|
|
|
return text
|
|
@@ -239,8 +243,8 @@ const PersonalReport = React.createClass({
|
|
|
title: '部门人数',
|
|
|
width:100,
|
|
|
fixed:true,
|
|
|
- dataIndex: 'position',
|
|
|
- key: 'position',
|
|
|
+ dataIndex: 'memberCount',
|
|
|
+ key: 'memberCount',
|
|
|
render:(text,record)=>{
|
|
|
if(!record.theNumber){
|
|
|
return text
|
|
@@ -260,16 +264,16 @@ const PersonalReport = React.createClass({
|
|
|
children: [
|
|
|
{
|
|
|
title: '单量',
|
|
|
- dataIndex: 'num66',
|
|
|
+ dataIndex: 'dailyOrderCount',
|
|
|
width:70,
|
|
|
- key: 'num66',
|
|
|
- sorter: (a, b) => a.num66 - b.num66,
|
|
|
+ key: 'dailyOrderCount',
|
|
|
+ sorter: (a, b) => a.dailyOrderCount - b.dailyOrderCount,
|
|
|
},{
|
|
|
title: '金额',
|
|
|
- dataIndex: 'age266',
|
|
|
+ dataIndex: 'dailyOrderAmount',
|
|
|
width:70,
|
|
|
- key: 'age266',
|
|
|
- sorter: (a, b) => a.age - b.age,
|
|
|
+ key: 'dailyOrderAmount',
|
|
|
+ sorter: (a, b) => a.dailyOrderAmount - b.dailyOrderAmount,
|
|
|
}
|
|
|
],
|
|
|
},
|
|
@@ -555,9 +559,9 @@ const PersonalReport = React.createClass({
|
|
|
this.totalData()
|
|
|
},
|
|
|
reset() {
|
|
|
- this.state.departmentSearch = undefined;
|
|
|
- this.state.postSearch = undefined;
|
|
|
- this.state.uesrNameSearch = '';
|
|
|
+ this.state.Dtime = undefined;
|
|
|
+ this.state.selTime='';
|
|
|
+ this.state.timeState=false;
|
|
|
this.totalData()
|
|
|
},
|
|
|
componentWillMount() {
|
|
@@ -575,33 +579,13 @@ const PersonalReport = React.createClass({
|
|
|
<div className='set-content'>
|
|
|
<span style={{fontSize:'16px'}}>部门业绩统计报表</span>
|
|
|
<div className="clearfix">
|
|
|
- <Select placeholder="部门机构"
|
|
|
- style={{ width: 150 ,marginRight:'10px',marginTop:'10px',marginBottom:'10px'}}
|
|
|
- value={this.state.departmentSearch}
|
|
|
- onChange={(e) => { this.setState({ departmentSearch: e }) }}>
|
|
|
- {
|
|
|
- departmentArr.map(function (item) {
|
|
|
- return <Select.Option key={item.id} >{item.name}</Select.Option>
|
|
|
- })
|
|
|
- }
|
|
|
- </Select>
|
|
|
- <Input value={this.state.uesrNameSearch} placeholder="用户姓名" style={{width:'150px'}}
|
|
|
- onChange={(e)=>{this.setState({uesrNameSearch:e.target.value})}} />
|
|
|
- <Select placeholder="职务"
|
|
|
- style={{ width: 150 ,marginRight:'10px',marginLeft:'10px'}}
|
|
|
- value={this.state.postSearch}
|
|
|
- onChange={(e) => { this.setState({ postSearch: e }) }}>
|
|
|
- {
|
|
|
- post.map(function (item) {
|
|
|
- return <Select.Option key={item.value} >{item.key}</Select.Option>
|
|
|
- })
|
|
|
- }
|
|
|
- </Select>
|
|
|
+ <span style={{fontSize:'16px'}}>选择日期 : </span>
|
|
|
+ <DatePicker onChange={this.selTime} value={this.state.Dtime}/>
|
|
|
<Button type="primary" onClick={this.search} style={{marginLeft:'10px',marginRight:'10px'}}>搜索</Button>
|
|
|
<Button onClick={this.reset}>重置</Button>
|
|
|
</div>
|
|
|
<div className="surfaceTitle">
|
|
|
- <span className="nowtime">{this.state.Nowtime}</span>
|
|
|
+ <span className="nowtime">{this.state.timeState?this.state.txtTime:this.state.Nowtime}</span>
|
|
|
<span>部门营销业绩统计表</span>
|
|
|
</div>
|
|
|
<div className="patent-table">
|