dengzhiguo 6 years ago
parent
commit
297f0ef3c2

+ 72 - 0
js/component/dataDic.js

@@ -2282,4 +2282,76 @@ module.exports = {
 	        label: "科技成果"
 	    }
     ],
+    year:[
+    	{
+	        value: "2010",
+	        key: "2010"
+	    },{
+	        value: "2011",
+	        key: "2011"
+	    },{
+	        value: "2012",
+	        key: "2012"
+	    },{
+	        value: "2013",
+	        key: "2013"
+	    },{
+	        value: "2014",
+	        key: "2014"
+	    },{
+	        value: "2015",
+	        key: "2015"
+	    },{
+	        value: "2016",
+	        key: "2016"
+	    },{
+	        value: "2017",
+	        key: "2017"
+	    },{
+	        value: "2018",
+	        key: "2018"
+	    },{
+	        value: "2019",
+	        key: "2019"
+	    },{
+	        value: "2020",
+	        key: "2020"
+	    },{
+	        value: "2021",
+	        key: "2021"
+	    },{
+	        value: "2022",
+	        key: "2022"
+	    },{
+	        value: "2023",
+	        key: "2023"
+	    }
+    ],
+    xiangmoState:[
+    	{
+	        value: "0",
+	        key: "申报中"
+	    },{
+	        value: "1",
+	        key: "已交材料"
+	    },{
+	        value: "2",
+	        key: "已立项"
+	    },{
+	        value: "3",
+	        key: "未立项"
+	    },{
+	        value: "4",
+	        key: "监理中"
+	    },{
+	        value: "5",
+	        key: "验收中"
+	    },{
+	        value: "6",
+	        key: "验收合格"
+	    },{
+	        value: "7",
+	        key: "验收不合格"
+	    }
+    ],
 };

+ 675 - 8
js/component/manageCenter/customer/NEW/crm/crm.jsx

@@ -1,15 +1,20 @@
 import React from 'react';
-import { Radio, Icon, Button, AutoComplete,Cascader,Input, Select, Spin, Popconfirm, Table, Switch, message, DatePicker, Upload, Form ,Modal,Tabs,Card } from 'antd';
+import { Radio, Icon, Button, AutoComplete,Cascader,Input, Select, Spin, Popconfirm, Table, Switch, message,Calendar , DatePicker, Upload, Form ,Modal,Tabs,Card } from 'antd';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import moment from 'moment';
+import {Document,Page}from 'react-pdf';
+import PDF from 'react-pdf';
+import 'viewer/dist/crocodoc.viewer.css';
 import TechAchievementDesc from '@/manageCenter/achievement/crmAchievement.jsx';
 import { citySelect, provinceList ,areaSelect} from '@/NewDicProvinceList';
-import { socialAttribute, industry, auditStatusL, lvl, currentMember ,slcRedit,dataGrade} from '@/dataDic.js';
-import { getSocialAttribute, beforeUploadFile,splitUrl ,getSlcRedit,getDataGrade,getAchievementCategory,getTechAuditStatus,getboutique,getPreviews,getPreview} from '@/tools.js';
+import { socialAttribute, industry, auditStatusL, lvl, currentMember ,slcRedit,dataGrade,year,xiangmoState} from '@/dataDic.js';
+import { getSocialAttribute, beforeUploadFile,splitUrl ,getSlcRedit,getDataGrade,getAchievementCategory,getTechAuditStatus,getboutique,getPreviews,getPreview,getXiangmoState} from '@/tools.js';
 import './customer.less';
 const TabPane = Tabs.TabPane;
 const Dragger = Upload.Dragger;
