import React from 'react';
import { Radio, Icon, Button, Input, Select, Spin,Popconfirm, Table, Switch, message, DatePicker, Modal, Upload,Form ,Row,Col,TimePicker} from 'antd';
import ajax from 'jquery/src/ajax/xhr.js';
import $ from 'jquery/src/ajax';
import moment from 'moment';
import './myClient.less';
const { Column, ColumnGroup } = Table;
import  TechAchievementDesc from './myClientDesc.jsx';
import { achievementCategoryList, techAuditStatusList,cityArr,tag,customerStatus,intentionalService,newFollow ,newFollowOn,contact,sex,intentionalServiceOn,customerStatusOn} from '../../dataDic.js';
import { beforeUploadFile, companySearch, getAchievementCategory,getsex,getSearchUrl,getTechAuditStatus,getcustomerTyp,getcityArr,getCompanyIntentionOn,getcustomerStatue,getCompanyIntention,getfllowSituation,getcontact,getfllowSituationOn,getcustomerStatueOn} from '../../tools.js';
import BatchImport from './batchImport';

//图片组件
const PicturesWall = React.createClass({
    getInitialState() {
        return {
            previewVisible: false,
            previewImage: '',
            fileList: [],
        }
    },
    handleCancel() {
        this.setState({ previewVisible: false })
    },
    handlePreview(file) {
        this.setState({
            previewImage: file.url || file.thumbUrl,
            previewVisible: true,
        });
    },
    handleChange(info) {
        let fileList = info.fileList;
        this.setState({ fileList });
        this.props.fileList(fileList);
    },
    componentWillReceiveProps(nextProps) {
        this.state.fileList = nextProps.pictureUrl;
    },
    render() {
        const { previewVisible, previewImage, fileList } = this.state;
        const uploadButton = (
            <div>
                <Icon type="plus" />
                <div className="ant-upload-text">点击上传</div>
            </div>
        );
        return (
            <div className="clearfix">
                <Upload
                    action={globalConfig.context + "/api/admin/achievement/uploadPicture"}
                    data={{ 'sign': this.props.pictureSign }}
                    listType="picture-card"
                    fileList={fileList}
                    onPreview={this.handlePreview}
                    onChange={this.handleChange} >
                    {fileList.length >= 5 ? null : uploadButton}
                </Upload>
                <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
                    <img alt="example" style={{ width: '100%' }} src={previewImage} />
                </Modal>
            </div>
        );
    }
});

