import React from 'react';
import ReactDom from 'react-dom';
import ajax from 'jquery/src/ajax/xhr.js';
import $ from 'jquery/src/ajax';
import '../content.less';
import { citySelect,provinceList,areaSelect,provinceSelect,addressList} from '../../../NewDicProvinceListAll';
import { Form,Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload,Popconfirm,AutoComplete,Tabs,Checkbox,Tree,Cascader} from 'antd';
import {patternOrganization,conditionOrganization,intentionalService,messageType,designatedObjects,socialAttribute,industry,featuredContent} from '../../../dataDic.js';
import {getPattern,getCondition} from '../../../tools.js';
const TabPane = Tabs.TabPane;
const TreeNodet = Tree.TreeNode;
const RemindMessage=Form.create()(React.createClass({
	loadData(pageNo) {
        this.state.data = [];
        this.setState({
            loading: true
        });
        let nameText=this.state.SuperArr;
		let superText=(this.state.superId)?nameText[parseInt(this.state.superId)].name:"";
       
        $.ajax({
            method: "post",
            dataType: "json",
            crossDomain: false,
            url: globalConfig.context + '/api/admin/organization/listOrganizationManagement',
            data: {
                pageNo: pageNo || 1,
                pageSize: this.state.pagination.pageSize,
                name: this.state.name, //组织名称
                superId:superText,//上级组织
                type:this.state.type,//组织类型
                depNo:this.state.depNo,//组织编号
            },
            success: function (data) {
                let theArr = [];
                if (!data.data || !data.data.list) {
                    if (data.error && data.error.length) {
                        message.warning(data.error[0].message);
                    };
                } else {
                    for (let i = 0; i < data.data.list.length; i++) {
                        let thisdata = data.data.list[i];
                        theArr.push({
                            key: thisdata.id,
                            id: thisdata.id,//每一条记录的ID
                            depNo:thisdata.depNo,//组织编号
                            name:thisdata.name,//组织名称
                            type:thisdata.type,//组织类型
                            managerId:thisdata.managerId,//负责人
                            superId:thisdata.superId,//上级组织
                            status:thisdata.status,//组织状态
                            
                        });
                    };
                    this.state.pagination.current = data.data.pageNo;
                    this.state.pagination.total = data.data.totalCount;
                };
                this.setState({
                    dataSource: theArr,
                    pagination: this.state.pagination
                });
            }.bind(this),
        }).always(function () {
            this.setState({
                loading: false
            });
        }.bind(this));
       
    },
    getInitialState() {
        return {
        	visible: false,
            data: [],
            showAdd: false,
            showDesc: false,
            expandedKeys: [],
            autoExpandParent: true,
            selectedKeys: [],
            searchMore: true,
            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 + '条数据';
                }
            },
            pagination1: {
                defaultCurrent: 1,
                defaultPageSize: 10,
                showQuickJumper: true,
                pageSize: 10,
                onChange: function (page) {
                    this.loadData(page);
                }.bind(this),
                showTotal: function (total) {
                    return '共' + total + '条数据';
                }
            },
            columns: [
                {
                    title: '消息时间',
                    dataIndex: 'depNo',
                    key: 'depNo',
                }, {
                    title: '消息标题',
                    dataIndex: 'name1',
                    key: 'name1',
                },{
                    title: '消息内容',
                    dataIndex: 'name',
                    key: 'name',
                }
            ],
            dataSource: [],
            columns1: [
                {
                    title: '客户名称',
                    dataIndex: 'depNo',
                    key: 'depNo',
                }, {
                    title: '地区',
                    dataIndex: 'name1',
                    key: 'name1',
                },{
                    title: '行业',
                    dataIndex: 'name',
                    key: 'name',
                },{
                    title: '社会性质',
                    dataIndex: 'type',
                    key: 'type',
                    render: text => { return getPattern(text) }
                },{
                    title: '创建时间',
                    dataIndex: 'name2',
                    key: 'name2',
                },{
                    title: '所属人',
                    dataIndex: 'name3',
                    key: 'name3',
                },{
                    title: '业务认证',
                    dataIndex: 'status',
                    key: 'status',
                    render: text => { return getCondition(text) }
                },{
                    title: '实名认证',
                    dataIndex: 'name4',
                    key: 'name4',
                },{
                    title: '是否高新',
                    dataIndex: 'name5',
                    key: 'name5',
                },{
                    title: '是否上市',
                    dataIndex: 'name6',
                    key: 'name6',
                },{
                    title: '是否国际',
                    dataIndex: 'name7',
                    key: 'name7',
                },{
                    title: '会员等级',
                    dataIndex: 'name8',
                    key: 'name8',
                },{
                    title: '会员状态',
                    dataIndex: 'name9',
                    key: 'name9',
                }
            ],
            dataSource: [],
            //searchTime: [,]
        };
    },
    componentWillMount() {
    	this.selectSuperId();
    },
    //获取上级组织
    selectSuperId() {  
    	this.state.data = []
         $.ajax({
                method: "post",
                dataType: "json",
                crossDomain: false,
                url: globalConfig.context + "/api/admin/organization/selectSuperId",
                data:{
                  
                },
                success: function (data) {                	  
                		let theArr = [];
					    let thedata=data.data;
					    if (!thedata) {
		                    if (data.error && data.error.length) {
		                        message.warning(data.error[0].message);
		                    };	
		                    thedata = {}; 
		              };   
					    var contactIds=[];
				        //for (let item in data.data) {
				        	for(var i=0;i<data.data.length;i++){
		                    let theData = data.data[i];
		                    theArr.push(
		                        <Select.Option value={i.toString()} key={theData.name}>{theData.name}</Select.Option>
		                    );
		                };
						this.setState({	
							SuperArr:thedata,
		                    contactsOption: theArr, 
		                    orderStatusOptions:data.data,
	                    });
	                    
					}.bind(this),
				}).always(function () {
				this.loadData();
	            this.setState({
	                loading: false
	            });
	        }.bind(this));
	},
	//编辑部门，保存
    edithandleSubmit(e){
    	e.preventDefault();	
    	//上级组织字典
        let nameText=this.state.SuperArr
        let superText=this.state.editSuperId;
        //let superText=(this.state.editSuperId).length<=1?nameText[parseInt(this.state.editSuperId)].name:''
    	let superOne=this.state.editDataSource[0].editSuperId;
    	let remarksText=(this.state.editRemarks)?this.state.editRemarks:'该组织没有职能说明，请完善！';
    	let isStatus=this.state.editStatus;
    	if(isStatus==1){
    		if(confirm('是否要解散该部门？')){
    			if(!(superOne==superText)){
		    		let changeSuper=nameText[parseInt(this.state.editSuperId)].name;
		    		if(confirm('上级组织已修改，是否保存？')){
			        $.ajax({
			            method: "post",
			            dataType: "json",
			            crossDomain: false,
			            url:globalConfig.context + '/api/admin/organization/updateOrganization',
			            data:{
			            	name:this.state.editName,//组织名称
			            	type:this.state.editType, //组织类型
			            	managerId:this.state.editManagerId,//负责人ID
			                superId:changeSuper,//上级组织
			                status:this.state.editStatus,//组织状态
			                remarks:remarksText,//组织职能说明
			                id:this.state.editId,//组织ID
			            }
			        }).done(function (data) { 
			            this.setState({
			                loading: false
			            });
			            if (!data.error.length) {
			                message.success('保存成功！'); 
			                this.edithandleCancel();
			                this.selectSuperId();
			            } else {
			                message.warning(data.error[0].message);
			            }
			        }.bind(this));
			        return false
		        	}
		    	}else {
		        	$.ajax({
			            method: "post",
			            dataType: "json",
			            crossDomain: false,
			            url:globalConfig.context + '/api/admin/organization/updateOrganization',
			            data:{
			            	name:this.state.editName,//组织名称
			            	type:this.state.editType, //组织类型
			            	managerId:this.state.editManagerId,//负责人ID
			                superId:superText,//上级组织
			                status:this.state.editStatus,//组织状态
			                remarks:remarksText,//组织职能说明
			                id:this.state.editId,//组织ID
			            }
			        }).done(function (data) { 
			            this.setState({
			                loading: false
			            });
			            if (!data.error.length) {
			                message.success('保存成功！'); 
			                this.edithandleCancel();
			                this.selectSuperId();
			            } else {
			                message.warning(data.error[0].message);
			            }
			        }.bind(this));
		        } 	
    		}
    	}else{
    		if(!(superOne==superText)){
		    		let changeSuper=nameText[parseInt(this.state.editSuperId)].name;
		    		if(confirm('上级组织已修改，是否保存？')){
			        $.ajax({
			            method: "post",
			            dataType: "json",
			            crossDomain: false,
			            url:globalConfig.context + '/api/admin/organization/updateOrganization',
			            data:{
			            	name:this.state.editName,//组织名称
			            	type:this.state.editType, //组织类型
			            	managerId:this.state.editManagerId,//负责人ID
			                superId:changeSuper,//上级组织
			                status:this.state.editStatus,//组织状态
			                remarks:remarksText,//组织职能说明
			                id:this.state.editId,//组织ID
			            }
			        }).done(function (data) { 
			            this.setState({
			                loading: false
			            });
			            if (!data.error.length) {
			                message.success('保存成功！'); 
			                this.edithandleCancel();
			                this.selectSuperId(); 
			            } else {
			                message.warning(data.error[0].message);
			            }
			        }.bind(this));
			        return false
		        	}
		    	}else {
		        	$.ajax({
			            method: "post",
			            dataType: "json",
			            crossDomain: false,
			            url:globalConfig.context + '/api/admin/organization/updateOrganization',
			            data:{
			            	name:this.state.editName,//组织名称
			            	type:this.state.editType, //组织类型
			            	managerId:this.state.editManagerId,//负责人ID
			                superId:superText,//上级组织
			                status:this.state.editStatus,//组织状态
			                remarks:remarksText,//组织职能说明
			                id:this.state.editId,//组织ID
			            }
			        }).done(function (data) { 
			            this.setState({
			                loading: false
			            });
			            if (!data.error.length) {
			                message.success('保存成功！'); 
			                this.edithandleCancel();
			                this.selectSuperId();
			            } else {
			                message.warning(data.error[0].message);
			            }
			        }.bind(this));
		        } 
    	}
    },  
	//整行点击
    tableRowClick(record, index) {
    	this.selectSuperId();
    	this.state.RowData = record; 
        this.setState({
        	editvisible: true,
        	selectedRowKeys:[],
        	rowId:record.businessId,
        })    
        $.ajax({
            method: "post",
            dataType: "json",
            crossDomain: false,
            url: globalConfig.context +"/api/admin/organization/selectAllById" ,
            data: {
               id: record.id
            },
            success: function (data) {
                let theArr = [];
                let thisdata = data;
                if (!data) {
                    if (data.error && data.error.length) {
                        message.warning(data.error[0].message);
                    };
                } else {
                    theArr.push({
                         editId: thisdata.id,//每一条记录的ID
                         editName:thisdata.name,//组织名称
                         editManagerId:thisdata.managerId,//负责人
                         editType:thisdata.type,//组织类型
                         editStatus:thisdata.status,//组织状态 
                         editSuperId:thisdata.superId,//上级组织
                         editDepNo: thisdata.depNo,//组织编号
                         editCreateId:thisdata.createId,//创建人
                         editTime:thisdata.createTime,//创建时间
                         editRemarks:thisdata.remarks,//组织职能说明
                    });
                   
                };
                this.setState({
                	 editId: thisdata.id,//每一条记录的ID
                	 editName:thisdata.name,//组织名称
                     editManagerId:thisdata.managerId,//负责人
                     editType:thisdata.type,//组织类型
                     editStatus:thisdata.status,//组织状态 
                     editSuperId:thisdata.superId,//上级组织
                     editDepNo: thisdata.depNo,//组织编号
                     editCreateId:thisdata.createId,//创建人
                     editTime:thisdata.createTime,//创建时间
                     editRemarks: thisdata.remarks,//组织职能说明
                     editDataSource: theArr,
                });
            }.bind(this),
        }).always(function () {
            this.setState({
                loading: false
            });
        }.bind(this));
    },
    //整行删除
    delectRow() {
        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: [],
            loading: deletedIds.length > 0
        });
        $.ajax({
            method: "POST",
            dataType: "json",
            crossDomain: false,
            url: globalConfig.context + "/api/admin/organization/deleteById",
            data: {
                id: deletedIds
            }
        }).done(function (data) {
            if (!data.error.length) {
                message.success('删除成功！');
                this.setState({
                    loading: false,
                });
            } else {
                message.warning(data.error[0].message);
            };
            this.selectSuperId();
        }.bind(this));
    },
    //新增一个部门，保存
    addhandleSubmit(e){
    	e.preventDefault();	
    	if(!this.state.theTypes){
    		message.warning('请输入负责人姓名');
    		return false;
    	}
    	if(!this.state.typeOrganization){
    		message.warning('请选择组织类型');
    		return false;
    	}
    	if(!this.state.upOrganization){
    		message.warning('请选择上级组织'); 
    		return false;
    	}
		this.props.form.validateFields((err, values) => {                                 
            if (!err) {
                this.setState({
                    loading: true
                }); 
                //上级组织字典
                let nameText=this.state.SuperArr
                let superText=nameText[parseInt(this.state.upOrganization)].name
                $.ajax({
                    method: "post",
                    dataType: "json",
                    crossDomain: false,
                    url:globalConfig.context + '/api/admin/organization/addOrganization',
                    data:{
                    	name:this.state.nameOrganization,//组织名称
                    	managerId:this.state.theTypes,//负责人ID
                        type:this.state.typeOrganization, //组织类型
                        superId:superText,//上级组织
                        remarks:this.state.remarksOrganization,//组织职能说明
                    	}
                }).done(function (data) { 
                    this.setState({
                        loading: false
                    });
                    if (!data.error.length) {
                        message.success('保存成功！'); 
                        this.handleCancel();
                        this.selectSuperId();
                    } else {
                        message.warning(data.error[0].message);
                    }
                }.bind(this));
            }
        });
    },
    
    //主管初始加载(自动补全)
	supervisor(e){ 
		$.ajax({
            method: "post",
            dataType: "json",
            crossDomain: false,
            url: globalConfig.context + "/api/admin/organization/selectName",
            data:{
            	name:e
            },
            success: function (data) {                	  
				       let thedata=data.data;
				    if (!thedata) {
                    if (data.error && data.error.length) {
                        message.warning(data.error[0].message);
                    };	
                    thedata = {}; 
              }; 
					this.setState({
						customerArr:thedata,	
                    });
				}.bind(this),
			}).always(function () {
            this.setState({
                loading: false
            });
        }.bind(this));  
	},
	//上级主管输入框失去焦点是判断客户是否存在
	selectAuto(value,options){
		this.setState({
			managerIdOrganization:value
		})
	},
	//失去焦点时
	blurChange(e){	
		this.setState({
			theTypes:e
		})
	},
	//详情tab切换数据处理
	callback(e) {
		this.setState({
			callnub: e,
		})
		if(e == 1) {
			this.loadData();
		}
		if(e == 2) {
			
		}
	},
	//切换创建系统消息中的指定发送对象
	changeObjects(e) {
		this.setState({
			designatedObject:e
		})
		if(e == 0) {
			this.setState({ visible1: true })
		}
		if(e == 1) {
			this.setState({ visible2: true })
		}
		if(e == 2) {
			this.setState({ visible3: true })
		}
		if(e == 3) {
			this.setState({ visible4: true })
		}
		if(e == 4) {
			this.setState({ visible5: true })
		}
		if(e == 5) {
			this.setState({ visible6: true })
		}
	},
	//值改变时请求客户名称
	httpChange(e){
		if(e.length>=2){
			this.supervisor(e); 
		}	
		this.setState({
			managerIdOrganization:e
		})
	},
    addClick() {
    	this.state.nameOrganization='';//组织名称清零
    	this.state.managerIdOrganization= '';//负责人ID清零
        this.state.typeOrganization= undefined; //组织类型清零
        this.state.upOrganization= undefined;//上级组织清零
        this.state.remarksOrganization= '';//组织职能说明清零
        this.state.RowData = {};
        this.setState({
            visible: true
        });
        this.selectSuperId();
        
    },
    editClick() {
        this.state.RowData = {};
        this.setState({
            editvisible: true
        });
    },
   	handleCancel() {
        this.setState({ visible: false })
    },
    handleCancel1() {
        this.setState({ visible1: false })
    },
    handleCancel2() {
        this.setState({ visible2: false })
    },
    handleCancel3() {
        this.setState({ visible3: false })
    },
    handleCancel4() {
        this.setState({ visible4: false })
    },
    handleCancel5() {
        this.setState({ visible5: false })
    },
    handleCancel6() {
        this.setState({ visible6: false })
    },
    edithandleCancel() {
        this.setState({ editvisible: false })
    },
    //地区多选
	onExpand(expandedKeys){
		this.setState({
			expandedKeys,
			autoExpandParent: false,
		});
	},
	onCheck(checkedKeys){
		this.setState({checkedKeys:checkedKeys });
	},
	onSelect(selectedKeys, info){
		this.setState({ selectedKeys });
	},
	renderTreeNodes(data){
		return provinceList.map((item) => {
				return(
					<TreeNodet title={item.name} key={item.id} dataRef={item}>
			            {item.cityList.map((item) => {
							return(
								<TreeNodet title={item.name} key={item.id} dataRef={item}>
						            {item.areaList.map((item) => {
										return(
											<TreeNodet title={item.name} key={item.id} dataRef={item}>
									            
									        </TreeNodet>
										);
										})
						            }
						        </TreeNodet>
							);
							})
			            }
			        </TreeNodet>
				);
			
			return <TreeNodet {...item} />;
		});
	},
    search() {
        this.loadData();
    },
    //把搜索的部分置零
    reset() {
        this.state.superId = undefined;//上级组织清零
        this.state.name = '';//组织名称清零
        this.state.type = undefined;//组织类型清零
        this.state.depNo = '';//组织编号清零
        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)
                });
            },
            onSelect: (recordt, selected, selectedRows) => {
			    this.setState({
			    	recordt:recordt.id
			    })
			},
        };
        const rowSelections = {
            selectedRowKeys: this.state.selectedRowKeys,
            onChange: (selectedRowKeys, selectedRows) => {
                this.setState({
                    selectedRows: selectedRows,
                    selectedRowKeys: selectedRowKeys
                });
            },
            onSelect: (recordt, selected, selectedRows) => {
			    this.setState({
			    	recordt:recordt.id
			    })
			},
        };
        const formItemLayout = {
            labelCol: { span: 8 },
            wrapperCol: { span: 14 },
        };
       	const { getFieldDecorator } = this.props.form;
        const hasSelected = this.state.selectedRowKeys.length > 0;
        const { RangePicker } = DatePicker;
        const dataSources=this.state.customerArr || [];
        const options = dataSources.map((group,index) =>
				      <Option key={index} value={group.name}>{group.name}</Option>
				     )
        return (
            <div className="user-content" >
                <div className="content-title">
	                <div className="user-search">
                		<Select placeholder="业务内容"
	                            style={{width:'150px',marginRight:'10px'}}
	                            value={this.state.type}
	                            onChange={(e) => { this.setState({ type: e }) }}>
	                            <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.Option value="4" >活动</Select.Option>
	                            <Select.Option value="5" >政策</Select.Option>
	                    </Select>
	                    <Select placeholder="业务进程"
	                            style={{width:'150px',marginRight:'10px'}}
	                            value={this.state.type}
	                            onChange={(e) => { this.setState({ type: e }) }}>
	                            <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.Option value="4" >付款</Select.Option>
	                    </Select>
	                    <Button type="primary" onClick={this.search} style={{marginRight:'10px'}}>搜索</Button>
	                </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>
	             
	                 <div className="patent-desc">
	                    <Modal maskClosable={false} visible={this.state.visible}
	                        onOk={this.checkPatentProcess} onCancel={this.handleCancel}
	                        width='600px'
	                        title='新建技淘智推'                       
	                        footer=''
	                        className="admin-desc-content">
	                         <Form horizontal onSubmit={this.addhandleSubmit} id="add-form">
				                <Spin spinning={this.state.loading}>
				                   <div className="clearfix">
				                    	<FormItem 
				                         	labelCol={{ span: 4 }}
					                        wrapperCol={{ span: 18 }}
				                           	label="推荐内容"
				                         > 
											  <Select placeholder="推荐内容" value={this.state.designatedObject} 
				                                onSelect={this.changeObjects} style={{width:'95%'}} required="required"> 
				                                {
				                                    featuredContent.map(function(item) {
				                                        return <Select.Option key={item.value} >{item.key}</Select.Option>
				                                    })
				                                }
				                              </Select> 
				                              <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
				                   		 </FormItem>
				                    </div>
				                    <div className="clearfix">
				                    	<FormItem 
				                         	labelCol={{ span: 4 }}
					                        wrapperCol={{ span: 18 }}
				                           	label="指定发送对象"
				                         > 
											  <Select placeholder="指定发送对象" value={this.state.designatedObject} 
				                                onSelect={this.changeObjects} style={{width:'95%'}} required="required"> 
				                                {
				                                    designatedObjects.map(function(item) {
				                                        return <Select.Option key={item.value} >{item.key}</Select.Option>
				                                    })
				                                }
				                              </Select> 
				                              <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
				                   		 </FormItem>
				                    </div>
				                    <FormItem wrapperCol={{ span: 12, offset: 7 }}>
				                        <Button className="set-submit" type="primary" htmlType="submit">保存</Button>  
				                        <Button className="set-submit" type="ghost" onClick={this.handleCancel} style={{marginLeft:'100px'}}>取消</Button>
				                    </FormItem> 
				                </Spin>
				            </Form >
	                    </Modal>
                	 </div>
                	 <div className="patent-desc">
	                    <Modal maskClosable={false} visible={this.state.editvisible}
	                        onOk={this.checkPatentProcess} onCancel={this.edithandleCancel}
	                        width='600px'
	                        title='编辑组织'                       
	                        footer=''
	                        className="admin-desc-content">
	                         <Form horizontal onSubmit={this.edithandleSubmit} id="edit-form">
				                <Spin spinning={this.state.loading}>
				                    <div className="clearfix">
				                    	<FormItem 
					                            labelCol={{ span: 7 }}
					                        	wrapperCol={{ span: 12 }}
					                            label="组织名称" >
				                    	     <Input placeholder="组织名称" value={this.state.editName} 
				                                onChange={(e)=>{this.setState({editName:e.target.value})}}/>
					                    </FormItem>
				                    </div>
				                    <div className="clearfix">
				                    	<FormItem 
					                            labelCol={{ span: 7 }}
					                        	wrapperCol={{ span: 12}}
					                            label="负责人" >
					                             <Input placeholder="负责人" value={this.state.editManagerId} 
				                                onChange={(e)=>{this.setState({editManagerId:e.target.value})}}/>
					                    </FormItem>
				                    </div>
				                    <div className="clearfix">
				                    	<FormItem  
				                         	labelCol={{ span: 7 }}
					                        wrapperCol={{ span: 12 }}
				                           	label="组织类型"
				                         > 
					                          <Select placeholder="组织类型" value={this.state.editType} 
				                                onChange={(e)=>{this.setState({editType:e})}}> 
				                                {
				                                    patternOrganization.map(function (item) {
				                                        return <Select.Option key={item.value} >{item.key}</Select.Option>
				                                    })
				                                }
				                              </Select>
				                   		 </FormItem>
				                    </div>
				                    <div className="clearfix">
				                    	<FormItem  
				                         	labelCol={{ span: 7 }}
					                        wrapperCol={{ span: 12 }}
				                           	label="组织状态"
				                         > 
					                          <Select placeholder="组织状态" value={this.state.editStatus} 
				                                onChange={(e)=>{this.setState({editStatus:e})}}> 
				                                {
				                                    conditionOrganization.map(function (item) {
				                                        return <Select.Option key={item.value} >{item.key}</Select.Option>
				                                    })
				                                }
				                              </Select>
				                   		 </FormItem>
				                    </div>
				                    <div className="clearfix">
					                    <FormItem  
					                    	labelCol={{ span: 7 }}
					                        wrapperCol={{ span: 12 }}
				                           label="上级组织"
			                               > 
			                              <Select placeholder="请选择上级组织" value={this.state.editSuperId} onChange={(e)=>{this.setState({editSuperId:e})}}
				                                notFoundContent="未获取到上级组织列表">
				                                {this.state.contactsOption}
				                            </Select> 
				                            
			                   		    </FormItem>
		                   		    </div>
		                   		    <div className="clearfix">
				                    	<FormItem 
						                    labelCol={{ span: 7 }}
						                    wrapperCol={{ span: 12 }}
						                    label="组织编号"
					                        >
					                        <span>{this.state.editDepNo}</span>
					                    </FormItem>
					                </div>
					                <div className="clearfix" >
				                    	<FormItem 
						                    labelCol={{ span: 7 }}
						                    wrapperCol={{ span: 12 }}
						                    label="创建人"
					                        >
					                        <span>{this.state.editCreateId}</span>
					                    </FormItem>
					                </div>
					                <div className="clearfix">
				                    	<FormItem 
						                    labelCol={{ span: 7 }}
						                    wrapperCol={{ span: 12 }}
						                    label="创建时间"
					                        >
					                        <span>{this.state.editTime}</span>
					                    </FormItem>
					                </div>
		                   		    <div className="clearfix">
			                   		    <FormItem
					                        labelCol={{ span: 7 }}
					                        wrapperCol={{ span: 12 }}
					                        label="组织职能说明" >					                        
					                        <Input type="textarea" rows={4} placeholder="组织职能说明" value={this.state.editRemarks}
	                           				 	onChange={(e) => { this.setState({ editRemarks: e.target.value }) }}/>					                           
					                    </FormItem>
					                </div>    
				                    <FormItem wrapperCol={{ span: 12, offset: 7 }}>
				                        <Button className="set-submit" type="primary" htmlType="submit">保存</Button>  
				                   		<Button className="set-submit" type="ghost" onClick={this.edithandleCancel} style={{marginLeft:'100px'}}>取消</Button>
				                    </FormItem> 
				                </Spin>
				            </Form >
	                    </Modal>
                	 </div>
                	 
                	 <div className="patent-desc">
	                    <Modal maskClosable={false} visible={this.state.visible1}
	                        onOk={this.checkPatentProcess} onCancel={this.handleCancel1}
	                        width='1200px'
	                        title='散户列表'                       
	                        footer=''
	                        className="admin-desc-content">
	                         <Form horizontal onSubmit={this.addhandleSubmit} id="add-form">
				                <Spin spinning={this.state.loading}>
				                	<div className="user-search">
					                    <Input placeholder="客户名称" style={{width:'150px',marginRight:'10px',marginBottom:'10px'}}
					                        value={this.state.name}
					                        onChange={(e) => { this.setState({ name: e.target.value }); }} />
					                    <Input placeholder="所属人" style={{width:'150px',marginRight:'10px'}}
					                        value={this.state.depNo}
					                        onChange={(e) => { this.setState({ depNo: e.target.value }); }} />    
					                    <Select placeholder="上级组织"
				                            style={{ width:'150px',marginRight:'10px' }}
				                            value={this.state.superId}
				                            onChange={(e) => { this.setState({ superId: e }) }} notFoundContent="未获取到上级组织列表">
				                            {this.state.contactsOption}
						                </Select>
						                <Select placeholder="所属行业"
				                            style={{ width:'150px',marginRight:'10px' }}
				                            value={this.state.superId}
				                            onChange={(e) => { this.setState({ superId: e }) }} notFoundContent="未获取到上级组织列表">
				                            {this.state.contactsOption}
						                </Select>
						                <Select placeholder="社会性质"
				                            style={{ width:'150px',marginRight:'10px' }}
				                            value={this.state.superId}
				                            onChange={(e) => { this.setState({ superId: e }) }} notFoundContent="未获取到上级组织列表">
				                            {this.state.contactsOption}
						                </Select>
						                <Select placeholder="是否上市"
					                            style={{width:'150px',marginRight:'10px'}}
					                            value={this.state.type}
					                            onChange={(e) => { this.setState({ type: e }) }}>
					                            <Select.Option value="0" >已上市</Select.Option>
					                            <Select.Option value="1" >未上市</Select.Option>
					                    </Select>
					                    <Select placeholder="是否国际"
					                            style={{width:'150px',marginRight:'10px'}}
					                            value={this.state.type}
					                            onChange={(e) => { this.setState({ type: e }) }}>
					                            <Select.Option value="0" >国际</Select.Option>
					                            <Select.Option value="1" >国内</Select.Option>
					                    </Select>
						                <Select placeholder="是否实名认证"
					                            style={{width:'150px',marginRight:'10px'}}
					                            value={this.state.type}
					                            onChange={(e) => { this.setState({ type: e }) }}>
					                            <Select.Option value="0" >已实名认证</Select.Option>
					                            <Select.Option value="1" >未实名认证</Select.Option>
					                    </Select>
						                <span style={{marginRight:'10px',width:'150px',display:'inline-block'}}>
					                     	<Cascader options={provinceSelect()}  style={{marginRight:'10px',width:'150px',display:'inlineBlock'}} value={this.state.ressSearch} placeholder="选择省份"
				    						onChange={(e,pre) => { this.setState({ ressSearch: e }) }} />	                 
			                    		</span>
			                    		<span style={{marginRight:'10px',width:'150px',display:'inline-block'}}>                   
					                     	<Cascader options={citySelect()}  style={{marginRight:'10px',width:'150px',display:'inlineBlock'}} value={this.state.ressSearch} placeholder="选择城市"
				    						onChange={(e,pre) => { this.setState({ ressSearch: e }) }} />	                 
			                    		</span>
				                    	<span style={{marginRight:'10px',width:'150px',display:'inline-block',marginBottom:'10px'}}>
					                     	<Cascader options={areaSelect()}  style={{marginRight:'10px',width:'150px',display:'inlineBlock'}} value={this.state.ressSearch} placeholder="选择地区"
				    						onChange={(e,pre) => { this.setState({ ressSearch: e }) }} />	                 
			                    		</span>
				                    	
					                    
					                    
					                    <Button type="primary" onClick={this.search} style={{marginRight:'10px'}}>搜索</Button>
					                    <Button onClick={this.reset} style={{marginRight:'10px'}}>重置</Button>
					                </div>
				                    <div className="foster-table">
				                        <Spin spinning={this.state.loading}>
				                            <Table columns={this.state.columns1}
				                                dataSource={this.state.dataSource}
				                                rowSelection={rowSelections}
				                                pagination={this.state.pagination1}
				                                onRowClick={this.tableRowClick} />
				                        </Spin>
				                    </div>
				                    <FormItem wrapperCol={{ span: 12, offset: 7 }}>
				                        <Button className="set-submit" type="primary" htmlType="submit">保存</Button>  
				                        <Button className="set-submit" type="ghost" onClick={this.handleCancel1} style={{marginLeft:'100px'}}>取消</Button>
				                    </FormItem> 
				                </Spin>
				            </Form >
	                    </Modal>
                	 </div>
                	 <div className="patent-desc">
	                    <Modal maskClosable={false} visible={this.state.visible2}
	                        onOk={this.checkPatentProcess} onCancel={this.handleCancel2}
	                        width='600px'
	                        title='社会属性'                       
	                        footer=''
	                        className="admin-desc-content">
	                         <Form horizontal onSubmit={this.addhandleSubmit} id="add-form">
				                <Spin spinning={this.state.loading}>
				                    <FormItem  
			                         	labelCol={{ span: 7 }}
				                        wrapperCol={{ span: 12 }}
			                           	label="请选择社会属性"
			                         > 
				                          <div  value={this.state.editStatus} 
			                                onChange={(e)=>{this.setState({editStatus:e})}}> 
			                                {
			                                    socialAttribute.map(function (item) {
			                                        return <Checkbox key={item.value} >{item.key}</Checkbox>
			                                    })
			                                }
			                              </div>
			                   		 </FormItem>
				                    <FormItem wrapperCol={{ span: 12, offset: 7 }}>
				                        <Button className="set-submit" type="primary" htmlType="submit">保存</Button>  
				                        <Button className="set-submit" type="ghost" onClick={this.handleCancel2} style={{marginLeft:'100px'}}>取消</Button>
				                    </FormItem> 
				                </Spin>
				            </Form >
	                    </Modal>
                	 </div>
                	 <div className="patent-desc">
	                    <Modal maskClosable={false} visible={this.state.visible3}
	                        onOk={this.checkPatentProcess} onCancel={this.handleCancel3}
	                        width='1200px'
	                        title='分公司列表'                       
	                        footer=''
	                        className="admin-desc-content">
	                         <Form horizontal onSubmit={this.addhandleSubmit} id="add-form">
				                <Spin spinning={this.state.loading}>
				                    <div className="foster-table">
				                        <Spin spinning={this.state.loading}>
				                            <Table columns={this.state.columns1}
				                                dataSource={this.state.dataSource}
				                                rowSelection={rowSelections}
				                                pagination={this.state.pagination1}
				                                onRowClick={this.tableRowClick} />
				                        </Spin>
				                    </div>
				                    <FormItem wrapperCol={{ span: 12, offset: 7 }}>
				                        <Button className="set-submit" type="primary" htmlType="submit">保存</Button>  
				                        <Button className="set-submit" type="ghost" onClick={this.handleCancel3} style={{marginLeft:'100px'}}>取消</Button>
				                    </FormItem> 
				                </Spin>
				            </Form >
	                    </Modal>
                	 </div>
                	 <div className="patent-desc">
	                    <Modal maskClosable={false} visible={this.state.visible4}
	                        onOk={this.checkPatentProcess} onCancel={this.handleCancel4}
	                        width='600px'
	                        title='地区'                       
	                        footer=''
	                        className="admin-desc-content">
	                         <Form horizontal onSubmit={this.addhandleSubmit} id="add-form">
				                <Spin spinning={this.state.loading}>
				                    <div className="clearfix" style={{marginLeft:'90px'}}>
				                		<Tree
									        checkable
									        onExpand={this.onExpand}
									        expandedKeys={this.state.expandedKeys}
									        autoExpandParent={this.state.autoExpandParent}
									        onCheck={this.onCheck}
									        checkedKeys={this.state.checkedKeys}
									        onSelect={this.onSelect}
									        selectedKeys={this.state.selectedKeys}
									      >
									        {this.renderTreeNodes(this.state.Interface)}
									      </Tree>
					                </div>
				                    <FormItem wrapperCol={{ span: 12, offset: 7 }}>
				                        <Button className="set-submit" type="primary" htmlType="submit">保存</Button>  
				                        <Button className="set-submit" type="ghost" onClick={this.handleCancel4} style={{marginLeft:'100px'}}>取消</Button>
				                    </FormItem> 
				                </Spin>
				            </Form >
	                    </Modal>
                	 </div>
                	 <div className="patent-desc">
	                    <Modal maskClosable={false} visible={this.state.visible5}
	                        onOk={this.checkPatentProcess} onCancel={this.handleCancel5}
	                        width='600px'
	                        title='行业'                       
	                        footer=''
	                        className="admin-desc-content">
	                         <Form horizontal onSubmit={this.addhandleSubmit} id="add-form">
				                <Spin spinning={this.state.loading}>
				                    <FormItem  
			                         	labelCol={{ span: 7 }}
				                        wrapperCol={{ span: 12 }}
			                           	label="请选择行业"
			                         > 
				                          <div  value={this.state.editStatus} 
			                                onChange={(e)=>{this.setState({editStatus:e})}}> 
			                                {
			                                    industry.map(function (item) {
			                                        return <Checkbox key={item.value} >{item.key}</Checkbox>
			                                    })
			                                }
			                              </div>
			                   		 </FormItem>
				                    <FormItem wrapperCol={{ span: 12, offset: 7 }}>
				                        <Button className="set-submit" type="primary" htmlType="submit">保存</Button>  
				                        <Button className="set-submit" type="ghost" onClick={this.handleCancel5} style={{marginLeft:'100px'}}>取消</Button>
				                    </FormItem> 
				                </Spin>
				            </Form >
	                    </Modal>
                	 </div>
                	 
                	 
                	 
                	 
            	</div>
            </div>
        );
    }
}));

export default RemindMessage;