+console.log(Document);
+//onDocumentLoad
 //图片组件
 const PicturesWall = React.createClass({
 	getInitialState() {
@@ -198,8 +203,113 @@ const IntentionCustomer = Form.create()(React.createClass({
             });
         }.bind(this));
     },
+    loadDatac(pageNo, apiUrl) {
+		this.setState({
+			loading: true,
+		});
+		$.ajax({
+			method: "get",
+			dataType: "json",
+			crossDomain: false,
+			url: globalConfig.context +"/api/admin/customers/selectListOrgAnnual",
+			data: {
+//				pageNo: pageNo || 1,
+//				pageSize: this.state.pagination.pageSize,
+				uid:this.state.uid,
+			},
+			success: function(data) {
+				let theArr = [];
+				if(data.error.length || data.data.list == "") {
+					if(data.error && data.error.length) {
+						message.warning(data.error[0].message);
+					};
+				} else {
+					for(let i = 0; i < data.data.list.length; i++) {
+						let thisdata = data.data.list[i];
+						let diqu=(thisdata.province==null?"":thisdata.province)+(thisdata.city==null?"":"-"+thisdata.city)+(thisdata.area==null?"":"-"+thisdata.area);
+						theArr.push({
+							key: i,
+							id: thisdata.id,//年报ID
+							year:thisdata.year,//年份
+							salesAmount: thisdata.salesAmount,//营销额
+							researchAmount: thisdata.researchAmount,//研发费用
+							assets: thisdata.assets,//总资产
+							aid: thisdata.aid,//录入人
+						});
+					};
+//					this.state.pagination.current = data.data.pageNo;
+//				    this.state.pagination.total = data.data.totalCount;
+				};
+				if(data.data&&data.data.list&&!data.data.list.length){
+					this.state.pagination.current=0
+					this.state.pagination.total=0
+				}
+				this.setState({
+					dataSourcec: theArr,
+//					pageNo: pageNo,
+//					pagination: this.state.pagination,
+//					selectedRowKeys:[]
+				});
+			}.bind(this),
+		}).always(function() {
+			this.setState({
+				loading: false
+			});
+		}.bind(this));
+	},
+	loadDatax(pageNo, apiUrl) {
+		this.setState({
+			loading: true,
+		});
+		$.ajax({
+			method: "get",
+			dataType: "json",
+			crossDomain: false,
+			url: globalConfig.context +"/api/admin/customers/selectListOrgYearProject",
+			data: {
+				uid:this.state.uid,
+			},
+			success: function(data) {
+				let theArr = [];
+				if(data.error.length || data.data.list == "") {
+					if(data.error && data.error.length) {
+						message.warning(data.error[0].message);
+					};
+				} else {
+					for(let i = 0; i < data.data.list.length; i++) {
+						let thisdata = data.data.list[i];
+						let diqu=(thisdata.province==null?"":thisdata.province)+(thisdata.city==null?"":"-"+thisdata.city)+(thisdata.area==null?"":"-"+thisdata.area);
+						theArr.push({
+							key: i,
+							id: thisdata.id,//用户ID
+							projectName:thisdata.projectName,//项目名称
+							year: thisdata.year,//年份
+							status: thisdata.status.toString(),//项目状态
+							remark: thisdata.remark,//备注
+							aid: thisdata.aid,//录入人
+						});
+					};
+//					this.state.pagination.current = data.data.pageNo;
+//				    this.state.pagination.total = data.data.totalCount;
+				};
+				if(data.data&&data.data.list&&!data.data.list.length){
+					this.state.pagination.current=0
+					this.state.pagination.total=0
+				}
+				this.setState({
+					dataSourcex: theArr,
+				});
+			}.bind(this),
+		}).always(function() {
+			this.setState({
+				loading: false
+			});
+		}.bind(this));
+	},
 	getInitialState() {
 		return {
+			pages:1,
+			pdfUrl:'',
 			addressSearch: [],
 			orgCodeUrl: [],
 			companyLogoUrl: [],
@@ -215,6 +325,11 @@ const IntentionCustomer = Form.create()(React.createClass({
 			pojectApplicationUrl:"",
 			isXian:0,
 			modalVisible:false,
+			numPages: null,
+    		pageNumber: 1,
+    		pagec:1,
+    		pages:2,
+    		isXin:1,
 			pagination: {
 				defaultCurrent: 1,
 				defaultPageSize: 10,
@@ -269,9 +384,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 				}
 			],
 			data: [],
-			dataman: [],
 			dataSource: [],
-			visitArrList: [],
 			columnsDate: [
                 {
                     title: '编号',
@@ -313,6 +426,73 @@ const IntentionCustomer = Form.create()(React.createClass({
                 },
             ],
             dataSourceDate: [],
+            columnsc: [{
+					title: '年份',
+					dataIndex: 'year',
+					key: 'year',
+				}, {
+					title: '营销额(万)',
+					dataIndex: 'salesAmount',
+					key: 'salesAmount',
+				},
+				{
+					title: '总资产(万)',
+					dataIndex: 'assets',
+					key: 'assets'
+				}, {
+					title: '研发费用(万)',
+					dataIndex: 'researchAmount',
+					key: 'researchAmount',
+				},{
+                	title: '操作',
+                    dataIndex: 'rrtk',
+                    key: 'rrtk',
+                    render:(text,record,index)=>{
+                    	return (
+                    		<div>
+								<Popconfirm title={'您将删除该条财务信息,请确认!'} onConfirm={(e)=>{this.deltalc(record)}} okText="确认" cancelText="取消">
+							   	   <Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation()}} type="danger">删除</Button>                 
+								</Popconfirm>
+							</div>
+							)
+                    }
+                }
+			],
+			dataSourcec: [],
+			columnsx: [{
+					title: '项目名称',
+					dataIndex: 'projectName',
+					key: 'projectName',
+				},{
+					title: '年份',
+					dataIndex: 'year',
+					key: 'year',
+				}, 
+				{
+					title: '项目状态',
+					dataIndex: 'status',
+					key: 'status',
+					render: text => { return getXiangmoState(text); }
+				}, {
+					title: '备注',
+					dataIndex: 'remark',
+					key: 'remark',
+				},{
+                	title: '操作',
+                    dataIndex: 'rrtk',
+                    key: 'rrtk',
+                    render:(text,record,index)=>{
+                    	return (
+                    		<div>
+								<Popconfirm title={'您将删除该项目,请确认!'} onConfirm={(e)=>{this.deltalx(record)}} okText="确认" cancelText="取消">
+							   	   <Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation()}} type="danger">删除</Button>                 
+								</Popconfirm>
+							</div>
+							)
+                    }
+                }
+			],
+			dataSourcex: [],
 		};
 	},
 	componentWillMount() {
@@ -365,6 +545,22 @@ const IntentionCustomer = Form.create()(React.createClass({
 		this.state.releaseDate[1] = undefined;
 		this.loadData();
 	},
+	resetc() {
+		this.state.id=undefined;//年报ID
+		this.state.assets=undefined;//总资产
+		this.state.researchAmount=undefined;//研发费用
+		this.state.salesAmount = undefined;//销售额
+		this.state.year = undefined;//年份清零
+		
+	},
+	resetx() {
+		this.state.id=undefined;//年报ID
+		this.state.projectName=undefined;//项目名称
+		this.state.status=undefined;//项目状态
+		this.state.remark = undefined;//备注
+		this.state.year = undefined;//年份清零
+		
+	},
 	//列表详情
 	details(id) {
 		$.ajax({
@@ -569,6 +765,80 @@ const IntentionCustomer = Form.create()(React.createClass({
 		}.bind(this));
 
 	},
+	//财务信息提交
+	newSubmitc(e) {
+		e.preventDefault();
+		if(!this.state.year) {
+			message.warning('请选择年份');
+			return false;
+		};
+		this.setState({
+			loading: true
+		});
+		console.log(this.state.isXin);
+		$.ajax({
+			method: "post",
+			dataType: "json",
+			url: globalConfig.context + this.state.isXin==1?'/api/admin/customers/addOrgAnnual':'/api/admin/customers/updateOrgAnnual',
+			data: {
+				id:this.state.id?this.state.id:undefined,//年报ID
+				uid:this.state.uid,//客户ID
+				year:this.state.year,//年份
+				researchAmount:this.state.researchAmount,//研发费用
+				assets:this.state.assets,//总资产
+				salesAmount:this.state.salesAmount,//销售额
+			}
+		}).done(function(data) {
+			this.setState({
+				loading: false
+			});
+			if(!data.error.length) {
+				message.success('保存成功!');
+				this.visitCancelc();
+				this.loadDatac();
+			} else {
+				message.warning(data.error[0].message);
+			}
+		}.bind(this));
+
+	},
+	//财务信息提交
+	newSubmitx(e) {
+		e.preventDefault();
+		if(!this.state.year) {
+			message.warning('请选择年份');
+			return false;
+		};
+		this.setState({
+			loading: true
+		});
+		console.log(this.state.isXin);
+		$.ajax({
+			method: "post",
+			dataType: "json",
+			url: globalConfig.context + this.state.isXinx==1?'/api/admin/customers/addOrgYearProject':'/api/admin/customers/updateOrgYearProject',
+			data: {
+				id:this.state.id?this.state.id:undefined,//年报ID
+				uid:this.state.uid,//客户ID
+				year:this.state.year,//年份
+				projectName:this.state.projectName,//研发费用
+				status:this.state.status,//总资产
+				remark:this.state.remark,//销售额
+			}
+		}).done(function(data) {
+			this.setState({
+				loading: false
+			});
+			if(!data.error.length) {
+				message.success('保存成功!');
+				this.visitCancelc();
+				this.loadDatax();
+			} else {
+				message.warning(data.error[0].message);
+			}
+		}.bind(this));
+
+	},
 	//获取ID
 	getStateData(id) {
         this.setState({
@@ -616,6 +886,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 		this.state.isXian=0;
 		this.details(record.id);
 	},
+	
 	//指定转交人自动补全
 	supervisor(e){ 
 		$.ajax({
@@ -727,6 +998,118 @@ const IntentionCustomer = Form.create()(React.createClass({
 			callnub:"0"
 		});
 	},
+	//新增年报打开
+	visitOkc(e) {
+		this.setState({
+			visitModulc: true,
+			visitModulx: true
+		});
+	},
+	//新增年报关闭
+	visitCancelc(e) {
+		this.resetc();
+		this.resetx();
+		this.setState({
+			visitModulc: false,
+			visitModulx: false,
+		});
+	},
+	
+	//PDF打开
+	visitOk1(e) {
+		alert(1)
+		this.getPrevie(this.state.uid, 'techProject', 'organization_application');
+//		this.showPdf(this.state.pdfUrl);
+		this.setState({
+			visitModul1: true
+		});
+		
+	},
+	//PDF关闭
+	visitCancel1(e) {
+		this.setState({
+			visitModul1: false,
+		});
+	},
+//	showPdf(url) {
+//      PDFJS.workerSrc = 'pdf.worker.js';
+//      PDFJS.getDocument(url).then(function getPdfHelloWorld(pdf) {
+//          pdf.getPage(1).then(function getPageHelloWorld(page) {
+//              var scale = 1;
+//              var viewport = page.getViewport(scale);
+//              var canvas = document.getElementById('the-canvas');
+//              var context = canvas.getContext('2d');
+//              canvas.height = viewport.height;
+//              canvas.width = viewport.width;
+//              var renderContext = {
+//                  canvasContext: context,
+//                  viewport: viewport
+//              };
+//              page.render(renderContext);
+//          });
+//      });
+//  },
+	//获取PDF地址
+	getPrevie(id,url,sign){
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/customer/" + url,
+            data:{
+                "id": id,
+                "sign": sign
+                },
+            success: function (data) {
+                if (!data.data) {
+                    if ( data.error && data.error.length ) {
+                        message.warning(data.error[0].message);
+                    };
+                };
+				alert(2)
+                this.setState({
+					pdfUrl: location.origin + globalConfig.context + "/open/preview?" + data.data,
+				});
+            }.bind(this)
+        });
+    },
+    //PDF分页
+   	onDocumentComplete (pages) {
+   		alert(222)
+    	this.setState({ page: 1, pages:8 });
+  	},
+ 
+  	handlePrevious (){
+  		alert(this.state.page)
+    	this.setState({ page: this.state.page - 1 });
+  	},
+ 
+ 	handleNext (){
+ 		alert(this.state.page)
+    	this.setState({ page: this.state.page + 1 });
+ 	},
+ 	renderPagination (page,pages) {
+	    let previousButton = <li className="previous" onClick={this.handlePrevious}><a href="#"><i className="fa fa-arrow-left">上一页</i> </a></li>;
+    if (page === 1) {
+      previousButton = <li className="previous disabled"><a href="#"><i className="fa fa-arrow-left">上一页1</i> </a></li>;
+    }
+    let nextButton = <li className="next" onClick={this.handleNext}><a href="#"> <i className="fa fa-arrow-right">下一页</i></a></li>;
+    if (page === pages) {
+      nextButton = <li className="next disabled"><a href="#"> <i className="fa fa-arrow-right">下一页1</i></a></li>;
+    }
+    return (
+      <nav>
+        <ul className="pager">
+          {previousButton}
+          {nextButton}
+        </ul>
+      </nav>
+      );
+  	},
+  	
+ 	//上面是做PDF分页的
+ 	
+ 	
 	getOrgCodeUrl(e) {
 		this.setState({ orgCodeUrl: e });
 	},
@@ -756,6 +1139,18 @@ const IntentionCustomer = Form.create()(React.createClass({
 			})
 			this.loadDatas();
 		}
+		if(e == '2') {
+			this.setState({
+				callnub: e,
+			})
+			this.loadDatac();
+		}
+		if(e == '3') {
+			this.setState({
+				callnub: e,
+			})
+			this.loadDatax();
+		}
 	},
 	//发布成果
 	addClick() {
@@ -764,6 +1159,24 @@ const IntentionCustomer = Form.create()(React.createClass({
             showDesc: true,
         });
     },
+    //新增财务信息
+	addClickc() {
+        this.state.RowData = {};
+        this.resetc();
+        this.setState({
+            visitModulc: true,
+            isXin:1,
+        });
+    },
+    //新增项目信息
+	addClickx() {
+        this.state.RowData = {};
+        this.resetx();
+        this.setState({
+            visitModulx: true,
+            isXinx:1,
+        });
+    },
     //关闭发布成果
     closeDesc(e, s) {
         this.state.showDesc = e;
@@ -771,6 +1184,7 @@ const IntentionCustomer = Form.create()(React.createClass({
             this.loadDatas();
         };
     },
+    //客户资料每行点击
     tableRowClickDate(record, index) {
         this.state.RowData = record;
         if(index!=undefined){
@@ -779,7 +1193,94 @@ const IntentionCustomer = Form.create()(React.createClass({
         	});
         }
     },
+    //年度每行点击
+    tableRowClickDatec(record, index) {
+        this.state.RowData = record;
+        if(index!=undefined){
+        	this.setState({
+        		isXin:2,
+            	visitModulc: true,
+            	year:record.year.toString(),//年份
+            	id:record.id,//年报详情ID
+            	assets:record.assets,//总资产
+            	researchAmount:record.researchAmount,//研发费用
+            	salesAmount:record.salesAmount,//销售额
+        	});
+        }
+    },
+    //项目每行点击
+    tableRowClickDatex(record, index) {
+        this.state.RowData = record;
+        if(index!=undefined){
+        	this.setState({
+        		isXinx:2,
+            	visitModulx: true,
+            	year:record.year.toString(),//年份
+            	id:record.id,//年报详情ID
+            	projectName:record.projectName,//项目名称
+            	status:record.status.toString(),//项目状态
+            	remark:record.remark,//销售额
+        	});
+        }
+    },
+    onDocumentLoad () {
+    	this.setState({ numPages });
+  	},
+  	//删除财务信息
+    deltalc(record){
+    	this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/admin/customers/delectOrgAnnual',
+            data: {
+            	id:record.id
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('操作成功');
+                this.setState({
+                    loading: false,
+                });
+                this.loadDatac();
+            } else {
+                message.warning(data.error[0].message);
+            };
+        }.bind(this));
+    },
+    //删除财务信息
+    deltalx(record){
+    	this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/admin/customers/delectOrgYearProject',
+            data: {
+            	id:record.id
+            }
+        }).done(function (data) {
+            if (!data.error.length) {
+                message.success('操作成功');
+                this.setState({
+                    loading: false,
+                });
+                this.loadDatax();
+            } else {
+                message.warning(data.error[0].message);
+            };
+        }.bind(this));
+    },
 	render() {
+		let paginationss = null;
+		if (this.state.pages) {
+			paginationss = this.renderPagination(this.state.page, this.state.pages);
+		}
 		const {
 			RangePicker,
 			MonthPicker
@@ -788,6 +1289,10 @@ const IntentionCustomer = Form.create()(React.createClass({
 			labelCol: { span: 8 },
 			wrapperCol: { span: 14 },
 		};
+		const formItemLayoutc = {
+			labelCol: { span: 6 },
+			wrapperCol: { span: 14 },
+		};
 		const FormItem = Form.Item;
 		const rowSelection = {
 			selectedRowKeys: this.state.selectedRowKeys,
@@ -828,6 +1333,8 @@ const IntentionCustomer = Form.create()(React.createClass({
 			  },
 			  
 			};
+		let pdfUrl =this.state.pdfUrl||'';
+		console.log(pdfUrl)
 		return(
 			<div className="user-content" >
                 <div className="content-title">                  
@@ -1205,14 +1712,15 @@ const IntentionCustomer = Form.create()(React.createClass({
 									                            <Button><Icon type="upload" /> 项目材料上传 </Button>
 									                            <span style={{ marginTop: '10px' ,marginLeft:"20px"}}>{this.state.pojectApplicationUrl ?
 										                            <span className="download-file">
-										                                <a onClick={() => {
+										                            	<a onClick={() => {
 										                                    var newTab = window.open('about:blank'); getPreviews(this.state.uid, 'techProject', 'organization_application', function (data) { newTab.location.href = data; });
 										                                }}><Icon style={{ fontSize: '16px' }} type="eye-o" /> </a>
 										                            </span>
 										                            : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}
 									                            </span>
 									                        </Upload>
-                    
+                    										<Button onClick={this.visitOk1}><Icon style={{ fontSize: '16px' }} type="eye-o" /> </Button>
+										                                
 													</FormItem>
 												 </div>
 						                    </div>
@@ -1234,8 +1742,167 @@ const IntentionCustomer = Form.create()(React.createClass({
 			                        onRowClick={this.tableRowClickDate} />
 			                </Spin>
 					    </TabPane>
+					    <TabPane tab="财务信息" key="2">
+					    	<Button type="primary" className="addButton" onClick={this.addClickc}>添加年度财务信息<Icon type="plus" /></Button>
+				    		<Spin spinning={this.state.loading}>
+			                    <Table columns={this.state.columnsc}
+			                        dataSource={this.state.dataSourcec}
+			                        rowSelection={rowSelection}
+			                        onRowClick={this.tableRowClickDatec} />
+			                </Spin>
+					    </TabPane>
+					    <TabPane tab="项目信息" key="3">
+					    	<Button type="primary" className="addButton" onClick={this.addClickx}>添加项目信息<Icon type="plus" /></Button>
+				    		<Spin spinning={this.state.loading}>
+			                    <Table columns={this.state.columnsx}
+			                        dataSource={this.state.dataSourcex}
+			                        rowSelection={rowSelection}
+			                        onRowClick={this.tableRowClickDatex} />
+			                </Spin>
+					    </TabPane>
 					</Tabs>
                 </Modal> 
+                <Modal	
+				      className="customeDetails"
+				      footer=''
+			          title="客户资料"
+			          width='100%'
+			          visible={this.state.visitModul1}
+			          onOk={this.visitOk1}
+					  onCancel={this.visitCancel1}							          							          
+			        >	
+			       		<div>
+			       		<a href={pdfUrl} target="_blank">点击看预览</a>
+			        	<PDF
+				          file={pdfUrl}
+				          onDocumentComplete={this.onDocumentComplete}
+				          onDocumentLoad={this.onDocumentComplete}
+          				  Page={this.state.page}
+				        /> 
+				       	{paginationss}
+				        </div>
+			    </Modal>
+			    <Modal	
+			      className="customeDetails"
+			      footer=''
+		          title="财务资料"
+		          width='500px'
+		          visible={this.state.visitModulc}
+		          onOk={this.visitOkc}
+				  onCancel={this.visitCancelc}							          							          
+		        >	<Form layout="horizontal" onSubmit={this.newSubmitc} id="demand-form">
+					    <Spin spinning={this.state.loading}>
+					    	<div className="clearfix" >
+			                    <FormItem  
+			                    	{...formItemLayoutc}
+			                        label="年份"
+	                           	 >
+		                            <Select placeholder="年份" value={this.state.year}   style={{width:'90%'}}
+							    		onChange={(e)=>{this.setState({year:e})}}> 
+                                     {
+                                        year.map(function (item) {
+                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
+                                        })
+                                    }
+                                     </Select>
+			                    </FormItem>
+			       		  	</div>
+						    <div className="clearfix" >
+			                    <FormItem  
+				                    	 {...formItemLayoutc}
+				                        label="销售额"
+		                           	 >
+			                            <Input placeholder="销售额" style={{width:'90%'}} value={this.state.salesAmount} onChange={(e) => {
+					                        this.setState({ salesAmount:  e.target.value }) }} />万
+			                    </FormItem>
+			       		  	</div>
+			       		  	<div className="clearfix" >
+			                    <FormItem 
+				                    	 {...formItemLayoutc}
+				                        label="总资产"
+		                           	 >
+			                            <Input placeholder="总资产" style={{width:'90%'}} value={this.state.assets} onChange={(e) => {
+					                        this.setState({ assets:  e.target.value }) }} />万
+			                    </FormItem>
+			       		  	</div>
+			       		  	<div className="clearfix" >
+			                    <FormItem 
+				                    	 {...formItemLayoutc}
+				                        label="研发费用"
+		                           	 >
+			                            <Input placeholder="研发费用" style={{width:'90%'}} value={this.state.researchAmount} onChange={(e) => {
+					                        this.setState({ researchAmount:  e.target.value }) }} />万
+			                    </FormItem>
+			       		  	</div>
+			       		  	<Button className="setSubmit" type="primary" htmlType="submit" style={{marginLeft:"100px"}}>保存</Button>  
+					        <Button  type="ghost" onClick={this.visitCancelc}>取消</Button>
+					    </Spin>
+					</Form>		
+			    </Modal>
+			    <Modal	
+			      className="customeDetails"
+			      footer=''
+		          title="项目资料"
+		          width='500px'
+		          visible={this.state.visitModulx}
+		          onOk={this.visitOkc}
+				  onCancel={this.visitCancelc}							          							          
+		        >	<Form layout="horizontal" onSubmit={this.newSubmitx} id="demand-form">
+					    <Spin spinning={this.state.loading}>
+					    	<div className="clearfix" >
+			                    <FormItem  
+			                    	{...formItemLayoutc}
+			                        label="年份"
+	                           	 >
+		                            <Select placeholder="年份" value={this.state.year}   style={{width:'90%'}}
+							    		onChange={(e)=>{this.setState({year:e})}}> 
+                                     {
+                                        year.map(function (item) {
+                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
+                                        })
+                                    }
+                                     </Select>
+			                    </FormItem>
+			       		  	</div>
+						    <div className="clearfix" >
+			                    <FormItem  
+				                    	 {...formItemLayoutc}
+				                        label="项目名称"
+		                           	 >
+			                            <Input placeholder="项目名称" style={{width:'90%'}} value={this.state.projectName} onChange={(e) => {
+					                        this.setState({ projectName:  e.target.value }) }} />
+			                    </FormItem>
+			       		  	</div>
+			       		  	<div className="clearfix" >
+			                    <FormItem  
+			                    	{...formItemLayoutc}
+			                        label="项目状态"
+	                           	 >
+		                            <Select placeholder="项目状态" value={this.state.status}   style={{width:'90%'}}
+							    		onChange={(e)=>{this.setState({status:e})}}> 
+                                     {
+                                        xiangmoState.map(function (item) {
+                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
+                                        })
+                                    }
+                                     </Select>
+			                    </FormItem>
+			       		  	</div>
+			       		  	<div className="clearfix" >
+			                    <FormItem 
+				                    	 {...formItemLayoutc}
+				                        label="备注"
+		                           	 >
+			                            <Input type="textarea" rows={3} placeholder="备注" style={{width:'90%'}} value={this.state.remark} onChange={(e) => {
+					                        this.setState({ remark:  e.target.value }) }} />
+			                    </FormItem>
+			       		  	</div>
+			       		  	
+			       		  	<Button className="setSubmit" type="primary" htmlType="submit" style={{marginLeft:"100px"}}>保存</Button>  
+					        <Button  type="ghost" onClick={this.visitCancelc}>取消</Button>
+					    </Spin>
+					</Form>		
+			    </Modal>
                 <TechAchievementDesc
 	                data={this.state.RowData}
 	                detailApiUrl={this.props['data-detailApiUrl']}
@@ -1245,7 +1912,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 	                closeDesc={this.closeDesc} 
 	                loadDatas={this.loadDatas}
 	                />
-                	
+
           </div >
           
 		);

+ 8 - 0
js/component/manageCenter/order/content.jsx

@@ -40,6 +40,14 @@ class Content extends Component {
                     });
                 });
                 break;
+            case 'orderStatistics':
+                require.ensure([], () => {
+                    const OrderStatistics = require('./orderStatistics/orderStatistics').default;
+                    this.setState({
+                        component: <OrderStatistics />
+                    });
+                });
+                break;
             case 'serviceManage':
                 require.ensure([], () => {
                     const ServiceManage = require('./departmentOrder/servicesOrder/serviceManage').default;

+ 806 - 0
js/component/manageCenter/order/orderStatistics/orderStatistics.jsx

@@ -0,0 +1,806 @@
+import React from 'react';
+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 { post,taskStatus,publishStatus } from '../../../dataDic.js';
+import moment from 'moment';
+const TabPane = Tabs.TabPane;
+
+const DiurnalStatistics = React.createClass({
+	loadData(timeTypes) {
+		this.setState({
+			loading: true
+		});
+		$.ajax({
+			method: "get",
+			dataType: "json",
+			crossDomain: false,
+			url: globalConfig.context + "/api/admin/report/technicalDepStatistics",
+			data: {
+				type:'1',
+				timeType:this.state.releaseDate[0]?4:timeTypes,
+				startTime: this.state.releaseDate[0],
+				endTime: this.state.releaseDate[1],
+				depId:this.state.superId,//部门机构
+				taskStatus:this.state.taskStatus,//任务状态
+				publishStatus:this.state.publishStatus,//公示状态
+			},
+			success: function(data) {
+				let thedata = data.data;
+				let theArr = [];
+				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;
+						theArr.push({
+							key: index,
+							theNumber:false,
+							nub:nub,
+							orderDep: item.orderDep,//订单部门
+							signTotalAmount:item.signTotalAmount,//项目签单金额
+							signTime:item.signTime,//签单日期
+							contractNo:item.contractNo,//合同编号
+							orderRemarks:item.orderRemarks, //订单留言
+							contacts:item.contacts,//企业联系人
+							contactMobile:item.contactMobile,//联系人电话
+							commodityName:item.commodityName,//任务名称
+							taskDistributionTime:item.taskDistributionTime,//派单时间
+							dutyDep:item.dutyDep, //任务责任部门
+							dutyName:item.dutyName,//任务责任人
+							dutyContactMobile:item.dutyContactMobile,//责任人联系电话
+							taskStatus:item.taskStatus,//任务状态
+							finishTime:item.finishTime, //完成时间
+							taskComment:item.taskComment,//任务说明
+							publishStatus:item.publishStatus, //公示状态
+							publishTime:item.publishTime,//公示时间
+							salesmanName:item.salesmanName, //营销员
+							orgName:item.orgName,//公司名称
+						})
+					})
+				}
+				
+				this.setState({
+					dataSource: theArr,
+				})
+			}.bind(this),
+		}).always(function() {
+			this.setState({
+				loading: false
+			});
+		}.bind(this));
+	},
+	totalData(timeTypes) {
+		this.setState({
+			loading: true
+		});
+		$.ajax({
+			method: "get",
+			dataType: "json",
+			crossDomain: false,
+			url: globalConfig.context + "/api/admin/report/sales/countsometimeMarketingStatistics",
+			data: {
+				type:'1',
+				timeType:this.state.releaseDate[0]?4:timeTypes,
+				startTime: this.state.releaseDate[0],
+				endTime: this.state.releaseDate[1],
+				depId:this.state.superId,//部门机构
+			},
+			success: function(data) {
+				let thedata = data.data;
+				let theArr = [];
+				if(!thedata) {
+					if(data.error && data.error.length) {
+						message.warning(data.error[0].message);
+					};
+					thedata = {};
+				} 
+				this.loadData(timeTypes)
+				this.selectSuperId();
+			}.bind(this),
+		}).always(function() {
+			this.setState({
+				loading: false
+			});
+		}.bind(this));
+	},
+	//时间选择
+    selTime(value,index){
+    	this.setState({
+    		Dtime:value,
+    		selTime:index
+    	})
+    },
+    //获取上级组织
+    selectSuperId() {  
+    	this.state.data = []
+         $.ajax({
+                method: "post",
+                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 () {
+				this.setState({
+	                loading: false
+	            });
+	        }.bind(this));
+	},
+	//判断浏览器类型
+	getExplorer() {
+		var explorer = window.navigator.userAgent;
+		//ie 
+		if(explorer.indexOf("MSIE") >= 0) {
+			return 'ie';
+		}
+		//firefox 
+		else if(explorer.indexOf("Firefox") >= 0) {
+			return 'Firefox';
+		}
+		//Chrome
+		else if(explorer.indexOf("Chrome") >= 0) {
+			return 'Chrome';
+		}
+		//Opera
+		else if(explorer.indexOf("Opera") >= 0) {
+			return 'Opera';
+		}
+		//Safari
+		else if(explorer.indexOf("Safari") >= 0) {
+			return 'Safari';
+		}
+	},
+    //导出为exel表格
+	tabExel() {
+		var table = document.querySelector('#daochu');
+		var idTmr;
+		//debugger;
+		//整个表格拷贝到EXCEL中
+		if(this.getExplorer() == 'ie') {
+			var curTbl = document.getElementById(tableid);
+			var oXL = new ActiveXObject("Excel.Application");
+			//创建AX对象excel 
+			var oWB = oXL.Workbooks.Add();
+			//获取workbook对象 
+			var xlsheet = oWB.Worksheets(1);
+			//激活当前sheet 
+			var sel = document.body.createTextRange();
+			sel.moveToElementText(curTbl);
+			//把表格中的内容移到TextRange中 
+			sel.select();
+			//全选TextRange中内容 
+			sel.execCommand("Copy");
+			//复制TextRange中内容  
+			xlsheet.Paste();
+			//粘贴到活动的EXCEL中       
+			oXL.Visible = true;
+			//设置excel可见属性
+			try {
+				var fname = oXL.Application.GetSaveAsFilename("Excel.xls", "Excel Spreadsheets (*.xls), *.xls");
+			} catch(e) {
+				print("Nested catch caught " + e);
+			} finally {
+				oWB.SaveAs(fname);
+
+				oWB.Close(savechanges = false);
+				//xls.visible = false;
+				oXL.Quit();
+				oXL = null;
+				//结束excel进程,退出完成
+				//window.setInterval("Cleanup();",1);
+				idTmr = window.setInterval("Cleanup();", 1);
+			}
+		} else {
+			
+			this.tableToExcel(table,this.getExplorer());
+		}
+		function Cleanup() {
+			window.clearInterval(idTmr);
+			CollectGarbage();
+		}
+	},
+	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) {
+				return window.btoa(unescape(encodeURIComponent(s)))
+			},
+			format = function(s, c) {
+				return s.replace(/{(\w+)}/g,
+					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))
+	},
+	getInitialState() {
+		return {
+			releaseDate: [],
+			selectedRowKeys: [],
+			selectedRows: [],
+			loading: false,
+			visible: false,
+			showDesc: false,
+			timeState:false,
+			weekColor:true,
+			monthColor:false,
+			quarterColor:false,
+			yearColor: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: 'orgName',
+				key: 'orgName',
+				width:100,
+				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: '订单部门',
+				fixed:false,
+				width:100,
+				dataIndex: 'orderDep',
+				key: 'orderDep',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},
+			{
+				title: '项目签单金额',
+				fixed:false,
+				dataIndex: 'signTotalAmount',
+				key: 'signTotalAmount',
+				sorter: (a, b) => a.signTotalAmount - b.signTotalAmount,
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:1
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			}, {
+				title: '签单日期',
+				fixed:false,
+				dataIndex: 'signTime',
+				key: 'signTime',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			}, {
+				title: '合同编号',
+				fixed:false,
+				dataIndex: 'contractNo',
+				key: 'contractNo',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},{
+				title: '订单留言',
+				fixed:false,
+				dataIndex: 'orderRemarks',
+				key: 'orderRemarks',
+				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:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},{
+				title: '企业联系人',
+				fixed:false,
+				dataIndex: 'contacts',
+				key: 'contacts',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},{
+				title: '联系人电话',
+				fixed:false,
+				dataIndex: 'contactMobile',
+				key: 'contactMobile',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},{
+				title: '任务名称',
+				fixed:false,
+				dataIndex: 'commodityName',
+				key: 'commodityName',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},{
+				title: '派单时间',
+				fixed:false,
+				dataIndex: 'taskDistributionTime',
+				key: 'taskDistributionTime',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},{
+				title: '部门',
+				fixed:false,
+				dataIndex: 'dutyDep',
+				key: 'dutyDep',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},{
+				title: '负责人',
+				fixed:false,
+				dataIndex: 'dutyName',
+				key: 'dutyName',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},{
+				title: '负责人电话',
+				fixed:false,
+				dataIndex: 'dutyContactMobile',
+				key: 'dutyContactMobile',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},{
+				title: '任务状态',
+				fixed:false,
+				dataIndex: 'taskStatus',
+				key: 'taskStatus',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},{
+				title: '项目完成时间',
+				fixed:false,
+				dataIndex: 'finishTime',
+				key: 'finishTime',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},{
+				title: '任务说明',
+				fixed:false,
+				dataIndex: 'taskComment',
+				key: 'taskComment',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},{
+				title: '公示状态',
+				fixed:false,
+				dataIndex: 'publishStatus',
+				key: 'publishStatus',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},{
+				title: '公示时间',
+				fixed:false,
+				dataIndex: 'publishTime',
+				key: 'publishTime',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:0
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			},
+			{
+				title: '营销员',
+				fixed:false,
+				dataIndex: 'salesmanName',
+				key: 'salesmanName',
+				render:(text,record)=>{
+				     if(!record.theNumber){
+				     	return text
+				     }else{
+				     	return {
+				     		children: text,
+      						props: {
+      							colSpan:1
+      						},
+				     	}
+				     	
+				     }
+				     
+				}
+			}
+			],
+			dataSource: [],
+		};
+	},
+	search() {
+		this.loadData(0)
+	},
+	reset() {
+		this.state.superId = undefined;//部门机构清零
+		this.loadData(0)
+		this.setState({
+			order:"false",
+			weekColor:true,
+			monthColor:false,
+			quarterColor:false,
+			yearColor:false
+		})
+	},
+	week(){
+		this.state.releaseDate[0] = undefined;//开始时间清零
+		this.state.releaseDate[1] = undefined;//结束时间清零
+		this.loadData(0);
+		this.setState({
+			weekColor:true,
+			monthColor:false,
+			quarterColor:false,
+			yearColor:false
+		})
+	},
+	month(){
+		this.state.releaseDate[0] = undefined;//开始时间清零
+		this.state.releaseDate[1] = undefined;//结束时间清零
+		this.loadData(1);
+		this.setState({
+			weekColor:false,
+			monthColor:true,
+			quarterColor:false,
+			yearColor:false
+		})
+	},
+	quarter(){
+		this.state.releaseDate[0] = undefined;//开始时间清零
+		this.state.releaseDate[1] = undefined;//结束时间清零
+		this.loadData(2);
+		this.setState({
+			weekColor:false,
+			monthColor:false,
+			quarterColor:true,
+			yearColor:false
+		})
+	},
+	year(){
+		this.state.releaseDate[0] = undefined;//开始时间清零
+		this.state.releaseDate[1] = undefined;//结束时间清零
+		this.loadData(3);
+		this.setState({
+			weekColor:false,
+			monthColor:false,
+			quarterColor:false,
+			yearColor:true
+		})
+	},
+	//重构排序
+	tabChange(pagination,filter,sorter){
+		console.log(pagination)
+		console.log(sorter)
+	},
+	componentWillMount() {
+		//this.loadData();
+		this.totalData(0);
+		let times=new Date();
+		let nowTime=times.getFullYear()+'年'+(times.getMonth()+1)+'月'+times.getDate()+'日';
+		this.setState({
+			Nowtime:nowTime
+		})
+	},
+	render() {
+		const { RangePicker } = DatePicker;
+		let departmentArr = this.state.departmentArr || [];
+		return(
+			<div className='set-content'>
+				<p style={{fontSize:'20px',marginBottom:'10px'}}>客户营销统计表(部门)</p>
+				<div className="clearfix">
+					<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}
+		          	</Select>
+		          	
+                  		<Select placeholder="任务状态"
+                            style={{ width: 150 ,marginRight:'10px'}}
+                            value={this.state.taskStatus}
+                            onChange={(e) => { this.setState({ taskStatus: e }) }}>
+                            {
+                                taskStatus.map(function (item) {
+                                        return <Select.Option key={item.value} >{item.key}</Select.Option>
+                                })
+                            }
+                        </Select>
+                        <Select placeholder="公示状态"
+                            style={{ width: 150 ,marginRight:'10px'}}
+                            value={this.state.publishStatus}
+                            onChange={(e) => { this.setState({ publishStatus: e }) }}>
+                            {
+                                publishStatus.map(function (item) {
+                                        return <Select.Option key={item.value} >{item.key}</Select.Option>
+                                })
+                            }
+                        </Select>
+                        <Button type="primary" onClick={this.search} style={{marginLeft:'10px',marginRight:'10px'}}>搜索</Button>
+	                	<Button onClick={this.reset}>重置</Button>
+                        <div className="clearfix" style={{marginTop:"10px"}}>
+                        	<Button onClick={this.week} style={{marginRight:'5px'}} type={this.state.weekColor?"primary":''}>本周</Button>
+				          	<Button onClick={this.month} style={{marginRight:'5px'}} type={this.state.monthColor?"primary":''}>本月</Button>
+				          	<Button onClick={this.quarter} style={{marginRight:'5px'}} type={this.state.quarterColor?"primary":''}>本季</Button>
+				          	<Button onClick={this.year} style={{marginRight:'5px'}} type={this.state.yearColor?"primary":''}>本年</Button>
+				          	<span className="titleTime" style={{marginRight:'5px',marginTop:"0px"}}>起止时间:</span>
+								<RangePicker style={{marginRight:'5px',marginTop:"0px"}}
+		                            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 }); }} />
+                        </div>
+                  	
+				</div>
+				<div id='daochu'>
+					<div className="surfaceTitle">
+				   	<span style={{marginTop:"10px"}}>客户营销统计表(部门)</span>
+					</div>
+					<div className="patent-table" id='daochu'>
+						<div className="scroll">
+		                    <Spin spinning={this.state.loading}>
+		                        <Table columns={this.state.columns}
+		                            dataSource={this.state.dataSource}
+		                            //scroll={{ x: 600,y:500}}
+		                            bordered
+		                            onChange={this.tabChange}
+		                            pagination={false}
+		                            />
+		                    </Spin>
+		                </div>
+		            </div>
+	            </div>
+			</div>
+		)
+	}
+});
+export default DiurnalStatistics;

+ 19 - 0
js/component/manageCenter/order/orderStatistics/report.less

@@ -0,0 +1,19 @@
+.set-content {
+    background: #fff;
+    padding: 20px;
+    .clearfix{
+        clear:both
+    }
+    .ant-table-thead > tr > th[rowspan],.ant-table-bordered .ant-table-thead > tr > th,.ant-table-bordered .ant-table-thead > tr > th, .ant-table-bordered .ant-table-tbody > tr > td{
+        text-align: center;
+    }
+    .surfaceTitle{
+        font-size: 18px;
+        text-align: center;
+        margin-bottom: 5px;
+    }
+    .surfaceTitle .nowtime{
+        margin-left: 20px;
+        margin-right: 20px;
+    }
+}

+ 15 - 1
js/component/tools.js

@@ -76,7 +76,8 @@ import {
     customerSource,
     slcRedit,
     dataGrade,
-    level
+    level,
+    xiangmoState
 } from './dataDic.js';
 
 import { provinceList} from './NewDicProvinceList.js';
@@ -1436,5 +1437,18 @@ module.exports = {
             });
             return theType;
         }
+	},
+	//项目状态
+	getXiangmoState:function(e){
+   		if (e||e==0) {
+   			let str=e.toString()
+            let theType = '';
+            xiangmoState.map(function (item) {
+                if (item.value == str) {
+                    theType = item.key;
+                };
+            });
+            return theType;
+        }
 	}
 }

+ 119 - 21
package-lock.json

@@ -1073,8 +1073,7 @@
     "big.js": {
       "version": "3.1.3",
       "resolved": "http://registry.npm.taobao.org/big.js/download/big.js-3.1.3.tgz",
-      "integrity": "sha1-TK2iGTZS6zyp7I5VyQFWacmAaXg=",
-      "dev": true
+      "integrity": "sha1-TK2iGTZS6zyp7I5VyQFWacmAaXg="
     },
     "binary-extensions": {
       "version": "1.10.0",
@@ -1292,7 +1291,7 @@
     "buffer-indexof": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz",
-      "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==",
+      "integrity": "sha1-Uvq8xqYG0aADAoAmSO9o9jnaJow=",
       "dev": true
     },
     "buffer-xor": {
@@ -1465,7 +1464,6 @@
       "requires": {
         "anymatch": "1.3.2",
         "async-each": "1.0.1",
-        "fsevents": "1.1.3",
         "glob-parent": "2.0.0",
         "inherits": "2.0.3",
         "is-binary-path": "1.0.1",
@@ -1900,7 +1898,7 @@
     "content-type": {
       "version": "1.0.4",
       "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
-      "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==",
+      "integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js=",
       "dev": true
     },
     "convert-source-map": {
@@ -2676,8 +2674,7 @@
     "emojis-list": {
       "version": "2.1.0",
       "resolved": "http://registry.npm.taobao.org/emojis-list/download/emojis-list-2.1.0.tgz",
-      "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=",
-      "dev": true
+      "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k="
     },
     "encodeurl": {
       "version": "1.0.2",
@@ -2983,6 +2980,11 @@
       "resolved": "http://registry.npm.taobao.org/fast-diff/download/fast-diff-1.1.1.tgz",
       "integrity": "sha1-CuoOTmBbaiGJ8Ok21Lf7rxt8/Zs="
     },
+    "fast-json-stable-stringify": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
+      "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
+    },
     "fastparse": {
       "version": "1.1.1",
       "resolved": "http://registry.npm.taobao.org/fastparse/download/fastparse-1.1.1.tgz",
@@ -3279,13 +3281,6 @@
       "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
       "dev": true
     },
-    "fsevents": {
-      "version": "1.1.3",
-      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz",
-      "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==",
-      "dev": true,
-      "optional": true
-    },
     "function-bind": {
       "version": "1.1.0",
       "resolved": "http://registry.npm.taobao.org/function-bind/download/function-bind-1.1.0.tgz",
@@ -3630,7 +3625,7 @@
         "readable-stream": {
           "version": "2.3.3",
           "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz",
-          "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==",
+          "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=",
           "dev": true,
           "requires": {
             "core-util-is": "1.0.2",
@@ -3645,7 +3640,7 @@
         "string_decoder": {
           "version": "1.0.3",
           "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
-          "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
+          "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=",
           "dev": true,
           "requires": {
             "safe-buffer": "5.1.1"
@@ -4414,8 +4409,7 @@
     "json5": {
       "version": "0.5.1",
       "resolved": "http://registry.npm.taobao.org/json5/download/json5-0.5.1.tgz",
-      "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=",
-      "dev": true
+      "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE="
     },
     "jsonify": {
       "version": "0.0.0",
@@ -5081,6 +5075,11 @@
         "lower-case": "1.1.4"
       }
     },
+    "node-ensure": {
+      "version": "0.0.0",
+      "resolved": "https://registry.npmjs.org/node-ensure/-/node-ensure-0.0.0.tgz",
+      "integrity": "sha1-7K52QVDemYYexcgQ/V0Jaxg5Mqc="
+    },
     "node-fetch": {
       "version": "1.7.2",
       "resolved": "http://registry.npm.taobao.org/node-fetch/download/node-fetch-1.7.2.tgz",
@@ -5647,6 +5646,20 @@
         "sha.js": "2.4.8"
       }
     },
+    "pdf": {
+      "version": "0.1.0",
+      "resolved": "https://registry.npmjs.org/pdf/-/pdf-0.1.0.tgz",
+      "integrity": "sha1-Uk0yFTWg33O6jCyY9CHvfNVJ42M="
+    },
+    "pdfjs-dist": {
+      "version": "1.10.100",
+      "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-1.10.100.tgz",
+      "integrity": "sha512-aCfONGqlBeazYxik3rjd7xaoCKMRYECwZSCC3EC3weqibF2V1Bp/v9WZbF7Lyy5Q6UE4NqOYu126r7U+Le4Uhg==",
+      "requires": {
+        "node-ensure": "0.0.0",
+        "worker-loader": "1.1.1"
+      }
+    },
     "performance-now": {
       "version": "0.2.0",
       "resolved": "http://registry.npm.taobao.org/performance-now/download/performance-now-0.2.0.tgz",
@@ -7004,6 +7017,16 @@
         "prop-types": "15.5.10"
       }
     },
+    "react-pdf": {
+      "version": "1.6.1",
+      "resolved": "https://registry.npmjs.org/react-pdf/-/react-pdf-1.6.1.tgz",
+      "integrity": "sha1-3FKOvua354ZNtQNtXVIgm2eo4NE=",
+      "requires": {
+        "pdfjs-dist": "1.10.100",
+        "react": "15.6.1",
+        "react-dom": "15.6.1"
+      }
+    },
     "react-quill": {
       "version": "1.1.0",
       "resolved": "http://registry.npm.taobao.org/react-quill/download/react-quill-1.1.0.tgz",
@@ -7911,7 +7934,7 @@
         "readable-stream": {
           "version": "2.3.3",
           "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz",
-          "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==",
+          "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=",
           "dev": true,
           "requires": {
             "core-util-is": "1.0.2",
@@ -7926,7 +7949,7 @@
         "string_decoder": {
           "version": "1.0.3",
           "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
-          "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
+          "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=",
           "dev": true,
           "requires": {
             "safe-buffer": "5.1.1"
@@ -8705,6 +8728,21 @@
       "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=",
       "dev": true
     },
+    "uri-js": {
+      "version": "4.2.2",
+      "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
+      "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
+      "requires": {
+        "punycode": "2.1.1"
+      },
+      "dependencies": {
+        "punycode": {
+          "version": "2.1.1",
+          "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+          "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
+        }
+      }
+    },
     "urix": {
       "version": "0.1.0",
       "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
@@ -8948,6 +8986,11 @@
         }
       }
     },
+    "viewer": {
+      "version": "0.10.11",
+      "resolved": "https://registry.npmjs.org/viewer/-/viewer-0.10.11.tgz",
+      "integrity": "sha1-3yR20nxfxZFKGVOQG7P1RdlRyxs="
+    },
     "vm-browserify": {
       "version": "0.0.4",
       "resolved": "http://registry.npm.taobao.org/vm-browserify/download/vm-browserify-0.0.4.tgz",
@@ -9172,7 +9215,6 @@
             "anymatch": "2.0.0",
             "async-each": "1.0.1",
             "braces": "2.3.0",
-            "fsevents": "1.1.3",
             "glob-parent": "3.1.0",
             "inherits": "2.0.3",
             "is-binary-path": "1.0.1",
@@ -9482,6 +9524,62 @@
       "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=",
       "dev": true
     },
+    "worker-loader": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/worker-loader/-/worker-loader-1.1.1.tgz",
+      "integrity": "sha512-qJZLVS/jMCBITDzPo/RuweYSIG8VJP5P67mP/71alGyTZRe1LYJFdwLjLalY3T5ifx0bMDRD3OB6P2p1escvlg==",
+      "requires": {
+        "loader-utils": "1.1.0",
+        "schema-utils": "0.4.5"
+      },
+      "dependencies": {
+        "ajv": {
+          "version": "6.5.2",
+          "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz",
+          "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==",
+          "requires": {
+            "fast-deep-equal": "2.0.1",
+            "fast-json-stable-stringify": "2.0.0",
+            "json-schema-traverse": "0.4.1",
+            "uri-js": "4.2.2"
+          }
+        },
+        "ajv-keywords": {
+          "version": "3.2.0",
+          "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz",
+          "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo="
+        },
+        "fast-deep-equal": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
+          "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk="
+        },
+        "json-schema-traverse": {
+          "version": "0.4.1",
+          "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+          "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+        },
+        "loader-utils": {
+          "version": "1.1.0",
+          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz",
+          "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=",
+          "requires": {
+            "big.js": "3.1.3",
+            "emojis-list": "2.1.0",
+            "json5": "0.5.1"
+          }
+        },
+        "schema-utils": {
+          "version": "0.4.5",
+          "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.5.tgz",
+          "integrity": "sha512-yYrjb9TX2k/J1Y5UNy3KYdZq10xhYcF8nMpAW6o3hy6Q8WSIEf9lJHG/ePnOBfziPM3fvQwfOwa13U/Fh8qTfA==",
+          "requires": {
+            "ajv": "6.5.2",
+            "ajv-keywords": "3.2.0"
+          }
+        }
+      }
+    },
     "wrap-ansi": {
       "version": "2.1.0",
       "resolved": "http://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-2.1.0.tgz",

+ 4 - 1
package.json

@@ -53,9 +53,12 @@
     "html2canvas": "^0.5.0-beta4",
     "jquery": "^3.1.1",
     "jspdf": "^1.3.3",
+    "pdf": "^0.1.0",
     "prop-types": "^15.5.10",
     "react": "^15.4.1",
     "react-dom": "^15.4.1",
-    "react-quill": "^1.0.0"
+    "react-pdf": "^1.6.1",
+    "react-quill": "^1.0.0",
+    "viewer": "^0.10.11"
   }
 }