const AchievementList = Form.create()(React.createClass({
	
    loadData(pageNo, apiUrl) {
        this.state.data = [];
        this.setState({
            loading: true
        });
        $.ajax({
            method: "post",
            dataType: "json",
            crossDomain: false,          
            url:globalConfig.context + '/api/admin/customer/listPrivateCustomer',
            data: {
 				pageNo: pageNo || 1,
                pageSize: this.state.pagination.pageSize,               
//              companyName: this.state.companyName, //名称1                
//				customerType: this.state.customerType, //客户类型1
//            	locationProvince:this.state.locationProvince,//地区
//				customerStatus:this.state.customerStatus,//客户状态1
//				contactName:this.state.contactName,//联系人姓名1							
//				contactTel:this.state.contactTel,//联系人手机
//				companyIntention:this.state.companyIntention,//意向服务
//              followSituation:this.state.followSituation,//最新跟进进度		
            },
            success: function (data) {            	
                let theArr = [];
                let ad;
                if (data.error.length || data.data.list=="") {
                    if (data.error && data.error.length) {
                        message.warning(data.error[0].message);
                    };                   
                } else { 
                	ad=data.data.list[0].aid;
                    for (let i = 0; i < data.data.list.length; i++) {
                        let thisdata = data.data.list[i];                       
                        theArr.push({
                            key: i,                           
                            id: thisdata.id,                                                  
                            companyName:thisdata.companyName,//公司名称
                            _shareType:thisdata._shareType,//客户类型
                            locationProvince:thisdata.locationProvince,//地区                        
                            contactName:thisdata.contactName, //联系人姓名
                            telNum:thisdata.telNum,//手机号
                            _customerStatus:thisdata._customerStatus,//客户状态
                            _companyIntention:thisdata._companyIntention,//意向服务
                            _followSituation:thisdata._followSituation,//最新跟进
                            customerStatus:thisdata.customerStatus,//客户状态
                            companyIntention:thisdata.companyIntention,//意向服务
                            followSituation:thisdata.followSituation,//最新跟进
                            adminName:thisdata.adminName,     //跟进人          
                            followDate:thisdata.followDate,
                            customerStatus:thisdata.customerStatus,//客户状态
                            companyIntention:thisdata.companyIntention,//意向服务 
                            _customerType:thisdata._customerType,//客户类型
                        });
                    };
                    this.state.pagination.current = data.data.pageNo;
                    this.state.pagination.total = data.data.totalCount;
                };               
                this.setState({
                	aid:ad,
                    dataSource: theArr,
                    pagination: this.state.pagination
                });
            }.bind(this),
        }).always(function () {
            this.setState({
                loading: false
            });
        }.bind(this));
    }, 
    loadData1(pageNo, apiUrl) {
        this.state.data = [];
        this.setState({
            loading: true
        });
        $.ajax({
            method: "post",
            dataType: "json",
            crossDomain: false,          
            url:globalConfig.context + '/api/admin/customer/listPrivateCustomer',
            data: {
 				pageNo: pageNo || 1,
                pageSize: this.state.pagination.pageSize,               
                companyName: this.state.companyName, //名称1                
				customerType: this.state.customerType, //客户类型1
              	locationProvince:this.state.locationProvince,//地区
				customerStatus:this.state.customerStatus,//客户状态1
				contactName:this.state.contactName,//联系人姓名1							
				contactTel:this.state.contactTel,//联系人手机
				companyIntention:this.state.companyIntention,//意向服务
                followSituation:this.state.followSituation,//最新跟进进度		
            },
            success: function (data) {            	
                let theArr = [];
                let ad;
                if (data.error.length || data.data.list=="") {
                    if (data.error && data.error.length) {
                        message.warning(data.error[0].message);
                    };                   
                } else { 
                	ad=data.data.list[0].aid;
                    for (let i = 0; i < data.data.list.length; i++) {
                        let thisdata = data.data.list[i];                       
                        theArr.push({
                            key: i,                           
                            id: thisdata.id,                                                  
                            companyName:thisdata.companyName,//公司名称
                            _shareType:thisdata._shareType,//客户类型
                            locationProvince:thisdata.locationProvince,//地区                        
                            contactName:thisdata.contactName, //联系人姓名
                            telNum:thisdata.telNum,//手机号
                            _customerStatus:thisdata._customerStatus,//客户状态
                            _companyIntention:thisdata._companyIntention,//意向服务
                            _followSituation:thisdata._followSituation,//最新跟进
                            customerStatus:thisdata.customerStatus,//客户状态
                            companyIntention:thisdata.companyIntention,//意向服务
                            followSituation:thisdata.followSituation,//最新跟进
                            adminName:thisdata.adminName,     //跟进人          
                            followDate:thisdata.followDate,
                            customerStatus:thisdata.customerStatus,//客户状态
                            companyIntention:thisdata.companyIntention,//意向服务 
                            _customerType:thisdata._customerType,//客户类型
                        });
                    };
                    this.state.pagination.current = data.data.pageNo;
                    this.state.pagination.total = data.data.totalCount;
                };               
                this.setState({
                	aid:ad,
                    dataSource: theArr,
                    pagination: this.state.pagination
                });
            }.bind(this),
        }).always(function () {
            this.setState({
                loading: false
            });
        }.bind(this));
    }, 
  	//点击+号进行两次查询，这个是查询联系人的函数
    getNewWoman(deletedIds) {
    	const contactsOptionWoman=[]
         $.ajax({
                method: "post",
                dataType: "json",
                crossDomain: false,
                url: globalConfig.context + "/api/admin/customer/findCustomerUserList",
                data:{
                	cid:deletedIds
                },
                 success: function (data) {                	  
                		let theArr = [];
					    let thedata=data.data;
					    var email=[];
					    var telNum=[];
					    var contactIds=[];
				        thedata.map(function (item,index) {				        				        	
				        	email.push(thedata[index].email);
				        	contactIds.push(thedata[index].id);
			            	telNum.push(thedata[index].telNum);
				          	theArr.push(<Select.Option value={index}>{item.name}</Select.Option>)						          
				        });	
			            var lastName= thedata[thedata.length-1].name;			        			          
			            var nub=thedata[thedata.length-1].telNum; 
			            var kid=thedata[thedata.length-1].id;
						var contacts='电话';
						this.setState({
						    kid:kid,
						    contactIds:contactIds,
						    contacts:contacts,
		        	    	nub:nub,
				        	telNum:telNum,
				        	email:email,
				        	lastName:lastName,
		                    orderStatusOption: theArr,                    
	                    });
					}.bind(this),
				}).always(function () {
	            this.setState({
	                loading: false
	            });
	        }.bind(this));
	},
    //在添加联系记录页面，选择联系方式查看号码
    contacts(e){
			let conts='';   
	    if(e==0){
	    	conts='电话'
	    	this.state.nub=this.state.changNub		    	
	    }
	    if(e==1){
	    	conts='邮件'
	    	this.state.nub=this.state.changEmail		    	
	    }
	    if(e==2){
	    	conts='面谈'
	    	this.state.nub=''		    
	    }	    	     
	    if(e==3){
	    	conts='短信'
	    	this.state.nub=''			    	
	    	}	
	    this.setState({
				conts:conts,
	      contacts: e,
	   });		
		},
	
    //通过ID查询这一条的信息
    Detailload(deletedIds,record){
    	this.RowClick;
    	$.ajax({
            method: "post",
            dataType: "json",
            crossDomain: false,
            url: globalConfig.context + '/api/admin/customer/findCustomerDetails',
            data: {
                id: deletedIds
            },
            success: function (data) {
                let thisData = data.data;
               
                if (!thisData) {
                    if (data.error && data.error.length) {
                        message.warning(data.error[0].message);
                    };
                    thisData = {};
                };
                this.setState({
                    data: thisData,
                   	followSituation:thisData.followSituation,
            		customerStatus:thisData.customerStatus,
            		companyIntention:thisData.companyIntention,
            		_followSituation:thisData._followSituation,
            		_customerStatus:thisData._customerStatus,
            		_companyIntention:thisData._companyIntention,
            		cid:thisData.cid,
            		customerType:thisData.customerType,
            		companyName:thisData.companyName,
            		adminName:thisData.adminName
                });
                if (thisData.ownerId) {
                    this.getContactsList(thisData.ownerId);
                };
               
            }.bind(this),
        }).always(function () {
            this.setState({
            	
                loading: false
            });
        }.bind(this));  
    },
    //点击出现函数	
	//点击消失函数
	setModal1Visiblecancel(e) {
	    this.setState({ 
	    	modal1Visible:false
	    });	
	    this.reset();
	},
    //点击添加跟进记录，点击最新跟进下的+号，将会查询出很多数据，展示在列表里面，
  	setModal1VisibleOk(e) {
  		this.setState({modal1Visible:true});
  		let deletedIds=this.state.rowId;  
         for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
            let rowItem = this.state.selectedRows[idx];                          
            if (rowItem.id) {
                deletedIds=rowItem.id;                 
            };            
        };       
		this.Detailload(deletedIds);
        this.getNewWoman(deletedIds);        
	},
	//点击出现函数
	setModal2VisibleOk(e) {
	    this.setState({ 
	    	modal2Visible:true
	    });  
	},
	//点击消失函数
	setModal2Visiblecancel(e) {
	    this.setState({ 
	    	modal2Visible:false
	    });	   	    
	},
	//点击消失函数
	setModal3Visiblecancel(e) {
	    this.setState({ 
	    	modal3Visible:false
	    });	   	    
	},
	//点击查看跟进记录，点击最新跟进的第一个按钮（跟进状态）执行的函数，将会出现很多跟进列表
	setModal3VisibleOk(e) {		
		this.setState({ modal3Visible:true });			  
        this.state.data = [];
        this.setState({
            loading: true
        });  
        let deletedIds=this.state.rowId; 
         for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
            let rowItem = this.state.selectedRows[idx];                          
            if (rowItem.id) {
                deletedIds=rowItem.id;               
            };            
        };       
        $.ajax({
            method: "get",
            dataType: "json",
            crossDomain: false,          
            url:globalConfig.context + '/api/admin/customer/listFollowUpRecord',
            data: {
                  customerId:deletedIds                 	
            },
            success: function (data) {            	
                let theArr = [];
                let theWomanID=[];
                let theFollowID=[];
                if (!data.data) {
                    if (data.error && data.error.length) {
                        message.warning(data.error[0].message);
                    };                   
                } else {  
                		data.data.map(function (item,index) {	
							theWomanID.push(data.data[index].contactId);					          
						});	
						data.data.map(function (item,index) {	
							theFollowID.push(data.data[index].followId);					          
						});
                    for (let i = 0; i < data.data.length; i++) {
                        let thisdata = data.data[i];
                        theArr.push({
                        		key:i,
                            _followDate:thisdata._followDate,//跟进时间
                            adminName:thisdata.adminName,//跟进人   
                            contactName:thisdata.contactName, //联系人姓名
                            contactId:thisdata.contactId, //联系人ID
                            contactInfo:thisdata.contactInfo,//联系信息
                            _customerStatus:thisdata._customerStatus,//客户状态     
                            _followSituation:thisdata._followSituation,//最新跟进
                            followResult:thisdata.followResult,//跟进结果
                            attachment:thisdata.attachment,//附件地址
                        });
                    };                   
                };               
                this.setState({//导出数据
                    datahistory: theArr, 
                    theWomanID:theWomanID,
                    theFollowID:theFollowID,
                });
            }.bind(this),
        }).always(function () {
            this.setState({
                loading: false
            });
        }.bind(this));
    }, 
    
    //删除历史记录
    onDelete(index){
    	let deleteID=this.state.theFollowID[index];
    	$.ajax({
            method: "get",
            dataType: "json",
            crossDomain: false,           
            url: globalConfig.context + "/api/admin/customer/deleteFollowUpRecord",
            data: {
                followId:deleteID,//删除的ID         
            }
        }).done(function (data) {
            if (!data.error.length) {
                message.success('删除成功！');
                this.setModal3Visiblecancel();
                this.setModal3VisibleOk();
                this.setState({
                    loading: false,
                });
            } else {
                message.warning(data.error[0].message);
            };
            this.loadData();
        }.bind(this));
    },
 
	//点击消失函数
	setModal4Visiblecancel(e) {
	    this.setState({ 
	    	modal4Visible:false
	    });	   	    
	},
	//点击客户的名字，进行详情的查询
	setModal4Visible(e,index) {
		this.setState({ modal4Visible:true });
		let changeIds=this.state.datahistory[index].contactId;
	     $.ajax({
            method: "get",
            dataType: "json",
            crossDomain: false,          
            url:globalConfig.context + '/api/admin/customer/findContactDetail',
            data: {
                  contactId:changeIds                 	
            },
            success: function (data) {            	
                let theArr = [];
                let theDate=data.data;
                if (!data.data) {
                    if (data.error && data.error.length) {
                        message.warning(data.error[0].message);
                    };                   
                } else {                	
                    for (let i = 0; i < data.data.length; i++) {
                        let thisdata = data.data[i];                       
                        theArr.push({
                        		key:i,
                        		name:name,//联系人姓名
                        		sex:sex,//联系人性别
                        		mobile:mobile,//座机号
                        		telNum:telNum,//手机号
                        		email:email,//邮箱
                        		qq:qq,//qq
                        		wechat:wechat,//微信号
                        		depatrment:depatrment,//部门
                        		customerPosition:customerPosition,//职位
                        });
                    };                   
                };               
                this.setState({//导出数据
                			theDate:theDate,	
                    		name:theDate.name,//联系人姓名
		            		sex:theDate.sex,//联系人性别
		            		mobile:theDate.mobile,//座机号
		            		telNum:theDate.telNum,//手机号
		            		email:theDate.email,//邮箱
		            		qq:theDate.qq,//qq
		            		wechat:theDate.wechat,//微信号
		            		depatrment:theDate.depatrment,//部门
		            		customerPosition:theDate.customerPosition,//职位
		            		companyName:theDate.companyName,//公司
		            		
                });
            }.bind(this),
        }).always(function () {
            this.setState({
                loading: false
            });
        }.bind(this));
	},
	//点击消失函数
	setModal5Visiblecancel(e) {
	    this.setState({ 
	    	modal5Visible:false
	    });	 
	    this.reset();
	},
	setModal6Visiblecancel(e) {
	    this.setState({ 
	    	modal6Visible:false
	    });	   	    
	},
	setModal7Visiblecancel(e) {
	    this.setState({ 
	    	modal7Visible:false
	    });	   	    
	},
	setModal8Visiblecancel(e) {
	    this.setState({ 
	    	modal8Visible:false
	    });	   	    
	},
	//点击名称时获取列表
	  setModal5VisibleOk(e) {
	  	this.setState({ modal5Visible:true });	//需要一个请求数据   	    
	    this.Detailload(e.id);
	  },
	  //历史记录查看更多，还是历史记录接口
	  	setModal6VisibleOk(e) {
	    this.setState({ modal6Visible:true });	//需要一个请求数据    
		},
		getPictureUrl(e) {
        this.setState({pictureUrl: e });
    },
    //查看所有的联系人
		setModal7VisibleOk(e) {
	    this.setState({ modal7Visible:true });	//需要一个请求数据 
	   
	    $.ajax({
                method: "post",
                dataType: "json",
                crossDomain: false,
                url: globalConfig.context + "/api/admin/customer/findCustomerUserList",
                data:{
                	cid:this.state.cid
                },
                 success: function (data) {                	  
                		let theArr = [];
					    let thedata=data.data;
					    let cidArr=[];
					    for (let i = 0; i < data.data.length; i++) {
					    	cidArr.push({
					    		i:thedata[i].cid,
					    	})
					    }
					    for (let i = 0; i < data.data.length; i++) {
	                        let thisdata = data.data[i];                       
	                        theArr.push({
	                        		cid:thisdata.cid,//客户的ID
	                        		id:thisdata.id,//联系人ID
	                        		contactName:thisdata.name,//联系人姓名
	                        		sex:thisdata.sex,//联系人性别
	                        		mobile:thisdata.mobile,//座机号
	                        		telNum:thisdata.telNum,//手机号
	                        		email:thisdata.email,//邮箱
	                        		qq:thisdata.qq,//qq
	                        		wechat:thisdata.wechat,//微信号
	                        		depatrment:thisdata.depatrment,//部门
	                        		customerPosition:thisdata.customerPosition,//职位
	                        });
	                    };         
						this.setState({
		                    information: theArr, 
		                    cidArr:cidArr,
	                    });
					}.bind(this),
				}).always(function () {
	            this.setState({
	                loading: false
	            });
	        }.bind(this));
		},
		//修改联系人列表数据
		setModal8VisibleOk(e) {
	    	this.setState({ modal8Visible:true });	//需要一个请求数据    
	    	let deletedIds=this.state.rowId;  
         	for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
            let rowItem = this.state.selectedRows[idx];                          
            if (rowItem.id) {
                deletedIds=rowItem.id;                 
            };  
         
        	};      
		},
		changefollow(e){
			e.preventDefault(); 
			
			$.ajax({
            method: "post",
            dataType: "json",
            crossDomain: false,           
            url: globalConfig.context + "/api/admin/customer/updateContacter",
            data: {
                id:this.state.id,//联系人ID
                cid:this.state.cid,//客户的ID
                name:this.state.name,//客户名
                sex:this.state.sex,//性别
                mobile:this.state.mobile,//座机号
        		telNum:this.state.telNum,//手机号
        		email:this.state.email,//邮箱
        		qq:this.state.qq,//qq
        		wechat:this.state.wechat,//微信号
        		depatrment:this.state.depatrment,//部门
        		customerPosition:this.state.customerPosition,//职位
        		primaryFlg:this.state.primaryFlg,//是否是主要联系人
            }
        }).done(function (data) {
            if (!data.error.length) {
                message.success('修改成功！');
                this.setState({
                    loading: false,
                });
                this.setModal8Visiblecancel()
            } else {
                message.warning(data.error[0].message);
            };
            //this.getNewWoman(this.state.cid)
            this.loadData();
        }.bind(this));
		},
		informationRowClick(index){
			this.setModal8VisibleOk()
			console.log(index);
			$.ajax({
            method: "get",
            dataType: "json",
            crossDomain: false,          
            url:globalConfig.context + '/api/admin/customer/findContactDetail',
            data: {
                  contactId:index.id                 	
            },
            success: function (data) {            	
                let theArr = [];
                let theDate=data.data;
                if (!data.data) {
                    if (data.error && data.error.length) {
                        message.warning(data.error[0].message);
                    };                   
                } else {                	
                    for (let i = 0; i < data.data.length; i++) {
                        let thisdata = data.data[i];                       
                        theArr.push({
                    		key:i,
                    		primaryFlg:primaryFlg,
                    		name:name,//联系人姓名
                    		sex:sex,//联系人性别
                    		mobile:mobile,//座机号
                    		telNum:telNum,//手机号
                    		email:email,//邮箱
                    		qq:qq,//qq
                    		wechat:wechat,//微信号
                    		depatrment:depatrment,//部门
                    		customerPosition:customerPosition,//职位
                        });
                    };                   
                };               
                this.setState({//导出数据
                			primaryFlg:theDate.primaryFlg,
                			thaDate:theDate,
                			cid:theDate.cid,//客户ID
                			id:theDate.id,//联系人ID
                    		name:theDate.name,//联系人姓名
		            		sex:theDate.sex,//联系人性别
		            		mobile:theDate.mobile,//座机号
		            		telNum:theDate.telNum,//手机号
		            		email:theDate.email,//邮箱
		            		qq:theDate.qq,//qq
		            		wechat:theDate.wechat,//微信号
		            		depatrment:theDate.depatrment,//部门
		            		customerPosition:theDate.customerPosition,//职位
		            		companyName:theDate.companyName,//公司
                });
            }.bind(this),
        }).always(function () {
            this.setState({
                loading: false
            });
        }.bind(this));
			
		},

    componentWillReceiveProps(nextProps) {
        if (!this.props.visible && nextProps.visible) {
            if (nextProps.data && nextProps.data.id) {
                this.loadData(nextProps.data.id, nextProps.detailApiUrl);
            };           
            this.state.technicalPictureUrl = [];       
        };
    },
    //添加一条跟进记录，点击保存按钮进行添加
    addFollowSubmit(e) {
        e.preventDefault(); 
        this.state.data = []
        this.setState({        	
            selectedRowKeys: [],
            //loading: deletedIds.length > 0
        });
        let deletedIds;
        this.state.data = [];
        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
            let rowItem = this.state.selectedRows[idx];
            if (rowItem.id) {
                deletedIds=rowItem.id
            };            
        };   
      	this.props.form.validateFields((err, values) => {
    		if (!err) {
            	this.setState({
                loading: true
            	});          
            let custype=values._shareType;
            let customerTypechange="";
            switch(custype){
            	case "个人客户":customerTypechange=0;break;
            	case "公司客户":customerTypechange=1;break;
            }  
            console.log(this.state.kid)
            let customerStatus= getcustomerStatueOn(this.state.customerStatus);
            let followSituation= getfllowSituationOn(this.state.followSituation);         
          
       		$.ajax({
                    method: "POST",
                    dataType: "json",
                    crossDomain: false,
                    url:globalConfig.context + '/api/admin/customer/addFollowUpRecord',
                    data: {
                        id: deletedIds,//编号id  
                        cuid:this.state.kid,//联系人ID
                        followDates:(values.createTime ? values.createTime.format('YYYY-MM-DD'):undefined)+" "+(values.createTim ? values.createTim.format('YYYY:MM:DD'):undefined),//跟进时间
                        followResult:values.remarks,//跟进结果
                        attachment:"",//附件地址
                        customerStatus:values.customerStatus,//跟进客户状态
                        followSituation:values.followSituation,//跟进进度
                        contactInfo:(this.state.conts?this.state.conts:"电话")+"-"+(this.state.nub?this.state.nub:""),
                    }
                }).done(function (data) {                	
                    this.setState({
                        loading: false
                    });
                    if (!data.error.length) {
                        message.success('保存成功！');
                        this.setModal1Visiblecancel()                     
                    } else {
                        message.warning(data.error[0].message);
                    }
                    //this.loadData();
                }.bind(this));  	
            }
    	})
        
    },
    //当选择联系人的列表变化时，则执行
    hundleName(e){		    	
       let changNub=this.state.telNum[e];
       let changEmail=this.state.email[e];
       let kid=this.state.contactIds[e];
       console.log(kid)
       this.setState({
       	  kid:kid,
       	  contacts:'电话',
       	  nub:this.state.telNum[e],
	        lastName: e,
	        changNub:changNub,
	        changEmail:changEmail,
	   });
	},


		
    //所有资料修改保存提交，点击保存按钮进行更新
    handleSubmit(e) {    		
        e.preventDefault(); 
        let deletedIds;
        let adminName;
        let customerStatus;       
        let companyIntention;
        let followSituation;           
        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
            let rowItem = this.state.selectedRows[idx];                          
            if (rowItem.id) {
                deletedIds=rowItem.id;               
                adminName=rowItem.adminName; 
                customerStatus=rowItem.customerStatus;
                companyIntention=rowItem.companyIntention;
                followSituation=rowItem.followSituation;
            };            
        };  
        //this.state.data = []
        this.setState({        	
            //selectedRowKeys: [],
           // loading: deletedIds.length > 0
        });
        this.props.form.validateFields((err, values) => {
    	if (!err) {
            this.setState({
                loading: true
            });          
            let custype=values._customerType; 
            let customerTypechange="";
            switch(custype){
            	case "个人客户":customerTypechange=0;break;
            	case "公司客户":customerTypechange=1;break;
            }      
            let companyIntentions= getCompanyIntentionOn(values.companyIntention);
            let followSituations= getfllowSituationOn(values.followSituation);         
         	let becompanyIntentions=getCompanyIntentionOn();
         	let city=getcityArr(values.locationProvince);
         	
       		$.ajax({
                    method: "POST",
                    dataType: "json",
                    crossDomain: false,
                    url:globalConfig.context + '/api/admin/customer/updateCustomer',
                    data: {
                        id: this.state.cid,//编号id  
                        customerType:this.state.customerType,//客户信息  1                       
                        //createTime: values.createTime ? values.createTime.format('YYYY-MM-DD') : undefined,//时间 1\                    
						companyName: values.companyName,//公司名称  1                        
                        companyIndustry: values.companyIndustry,//公司行业                          
                        tag: values.tag,
                        locationProvince:values.locationProvince ,//省份1
                        adress: values.adress,//详细地址1
                        remarks: values.remarks,//备注1
                        companyIntention:this.state.companyIntention,//公司意向
                        followSituation:this.state.followSituation,//最新跟进1
                        customerStatus:this.state.customerStatus,//客户状态1
                        //name: values.name,//客户姓名1                        
//                     	beforeCustomerStatus:this.state.customerStatus,//客户状态
//             			beforeCompanyIntention:this.state.companyIntention,
//              		beforeFollowSituation:this.state.followSituation,//最新跟进
                		beforeAdminName:this.state.adminName,
                		name:this.state.companyName,
                    }
                }).done(function (data) {                	
                    this.setState({
                        loading: false
                    });
                    if (!data.error.length) {
                        message.success('修改成功！');
                               this.setModal5Visiblecancel();
                    } else {
                        message.warning(data.error[0].message);
                    }
                    this.loadData();
                }.bind(this));  	
            }
    	})
        
    },
    
    submitcontactman(e){
    
    	let deletedIds;
        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
            let rowItem = this.state.selectedRows[idx];
            if (rowItem.id) {
                deletedIds=rowItem.id
            };            
        };       
        this.setState({
            selectedRowKeys: [],
        });        
    		e.preventDefault();
        this.props.form.validateFields((err, values) => {           	
            if (!err) {          	
                this.setState({
                    loading: true
                });
               
                $.ajax({
                    method: "POST",
                    dataType: "json",
                    crossDomain: false,
                    url: globalConfig.context + '/api/admin/customer/addContacter',
                    data: {
                        cid: deletedIds,//编号id
                        sex:this.state.hot,//性别
                        primaryFlg:this.state.hots,//是否是主要联系人
                        name:this.state.paymentId,//联系人姓名
                        mobile:this.state.paym,//座机
                        telNum:this.state.pay,//电话
                        qq:this.state.entId,//qq
                       	wechat:this.state.payId,//微信
                       	customerPosition:this.state.paentId,//职位
                       	depatrment:this.state.paytId,//部门
                       	email:this.state.emails,//邮箱                  
                    }
                }).done(function (data) {                	
                    this.setState({
                        loading: false
                    });
                    if (!data.error.length) {
                        message.success('保存成功！');
                        this.setModal2Visiblecancel()                       
                    } else {
                        message.warning(data.error[0].message);
                    }
                    //this.loadData();
                }.bind(this));
            }
        });
    },
    getTechnicalPictureUrl(e) {
        this.setState({ technicalPictureUrl: e });
    },
    
    //新建联系人modal框显示
	showModal(){
	    this.setState({
	      visible: true,
	    });
	},
	
	//指定转交人的点击函数
	showModa(){
	    this.setState({
	      visible: true,
	    });
	    let changeIds;
        let adminName;
        let customerStatus;       
        let companyIntention;
        let followSituation;       
        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
            let rowItem = this.state.selectedRows[idx];                          
            if (rowItem.id) {
                changeIds=rowItem.id;               
                adminName=rowItem.adminName; 
                customerStatus=rowItem.customerStatus;
                companyIntention=rowItem.companyIntention;
                followSituation=rowItem.followSituation;   
               
            };            
        };  
	     $.ajax({
	     	method: "post",
            dataType: "json",
            crossDomain: false,
            url: globalConfig.context + "/api/admin/customer/findAdmin",
            data: { 
            	id: changeIds,//这一行数据的ID	           
	            beforeCompanyIntention:companyIntention,//意向服务
				beforeCustomerStatus:customerStatus,//客户状态
				beforeFollowSituation:followSituation,//最新跟进状态
				beforeAdminName:adminName,//跟进人
            }
        }).done(function (data) {
        	
            if (data.error && data.error.length) {
            	message.warning(data.error[0].message);
            } else {
             let theAssigne = [];
                if (!data.data) {
                    if (data.error && data.error.length) {
                        message.warning(data.error[0].message);
                    };    
                  
                } else {                	
                    for (let i = 0; i < data.data.length; i++) {
                    	
                        let thisdata = data.data[i];  
                        //处理数据 进行循环
                        theAssigne.push({
                            key: thisdata.name,
                            id: thisdata.id,
                            ids: thisdata.cid,
                            mobile:thisdata.mobile,
                            adminName: thisdata.beforeAdminName,
                            customerStatus: thisdata.beforeCustomerStatus,
                            companyIntention: thisdata.beforeCompanyIntention,
                            followSituation: thisdata.beforeFollowSituation,  
                        });
                    }; 
                   
                };               
                this.setState({
                    dataman: theAssigne,                   
                });              
            }
        }.bind(this));
    },	   
    //选择了指定人之后的保存点击函数，需要修改函数
    changeAssigner() {
          this.setState({
	      visible: false,
	    });
	    let changeId;
	    let changeIds;
        let adminName;
        let beforeAdminName;
        let customerStatus;       
        let companyIntention;
        let followSituation;       
        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
            let rowItem = this.state.selectedRows[idx];                          
            if (rowItem.id) {
                changeId=rowItem.id;               
                beforeAdminName=rowItem.adminName; 
                adminName=rowItem.key; 
                customerStatus=rowItem.customerStatus;
                companyIntention=rowItem.companyIntention;
                followSituation=rowItem.followSituation;  
                changeIds=rowItem.ids;  
            };            
        };  
        
	      $.ajax({
	        method: "post",
	        dataType: "json",
	        crossDomain: false,           
	        url: globalConfig.context + "/api/admin/customer/transferCustomer",
	        data: {
	            id: changeIds,//这一行数据的ID
	            aid:changeId,//指定转交人的ID 
	            beforeCompanyIntention:companyIntention,//意向服务
							beforeCustomerStatus:customerStatus,//客户状态
							beforeFollowSituation:followSituation,//最新跟进状态
							beforeAdminName:beforeAdminName,//之前的跟进人
							adminName:adminName,//转交的跟进人
	        }
        }).done(function (data) {
            if (!data.error.length) {
                message.success('转交成功！');
                this.setState({
                    loading: false,
                });
            } else {
                message.warning(data.error[0].message);
            };
            this.loadData();
        }.bind(this));
    },
    handleOk(e){	   
	    this.setState({
	      visible: false,
	    });
	},
	handleCancel(e){	   
	    this.setState({
	      visible: false,
	    });
	},
	//点击公司名称，进行弹出框动作，同时进行资料详情查询
    getInitialState() {
        return { 
        	technicalPictureUrl: [],
		    modal1Visible: false,
		    modal2Visible: false,	
        	visible: false ,
            searchMore: true,
            searchType: 0,
            validityPeriodDate: [],
            releaseDate: [],
            selectedRowKeys: [],
            selectedRows: [],
            loading: false,
            pagination: {
                defaultCurrent: 1,
                defaultPageSize: 10,
                showQuickJumper: true,
                pageSize: 10,
                onChange: function (page) {
                    this.loadData(page);
                }.bind(this),
                showTotal: function (total) {
                    return '共' + total + '条数据';
                }
            },
            contactInformation:[
            {
				  title: '姓名',
				  dataIndex: 'contactName',
				  key: 'contactName'
				  
			},{
				  title: '性别',
				  dataIndex: 'sex',
				  key: 'sex',
				  render: text => { return getsex(text); }
			},
			{
				  title: '手机号码',
				  dataIndex: 'telNum',
				  key: 'telNum'	 
			},{
				  title: '座机号',
				  dataIndex: 'mobile',
				  key: 'mobile'	 
			},{
				  title: 'QQ号码',
				  dataIndex: 'qq',
				  key: 'qq'	 
			},{
				  title: '邮箱号',
				  dataIndex: 'email',
				  key: 'email'	 
			},{
				  title: '微信',
				  dataIndex: 'wechat',
				  key: 'wechat'	 
			},{
				  title: '部门',
				  dataIndex: 'depatrment',
				  key: 'depatrment'	 
			},{
				  title: '职位',
				  dataIndex: 'customerPosition',
				  key: 'customerPosition'	 
			}	
       ],

            columnsman:[{
				  title: '姓名',
				  dataIndex: 'key',
				  key: 'key'	 
			},{
				  title: '手机号码',
				  dataIndex: 'mobile',
				  key: 'mobile'	 
			}
            ],
            columns: [               
                {
                    title: '公司名称',
                    dataIndex: 'companyName',
                    key: 'companyName',
                    render: text => { 	
                     		const theData = this.state.data || {};                     		
                     		const contactsOption="";
					        const { getFieldDecorator } = this.props.form;
					        const FormItem = Form.Item;
					        const rowSelection = {
	            				  selectedRowKeys: this.state.selectedRowKeys,
	            				  onChange: (selectedRowKeys, selectedRows) => {
	                			  this.setState({
	                    	      selectedRows: selectedRows.slice(-1),
	                    		  selectedRowKeys: selectedRowKeys.slice(-1)
	                				});
   			 				}
			 				};
							const hasSelected = this.state.selectedRowKeys.length > 0;
					        const formItemLayout = {
					            labelCol: { span: 8 },
					            wrapperCol: { span: 14 },
					        };
				return (
				   <div>
    		  		<span>{text}</span>
            		  <Modal						                				  
							      footer=''
						          title="客户详情"
						          width='1000px'
						          visible={this.state.modal5Visible}
						          onOk={this.setModal5Visiblecancel}
						          onCancel={this.setModal5Visiblecancel}							          							          
						        >
						        <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
					            <Spin spinning={this.state.loading}>
					                <div className="clearfix">                    	
					                    <FormItem className="half-item"
			                            {...formItemLayout}
			                            label="客户类型" >
					                    <span>{theData._customerType}</span>
				                      </FormItem>
				                  </div>				                 
		                    	<div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>基本资料:</div>
		                    	<div>
		                         <FormItem className="half-item"
			                            {...formItemLayout}
			                            label="跟进记录" >
		                         		<span style={{marginRight:"10px"}}>{theData._followSituation}</span>
			                            <a href='#' onClick={this.setModal3VisibleOk  } style={{marginRight:'50px',display:'inlineBlock'}}>查看更多</a>
	                        	</FormItem>
		                        <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="修改次数" >
		                             <span></span>
		                        </FormItem>
		                        <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="转为共享用户时间" >
		                            <span></span>
		                        </FormItem>
		                        <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="修改日志" >
		                            <span></span>
		                        </FormItem>
		                        <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="注册账号" >
		                            <span></span>
		                        </FormItem>
		                    {/* <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="最后联系时间" >
		                            <span></span>
		                        </FormItem> */}
		                        <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="业务操作" >
		                            <span>查询</span>
		                        </FormItem>
		                       <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="录入时间" >
		                            <span>{theData.createTime}</span>
		                        </FormItem>
		                        <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="跟单人" >
		                            <span>{theData.adminName}</span>
		                        </FormItem>
	                        </div>			                       
	                        <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>公司资料:</div>	                    		                           	                                                       	                                               	                        
	                        <div>
                            <FormItem className="half-item"
	                            {...formItemLayout}
	                            label="公司名称" >
	                            {getFieldDecorator('companyName', {	                               
	                                initialValue: theData.companyName
	                            })(
	                                <Input />
	                                )}
		                        </FormItem>
		                        <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="公司行业" >
		                            {getFieldDecorator('companyIndustry', {	                                
		                                initialValue: theData.companyIndustry
		                            })(
		                                <Input />
		                                )}
		                        </FormItem>
		                        <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="意向服务" >
		                               <Select placeholder="选择服务类型" value={getCompanyIntention(this.state.companyIntention)} onChange={(e) => {
										                    this.setState({ companyIntention: e}) }}>
		                                    {
		                                        intentionalService.map(function (item) {
		                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
		                                        })
		                                    }
		                                </Select>
		                               
		                        </FormItem>	                       
				                    <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="地区" >
		                            {getFieldDecorator('locationProvince', {
		                                initialValue: getcityArr(theData.locationProvince)
		                            })(
		                                <Select placeholder="选择地区" style={{ width: 160 }} >
		                                    {
		                                        cityArr.map(function (item) {
		                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
		                                        })
		                                    }
		                                </Select>
		                                )}
		                        </FormItem>
		                        <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="最新跟进" >		                           
		                                <Select placeholder="选择跟进进度" value={getfllowSituation(this.state.followSituation)} style={{ width: 160 }} onChange={(e) => { this.setState({ followSituation: e}) }}>
		                                    {
		                                        newFollow.map(function (item) {
		                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
		                                        })
		                                    }
		                                </Select>		                              
		                        </FormItem>
		                        <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="客户状态" >
		                                <Select placeholder="选择客户状态" value={getcustomerStatue(this.state.customerStatus)} style={{ width: 160 }} onChange={(e) => { this.setState({ customerStatus: e }) }}>
		                                    {
		                                        customerStatus.map(function (item) {
		                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
		                                        })
		                                    }
		                                </Select>
		                        </FormItem>	                       
		                        <FormItem className="half-item"
			                            {...formItemLayout}
			                            label="详细地址" >
			                            {getFieldDecorator('adress', {		                            	
			                                initialValue: theData.adress
			                            })(
			                                <Input />
			                                )}
			                      </FormItem>
			                      <FormItem className="half-item"
		                            {...formItemLayout}
		                            label="标签" >
		                            {getFieldDecorator('tag', {	                            	
		                                initialValue: theData.tag
		                            })(
		                               <Select placeholder="选择客户标签" >
		                                    {
		                                        tag.map(function (item) {
		                                            return <Select.Option key={item.key} >{item.key}</Select.Option>
		                                        })
		                                    }
		                                </Select>
		                                )}
		                        </FormItem>
		                        <div  className="clearfix">		                        
					                      <FormItem
						                        labelCol={{ span: 4 }}
						                        wrapperCol={{ span: 18 }}
						                        label="备注" >
						                        {getFieldDecorator('remarks', {
						                            initialValue: theData.remarks
						                        })(
						                            <Input type="textarea" rows={4} />
						                            )}
				                         </FormItem>
				                    </div>
	                        </div>  
	                        <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>联系资料:<a href="#" style={{marginLeft:'15px'}} onClick={this.setModal7VisibleOk}>查看所有的联系人</a></div>
	                        <Modal
	                        		width="1000px"
								    footer=''
							        title="联系人列表"
							        visible={this.state.modal7Visible}
						            onOk={this.setModal7Visiblecancel}
						            onCancel={this.setModal7Visiblecancel}>
                    				<Spin spinning={this.state.loading}>
						            <Table 
					            	 columns={this.state.contactInformation} 					            	 
					            	 dataSource={this.state.information}
					            	 
					            	 onRowClick={this.informationRowClick}
					            	 />
						            
									                      																	                   
									</Spin>
									</Modal>
									<FormItem wrapperCol={{ span: 12, offset: 4 }}>
				                        <Button className="set-submit" type="primary" htmlType="submit">保存</Button>																	                     
				                        <Button className="set-submit" type="ghost" onClick={this.setModal5Visiblecancel}>取消</Button>																		                                                          							             														 
					                </FormItem>	
							         </Spin>
							      </Form>										     
    							</Modal>
	        						<Modal	
	                        		width="600px"
					              	footer=''
						          title="联系人详细信息"
						          visible={this.state.modal8Visible}
						            onOk={this.setModal8Visiblecancel}
						            onCancel={this.setModal8Visiblecancel}>
						            <div style={{paddingRight:"50px"}}>
				                        	<FormItem className="half-item"
					                            {...formItemLayout}
					                            label="姓名" >
					                            {getFieldDecorator('name', {					                              
					                                initialValue: this.state.name
					                            })(
					                                <Input onChange={(e) => { this.setState({ name: e.target.value }) }}/>
					                                )}
					                        </FormItem>
					                        <FormItem className="half-item"
				                                {...formItemLayout}
				                                label="性别" >
				                                {getFieldDecorator('sex', {			                                	
				                                    initialValue: this.state.sex
				                                })(
			                                     <Radio.Group onChange={(e) => { this.setState({ sex: e.target.value }); }}>
		    										<Radio value="0">男</Radio>
				                                   <Radio value="1">女</Radio>
				                                 </Radio.Group>
			                                    )}
				                       		</FormItem>
				                       		<FormItem
						                        labelCol={{ span: 6 }}
						                        wrapperCol={{ span: 14 }}
						                        label="是否是主要联系人：" style={{marginLeft:"65px"}}>
				                       			{getFieldDecorator('primaryFlg', {			                                	
				                                    initialValue: this.state.primaryFlg
				                                })(
			                                     	<Radio.Group onChange={(e) => {this.setState({primaryFlg: e.target.value });}}>
								                        <Radio value={0}>是</Radio>
								                        <Radio value={1}>否</Radio>
							                        </Radio.Group>
			                                    )}
						                        
						                    	</FormItem>	
				                       			<FormItem className="half-item"
					                            {...formItemLayout}
					                            label="手机号码" >
					                            {getFieldDecorator('telNum', {	
					                                initialValue: this.state.telNum 
					                            })(
					                                <Input onChange={(e) => { this.setState({ telNum: e.target.value }) }}/>
					                                )}
					                        </FormItem>
					                        <FormItem className="half-item"
					                            {...formItemLayout}
					                            label="座机号" >
					                            {getFieldDecorator('mobile', {	                              
					                                initialValue: this.state.mobile
					                            })(
					                                <Input onChange={(e) => { this.setState({ mobile: e.target.value }) }}/>
					                                )}
					                        </FormItem>
					                        <FormItem className="half-item"
					                            {...formItemLayout}
					                            label="QQ号码" >
					                            {getFieldDecorator('qq', {	                              
					                                initialValue: this.state.qq
					                            })(
					                                <Input onChange={(e) => { this.setState({ qq: e.target.value }) }}/>
					                                )}
					                        </FormItem>
					                        <FormItem className="half-item"
					                            {...formItemLayout}
					                            label="邮箱号" >
					                            {getFieldDecorator('email', {	                              
					                                initialValue: this.state.email
					                            })(
					                                <Input onChange={(e) => { this.setState({ email: e.target.value }) }}/>
					                                )}
					                        </FormItem>
					                        <FormItem className="half-item"
					                            {...formItemLayout}
					                            label="微信" >
					                            {getFieldDecorator('wechat', {	                              
					                                initialValue: this.state.wechat
					                            })(
					                                <Input onChange={(e) => { this.setState({ wechat: e.target.value }) }}/>
					                                )}
					                        </FormItem>
					                        <FormItem className="half-item"
					                            {...formItemLayout}
					                            label="部门" >
					                            {getFieldDecorator('depatrment', {	                              
					                                initialValue: this.state.depatrment
					                            })(
					                                <Input onChange={(e) => { this.setState({ depatrment: e.target.value }) }}/>
					                                )}
					                        </FormItem>
					                        <FormItem className="half-item"
					                            {...formItemLayout}
					                            label="职位" >
					                            {getFieldDecorator('customerPosition', {	                              
					                                initialValue: this.state.customerPosition
					                            })(
					                                <Input onChange={(e) => { this.setState({ customerPosition: e.target.value }); }}/>
					                                )}
					                        </FormItem>												                                  
										        	</div>
										        	<FormItem wrapperCol={{ span: 12, offset: 4 }}>
							                        <Button className="set-submit" type="primary" htmlType="submit" onClick={this.changefollow} style={{marginRight:"50px"}}>保存</Button>																	                     
							                        <Button className="set-submit" type="ghost" onClick={this.setModal8Visiblecancel}>取消</Button>																		                                                          							             														 
							                </FormItem>	
	        						</Modal>
								</div>
                    		) 
                    	}
                }, {
                    title: '客户类型',
                    dataIndex: '_customerType',
                    key: '_customerType'
                 // render: text => { return getcustomerTyp(text); }
                }, {
                    title: '地区',
                    dataIndex: 'locationProvince',
                    key: 'locationProvince',
                    render: text => { return getcityArr(text); }
                }, {
                    title: '联系人姓名',
                    dataIndex: 'contactName',
                    key: 'contactName',                    
                }, 
                {
                    title: '手机号',
                    dataIndex: 'telNum',
                    key:'telNum',                   
                },
                 {
                    title: '客户状态',
                    dataIndex: '_customerStatus',
                    key: '_customerStatus'
                  //render: text => { return getcustomerStatue(text) }
                },
                {
                    title: '意向服务',
                    dataIndex: '_companyIntention',
                    key: '_companyIntention',
                    //render: text => { return getCompanyIntention(text) }
                },
                 {
                    title: '最新跟进',
                    dataIndex: '_followSituation',
                    key: '_followSituation',                    
                    render:text => { 
                    	const theData = this.state.data || {};
                    	const contactsOption="";
                    	const rowSelection = {
            				  selectedRowKeys: this.state.selectedRowKeys,
            				  onChange: (selectedRowKeys, selectedRows) => {
                			  this.setState({
                    	      selectedRows: selectedRows.slice(-1),
                    		  selectedRowKeys: selectedRowKeys.slice(-1)
                				});
           			 				}
       				 				};
       				 				//const lastwomen=this.state.wemon || {};
       				 				
                    	const FormItem = Form.Item;
                    	const { getFieldDecorator } = this.props.form;
                    	const formItemLayout = {
							            labelCol: { span: 8 },
							            wrapperCol: { span: 14 },
							        };
							        const formItemLayput = {
							            labelCol: { span: 10 },
							            wrapperCol: { span: 14 },
							        };
                    	return  (  
	                    	<div>	
	                    	<span>{text}</span>
	                    		    
								    <Modal
	                				  style={{left:'500px'}}
								      footer=''
							          title="客户详细信息"
							          width='400px'
							          visible={this.state.modal4Visible}
							          onOk={this.setModal4Visiblecancel}
							          onCancel={this.setModal4Visiblecancel}							          							          
							        >
	                					<Form horizontal onSubmit={this.submitcontact} id="demand-form">
								            <Spin spinning={this.state.loading}> 
								                <div className='clearfix'>
						                          <FormItem className="half-item"
							                            {...formItemLayput}
							                            label="所属公司" >
							                            <span>{this.state.companyName}</span>
							                        </FormItem>	
							                        <FormItem className="half-item"
							                            {...formItemLayput}
							                            label="性别" >
							                            <span>{getsex(this.state.sex)}</span>
							                        </FormItem>
							                        <FormItem className="half-item"
							                            {...formItemLayput}
							                            label="姓名" >
							                            <span>{this.state.name}</span>
							                        </FormItem>
						                            <FormItem className="half-item"
							                            {...formItemLayput}
							                            label="QQ号" >
							                            <span>{this.state.qq}</span>
							                        </FormItem>
							                      	<FormItem className="half-item"
							                            {...formItemLayput}
							                            label="手机号" >
							                            <span>{this.state.telNum}</span>
							                        </FormItem>
						                            <FormItem className="half-item"
							                            {...formItemLayput}
							                            label="部门" >
							                            <span>{this.state.depatrment}</span>
							                        </FormItem>
							                   		<FormItem className="half-item"
							                            {...formItemLayput}
							                            label="职位" >
							                            <span>{this.state.customerPosition}</span>
							                        </FormItem>
						                            <FormItem className="half-item"
							                            {...formItemLayput}
							                            label="微信号" >
							                            <span>{this.state.wechat}</span>
							                        </FormItem>	
							                    </div>
								            </Spin>
								        </Form>   
	                				</Modal>								   
								    <Modal
								      footer=''
							          title="历史记录列表"
							          width='800px'
							          visible={this.state.modal3Visible}
							          onOk={this.setModal3Visiblecancel}
							          onCancel={this.setModal3Visiblecancel}							          							          
							        >	
							          <Spin spinning={this.state.loading}>	
										        <Table dataSource={this.state.datahistory} >												    
													      <Column
													        title="时间"
													        dataIndex="_followDate"
													        key="_followDate"
													      />
													      <Column
													        title="客户"
													        dataIndex="contactName"
													        key="contactName"
													        render={(text, record,index) => (
													        	<a href="#" onClick={() => this.setModal4Visible(true,index)}>{text}</a>
													        )}
													      />													    
													    <Column
													      title="跟进人"
													      dataIndex="adminName"
													      key="adminName"
													    />
													    <Column
													      title="联系方式"
													      dataIndex="contactInfo"
													      key="contactInfo"
													    />
													    <Column
													      title="最新跟进状态"
													      dataIndex="_followSituation"
													      key="_followSituation"
													    />
													   <Column
													      title="跟进结果"
													      dataIndex="followResult"
													      key="followResult"	
													      render={(text, record) => (	
													      	<div>
														      	<a  href="#" onClick={this.setModal6VisibleOk}>{text}</a>
														      	<Modal				             
												              footer=''
														          title="更多详情"
														          visible={this.state.modal6Visible}
													            onOk={this.setModal6Visiblecancel}
													            onCancel={this.setModal6Visiblecancel}>
														      		<Spin spinning={this.state.loading}>	
														      			<div className="clearfix">
										                       <FormItem 
										                            labelCol={{ span: 5 }}
			                       									wrapperCol={{ span: 18 }}
										                            label="跟进结果" >
										                            <span>{}</span>							                            
										                        </FormItem>							                        
										                    </div>
														    <FormItem
										                        labelCol={{ span: 5 }}
										                        wrapperCol={{ span: 18 }}
										                        label="附件" >
										                        <div className="clearfix">
										                            <Upload className="demandDetailShow-upload"
										                                listType="picture-card"
										                                fileList={this.state.attachment}
										                                onPreview={(file) => {
										                                    this.setState({
										                                        previewImage: file.url || file.thumbUrl,
										                                        previewVisible: true,
										                                    });
										                                }} >
										                            </Upload>
										                            <Modal maskClosable={false} footer={null}
										                                visible={this.state.previewVisible}
										                                onCancel={() => { this.setState({ previewVisible: false }) }}>
										                                <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
										                            </Modal>
										                        </div>
													              </FormItem>	
													       			</Spin>
														      	</Modal>
														      </div>
															)}												      
													    />
													    <Column
													      title="删除记录"
													      key="del"
													      render={(text, record, index) => (													       													          
													            <Popconfirm title="是否删除?" onConfirm={() => this.onDelete(index)}>
													              <a href="#" style={{color:"#f00"}}>删除</a>
													            </Popconfirm>													         													       
													      )}
													    />
													  </Table>
							          </Spin>	
							        </Modal>
								    <Modal
								      footer=''
							          title="新增跟进记录"
							          width='1000px'
							          visible={this.state.modal1Visible}
							          onOk={this.setModal1Visiblecancel}
							          onCancel={this.setModal1Visiblecancel}							          							          
							        >	 
							        		
						          <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
							            <Spin spinning={this.state.loading}>                        	
                            <div className="user-search">  				                            	
                            	
	                            	<div className="clearfix">
	                            		<FormItem className="half-item"
					                            {...formItemLayout}
					                            label="客户公司名称:" >
					                            <span>{theData.companyName}</span>
													        </FormItem>	
																</div>
		                            <FormItem className="half-item"
			                            {...formItemLayout}
			                            label="最新联系人：" >		                            	
			                                <Select placeholder="选择联系人" style={{ width: 140 }}
						                        value={this.state.lastName}
						                        onChange={this.hundleName}>
						                        {this.state.orderStatusOption}
				                    			</Select>			                               
								              <span style={{width:'120px',display:'inline-block',marginLeft:'20px'}}>{getcustomerTyp(theData.customerTyp)}
				                                 <Button type="primary" onClick={this.setModal2VisibleOk}>添加</Button>	
				                              </span>
												    	<Modal
													      footer=''
													      width='800px'
												          title="新增联系人"
												          visible={this.state.modal2Visible}
												          onOk={this.setModal2Visiblecancel}
												          onCancel={this.setModal2Visiblecancel}						          							          
												        >
												       <Form horizontal onSubmit={this.submitcontactman} id="demand-form">
											           <Spin spinning={this.state.loading}> 
											              {/*    <Row>
									                            <FormItem className="half-item"
										                            {...formItemLayout}
										                            label="所属公司" >
										                            <span>{theData.id}</span>
										                        </FormItem>	
									                        </Row>*/}
											           <Row>	
														<FormItem
								                        labelCol={{ span: 4 }}
								                        wrapperCol={{ span: 14 }}
								                        label="是否是主要联系人："  style={{marginRight:'10px'}}>
								                        <Radio.Group value={this.state.hots} onChange={(e) => {
										                    this.setState({ hots: e.target.value })
										                    }}>
										                        <Radio value={0}>是</Radio>
										                        <Radio value={1}>否</Radio>
									                    </Radio.Group>
								                    	</FormItem>	
									                    <FormItem 
									                        labelCol={{ span: 4 }}
									                        wrapperCol={{ span: 14 }}
									                        label="性别："  style={{marginRight:'10px',marginTop: '-15px'}}>
									                        <Radio.Group value={this.state.hot} onChange={(e) => {
											                    this.setState({ hot: e.target.value })
											                    }}>
											                        <Radio value={0}>男</Radio>
											                        <Radio value={1}>女</Radio>
										                    </Radio.Group>
									                    </FormItem>	
													</Row>								               
											        <Row style={{ paddingLeft:'50px' }}>
								                        <Col span={2}>姓名：</Col>
						                                <Col span={8}>
						                                    <Input value={this.state.paymentId}
						                                        onChange={(e) => { this.setState({ paymentId: e.target.value }) }} />
						                                </Col>
						                                <Col span={2} style={{ marginLeft: '50px' }}>QQ号：</Col>
						                                <Col span={8}>
						                                    <Input value={this.state.entId}
						                                        onChange={(e) => { this.setState({ entId: e.target.value }) }} />
						                                </Col>
					                                </Row>
								                    <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
								                        <Col span={2}>手机号：</Col>
						                                <Col span={8}>
						                                    <Input value={this.state.pay}
						                                        onChange={(e) => { this.setState({ pay: e.target.value }) }} />
						                                </Col>
						                                <Col span={2} style={{ marginLeft: '50px' }}>座机号：</Col>
						                                <Col span={8}>
						                                    <Input value={this.state.paym}
						                                        onChange={(e) => { this.setState({ paym: e.target.value }) }} />
						                                </Col>
					                                </Row>
	
					                                <Row style={{ marginTop: '20px' ,paddingLeft:'50px'}}>
								                        		<Col span={2}>部门：</Col>
						                                <Col span={8}>
						                                    <Input value={this.state.paytId}
						                                        onChange={(e) => { this.setState({ paytId: e.target.value }) }} />
						                                </Col>
						                                <Col span={2} style={{ marginLeft: '50px' }}>职位：</Col>
						                                <Col span={8}>
						                                    <Input value={this.state.paentId}
						                                        onChange={(e) => { this.setState({ paentId: e.target.value }) }} />
						                                </Col>
					                                </Row>	
					                                <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>						                       
						                                 <Col span={2}>微信号：</Col>
						                                	<Col span={8}>
						                                    <Input value={this.state.payId}
						                                        onChange={(e) => { this.setState({ payId: e.target.value }) }} />
						                                </Col>
						                                <Col span={2} style={{ marginLeft: '50px' }}>邮箱：</Col>
						                                <Col span={8}>
						                                    <Input value={this.state.emails}
						                                        onChange={(e) => { this.setState({ emails: e.target.value }) }} />
						                                </Col>
					                                </Row>
					                                <Row style={{ marginTop: '20px',paddingLeft:'50px' ,marginBottom:'50px'}}>
						                          <Button className="set-submit" type="primary" htmlType="submit"  id="change_keep" style={{marginLeft:'60px'}}>保存</Button>
         							              <Button className="set-submit" type="ghost" onClick={this.setModal2Visiblecancel} id='change_rem'>取消</Button>
									            	</Row>
									            </Spin>
									        </Form>   
									    </Modal> 
									</FormItem>
													
									<FormItem className="half-item"							                           
				                        {...formItemLayout}
			                            label="联系方式" >							                           
		                               <Select placeholder="选择方式" style={{width:'100px'}} value={this.state.contacts}
										         					onChange={this.contacts}>
		                                   	 <Select.Option value="0">电话</Select.Option>
										         <Select.Option value="1">邮件</Select.Option>
										         <Select.Option value="2">面谈</Select.Option>
										         <Select.Option value="3">短信</Select.Option>
		                                		</Select>	
		                                <span style={{marginLeft:'20px'}}>{this.state.nub}</span>							                                															                         							                               
						            </FormItem>
						            <FormItem className="half-item"
			                            {...formItemLayout}
			                            label="最近跟进时间:" >
			                            <span>{theData.createTime}</span>
										    			</FormItem>
										    			<div>
											  				<FormItem className="half-item"
				                            {...formItemLayout}
				                            label="最新跟进时间" >
				                            {getFieldDecorator('createTime', {
				                            	rules: [{ required: true, message: '此项为必填项!' }],
				                                initialValue: theData.createTime ? moment(theData.createTime) : null
				                            })(
				                                <DatePicker />					                               
				                                )}
				                            {getFieldDecorator('createTim', {
				                            	rules: [{ required: true, message: '此项为必填项!' }],
				                                initialValue: theData.createTime ? moment(theData.createTime) : null
				                            })(
						                            <TimePicker />
						                           )}		                            
                    						</FormItem> 
                    						
				                    	</div>
				                        <FormItem className="half-item"
				                            {...formItemLayout}
				                            label="客户状态：" >
				                            <span>{this.state._customerStatus}</span>
									    </FormItem>				
                           					<FormItem className="half-item"
						                            {...formItemLayout}
						                            label="最新客户状态" >
						                            {getFieldDecorator('customerStatus', {
						                            	
						                                initialValue: ""
						                            })(
						                                <Select placeholder="选择客户状态" style={{width:'200px'}}>
					                                    {
					                                        customerStatus.map(function (item) {
					                                            return <Select.Option key={item.value} style={{width:'200px'}}>{item.key}</Select.Option>
					                                        })
					                                    }
				                                </Select>
						                                )}
						                    </FormItem>
								                    <FormItem className="half-item"
						                            {...formItemLayout}
						                            label="跟进状态：" >
						                            <span>{this.state._followSituation}</span>
											    					</FormItem>		
								                    <FormItem className="half-item"
							                            {...formItemLayout}
							                            label="最新跟进状态" >
							                            {getFieldDecorator('followSituation', {
							                            	
							                                initialValue: ""
							                            })(
							                                <Select placeholder="选择跟进状态" style={{width:'200px'}}>
							                                    {
							                                        newFollow.map(function (item) {
							                                            return <Select.Option key={item.value} style={{width:'200px'}}>{item.key}</Select.Option>
							                                        })
							                                    }
							                                </Select>
							                                )}
								                    </FormItem>
																		<div  className="clearfix">		                        
										                <FormItem
									                        labelCol={{ span: 4 }}
									                        wrapperCol={{ span: 18 }}
									                        label="跟进结果" >
									                        {getFieldDecorator('remarks', {
									                            initialValue: theData.remarks
									                        })(
									                            <Input type="textarea" rows={4} />
									                            )}
									                    </FormItem>										                
								                    </div> 
								                    <div className="clearfix">	
																		<FormItem
									                        labelCol={{ span: 4 }}
									                        wrapperCol={{ span: 18 }}
									                        label="技术图片" >
									                        <PicturesWall
									                            pictureSign="achievement_technical_picture"
									                            fileList={this.getTechnicalPictureUrl}
									                            pictureUrl={this.state.technicalPictureUrl} />
									                        <p>图片建议：图片要清晰。</p>
									                    </FormItem>
								                    </div>									                  
										            <Button style={{ marginRight: '20px' ,marginLeft:'160px',marginBottom:'50px'}} type="primary" onClick={this.addFollowSubmit}>保存</Button>                                    
							                  		<Button className="set-submit" type="ghost" onClick={this.setModal1Visiblecancel} id='change_rem'>取消</Button>								                  										                   
								               </div>
					                        </Spin>
				                        </Form >
							        </Modal>							       
	                    	</div>   
							)
                      	}
                 },
                {
                    title: '跟单人',
                    dataIndex: 'adminName',
                    key: 'adminName',
                },
                {
                    title: '时间',
                    dataIndex: 'followDate',
                    key: 'followDate',
                }
            ],
            dataSource: [],
            searchTime: [,]
        };
    },
    
    
    componentWillMount() {
        let theArr = [];
        customerStatus.map(function (item) {
            theArr.push(
                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
            )
        });
        let auditArr = [];
        cityArr.map(function (item) {
            auditArr.push(
                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
            )
        }); 
        let intentionalArr = [];
        intentionalService.map(function (item) {
            intentionalArr.push(
                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
            )
        });   
        let newArr = [];
        newFollow.map(function (item) {
            newArr.push(
                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
            )
        });   

        this.state.customerStatuarr = theArr;
        this.state.auditStatusOption = auditArr;
        this.state.intentionalOption = intentionalArr;
        this.state.newOption = newArr;  
        this.loadData();        
    },
    tableRowClick(record, index) {
        this.state.RowData = record;
        this.setModal5VisibleOk(record);
        this.setState({
        	rowId:record.id ,
        	before_customerStatus:record._customerStatus,
        	before_companyIntention:record._companyIntention,
        	before_followSituation:record._followSituation
        })
      console.log(record);
    },
   
    //删除功能,已经完成
    delectRow() {
        let deletedIds;       
        let adminName;
        let customerStatus;       
        let companyIntention;
        let followSituation;       
        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
            let rowItem = this.state.selectedRows[idx];                          
            if (rowItem.id) {
                deletedIds=rowItem.id;               
                adminName=rowItem.adminName; 
                customerStatus=rowItem.customerStatus;
                companyIntention=rowItem.companyIntention;
                followSituation=rowItem.followSituation;                
            };            
        };  
        this.state.data = []
        this.setState({        	
            selectedRowKeys: [],
            
        });
        $.ajax({
            method: "post",
            dataType: "json",
            crossDomain: false,           
            url: globalConfig.context + "/api/admin/customer/deleteCustomer",
            data: {
                id: deletedIds,//删除的ID                
                beforeCustomerStatus:customerStatus,
                beforeCompanyIntention:companyIntention,
                beforeFollowSituation:followSituation,
                beforeAdminName:adminName
            }
        }).done(function (data) {
            if (!data.error.length) {
                message.success('删除成功！');
                this.setState({
                    loading: false,
                });
            } else {
                message.warning(data.error[0].message);
            };
            this.loadData();
        }.bind(this));
    },
    //删除功能
    delectRowFollow() {
        let deletedIds;         
        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
            let rowItem = this.state.selectedRows[idx];                          
            if (rowItem.id) {
                deletedIds=rowItem.id;                 
            };            
        };  
        this.state.data = []
        this.setState({        	
            selectedRowKeys: [],
            
        });
        $.ajax({
            method: "post",
            dataType: "json",
            crossDomain: false,           
            url: globalConfig.context + "/api/admin/customer/deleteContacter",
            data: {
                contactId: deletedIds,//删除的ID    
            }
        }).done(function (data) {
            if (!data.error.length) {
                message.success('删除成功！');
                this.setState({
                    loading: false,
                });
            } else {
                message.warning(data.error[0].message);
            };
            this.loadData();
        }.bind(this));
    },
    //转为公共客户功能
    changeRow() {
        let deletedIds;
        let customerStatus;       
        let companyIntention;
        let followSituation;   
        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
            let rowItem = this.state.selectedRows[idx];
            if (rowItem.id) {
                deletedIds=rowItem.id;
                customerStatus=rowItem.customerStatus;
                companyIntention=rowItem.companyIntention;
                followSituation=rowItem.followSituation;
            };            
        };       
        this.setState({
            selectedRowKeys: [],
            
        });
        $.ajax({
            method: "post",
            dataType: "json",
            crossDomain: false,           
            url: globalConfig.context + "/api/admin/customer/transferToPublic",  
            data: {
            	aid:this.state.aid,
                id: deletedIds,
                beforeCompanyIntention:companyIntention,//意向服务
				beforeCustomerStatus:customerStatus,//客户状态
				beforeFollowSituation:followSituation,//最新跟进状态
            }
        }).done(function (data) {
            if (!data.error.length) {
                message.success('已转为公共客户！');
                this.setState({
                    loading: false,
                });
            } else {
                message.warning(data.error[0].message);
            };
            this.loadData();
        }.bind(this));
    },
    addClick() {
        this.state.RowData = {};
        this.setState({
            showDesc: true
        });
    },
    
    closeDesc(e, s) {
        this.state.showDesc = e;
        if (s) {
            this.loadData();
        };
    },
    search() {
        this.loadData1();
    },
    reset() {
    	this.state.companyName='';  
    	this.state.customerType = undefined;
        this.state.id = undefined;
        this.state.shareType = undefined;
        this.state.companyIntention  = undefined;
        this.state.followSituation  = undefined;
        this.state.locationProvince  = undefined;
        this.state.customerStatus  = undefined;
        this.state.contactName   = undefined;
        this.state.contactTel = undefined;
        this.state.contactName = undefined;  
        this.state.releaseDate = [];
        this.loadData(); 
    },
    searchSwitch() {
        this.setState({
            searchMore: !this.state.searchMore
        });
    },
    render() {
    	const FormItem = Form.Item
        const rowSelection = {
            selectedRowKeys: this.state.selectedRowKeys,
            onChange: (selectedRowKeys, selectedRows) => {
                this.setState({
                    selectedRows: selectedRows.slice(-1),
                    selectedRowKeys: selectedRowKeys.slice(-1)
                });
            }
        };
        const hasSelected = this.state.selectedRowKeys.length > 0;
        const { RangePicker } = DatePicker;
        const theData = this.props.data || {};    	
    	const { getFieldDecorator } = this.props.form;
    	const formItemLayout = {
            labelCol: { span: 8 },
            wrapperCol: { span: 14 },
        };
        return (
            <div className="user-content" >
                <div className="content-title">                  
                    <span>客户管理</span>
                    <div className="patent-addNew clearfix"  style={{marginRight:"22px"}}>                                             
                        <Button type="primary" className="addButton" onClick={this.addClick}>新建客户<Icon type="plus" /></Button>                        
                    </div>
                </div>
                <div className="user-search">                    
                    <Input placeholder="公司名称"
                        value={this.state.companyName}
                        onChange={(e) => { this.setState({ companyName: e.target.value }); }} /> 
                    <Select placeholder="客户类型" style={{ width: 120 }}
                            value={this.state.customerType }
                            onChange={(e) => { this.setState({ customerType : e }) }}>
                            <Select.Option value="0" >个人客户</Select.Option>
                            <Select.Option value="1" >公司客户</Select.Option>
                    </Select>     
                    <Select placeholder="意向服务"
                            style={{ width: 160 }}
                            value={this.state.companyIntention}
                            onChange={(e) => { this.setState({ companyIntention: e }) }}>
                            {this.state.intentionalOption}
                    </Select>
                    <Select placeholder="跟进进度"
                            style={{ width: 160 }}
                            value={this.state.followSituation}
                            onChange={(e) => { this.setState({ followSituation: e }) }}>
                            {this.state.newOption}
                    </Select>
                    <Select placeholder="地区"
                            style={{ width: 160 }}
                            value={this.state.locationProvince}
                            onChange={(e) => { this.setState({ locationProvince: e }) }}>
                            {this.state.auditStatusOption}
                    </Select>
                    <Select placeholder="客户状态" style={{ width: 120 }}
                            value={this.state.customerStatus}
                            onChange={(e) => { this.setState({customerStatus: e }) }}>                           
                            {this.state.customerStatuarr}
                    </Select>
                    <Button type="primary" onClick={this.search}>搜索</Button>
                    <Button onClick={this.reset}>重置</Button>                                                                                                              
                    <Button onClick={this.setModal3VisibleOk} style={{marginRight:'10px'}}  disabled={!hasSelected}>查看跟进记录</Button>
	                <Button type="primary" onClick={this.setModal1VisibleOk}  disabled={!hasSelected}>添加跟进记录</Button>	
                    <Button type="primary" onClick={this.showModa}  disabled={!hasSelected}>指定转交人</Button>                    	 
		            <Modal				             
				              footer=''
						          title="选择指定人"
						          visible={this.state.visible}
						          onOk={this.handleOk}
						          onCancel={this.handleCancel}	
						          
						        >
					            <Spin spinning={this.state.loading}>
					            	 <Table 
					            	 columns={this.state.columnsman} 
					            	 rowSelection={rowSelection} 
					            	 dataSource={this.state.dataman}
					            	 />
					           				            				        
				                <FormItem wrapperCol={{ span: 12, offset: 12 }}>
                       		<Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:"50px"}} onClick={this.changeAssigner }>保存</Button>
                       		<Button className="set-submit" type="ghost" onClick={this.handleCancel } style={{marginLeft:"30px"}} id='change_rem'>取消</Button>
                    	  </FormItem>  
                    	</Spin>
					</Modal>
                    <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
                        disabled={!hasSelected}
                        onClick={this.changeRow}>转为公共客户<Icon /></Button>
                    <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
                        disabled={!hasSelected}
                        onClick={this.delectRow}>删除<Icon type="minus" /></Button>
                    <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
                    <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>                    			                  
		                <Input placeholder="联系人姓名" style={{width:'140px',marginRight:'10px'}}
		                    value={this.state.contactName}
		                    onChange={(e) => { this.setState({ contactName: e.target.value }); }} /> 
		                <Input placeholder="手机号码" style={{width:'140px',marginRight:'10px'}}
		                    value={this.state.contactTel }
		                    onChange={(e) => { this.setState({ contactTel: e.target.value }); }} />
		            </div>        
                </div>                                               
                <div className="patent-table">
                    <Spin spinning={this.state.loading}>
                        <Table columns={this.state.columns}
                            dataSource={this.state.dataSource}
                            rowSelection={rowSelection}
                            pagination={this.state.pagination}
                            onRowClick={this.tableRowClick}
                           />
                    </Spin>
                </div>
                <TechAchievementDesc
                    data={this.state.RowData}
                    detailApiUrl={this.props['data-detailApiUrl']}
                    achievementCategoryOption={this.state.achievementCategoryOption}
                    showDesc={this.state.showDesc}
                    closeDesc={this.closeDesc} />
               
            </div >
        );
    }
}));

export default AchievementList;