|
@@ -1,16 +1,16 @@
|
|
|
import React from 'react';
|
|
|
-import { Select, Spin, Input, Table, Button ,DatePicker, Form , Tabs , Switch,message} from 'antd';
|
|
|
+import { Select, Spin, Input, Table, Button, DatePicker, Form, Tabs, Switch, message } from 'antd';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import './report.less';
|
|
|
import DiurnalStatisticsOne from './diurnalStatisticsOne.jsx';
|
|
|
import { post } from '../../../dataDic.js';
|
|
|
-import {ChooseList} from "../../order/orderNew/chooseList";
|
|
|
+import { ChooseList } from "../../order/orderNew/chooseList";
|
|
|
const TabPane = Tabs.TabPane;
|
|
|
|
|
|
const DiurnalStatistics = React.createClass({
|
|
|
loadData(totalArr) {
|
|
|
- let total=totalArr;
|
|
|
+ let total = totalArr;
|
|
|
this.setState({
|
|
|
loading: true
|
|
|
});
|
|
@@ -20,70 +20,70 @@ const DiurnalStatistics = React.createClass({
|
|
|
crossDomain: false,
|
|
|
url: globalConfig.context + "/api/admin/report/sales/marketingStatistics",
|
|
|
data: {
|
|
|
- type:'1',
|
|
|
- depId:this.state.superId,//部门机构
|
|
|
+ type: '1',
|
|
|
+ depId: this.state.superId,//部门机构
|
|
|
},
|
|
|
- success: function(data) {
|
|
|
+ success: function (data) {
|
|
|
let thedata = data.data;
|
|
|
let theArr = [];
|
|
|
- if(!thedata) {
|
|
|
- if(data.error && data.error.length) {
|
|
|
+ if (!thedata) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
message.warning(data.error[0].message);
|
|
|
};
|
|
|
thedata = {};
|
|
|
} else {
|
|
|
- thedata.map(function(item, index) {
|
|
|
- let nub=index+1;
|
|
|
+ thedata.map(function (item, index) {
|
|
|
+ let nub = index + 1;
|
|
|
theArr.push({
|
|
|
key: index,
|
|
|
- theNumber:false,
|
|
|
- nub:nub,
|
|
|
+ theNumber: false,
|
|
|
+ nub: nub,
|
|
|
id: item.id,
|
|
|
- departmentId:item.departmentId,//部门ID
|
|
|
- departmentName:item.departmentName,//部门名称
|
|
|
- departmentManagerName:item.departmentManagerName,//部门负责人名称
|
|
|
- departmentNumber:item.departmentNumber, //部门人数
|
|
|
- privateCustomersCount:item.privateCustomersCount,// 部门客户数
|
|
|
- dataCount:item.dataCount,// 新增客户数
|
|
|
- dailyTelNo:item.dayTelNo,//日电话量
|
|
|
- dailyVisitNo:item.dayVisitNo,//日外拜量
|
|
|
- dailyFollowNo:item.dayFollowNo,//日营销总量
|
|
|
- dailyAVG:parseFloat(item.dayAVG).toFixed(2),//日人均营销量
|
|
|
- weekTelNo:item.weeklyTelNo,//周电话量
|
|
|
- weekFollowNo:item.weeklyFollowNo,//周总量
|
|
|
- weekVisitNo:item.weeklyVisitNo,//周外拜量
|
|
|
- monthsTelNo:item.monthTelNo,//月电话量
|
|
|
- monthsFollowNo:item.monthFollowNo,//月总量
|
|
|
- monthsVisitNo:item.monthVisitNo,//月外拜量
|
|
|
- annualTelNo:item.yearTelNo,//年电话量
|
|
|
- annualFollowNo:item.yearFollowNo,//年总量
|
|
|
- annualVisitNo:item.yearVisitNo,//年外拜量
|
|
|
-
|
|
|
+ departmentId: item.departmentId,//部门ID
|
|
|
+ departmentName: item.departmentName,//部门名称
|
|
|
+ departmentManagerName: item.departmentManagerName,//部门负责人名称
|
|
|
+ departmentNumber: item.departmentNumber, //部门人数
|
|
|
+ privateCustomersCount: item.privateCustomersCount,// 部门客户数
|
|
|
+ dataCount: item.dataCount,// 新增客户数
|
|
|
+ dailyTelNo: item.dayTelNo,//日电话量
|
|
|
+ dailyVisitNo: item.dayVisitNo,//日外拜量
|
|
|
+ dailyFollowNo: item.dayFollowNo,//日营销总量
|
|
|
+ dailyAVG: parseFloat(item.dayAVG).toFixed(2),//日人均营销量
|
|
|
+ weekTelNo: item.weeklyTelNo,//周电话量
|
|
|
+ weekFollowNo: item.weeklyFollowNo,//周总量
|
|
|
+ weekVisitNo: item.weeklyVisitNo,//周外拜量
|
|
|
+ monthsTelNo: item.monthTelNo,//月电话量
|
|
|
+ monthsFollowNo: item.monthFollowNo,//月总量
|
|
|
+ monthsVisitNo: item.monthVisitNo,//月外拜量
|
|
|
+ annualTelNo: item.yearTelNo,//年电话量
|
|
|
+ annualFollowNo: item.yearFollowNo,//年总量
|
|
|
+ annualVisitNo: item.yearVisitNo,//年外拜量
|
|
|
+
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
- if(theArr.length){
|
|
|
+ if (theArr.length) {
|
|
|
theArr.push(
|
|
|
{
|
|
|
- key:9999999,
|
|
|
- theNumber:true,
|
|
|
- departmentName:'合计',
|
|
|
- departmentNumber:total.departmentNumber, //部门人数
|
|
|
- privateCustomersCount:total.privateCustomersCount,// 部门客户数
|
|
|
- dataCount:total.dataCount,// 新增客户数
|
|
|
- dailyTelNo:total.dayTelNo,//日电话量
|
|
|
- dailyVisitNo:total.dayVisitNo,//日外拜量
|
|
|
- dailyFollowNo:total.dayFollowNo,//日营销总量
|
|
|
- dailyAVG:parseFloat(total.dayAVG).toFixed(2),//日人均营销量
|
|
|
- weekTelNo:total.weeklyTelNo,//周电话量
|
|
|
- weekFollowNo:total.weeklyFollowNo,//周总量
|
|
|
- weekVisitNo:total.weeklyVisitNo,//周外拜量
|
|
|
- monthsTelNo:total.monthTelNo,//月电话量
|
|
|
- monthsFollowNo:total.monthFollowNo,//月总量
|
|
|
- monthsVisitNo:total.monthVisitNo,//月外拜量
|
|
|
- annualTelNo:total.yearTelNo,//年电话量
|
|
|
- annualFollowNo:total.yearFollowNo,//年总量
|
|
|
- annualVisitNo:total.yearVisitNo,//年外拜量
|
|
|
+ key: 9999999,
|
|
|
+ theNumber: true,
|
|
|
+ departmentName: '合计',
|
|
|
+ departmentNumber: total.departmentNumber, //部门人数
|
|
|
+ privateCustomersCount: total.privateCustomersCount,// 部门客户数
|
|
|
+ dataCount: total.dataCount,// 新增客户数
|
|
|
+ dailyTelNo: total.dayTelNo,//日电话量
|
|
|
+ dailyVisitNo: total.dayVisitNo,//日外拜量
|
|
|
+ dailyFollowNo: total.dayFollowNo,//日营销总量
|
|
|
+ dailyAVG: parseFloat(total.dayAVG).toFixed(2),//日人均营销量
|
|
|
+ weekTelNo: total.weeklyTelNo,//周电话量
|
|
|
+ weekFollowNo: total.weeklyFollowNo,//周总量
|
|
|
+ weekVisitNo: total.weeklyVisitNo,//周外拜量
|
|
|
+ monthsTelNo: total.monthTelNo,//月电话量
|
|
|
+ monthsFollowNo: total.monthFollowNo,//月总量
|
|
|
+ monthsVisitNo: total.monthVisitNo,//月外拜量
|
|
|
+ annualTelNo: total.yearTelNo,//年电话量
|
|
|
+ annualFollowNo: total.yearFollowNo,//年总量
|
|
|
+ annualVisitNo: total.yearVisitNo,//年外拜量
|
|
|
}
|
|
|
)
|
|
|
}
|
|
@@ -91,7 +91,7 @@ const DiurnalStatistics = React.createClass({
|
|
|
dataSource: theArr,
|
|
|
})
|
|
|
}.bind(this),
|
|
|
- }).always(function() {
|
|
|
+ }).always(function () {
|
|
|
this.setState({
|
|
|
loading: false
|
|
|
});
|
|
@@ -107,110 +107,110 @@ const DiurnalStatistics = React.createClass({
|
|
|
crossDomain: false,
|
|
|
url: globalConfig.context + "/api/admin/report/sales/countMarketingStatistics",
|
|
|
data: {
|
|
|
- type:'1',
|
|
|
- depId:this.state.superId,//部门机构
|
|
|
+ type: '1',
|
|
|
+ depId: this.state.superId,//部门机构
|
|
|
},
|
|
|
- success: function(data) {
|
|
|
+ success: function (data) {
|
|
|
let thedata = data.data;
|
|
|
let theArr = [];
|
|
|
- if(!thedata) {
|
|
|
- if(data.error && data.error.length) {
|
|
|
+ if (!thedata) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
message.warning(data.error[0].message);
|
|
|
};
|
|
|
thedata = {};
|
|
|
- }
|
|
|
+ }
|
|
|
this.loadData(thedata)
|
|
|
this.selectSuperId();
|
|
|
}.bind(this),
|
|
|
- }).always(function() {
|
|
|
+ }).always(function () {
|
|
|
this.setState({
|
|
|
loading: false
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
//时间选择
|
|
|
- selTime(value,index){
|
|
|
- this.setState({
|
|
|
- Dtime:value,
|
|
|
- selTime:index
|
|
|
- })
|
|
|
- },
|
|
|
- //获取上级组织
|
|
|
- selectSuperId() {
|
|
|
- this.state.data = []
|
|
|
- $.ajax({
|
|
|
- method: "get",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/organization/selectSuperId",
|
|
|
- data:{
|
|
|
-
|
|
|
- },
|
|
|
- success: function (data) {
|
|
|
- let theArr = [];
|
|
|
- let theId=[];//用于保存上级组织的ID和名称
|
|
|
- let thedata=data.data;
|
|
|
- if (!thedata) {
|
|
|
- if (data.error && data.error.length) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- };
|
|
|
- thedata = {};
|
|
|
- };
|
|
|
- var contactIds=[];
|
|
|
- for(var i=0;i<data.data.length;i++){
|
|
|
- let theData = data.data[i];
|
|
|
- theArr.push(
|
|
|
- <Select.Option value={theData.id} key={theData.id}>{theData.name}</Select.Option>
|
|
|
- );
|
|
|
- theId.push(
|
|
|
- [theData.id,theData.name]
|
|
|
- );
|
|
|
- };
|
|
|
- this.setState({
|
|
|
- SuperArr:thedata,
|
|
|
- contactsOption: theArr,
|
|
|
- theId: theId,
|
|
|
- orderStatusOptions:data.data,
|
|
|
- });
|
|
|
-
|
|
|
- }.bind(this),
|
|
|
- }).always(function () {
|
|
|
+ selTime(value, index) {
|
|
|
+ this.setState({
|
|
|
+ Dtime: value,
|
|
|
+ selTime: index
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //获取上级组织
|
|
|
+ selectSuperId() {
|
|
|
+ this.state.data = []
|
|
|
+ $.ajax({
|
|
|
+ method: "get",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/api/admin/organization/selectSuperId",
|
|
|
+ data: {
|
|
|
+
|
|
|
+ },
|
|
|
+ success: function (data) {
|
|
|
+ let theArr = [];
|
|
|
+ let theId = [];//用于保存上级组织的ID和名称
|
|
|
+ let thedata = data.data;
|
|
|
+ if (!thedata) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
+ thedata = {};
|
|
|
+ };
|
|
|
+ var contactIds = [];
|
|
|
+ for (var i = 0; i < data.data.length; i++) {
|
|
|
+ let theData = data.data[i];
|
|
|
+ theArr.push(
|
|
|
+ <Select.Option value={theData.id} key={theData.id}>{theData.name}</Select.Option>
|
|
|
+ );
|
|
|
+ theId.push(
|
|
|
+ [theData.id, theData.name]
|
|
|
+ );
|
|
|
+ };
|
|
|
this.setState({
|
|
|
- loading: false
|
|
|
- });
|
|
|
- }.bind(this));
|
|
|
+ SuperArr: thedata,
|
|
|
+ contactsOption: theArr,
|
|
|
+ theId: theId,
|
|
|
+ orderStatusOptions: data.data,
|
|
|
+ });
|
|
|
+
|
|
|
+ }.bind(this),
|
|
|
+ }).always(function () {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ }.bind(this));
|
|
|
},
|
|
|
//判断浏览器类型
|
|
|
getExplorer() {
|
|
|
var explorer = window.navigator.userAgent;
|
|
|
//ie
|
|
|
- if(explorer.indexOf("MSIE") >= 0) {
|
|
|
+ if (explorer.indexOf("MSIE") >= 0) {
|
|
|
return 'ie';
|
|
|
}
|
|
|
//firefox
|
|
|
- else if(explorer.indexOf("Firefox") >= 0) {
|
|
|
+ else if (explorer.indexOf("Firefox") >= 0) {
|
|
|
return 'Firefox';
|
|
|
}
|
|
|
//Chrome
|
|
|
- else if(explorer.indexOf("Chrome") >= 0) {
|
|
|
+ else if (explorer.indexOf("Chrome") >= 0) {
|
|
|
return 'Chrome';
|
|
|
}
|
|
|
//Opera
|
|
|
- else if(explorer.indexOf("Opera") >= 0) {
|
|
|
+ else if (explorer.indexOf("Opera") >= 0) {
|
|
|
return 'Opera';
|
|
|
}
|
|
|
//Safari
|
|
|
- else if(explorer.indexOf("Safari") >= 0) {
|
|
|
+ else if (explorer.indexOf("Safari") >= 0) {
|
|
|
return 'Safari';
|
|
|
}
|
|
|
},
|
|
|
- //导出为exel表格
|
|
|
+ //导出为exel表格
|
|
|
tabExel() {
|
|
|
var table = document.querySelector('#daochu');
|
|
|
var idTmr;
|
|
|
//debugger;
|
|
|
//整个表格拷贝到EXCEL中
|
|
|
- if(this.getExplorer() == 'ie') {
|
|
|
+ if (this.getExplorer() == 'ie') {
|
|
|
var curTbl = document.getElementById(tableid);
|
|
|
var oXL = new ActiveXObject("Excel.Application");
|
|
|
//创建AX对象excel
|
|
@@ -231,7 +231,7 @@ const DiurnalStatistics = React.createClass({
|
|
|
//设置excel可见属性
|
|
|
try {
|
|
|
var fname = oXL.Application.GetSaveAsFilename("Excel.xls", "Excel Spreadsheets (*.xls), *.xls");
|
|
|
- } catch(e) {
|
|
|
+ } catch (e) {
|
|
|
print("Nested catch caught " + e);
|
|
|
} finally {
|
|
|
oWB.SaveAs(fname);
|
|
@@ -245,31 +245,31 @@ const DiurnalStatistics = React.createClass({
|
|
|
idTmr = window.setInterval("Cleanup();", 1);
|
|
|
}
|
|
|
} else {
|
|
|
- this.tableToExcel(table,this.getExplorer());
|
|
|
+ this.tableToExcel(table, this.getExplorer());
|
|
|
}
|
|
|
function Cleanup() {
|
|
|
window.clearInterval(idTmr);
|
|
|
CollectGarbage();
|
|
|
}
|
|
|
},
|
|
|
- tableToExcel(table,name) {
|
|
|
+ tableToExcel(table, name) {
|
|
|
var uri = 'data:application/vnd.ms-excel;base64,',
|
|
|
template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>',
|
|
|
- base64 = function(s) {
|
|
|
+ base64 = function (s) {
|
|
|
return window.btoa(unescape(encodeURIComponent(s)))
|
|
|
},
|
|
|
- format = function(s, c) {
|
|
|
+ format = function (s, c) {
|
|
|
return s.replace(/{(\w+)}/g,
|
|
|
- function(m, p) {
|
|
|
+ function (m, p) {
|
|
|
return c[p];
|
|
|
})
|
|
|
}
|
|
|
- if(!table.nodeType) table = document.getElementById(table);
|
|
|
- var ctx = {
|
|
|
- worksheet: name || 'Worksheet',
|
|
|
- table: table.innerHTML
|
|
|
- };
|
|
|
- window.location.href = uri + base64(format(template, ctx))
|
|
|
+ if (!table.nodeType) table = document.getElementById(table);
|
|
|
+ var ctx = {
|
|
|
+ worksheet: name || 'Worksheet',
|
|
|
+ table: table.innerHTML
|
|
|
+ };
|
|
|
+ window.location.href = uri + base64(format(template, ctx))
|
|
|
},
|
|
|
getInitialState() {
|
|
|
return {
|
|
@@ -278,235 +278,235 @@ const DiurnalStatistics = React.createClass({
|
|
|
loading: false,
|
|
|
visible: false,
|
|
|
showDesc: false,
|
|
|
- timeState:false,
|
|
|
- Dtime:undefined,
|
|
|
- selTime:'',
|
|
|
+ timeState: false,
|
|
|
+ Dtime: undefined,
|
|
|
+ selTime: '',
|
|
|
columns: [
|
|
|
- {
|
|
|
- title: '序号',
|
|
|
- dataIndex: 'nub',
|
|
|
- width:50,
|
|
|
- key: 'nub',
|
|
|
- fixed:false,
|
|
|
- render:(text,record)=>{
|
|
|
- if(!record.theNumber){
|
|
|
- return text
|
|
|
- }else{
|
|
|
- return {
|
|
|
- children: text,
|
|
|
- props: {
|
|
|
- colSpan:0
|
|
|
- },
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '部门',
|
|
|
- dataIndex: 'departmentName',
|
|
|
- key: 'departmentName',
|
|
|
- width:230,
|
|
|
- fixed:false,
|
|
|
- render:(text,record)=>{
|
|
|
- if(!record.theNumber){
|
|
|
- return text//&&text.length>6?<span title={text}>{text.substr(0,6)+'…'}</span>:text
|
|
|
- }else{
|
|
|
- return {
|
|
|
- children: text,
|
|
|
- props: {
|
|
|
- colSpan:3
|
|
|
- },
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }, {
|
|
|
- title: '总经理',
|
|
|
- width:100,
|
|
|
- fixed:false,
|
|
|
- dataIndex: 'departmentManagerName',
|
|
|
- key: 'departmentManagerName',
|
|
|
- render:(text,record)=>{
|
|
|
- if(!record.theNumber){
|
|
|
- return text
|
|
|
- }else{
|
|
|
- return {
|
|
|
- children: text,
|
|
|
- props: {
|
|
|
- colSpan:0
|
|
|
- },
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '部门人数',
|
|
|
- width:100,
|
|
|
- fixed:false,
|
|
|
- dataIndex: 'departmentNumber',
|
|
|
- key: 'departmentNumber',
|
|
|
- render:(text,record)=>{
|
|
|
- if(!record.theNumber){
|
|
|
- return text
|
|
|
- }else{
|
|
|
- return {
|
|
|
- children: text,
|
|
|
- props: {
|
|
|
- colSpan:1
|
|
|
- },
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '部门客户数',
|
|
|
- width:100,
|
|
|
- fixed:false,
|
|
|
- dataIndex: 'privateCustomersCount',
|
|
|
- key: 'privateCustomersCount',
|
|
|
- render:(text,record)=>{
|
|
|
- if(!record.theNumber){
|
|
|
- return text
|
|
|
- }else{
|
|
|
- return {
|
|
|
- children: text,
|
|
|
- props: {
|
|
|
- colSpan:1
|
|
|
- },
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- },{
|
|
|
- title: '新增客户数',
|
|
|
- width:100,
|
|
|
- fixed:false,
|
|
|
- dataIndex: 'dataCount',
|
|
|
- key: 'dataCount',
|
|
|
- render:(text,record)=>{
|
|
|
- if(!record.theNumber){
|
|
|
- return text
|
|
|
- }else{
|
|
|
- return {
|
|
|
- children: text,
|
|
|
- props: {
|
|
|
- colSpan:1
|
|
|
- },
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '今日营销',
|
|
|
- children: [
|
|
|
- {
|
|
|
- title: '营销总量(所有)',
|
|
|
- width:100,
|
|
|
- dataIndex: 'dailyFollowNo',
|
|
|
- key: 'nudailyFollowNom',
|
|
|
- sorter: (a, b) => a.dailyFollowNo - b.dailyFollowNo,
|
|
|
-// sortOrder:'ascend'
|
|
|
- },{
|
|
|
- title: '电话量',
|
|
|
- width:80,
|
|
|
- dataIndex: 'dailyTelNo',
|
|
|
- key: 'dailyTelNo',
|
|
|
- sorter: (a, b) => a.dailyTelNo - b.dailyTelNo,
|
|
|
- },{
|
|
|
- title: '外拜量',
|
|
|
- width:80,
|
|
|
- dataIndex: 'dailyVisitNo',
|
|
|
- key: 'dailyVisitNo',
|
|
|
- sorter: (a, b) => a.dailyVisitNo - b.dailyVisitNo,
|
|
|
- },{
|
|
|
- title: '人均营销量',
|
|
|
- width:110,
|
|
|
- dataIndex: 'dailyAVG',
|
|
|
- key: 'dailyAVG',
|
|
|
- sorter: (a, b) => a.dailyAVG - b.dailyAVG,
|
|
|
+ {
|
|
|
+ title: '序号',
|
|
|
+ dataIndex: 'nub',
|
|
|
+ width: 50,
|
|
|
+ key: 'nub',
|
|
|
+ fixed: false,
|
|
|
+ render: (text, record) => {
|
|
|
+ if (!record.theNumber) {
|
|
|
+ return text
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ children: text,
|
|
|
+ props: {
|
|
|
+ colSpan: 0
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- title: '周营销累计',
|
|
|
- children: [
|
|
|
- {
|
|
|
- title: '周营销总量(所有)',
|
|
|
- width:110,
|
|
|
- dataIndex: 'weekFollowNo',
|
|
|
- key: 'weekFollowNo',
|
|
|
- sorter: (a, b) => a.weekFollowNo - b.weekFollowNo,
|
|
|
- },{
|
|
|
- title: '电话量',
|
|
|
- width:80,
|
|
|
- dataIndex: 'weekTelNo',
|
|
|
- key: 'weekTelNo',
|
|
|
- sorter: (a, b) => a.weekTelNo - b.weekTelNo,
|
|
|
- },{
|
|
|
- title: '外拜量',
|
|
|
- width:80,
|
|
|
- dataIndex: 'weekVisitNo',
|
|
|
- key: 'weekVisitNo',
|
|
|
- sorter: (a, b) => a.weekVisitNo - b.weekVisitNo,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '部门',
|
|
|
+ dataIndex: 'departmentName',
|
|
|
+ key: 'departmentName',
|
|
|
+ width: 230,
|
|
|
+ fixed: false,
|
|
|
+ render: (text, record) => {
|
|
|
+ if (!record.theNumber) {
|
|
|
+ return text//&&text.length>6?<span title={text}>{text.substr(0,6)+'…'}</span>:text
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ children: text,
|
|
|
+ props: {
|
|
|
+ colSpan: 3
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- ],
|
|
|
- },{
|
|
|
- title: '月营销累计',
|
|
|
- children: [
|
|
|
- {
|
|
|
- title: '月营销总量(所有)',
|
|
|
- width:110,
|
|
|
- dataIndex: 'monthsFollowNo',
|
|
|
- key: 'monthsFollowNo',
|
|
|
- sorter: (a, b) => a.monthsFollowNo - b.monthsFollowNo,
|
|
|
- },{
|
|
|
- title: '电话量',
|
|
|
- width:80,
|
|
|
- dataIndex: 'monthsTelNo',
|
|
|
- key: 'monthsTelNo',
|
|
|
- sorter: (a, b) => a.monthsTelNo - b.monthsTelNo,
|
|
|
- },{
|
|
|
- title: '外拜量',
|
|
|
- width:80,
|
|
|
- dataIndex: 'monthsVisitNo',
|
|
|
- key: 'monthsVisitNo',
|
|
|
- sorter: (a, b) => a.monthsVisitNo - b.monthsVisitNo,
|
|
|
+ }, {
|
|
|
+ title: '总经理',
|
|
|
+ width: 100,
|
|
|
+ fixed: false,
|
|
|
+ dataIndex: 'departmentManagerName',
|
|
|
+ key: 'departmentManagerName',
|
|
|
+ render: (text, record) => {
|
|
|
+ if (!record.theNumber) {
|
|
|
+ return text
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ children: text,
|
|
|
+ props: {
|
|
|
+ colSpan: 0
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '部门人数',
|
|
|
+ width: 100,
|
|
|
+ fixed: false,
|
|
|
+ dataIndex: 'departmentNumber',
|
|
|
+ key: 'departmentNumber',
|
|
|
+ render: (text, record) => {
|
|
|
+ if (!record.theNumber) {
|
|
|
+ return text
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ children: text,
|
|
|
+ props: {
|
|
|
+ colSpan: 1
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- ],
|
|
|
- },{
|
|
|
- title: '年营销累计',
|
|
|
- children: [
|
|
|
- {
|
|
|
- title: '年营销总量(所有)',
|
|
|
- width:110,
|
|
|
- dataIndex: 'annualFollowNo',
|
|
|
- key: 'annualFollowNo',
|
|
|
- sorter: (a, b) => a.annualFollowNo - b.annualFollowNo,
|
|
|
- },{
|
|
|
- title: '电话量',
|
|
|
- width:80,
|
|
|
- dataIndex: 'annualTelNo',
|
|
|
- key: 'annualTelNo',
|
|
|
- sorter: (a, b) => a.annualTelNo - b.annualTelNo,
|
|
|
- },{
|
|
|
- title: '外拜量',
|
|
|
- width:80,
|
|
|
- dataIndex: 'annualVisitNo',
|
|
|
- key: 'annualVisitNo',
|
|
|
- sorter: (a, b) => a.annualVisitNo - b.annualVisitNo,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '部门客户数',
|
|
|
+ width: 100,
|
|
|
+ fixed: false,
|
|
|
+ dataIndex: 'privateCustomersCount',
|
|
|
+ key: 'privateCustomersCount',
|
|
|
+ render: (text, record) => {
|
|
|
+ if (!record.theNumber) {
|
|
|
+ return text
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ children: text,
|
|
|
+ props: {
|
|
|
+ colSpan: 1
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- ],
|
|
|
- }
|
|
|
+ }, {
|
|
|
+ title: '新增客户数',
|
|
|
+ width: 100,
|
|
|
+ fixed: false,
|
|
|
+ dataIndex: 'dataCount',
|
|
|
+ key: 'dataCount',
|
|
|
+ render: (text, record) => {
|
|
|
+ if (!record.theNumber) {
|
|
|
+ return text
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ children: text,
|
|
|
+ props: {
|
|
|
+ colSpan: 1
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '今日营销',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ title: '营销总量(所有)',
|
|
|
+ width: 100,
|
|
|
+ dataIndex: 'dailyFollowNo',
|
|
|
+ key: 'nudailyFollowNom',
|
|
|
+ sorter: (a, b) => a.dailyFollowNo - b.dailyFollowNo,
|
|
|
+ // sortOrder:'ascend'
|
|
|
+ }, {
|
|
|
+ title: '电话量',
|
|
|
+ width: 80,
|
|
|
+ dataIndex: 'dailyTelNo',
|
|
|
+ key: 'dailyTelNo',
|
|
|
+ sorter: (a, b) => a.dailyTelNo - b.dailyTelNo,
|
|
|
+ }, {
|
|
|
+ title: '外拜量',
|
|
|
+ width: 80,
|
|
|
+ dataIndex: 'dailyVisitNo',
|
|
|
+ key: 'dailyVisitNo',
|
|
|
+ sorter: (a, b) => a.dailyVisitNo - b.dailyVisitNo,
|
|
|
+ }, {
|
|
|
+ title: '人均营销量',
|
|
|
+ width: 110,
|
|
|
+ dataIndex: 'dailyAVG',
|
|
|
+ key: 'dailyAVG',
|
|
|
+ sorter: (a, b) => a.dailyAVG - b.dailyAVG,
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '周营销累计',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ title: '周营销总量(所有)',
|
|
|
+ width: 110,
|
|
|
+ dataIndex: 'weekFollowNo',
|
|
|
+ key: 'weekFollowNo',
|
|
|
+ sorter: (a, b) => a.weekFollowNo - b.weekFollowNo,
|
|
|
+ }, {
|
|
|
+ title: '电话量',
|
|
|
+ width: 80,
|
|
|
+ dataIndex: 'weekTelNo',
|
|
|
+ key: 'weekTelNo',
|
|
|
+ sorter: (a, b) => a.weekTelNo - b.weekTelNo,
|
|
|
+ }, {
|
|
|
+ title: '外拜量',
|
|
|
+ width: 80,
|
|
|
+ dataIndex: 'weekVisitNo',
|
|
|
+ key: 'weekVisitNo',
|
|
|
+ sorter: (a, b) => a.weekVisitNo - b.weekVisitNo,
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ }, {
|
|
|
+ title: '月营销累计',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ title: '月营销总量(所有)',
|
|
|
+ width: 110,
|
|
|
+ dataIndex: 'monthsFollowNo',
|
|
|
+ key: 'monthsFollowNo',
|
|
|
+ sorter: (a, b) => a.monthsFollowNo - b.monthsFollowNo,
|
|
|
+ }, {
|
|
|
+ title: '电话量',
|
|
|
+ width: 80,
|
|
|
+ dataIndex: 'monthsTelNo',
|
|
|
+ key: 'monthsTelNo',
|
|
|
+ sorter: (a, b) => a.monthsTelNo - b.monthsTelNo,
|
|
|
+ }, {
|
|
|
+ title: '外拜量',
|
|
|
+ width: 80,
|
|
|
+ dataIndex: 'monthsVisitNo',
|
|
|
+ key: 'monthsVisitNo',
|
|
|
+ sorter: (a, b) => a.monthsVisitNo - b.monthsVisitNo,
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ }, {
|
|
|
+ title: '年营销累计',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ title: '年营销总量(所有)',
|
|
|
+ width: 110,
|
|
|
+ dataIndex: 'annualFollowNo',
|
|
|
+ key: 'annualFollowNo',
|
|
|
+ sorter: (a, b) => a.annualFollowNo - b.annualFollowNo,
|
|
|
+ }, {
|
|
|
+ title: '电话量',
|
|
|
+ width: 80,
|
|
|
+ dataIndex: 'annualTelNo',
|
|
|
+ key: 'annualTelNo',
|
|
|
+ sorter: (a, b) => a.annualTelNo - b.annualTelNo,
|
|
|
+ }, {
|
|
|
+ title: '外拜量',
|
|
|
+ width: 80,
|
|
|
+ dataIndex: 'annualVisitNo',
|
|
|
+ key: 'annualVisitNo',
|
|
|
+ sorter: (a, b) => a.annualVisitNo - b.annualVisitNo,
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ }
|
|
|
],
|
|
|
dataSource: [],
|
|
|
};
|
|
@@ -518,11 +518,11 @@ const DiurnalStatistics = React.createClass({
|
|
|
this.state.superId = undefined;//部门机构清零
|
|
|
this.totalData()
|
|
|
this.setState({
|
|
|
- order:"false"
|
|
|
+ order: "false"
|
|
|
})
|
|
|
},
|
|
|
//重构排序
|
|
|
- tabChange(pagination,filter,sorter){
|
|
|
+ tabChange(pagination, filter, sorter) {
|
|
|
console.log(pagination)
|
|
|
console.log(sorter)
|
|
|
},
|
|
@@ -542,30 +542,30 @@ const DiurnalStatistics = React.createClass({
|
|
|
componentWillMount() {
|
|
|
//this.loadData();
|
|
|
this.totalData();
|
|
|
- let times=new Date();
|
|
|
- let nowTime=times.getFullYear()+'年'+(times.getMonth()+1)+'月'+times.getDate()+'日';
|
|
|
+ let times = new Date();
|
|
|
+ let nowTime = times.getFullYear() + '年' + (times.getMonth() + 1) + '月' + times.getDate() + '日';
|
|
|
this.setState({
|
|
|
- Nowtime:nowTime
|
|
|
+ Nowtime: nowTime
|
|
|
})
|
|
|
},
|
|
|
render() {
|
|
|
let departmentArr = this.state.departmentArr || [];
|
|
|
- return(
|
|
|
+ return (
|
|
|
<div className='set-content'>
|
|
|
- <p style={{fontSize:'20px',marginBottom:'10px'}}>客户营销统计表(部门)</p>
|
|
|
+ <p style={{ fontSize: '20px', marginBottom: '10px' }}>客户营销统计表(部门)</p>
|
|
|
<Tabs defaultActiveKey="1" className="test">
|
|
|
<TabPane tab="搜索" key="1">
|
|
|
- <div className="clearfix" style={{paddingTop:'11px'}}>
|
|
|
- <Button type="primary" onClick={this.tabExel} style={{ float:'right' }}>导出到表格</Button>
|
|
|
- <span style={{fontSize:'16px'}}>部门机构 : </span>
|
|
|
+ <div className="clearfix" style={{ paddingTop: '11px' }}>
|
|
|
+ <Button type="primary" onClick={this.tabExel} style={{ float: 'right' }}>导出到表格</Button>
|
|
|
+ <span style={{ fontSize: '16px' }}>部门机构 : </span>
|
|
|
<Select placeholder="选择部门"
|
|
|
- style={{ width:'200px',marginRight:'10px' }}
|
|
|
- value={this.state.superId}
|
|
|
- onChange={(e) => { this.setState({ superId: e }) }} notFoundContent="未获取到上级组织列表">
|
|
|
- {this.state.contactsOption}
|
|
|
+ style={{ width: '200px', marginRight: '10px' }}
|
|
|
+ value={this.state.superId}
|
|
|
+ onChange={(e) => { this.setState({ superId: e }) }} notFoundContent="未获取到上级组织列表">
|
|
|
+ {this.state.contactsOption}
|
|
|
</Select>
|
|
|
|
|
|
- <Button type="primary" onClick={this.search} style={{marginLeft:'10px',marginRight:'10px'}}>搜索</Button>
|
|
|
+ <Button type="primary" onClick={this.search} style={{ marginLeft: '10px', marginRight: '10px' }}>搜索</Button>
|
|
|
<Button onClick={this.reset}>重置</Button>
|
|
|
</div>
|
|
|
</TabPane>
|
|
@@ -583,27 +583,28 @@ const DiurnalStatistics = React.createClass({
|
|
|
</Tabs>
|
|
|
<div id='daochu'>
|
|
|
<div className="surfaceTitle">
|
|
|
- <span className="nowtime" style={{fontWeight:'bold'}}>{this.state.timeState?this.state.txtTime:this.state.Nowtime}</span>
|
|
|
- <span style={{fontWeight:'bold'}}>客户营销统计表(部门)</span>
|
|
|
+ <span className="nowtime" style={{ fontWeight: 'bold' }}>{this.state.timeState ? this.state.txtTime : this.state.Nowtime}</span>
|
|
|
+ <span style={{ fontWeight: 'bold' }}>客户营销统计表(部门)</span>
|
|
|
</div>
|
|
|
<div className="patent-table" id='daochu'>
|
|
|
<div className="scroll">
|
|
|
- <Spin spinning={this.state.loading}>
|
|
|
- <Table columns={
|
|
|
- this.state.changeList
|
|
|
- ? this.state.changeList
|
|
|
- : this.state.columns
|
|
|
+ <Spin spinning={this.state.loading}>
|
|
|
+ <Table
|
|
|
+ columns={
|
|
|
+ this.state.changeList
|
|
|
+ ? this.state.changeList
|
|
|
+ : this.state.columns
|
|
|
}
|
|
|
- dataSource={this.state.dataSource}
|
|
|
- //scroll={{ x: 600,y:500}}
|
|
|
- bordered
|
|
|
- onChange={this.tabChange}
|
|
|
- pagination={false}
|
|
|
- />
|
|
|
- </Spin>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ dataSource={this.state.dataSource}
|
|
|
+ //scroll={{ x: 600,y:500}}
|
|
|
+ bordered
|
|
|
+ onChange={this.tabChange}
|
|
|
+ pagination={false}
|
|
|
+ />
|
|
|
+ </Spin>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
@@ -611,19 +612,19 @@ const DiurnalStatistics = React.createClass({
|
|
|
|
|
|
|
|
|
|
|
|
-const Tablees=Form.create()(React.createClass({
|
|
|
+const Tablees = Form.create()(React.createClass({
|
|
|
//详情tab切换数据处理
|
|
|
callbacks(e) {
|
|
|
this.setState({
|
|
|
callnubs: e,
|
|
|
})
|
|
|
- if(e == '1') {
|
|
|
-
|
|
|
+ if (e == '1') {
|
|
|
+
|
|
|
}
|
|
|
- if(e == '2') {
|
|
|
-
|
|
|
+ if (e == '2') {
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
getInitialState() {
|
|
|
return {
|
|
@@ -631,16 +632,16 @@ const Tablees=Form.create()(React.createClass({
|
|
|
}
|
|
|
},
|
|
|
render() {
|
|
|
- return(
|
|
|
- <div className="clearfix" style={{marginTop:'0px',marginLeft:'10px'}}>
|
|
|
- <Tabs onChange={this.callbacks} type="card" activeKey={this.state.callnubs} style={{paddingLeft:'15px',paddingRight:'15px',marginRight:'20px'}}>
|
|
|
- <TabPane tab="客户营销统计表(部门)" key="1" >
|
|
|
- <DiurnalStatistics />
|
|
|
- </TabPane>
|
|
|
- <TabPane tab="客户营销统计表(员工)" key="2">
|
|
|
- <DiurnalStatisticsOne />
|
|
|
- </TabPane>
|
|
|
- </Tabs>
|
|
|
+ return (
|
|
|
+ <div className="clearfix" style={{ marginTop: '0px', marginLeft: '10px' }}>
|
|
|
+ <Tabs onChange={this.callbacks} type="card" activeKey={this.state.callnubs} style={{ paddingLeft: '15px', paddingRight: '15px', marginRight: '20px' }}>
|
|
|
+ <TabPane tab="客户营销统计表(部门)" key="1" >
|
|
|
+ <DiurnalStatistics />
|
|
|
+ </TabPane>
|
|
|
+ <TabPane tab="客户营销统计表(员工)" key="2">
|
|
|
+ <DiurnalStatisticsOne />
|
|
|
+ </TabPane>
|
|
|
+ </Tabs>
|
|
|
</div>
|
|
|
);
|
|
|
}
|