dev01 3 years ago
parent
commit
97019c64ce

File diff suppressed because it is too large
+ 2062 - 2054
js/component/manageCenter/customer/NEW/crm/crm.jsx


File diff suppressed because it is too large
+ 770 - 761
js/component/manageCenter/customer/NEW/crm/crmAll.jsx


+ 342 - 341
js/component/manageCenter/customer/NEW/crm/crmCount.jsx

@@ -1,17 +1,18 @@
 import React from 'react';
-import {Select, Spin, message, Table, Button, DatePicker, Tabs} from 'antd';
+import { Select, Spin, message, Table, Button, DatePicker, Tabs } from 'antd';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery';
 import './customer.less';
 import { post } from '@/dataDic.js';
 import moment from 'moment';
-import {ChooseList} from "../../../order/orderNew/chooseList";
+import { ChooseList } from "../../../order/orderNew/chooseList";
+import { onReplace } from '@/tools.js';
 
 const { TabPane } = Tabs;
 
 const DiurnalStatisticsOne = React.createClass({
-	loadData(timeTypes,totalArr) {
-		let total=totalArr;
+	loadData(timeTypes, totalArr) {
+		let total = totalArr;
 		this.setState({
 			loading: true
 		});
@@ -21,47 +22,47 @@ const DiurnalStatisticsOne = React.createClass({
 			crossDomain: false,
 			url: globalConfig.context + "/api/admin/report/userDataStatistics",
 			data: {
-				
-				depId:this.state.superId,//部门机构
+
+				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,
 							depName: item.depName,//部门
-							name:item.name,//员工姓名
-							signUser:item.signUser,//签单客户数
-							fullUser:item.fullUser,//资料完善数
-							dayFullUser:item.dayFullUser,//今日完善数
-							dayNewUser:item.dayNewUser, //今日新增数
-							countUser:item.countUser,//私有客户数
-							signFullUser:item.signFullUser,//签单客户完善数
+							name: item.name,//员工姓名
+							signUser: item.signUser,//签单客户数
+							fullUser: item.fullUser,//资料完善数
+							dayFullUser: item.dayFullUser,//今日完善数
+							dayNewUser: item.dayNewUser, //今日新增数
+							countUser: item.countUser,//私有客户数
+							signFullUser: item.signFullUser,//签单客户完善数
 						})
 					})
 				}
-				if(theArr.length){
+				if (theArr.length) {
 					theArr.push(
 						{
-							key:9999999,
-							theNumber:true,
-							name:'合计',
-							signUser:total.signUser,//签单客户数
-							fullUser:total.fullUser,//资料完善数
-							dayFullUser:total.dayFullUser,//今日完善数
-							dayNewUser:total.dayNewUser,//今日新增数
-							countUser:total.countUser,//私有客户数
-							signFullUser:total.signFullUser,//签单客户完整数
+							key: 9999999,
+							theNumber: true,
+							name: '合计',
+							signUser: total.signUser,//签单客户数
+							fullUser: total.fullUser,//资料完善数
+							dayFullUser: total.dayFullUser,//今日完善数
+							dayNewUser: total.dayNewUser,//今日新增数
+							countUser: total.countUser,//私有客户数
+							signFullUser: total.signFullUser,//签单客户完整数
 						}
 					)
 				}
@@ -69,7 +70,7 @@ const DiurnalStatisticsOne = React.createClass({
 					dataSource: theArr,
 				})
 			}.bind(this),
-		}).always(function() {
+		}).always(function () {
 			this.setState({
 				loading: false
 			});
@@ -85,103 +86,103 @@ const DiurnalStatisticsOne = React.createClass({
 			crossDomain: false,
 			url: globalConfig.context + "/api/admin/report/userDataStatisticsCount",
 			data: {
-				depId:this.state.superId,//部门机构
+				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(timeTypes,thedata);
+				}
+				this.loadData(timeTypes, 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('#daochu1');
 		var idTmr;
@@ -189,7 +190,7 @@ const DiurnalStatisticsOne = React.createClass({
 		$("#daochu1").after(ahtml);
 		//debugger;
 		//整个表格拷贝到EXCEL中
-		if(this.getExplorer() == 'ie') {
+		if (this.getExplorer() == 'ie') {
 			var curTbl = document.getElementById(tableid);
 			var oXL = new ActiveXObject("Excel.Application");
 			//创建AX对象excel 
@@ -210,7 +211,7 @@ const DiurnalStatisticsOne = 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);
@@ -224,36 +225,36 @@ const DiurnalStatisticsOne = 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 worksheet = '表格'
 		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
-			};
-			document.getElementById("exportExcel").href = uri
-				+ base64(format(template, ctx));
-			document.getElementById("exportExcel").download = '客户资料统计' + ".xls";//自定义文件名
-			document.getElementById("exportExcel").click();
-			//window.location.href = uri + base64(format(template, ctx))
+		if (!table.nodeType) table = document.getElementById(table);
+		var ctx = {
+			worksheet: name || 'Worksheet',
+			table: table.innerHTML
+		};
+		document.getElementById("exportExcel").href = uri
+			+ base64(format(template, ctx));
+		document.getElementById("exportExcel").download = '客户资料统计' + ".xls";//自定义文件名
+		document.getElementById("exportExcel").click();
+		//window.location.href = uri + base64(format(template, ctx))
 	},
 	getInitialState() {
 		return {
@@ -263,199 +264,199 @@ const DiurnalStatisticsOne = React.createClass({
 			loading: false,
 			visible: false,
 			showDesc: false,
-			timeState:false,
-			weekColor:true,
-			monthColor:false,
-			quarterColor:false,
-			yearColor:false,
-			Dtime:undefined,
-			selTime:'',
+			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: '姓名',
-				fixed:false,
-				dataIndex: 'name',
-				key: 'name',
-				render:(text,record)=>{
-				     if(!record.theNumber){
-				     	return text
-				     }else{
-				     	return {
-				     		children: text,
-      						props: {
-      							colSpan:3
-      						},
-				     	}
-				     	
-				     }
-				     
-				}
-			},
-			{
-				title: '部门',
-				dataIndex: 'depName',
-				key: 'depName',
-				fixed:false,
-				width:300,
-				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: 'countUser',
-				key: 'countUser',
-				render:(text,record)=>{
-				     if(!record.theNumber){
-				     	return text
-				     }else{
-				     	return {
-				     		children: text,
-      						props: {
-      							colSpan:1
-      						},
-				     	}
-				     	
-				     }
-				     
-				}
-			}, 
-			{
-				title: '今日新增客户数',
-				fixed:false,
-				dataIndex: 'dayNewUser',
-				key: 'dayNewUser',
-				sorter: (a, b) => a.dayNewUser - b.dayNewUser,
-				render:(text,record)=>{
-				     if(!record.theNumber){
-				     	return text
-				     }else{
-				     	return {
-				     		children: text,
-      						props: {
-      							colSpan:1
-      						},
-				     	}
-				     	
-				     }
-				     
-				}
-			}, 
-			{
-				title: '完整客户总数',
-				fixed:false,
-				dataIndex: 'fullUser',
-				key: 'fullUser',
-				sorter: (a, b) => a.fullUser - b.fullUser,
-				render:(text,record)=>{
-				     if(!record.theNumber){
-				     	return text
-				     }else{
-				     	return {
-				     		children: text,
-      						props: {
-      							colSpan:1
-      						},
-				     	}
-				     	
-				     }
-				     
-				}
-			}, 
-			{
-				title: '今日完整客户数',
-				fixed:false,
-				dataIndex: 'dayFullUser',
-				key: 'dayFullUser',
-				sorter: (a, b) => a.dayFullUser - b.dayFullUser,
-				render:(text,record)=>{
-				     if(!record.theNumber){
-				     	return text
-				     }else{
-				     	return {
-				     		children: text,
-      						props: {
-      							colSpan:1
-      						},
-				     	}
-				     	
-				     }
-				     
-				}
-			}, 
-			{
-				title: '签单客户总数',
-				fixed:false,
-				dataIndex: 'signUser',
-				key: 'signUser',
-				sorter: (a, b) => a.signUser - b.signUser,
-				render:(text,record)=>{
-				     if(!record.theNumber){
-				     	return text
-				     }else{
-				     	return {
-				     		children: text,
-      						props: {
-      							colSpan:1
-      						},
-				     	}
-				     	
-				     }
-				     
-				}
-			}, 
-			{
-				title: '签单完整客户数',
-				fixed:false,
-				dataIndex: 'signFullUser',
-				key: 'signFullUser',
-				sorter: (a, b) => a.signFullUser - b.signFullUser,
-				render:(text,record)=>{
-				     if(!record.theNumber){
-				     	return text
-				     }else{
-				     	return {
-				     		children: text,
-      						props: {
-      							colSpan:1
-      						},
-				     	}
-				     	
-				     }
-				     
+				{
+					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: '姓名',
+					fixed:false,
+					dataIndex: 'name',
+					key: 'name',
+					render: (text, record) => {
+						if (!record.theNumber) {
+							return onReplace(text)
+						} else {
+							return {
+								children: onReplace(text),
+								props: {
+									colSpan: 3
+								},
+							}
+
+						}
+
+					}
+				},
+				{
+					title: '部门',
+					dataIndex: 'depName',
+					key: 'depName',
+					fixed: false,
+					width: 300,
+					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: 'countUser',
+					key: 'countUser',
+					render: (text, record) => {
+						if (!record.theNumber) {
+							return text
+						} else {
+							return {
+								children: text,
+								props: {
+									colSpan: 1
+								},
+							}
+
+						}
+
+					}
+				},
+				{
+					title: '今日新增客户数',
+					fixed: false,
+					dataIndex: 'dayNewUser',
+					key: 'dayNewUser',
+					sorter: (a, b) => a.dayNewUser - b.dayNewUser,
+					render: (text, record) => {
+						if (!record.theNumber) {
+							return text
+						} else {
+							return {
+								children: text,
+								props: {
+									colSpan: 1
+								},
+							}
+
+						}
+
+					}
+				},
+				{
+					title: '完整客户总数',
+					fixed: false,
+					dataIndex: 'fullUser',
+					key: 'fullUser',
+					sorter: (a, b) => a.fullUser - b.fullUser,
+					render: (text, record) => {
+						if (!record.theNumber) {
+							return text
+						} else {
+							return {
+								children: text,
+								props: {
+									colSpan: 1
+								},
+							}
+
+						}
+
+					}
+				},
+				{
+					title: '今日完整客户数',
+					fixed: false,
+					dataIndex: 'dayFullUser',
+					key: 'dayFullUser',
+					sorter: (a, b) => a.dayFullUser - b.dayFullUser,
+					render: (text, record) => {
+						if (!record.theNumber) {
+							return text
+						} else {
+							return {
+								children: text,
+								props: {
+									colSpan: 1
+								},
+							}
+
+						}
+
+					}
+				},
+				{
+					title: '签单客户总数',
+					fixed: false,
+					dataIndex: 'signUser',
+					key: 'signUser',
+					sorter: (a, b) => a.signUser - b.signUser,
+					render: (text, record) => {
+						if (!record.theNumber) {
+							return text
+						} else {
+							return {
+								children: text,
+								props: {
+									colSpan: 1
+								},
+							}
+
+						}
+
+					}
+				},
+				{
+					title: '签单完整客户数',
+					fixed: false,
+					dataIndex: 'signFullUser',
+					key: 'signFullUser',
+					sorter: (a, b) => a.signFullUser - b.signFullUser,
+					render: (text, record) => {
+						if (!record.theNumber) {
+							return text
+						} else {
+							return {
+								children: text,
+								props: {
+									colSpan: 1
+								},
+							}
+
+						}
+
+					}
 				}
-			}
 			],
 			dataSource: [],
 		};
@@ -467,56 +468,56 @@ const DiurnalStatisticsOne = React.createClass({
 		this.state.superId = undefined;//部门机构清零
 		this.totalData(0);
 	},
-	week(){
+	week() {
 		this.state.releaseDate[0] = undefined;//开始时间清零
 		this.state.releaseDate[1] = undefined;//结束时间清零
 		this.totalData(0);
 		this.setState({
-			weekColor:true,
-			monthColor:false,
-			quarterColor:false,
-			yearColor:false
+			weekColor: true,
+			monthColor: false,
+			quarterColor: false,
+			yearColor: false
 		})
 	},
-	month(){
+	month() {
 		this.state.releaseDate[0] = undefined;//开始时间清零
 		this.state.releaseDate[1] = undefined;//结束时间清零
 		this.totalData(1);
 		this.setState({
-			weekColor:false,
-			monthColor:true,
-			quarterColor:false,
-			yearColor:false
+			weekColor: false,
+			monthColor: true,
+			quarterColor: false,
+			yearColor: false
 		})
 	},
-	quarter(){
+	quarter() {
 		this.state.releaseDate[0] = undefined;//开始时间清零
 		this.state.releaseDate[1] = undefined;//结束时间清零
 		this.totalData(2);
 		this.setState({
-			weekColor:false,
-			monthColor:false,
-			quarterColor:true,
-			yearColor:false
+			weekColor: false,
+			monthColor: false,
+			quarterColor: true,
+			yearColor: false
 		})
 	},
-	year(){
+	year() {
 		this.state.releaseDate[0] = undefined;//开始时间清零
 		this.state.releaseDate[1] = undefined;//结束时间清零
 		this.totalData(3);
 		this.setState({
-			weekColor:false,
-			monthColor:false,
-			quarterColor:false,
-			yearColor:true
+			weekColor: false,
+			monthColor: false,
+			quarterColor: false,
+			yearColor: true
 		})
 	},
 	componentWillMount() {
 		this.totalData(0);
-		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
 		})
 	},
 	changeList(arr) {
@@ -535,24 +536,24 @@ const DiurnalStatisticsOne = React.createClass({
 	render() {
 		const { RangePicker } = DatePicker;
 		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={{ marginTop: 10 }}>
-							<Button type="primary" onClick={this.tabExel} style={{float:'right'}}>导出到表格</Button>
-							<span style={{fontSize:'16px'}}>部门机构 : </span>
+							<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="未获取到上级组织列表">
+								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>
@@ -574,21 +575,21 @@ const DiurnalStatisticsOne = React.createClass({
 					</div>
 					<div className="patent-table">
 						<div className="scroll">
-		                    <Spin spinning={this.state.loading}>
-		                        <Table columns={
+							<Spin spinning={this.state.loading}>
+								<Table columns={
 									this.state.changeList
 										? this.state.changeList
 										: this.state.columns
-									}
-		                            dataSource={this.state.dataSource}
+								}
+									dataSource={this.state.dataSource}
 									pagination={false}
 									bordered
 									size="small"
-		                            />
-		                    </Spin>
-		                </div>
-		            </div>
-	            </div>
+								/>
+							</Spin>
+						</div>
+					</div>
+				</div>
 			</div>
 		)
 	}

File diff suppressed because it is too large
+ 1000 - 999
js/component/manageCenter/customer/NEW/crm/patentPayment.jsx


+ 204 - 201
js/component/manageCenter/customer/NEW/publicCustomer/publicCustomer.jsx

@@ -1,141 +1,144 @@
 import React from 'react';
-import { Button,Cascader,Input, Select, Spin, Table, message, Form, Tabs} from 'antd';
+import { Button, Cascader, Input, Select, Spin, Table, message, Form, Tabs } from 'antd';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import { citySelect, provinceList } from '@/NewDicProvinceList';
-import {ShowModal} from '../../../../tools.js'
+import { ShowModal, onReplace } from '../../../../tools.js'
 import ShowModalDiv from "@/showModal.jsx";
-import {ChooseList} from "../../../order/orderNew/chooseList";
+import { ChooseList } from "../../../order/orderNew/chooseList";
 
 const QueryCustomer = React.createClass({
 	loadData(pageNo, apiUrl) {
 		this.setState({
 			loading: true,
-			ispage:pageNo,
+			ispage: pageNo,
 		});
-		let api=apiUrl?apiUrl:this.props.ApiUrl;
+		let api = apiUrl ? apiUrl : this.props.ApiUrl;
 		$.ajax({
-      method: "post",
-      dataType: "json",
-      crossDomain: false,
-      url: globalConfig.context + api,
-      data: {
-        pageNo: pageNo || 1,
-        pageSize: this.state.pagination.pageSize,
-        name: this.state.nameSearch,
-        province: !this.state.addressSearch.length
-          ? this.state.provinceSearch
-          : this.state.addressSearch[0],
-        city: !this.state.addressSearch.length
-          ? ""
-          : this.state.addressSearch[1],
-        sort: this.state.sort
-      },
-      success: function (data) {
-        ShowModal(this);
-        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];
-            theArr.push({
-              key: i,
-              id: thisdata.uid,
-              name: thisdata.name,
-              contacts: thisdata.contacts,
-              contactMobile: thisdata.contactMobile,
-              createTime:
-                thisdata.createTime && thisdata.createTime.split(" ")[0],
-              transferTime:
-                thisdata.transferTime && thisdata.transferTime.split(" ")[0],
-              locationProvince: thisdata.province
-                ? (thisdata.province || '')  + (thisdata.city ? "-" + thisdata.city : '') + (thisdata.area ? "-" + thisdata.area : '')
-                : "--",
-            });
-          }
-          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({
-          dataSource: theArr,
-          pagination: this.state.pagination,
-          selectedRowKeys: [],
-        });
-      }.bind(this),
-    }).always(
-      function () {
-        this.setState({
-          loading: false,
-        });
-      }.bind(this)
-    );
+			method: "post",
+			dataType: "json",
+			crossDomain: false,
+			url: globalConfig.context + api,
+			data: {
+				pageNo: pageNo || 1,
+				pageSize: this.state.pagination.pageSize,
+				name: this.state.nameSearch,
+				province: !this.state.addressSearch.length
+					? this.state.provinceSearch
+					: this.state.addressSearch[0],
+				city: !this.state.addressSearch.length
+					? ""
+					: this.state.addressSearch[1],
+				sort: this.state.sort
+			},
+			success: function (data) {
+				ShowModal(this);
+				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];
+						theArr.push({
+							key: i,
+							id: thisdata.uid,
+							name: thisdata.name,
+							contacts: thisdata.contacts,
+							contactMobile: thisdata.contactMobile,
+							createTime:
+								thisdata.createTime && thisdata.createTime.split(" ")[0],
+							transferTime:
+								thisdata.transferTime && thisdata.transferTime.split(" ")[0],
+							locationProvince: thisdata.province
+								? (thisdata.province || '') + (thisdata.city ? "-" + thisdata.city : '') + (thisdata.area ? "-" + thisdata.area : '')
+								: "--",
+						});
+					}
+					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({
+					dataSource: theArr,
+					pagination: this.state.pagination,
+					selectedRowKeys: [],
+				});
+			}.bind(this),
+		}).always(
+			function () {
+				this.setState({
+					loading: false,
+				});
+			}.bind(this)
+		);
 	},
-	getInitialState(){
+	getInitialState() {
 		return {
 			sort: 0,
 			addressSearch: [],
-			dataSource:[],
-			loading:false,
+			dataSource: [],
+			loading: false,
 			selectedRowKeys: [],
-			selectedRows:[],
-			selectedData:[],
+			selectedRows: [],
+			selectedData: [],
 			pagination: {
 				defaultCurrent: 1,
 				defaultPageSize: 10,
 				showQuickJumper: true,
 				pageSize: 10,
-				onChange: function(page) {
+				onChange: function (page) {
 					this.loadData(page);
 				}.bind(this),
-				showTotal: function(total) {
+				showTotal: function (total) {
 					return '共' + total + '条数据';
 				}
 			},
 			columns: [{
-					title: '客户名称',
-					dataIndex: 'name',
-					key: 'name',
-				}, {
-					title: '地区',
-					dataIndex: 'locationProvince',
-					key: 'locationProvince',
-				},
-				// {
-				// 	title: '联系人',
-				// 	dataIndex: 'contacts',
-				// 	key: 'contacts',
-				// },{
-				// 	title: '联系电话',
-				// 	dataIndex: 'contactMobile',
-				// 	key: 'contactss',
-				// },
-				{
-					title: '创建时间',
-					dataIndex: 'createTime',
-					key: 'createTime',
-				},
-				{
-					title: '转换时间',
-					dataIndex: 'transferTime',
-					key: 'transferTime',
-				},
-				{
-					title: '操作',
-					dataIndex: 'abc',
-					key: 'abc',
-					render: (text, record, index) => {
-						return <div>
-                            <Button onClick={(e) =>{ e.stopPropagation(), this.receive(record)}} type="primary">领取</Button>
-                        </div>
-					}
+				title: '客户名称',
+				dataIndex: 'name',
+				key: 'name',
+				render: (text, record, index) =>
+					onReplace(text)
+			},
+			{
+				title: '地区',
+				dataIndex: 'locationProvince',
+				key: 'locationProvince',
+			},
+			// {
+			// 	title: '联系人',
+			// 	dataIndex: 'contacts',
+			// 	key: 'contacts',
+			// },{
+			// 	title: '联系电话',
+			// 	dataIndex: 'contactMobile',
+			// 	key: 'contactss',
+			// },
+			{
+				title: '创建时间',
+				dataIndex: 'createTime',
+				key: 'createTime',
+			},
+			{
+				title: '转换时间',
+				dataIndex: 'transferTime',
+				key: 'transferTime',
+			},
+			{
+				title: '操作',
+				dataIndex: 'abc',
+				key: 'abc',
+				render: (text, record, index) => {
+					return <div>
+						<Button onClick={(e) => { e.stopPropagation(), this.receive(record) }} type="primary">领取</Button>
+					</div>
 				}
+			}
 			],
 		}
 	},
@@ -153,8 +156,8 @@ const QueryCustomer = React.createClass({
 			data: {
 				uid: e.id,
 			}
-		}).done(function(data) {
-			if(!data.error.length) {
+		}).done(function (data) {
+			if (!data.error.length) {
 				message.success('领取成功!');
 				this.setState({
 					loading: false,
@@ -172,24 +175,24 @@ const QueryCustomer = React.createClass({
 		this.loadData();
 	},
 	reset() {
-		this.state.nameSearch='';
-		this.state.provinceSearch=undefined;
-		this.state.addressSearch=[];
+		this.state.nameSearch = '';
+		this.state.provinceSearch = undefined;
+		this.state.addressSearch = [];
 		this.state.sort = 0
 		this.loadData()
 	},
 	componentWillReceiveProps(nextProps) {
-		if(nextProps.ApiUrl!=this.props.ApiUrl) {
-			this.state.nameSearch='';
-			this.state.provinceSearch=undefined;
-			this.state.addressSearch=[];
-			this.loadData(null,nextProps.ApiUrl);
+		if (nextProps.ApiUrl != this.props.ApiUrl) {
+			this.state.nameSearch = '';
+			this.state.provinceSearch = undefined;
+			this.state.addressSearch = [];
+			this.loadData(null, nextProps.ApiUrl);
 		};
 	},
 	componentWillMount() {
 		//城市
 		let Province = [];
-		provinceList.map(function(item) {
+		provinceList.map(function (item) {
 			var id = String(item.id)
 			Province.push(
 				<Select.Option value={id} key={item.name}>{item.name}</Select.Option>
@@ -211,104 +214,104 @@ const QueryCustomer = React.createClass({
 			changeList: newArr
 		});
 	},
-	render(){
-		const intentionState=this.props.intentionState;
+	render() {
+		const intentionState = this.props.intentionState;
 		const FormItem = Form.Item;
-		const {TabPane} = Tabs
+		const { TabPane } = Tabs
 		const rowSelection = {
 			selectedRowKeys: this.state.selectedRowKeys,
 			onChange: (selectedRowKeys, selectedRows) => {
 				this.setState({
-					selectedRows:selectedRows,
+					selectedRows: selectedRows,
 					selectedRowKeys: selectedRowKeys
 				});
 			},
 			onSelect: (recordt, selected, selectedData) => {
 				this.setState({
-					selectedData:selectedData,
+					selectedData: selectedData,
 					recordt: recordt.id
 				})
 			},
 
 		};
 		return (
-      <div className="user-content">
-        <ShowModalDiv ShowModal={this.state.showModal} />
-        <div className="content-title">
-          <span>{!intentionState ? "单位公共客户" : "个人公共客户"}</span>
-        </div>
-        <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
-          <TabPane tab="搜索" key="1">
-            <div className="user-search">
-              <Input
-                placeholder="客户名称"
-                value={this.state.nameSearch}
-                style={{ width: 150 }}
-                onChange={(e) => {
-                  this.setState({ nameSearch: e.target.value });
-                }}
-              />
-              <Select
-                placeholder="省"
-                style={{ width: 80 }}
-                value={this.state.provinceSearch}
-                onChange={(e) => {
-                  this.setState({ provinceSearch: e });
-                }}
-              >
-                {this.state.Provinces}
-              </Select>
-              <span style={{ marginRight: "10px" }}>
-                <Cascader
-                  options={citySelect()}
-                  value={this.state.addressSearch}
-                  placeholder="选择城市"
-                  onChange={(e, pre) => {
-                    this.setState({ addressSearch: e });
-                  }}
-                />
-              </span>
-			  <span>排序:</span>
-              <Select style={{ width: 120 }} value={this.state.sort} onChange={e => {this.setState({sort: e})}} placeholder="选择排序">
-                <Option value={0}>默认</Option>
-                <Option value={1}>降序</Option>
-                <Option value={2}>升序</Option>
-              </Select>
-              <Button type="primary" onClick={this.search}>
-                搜索
-              </Button>
-              <Button onClick={this.reset}>重置</Button>
-            </div>
-          </TabPane>
-			<TabPane tab="更改表格显示数据" key="2">
-				<div style={{ marginLeft: 10 }}>
-					<ChooseList
-						columns={this.state.columns}
-						changeFn={this.changeList}
-						changeList={this.state.changeList}
-						top={55}
-						margin={11}
-					/>
+			<div className="user-content">
+				<ShowModalDiv ShowModal={this.state.showModal} />
+				<div className="content-title">
+					<span>{!intentionState ? "单位公共客户" : "个人公共客户"}</span>
+				</div>
+				<Tabs defaultActiveKey="1" onChange={this.callback} className="test">
+					<TabPane tab="搜索" key="1">
+						<div className="user-search">
+							<Input
+								placeholder="客户名称"
+								value={this.state.nameSearch}
+								style={{ width: 150 }}
+								onChange={(e) => {
+									this.setState({ nameSearch: e.target.value });
+								}}
+							/>
+							<Select
+								placeholder="省"
+								style={{ width: 80 }}
+								value={this.state.provinceSearch}
+								onChange={(e) => {
+									this.setState({ provinceSearch: e });
+								}}
+							>
+								{this.state.Provinces}
+							</Select>
+							<span style={{ marginRight: "10px" }}>
+								<Cascader
+									options={citySelect()}
+									value={this.state.addressSearch}
+									placeholder="选择城市"
+									onChange={(e, pre) => {
+										this.setState({ addressSearch: e });
+									}}
+								/>
+							</span>
+							<span>排序:</span>
+							<Select style={{ width: 120 }} value={this.state.sort} onChange={e => { this.setState({ sort: e }) }} placeholder="选择排序">
+								<Option value={0}>默认</Option>
+								<Option value={1}>降序</Option>
+								<Option value={2}>升序</Option>
+							</Select>
+							<Button type="primary" onClick={this.search}>
+								搜索
+							</Button>
+							<Button onClick={this.reset}>重置</Button>
+						</div>
+					</TabPane>
+					<TabPane tab="更改表格显示数据" key="2">
+						<div style={{ marginLeft: 10 }}>
+							<ChooseList
+								columns={this.state.columns}
+								changeFn={this.changeList}
+								changeList={this.state.changeList}
+								top={55}
+								margin={11}
+							/>
+						</div>
+					</TabPane>
+				</Tabs>
+				<div className="patent-table">
+					<Spin spinning={this.state.loading}>
+						<Table
+							size="middle"
+							columns={
+								this.state.changeList
+									? this.state.changeList
+									: this.state.columns
+							}
+							dataSource={this.state.dataSource}
+							// rowSelection={rowSelection}
+							pagination={this.state.pagination}
+						/>
+					</Spin>
 				</div>
-			</TabPane>
-        </Tabs>
-        <div className="patent-table">
-          <Spin spinning={this.state.loading}>
-            <Table
-			  size="middle"
-			  columns={
-				  this.state.changeList
-					  ? this.state.changeList
-					  : this.state.columns
-			  }
-              dataSource={this.state.dataSource}
-              // rowSelection={rowSelection}
-              pagination={this.state.pagination}
-            />
-          </Spin>
-        </div>
-      </div>
-    );
+			</div>
+		);
 	}
 })
 export default QueryCustomer;

+ 4 - 0
js/component/tools.js

@@ -116,6 +116,10 @@ import { provinceList } from './NewDicProvinceList.js';
 import ShowModal from './showModal.jsx';
 
 module.exports = {
+  onReplace: function (val) {
+    let text = val.replace(/ /gm, ' ⁠⁡⁢⁣⁤⁠⁡⁢⁣⁤ ⁠⁡⁢⁣⁤⁠⁡⁢⁣⁤⁠⁡⁢⁣⁤⁠⁡⁢⁣⁤⁠⁡ ⁠⁡⁢⁣⁤⁠⁡⁢⁣⁤ ⁠⁡⁢⁣⁤⁠⁡⁢⁣⁤ ⁠⁡⁢⁣⁠⁡⁢⁣⁤⁠')
+    return text
+  },
   getPercentage: function (val) {
     return (Math.round(val * 10000)) / 100 + '%';
   },