Bladeren bron

新增部门

liting2017 7 jaren geleden
bovenliggende
commit
d04ff86d91

+ 6 - 0
js/component/manageCenter/customer/customerData/companyCustomer.jsx

@@ -125,6 +125,7 @@ const PublicCustomer = Form.create()(React.createClass({
 							currentMemberStatus: thisdata.currentMemberStatus,
 							international: thisdata.international,
 							listed: thisdata.listed,
+							adminName: thisdata.adminName,
 							highTechZone: thisdata.highTechZone,
 							locationProvince: thisdata.province ? thisdata.province + '-' + thisdata.city || '' + '-' + thisdata.area : '--'
 						});
@@ -523,6 +524,11 @@ const PublicCustomer = Form.create()(React.createClass({
 					key: 'createTime',
 				},
 				{
+					title: '所属人',
+					dataIndex: 'adminName',
+					key: 'adminName',
+				},
+				{
 					title: '业务认证',
 					dataIndex: 'businessAudit',
 					key: 'businessAudit',

+ 2 - 1
js/component/manageCenter/customer/customerData/myClient.jsx

@@ -2072,12 +2072,13 @@ const MyClient = Form.create()(React.createClass({
                         }} >
                         <Button>上传批量内容</Button>
                     </Upload>                        
-	                <Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
+	                {/*<Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
 							     <Button type="danger" style={{marginLeft:'10px'}}
 	                       			 disabled={!hasSelected} 
 	                       		 >删除<Icon type="minus" />
 	                        </Button>
 	                </Popconfirm> 
+	                */}
 	                <AutoComplete
 				        className="certain-category-search"
 				        dropdownClassName="certain-category-search-dropdown"

+ 6 - 1
js/component/manageCenter/customer/customerService/myBusiness.jsx

@@ -52,7 +52,8 @@ const MyBusiness = Form.create()(React.createClass({
                             customerStatus:thisdata.customerStatus,
                             customerStatust:thisdata.customerStatus,
                             adminName:thisdata.adminName,
-                   			createTime:thisdata.createTime			                
+                   			createTime:thisdata.createTime,
+                   			updateTime:thisdata.updateTime,
                         });
                     }; 
                     this.state.pagination.current = data.data.pageNo;
@@ -194,6 +195,10 @@ const MyBusiness = Form.create()(React.createClass({
                     dataIndex: 'createTime',
                     key: 'createTime',
                 }, {
+                    title: '更新时间',
+                    dataIndex: 'updateTime',
+                    key: 'updateTime',
+                }, {
                     title: '客户名称',
                     dataIndex: 'identifyName',
                     key: 'identifyName', 

+ 6 - 1
js/component/manageCenter/customer/customerService/serviceQuery.jsx

@@ -49,7 +49,8 @@ const ServiceQuery= Form.create()(React.createClass({
                             followSituation:thisdata.followSituation,
                             customerStatus:thisdata.customerStatus,
                             adminName:thisdata.adminName,
-                   			createTime:thisdata.createTime			                
+                   			createTime:thisdata.createTime,
+                   			updateTime:thisdata.updateTime,
                         });
                     };
                     this.state.pagination.current = data.data.pageNo;
@@ -152,6 +153,10 @@ const ServiceQuery= Form.create()(React.createClass({
                     dataIndex: 'createTime',
                     key: 'createTime',
                 }, {
+                    title: '更新时间',
+                    dataIndex: 'updateTime',
+                    key: 'updateTime',
+                }, {
                     title: '客户名称',
                     dataIndex: 'identifyName',
                     key: 'identifyName', 

+ 3 - 2
js/component/manageCenter/customer/individualCustomer/individualCustomer.jsx

@@ -2093,17 +2093,18 @@ const IndividualCustomer = Form.create()(React.createClass({
                         <Button>上传批量内容</Button>
                     </Upload>                        
 										
-					<Button style={{ marginRight:'10px' ,marginLeft:'10px'}} type='danger'
+					{/*<Button style={{ marginRight:'10px' ,marginLeft:'10px'}} type='danger'
 	                        disabled={!hasSelected} 
 	                        onClick={this.delectRow}>删除<Icon type="minus" />
 	                </Button>
+	                */}
 	               <AutoComplete
 				        className="certain-category-search"
 				        dropdownClassName="certain-category-search-dropdown"
 				        dropdownMatchSelectWidth={false}
 				        dropdownStyle={{ width: 120 }}
 				        
-				        style={{ width: '120px'}}
+				        style={{ width: '120px',marginLeft:'10px'}}
 				        dataSource={options}
 				        placeholder="输入转交人姓名"
 				        value={this.state.auto}

+ 6 - 1
js/component/manageCenter/customer/individualCustomer/queryCustomer.jsx

@@ -97,7 +97,7 @@ const QueryCustomer = Form.create()(React.createClass({
 				celebrity: this.state.celebritySearch,
 				expert: this.state.expertSearch,
 				industry: this.state.industrySearch,
-				shareType: this.state.shareTypeSearch
+				shareType: this.state.shareTypeSearch,
 			},
 			success: function(data) {
 				let theArr = [];
@@ -130,6 +130,7 @@ const QueryCustomer = Form.create()(React.createClass({
 							international: thisdata.international,
 							expert: thisdata.expert,
 							celebrity: thisdata.celebrity,
+							adminName: thisdata.adminName,
 							highTechZone: thisdata.highTechZone,
 							locationProvince: thisdata.province ? thisdata.province + '-' + thisdata.city || '' + '-' + thisdata.area : '--'
 						});
@@ -529,6 +530,10 @@ const QueryCustomer = Form.create()(React.createClass({
 					title: '创建时间',
 					dataIndex: 'createTime',
 					key: 'createTime',
+				},{
+					title: '所属人',
+					dataIndex: 'adminName',
+					key: 'adminName',
 				},
 				{
 					title: '业务认证',

+ 57 - 2
js/component/manageCenter/customer/statistics/followStatistics.jsx

@@ -48,7 +48,8 @@ const FollowStatistics = React.createClass({
 				endDate: this.state.releaseDate[1],
 				timeSpan:this.state.releaseDate[0]?'':urls,
 				depId:this.state.depId,
-				businessGlossoryId:this.state.followSearch
+				businessGlossoryId:this.state.followSearch,
+				depNo:this.state.departmentt
 			},
 			success: function(data) {
 				let theArr = [];
@@ -148,6 +149,47 @@ const FollowStatistics = React.createClass({
 			}]
 		}
 	},
+	//部门
+	departmentList() {
+		this.setState({
+			loading: true
+		});
+		$.ajax({
+			method: "post",
+			dataType: "json",
+			crossDomain: false,
+			url: globalConfig.context + "/api/admin/organization/selectSuperId",
+			data: {
+				
+			},
+			success: function(data) {
+				let thedata = data.data;
+				let theArr=[];
+				if(!thedata) {
+					if(data.error && data.error.length) {
+						message.warning(data.error[0].message);
+					};
+					thedata = {};
+				}else{
+					thedata.map(function(item,index){
+						theArr.push({
+							key:index,
+							name:item.name,
+							id:item.id,
+							depNo:item.depNo
+						})
+					})
+				}
+				this.setState({
+					departmentArr:theArr,
+				})
+			}.bind(this),
+			}).always(function() {
+				this.setState({
+					loading: false
+				});
+			}.bind(this));
+	},
 	callback(e) {
 		this.setState({
 			callnub: e,
@@ -169,15 +211,18 @@ const FollowStatistics = React.createClass({
 		this.loadData(1, this.state.callnub)
 	},
 	reset() {
+		this.state.departmentt=undefined;
 		this.state.releaseDate = [];
 		this.state.followSearch=undefined;
 		this.loadData(1, this.state.callnub);
 	},
 	componentWillMount() {
 		this.loadData();
+		this.departmentList()
 	},
 	render() {
 		const { RangePicker } = DatePicker;
+		let departmentArr = this.state.departmentArr || [];
 		return <div className="visitContant">
 					<div className="visitTitle">
 						<span className="titleTime">起止时间</span>
@@ -193,7 +238,17 @@ const FollowStatistics = React.createClass({
 	                            return <Select.Option key={item.value} >{item.key}</Select.Option>
 	                        })
 	                      }
-                        </Select>    
+                        </Select> 
+                        <span style={{marginRight:'15px',marginLeft:'15px'}}>部门:</span>
+                        <Select placeholder="选择部门" style={{width:'150px'}}
+                            value={this.state.departmentt}
+                            onChange={(e) => { this.setState({ departmentt: e }) }}>
+                            {
+                                departmentArr.map(function (item) {
+                                        return <Select.Option key={item.depNo} >{item.name}</Select.Option>
+                                })
+                            }
+	                    </Select>
                         <Button  onClick={this.search} className="blue" style={{background:'red',color:'#ffffff',border:'none'}}>统计</Button>
                         <Button  onClick={this.reset} className="green" style={{background:'green',color:'#ffffff',border:'none'}}>重置</Button>
                         

+ 56 - 1
js/component/manageCenter/customer/statistics/statusStatistics.jsx

@@ -49,6 +49,7 @@ const StatusStatistics = React.createClass({
 				timeSpan:this.state.releaseDate[0]?'':urls,
 				businessGlossoryId:this.state.intentionalSearch,
 				depId:this.state.depId,
+				depNo:this.state.departmentt
 			},
 			success: function(data) {
 				let theArr = [];
@@ -139,6 +140,47 @@ const StatusStatistics = React.createClass({
 			}]
 		}
 	},
+	//部门
+	departmentList() {
+		this.setState({
+			loading: true
+		});
+		$.ajax({
+			method: "post",
+			dataType: "json",
+			crossDomain: false,
+			url: globalConfig.context + "/api/admin/organization/selectSuperId",
+			data: {
+				
+			},
+			success: function(data) {
+				let thedata = data.data;
+				let theArr=[];
+				if(!thedata) {
+					if(data.error && data.error.length) {
+						message.warning(data.error[0].message);
+					};
+					thedata = {};
+				}else{
+					thedata.map(function(item,index){
+						theArr.push({
+							key:index,
+							name:item.name,
+							id:item.id,
+							depNo:item.depNo
+						})
+					})
+				}
+				this.setState({
+					departmentArr:theArr,
+				})
+			}.bind(this),
+			}).always(function() {
+				this.setState({
+					loading: false
+				});
+			}.bind(this));
+	},
 	callback(e) {
 		this.setState({
 			callnub: e,
@@ -161,15 +203,18 @@ const StatusStatistics = React.createClass({
 	},
 	
 	reset() {
+		this.state.departmentt=undefined;
 		this.state.releaseDate = [];
 		this.state.intentionalSearch = undefined;
 		this.loadData(1, this.state.callnub);
 	},
 	componentWillMount() {
 		this.loadData();
+		this.departmentList()
 	},
 	render() {
 		const { RangePicker } = DatePicker;
+		let departmentArr = this.state.departmentArr || [];
 		return <div className="visitContant">
 					<div className="visitTitle">
 						<span className="titleTime">起止时间</span>
@@ -185,7 +230,17 @@ const StatusStatistics = React.createClass({
 	                            return <Select.Option key={item.value} >{item.key}</Select.Option>
 	                        })
 	                      }
-                        </Select>    
+                        </Select> 
+                        <span style={{marginRight:'15px',marginLeft:'15px'}}>部门:</span>
+                        <Select placeholder="选择部门" style={{width:'150px'}}
+                            value={this.state.departmentt}
+                            onChange={(e) => { this.setState({ departmentt: e }) }}>
+                            {
+                                departmentArr.map(function (item) {
+                                        return <Select.Option key={item.depNo} >{item.name}</Select.Option>
+                                })
+                            }
+	                    </Select>
                         <Button  onClick={this.search} className="blue" style={{background:'red',color:'#ffffff',border:'none'}}>统计</Button>
                         <Button  onClick={this.reset} className="green" style={{background:'green',color:'#ffffff',border:'none'}}>重置</Button>
                         

+ 55 - 0
js/component/manageCenter/customer/statistics/visitStatistics.jsx

@@ -48,6 +48,7 @@ const VisitStatistics = React.createClass({
 				endDate: this.state.releaseDate[1],
 				timeSpan: this.state.releaseDate[0] ? '' : urls,
 				depId: this.state.depId,
+				depNo:this.state.departmentt
 			},
 			success: function(data) {
 				let theArr = [];
@@ -167,15 +168,59 @@ const VisitStatistics = React.createClass({
 		}
 		this.loadData(1, this.state.callnub)
 	},
+	//部门
+	departmentList() {
+		this.setState({
+			loading: true
+		});
+		$.ajax({
+			method: "post",
+			dataType: "json",
+			crossDomain: false,
+			url: globalConfig.context + "/api/admin/organization/selectSuperId",
+			data: {
+				
+			},
+			success: function(data) {
+				let thedata = data.data;
+				let theArr=[];
+				if(!thedata) {
+					if(data.error && data.error.length) {
+						message.warning(data.error[0].message);
+					};
+					thedata = {};
+				}else{
+					thedata.map(function(item,index){
+						theArr.push({
+							key:index,
+							name:item.name,
+							id:item.id,
+							depNo:item.depNo
+						})
+					})
+				}
+				this.setState({
+					departmentArr:theArr,
+				})
+			}.bind(this),
+			}).always(function() {
+				this.setState({
+					loading: false
+				});
+			}.bind(this));
+	},
 	reset() {
+		this.state.departmentt=undefined;
 		this.state.releaseDate = [];
 		this.loadData(1, this.state.callnub);
 	},
 	componentWillMount() {
 		this.loadData();
+		this.departmentList()
 	},
 	render() {
 		const { RangePicker } = DatePicker;
+		let departmentArr = this.state.departmentArr || [];
 		return <div className="visitContant">
 					<div className="visitTitle">
 						<span className="titleTime">起止时间</span>
@@ -183,6 +228,16 @@ const VisitStatistics = React.createClass({
                             value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
                             this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
                             onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
+						<span style={{marginRight:'15px',marginLeft:'15px'}}>部门:</span>
+						<Select placeholder="选择部门" style={{width:'150px'}}
+                            value={this.state.departmentt}
+                            onChange={(e) => { this.setState({ departmentt: e }) }}>
+                            {
+                                departmentArr.map(function (item) {
+                                        return <Select.Option key={item.depNo} >{item.name}</Select.Option>
+                                })
+                            }
+	                    </Select>
                             <Button  onClick={this.search} className="blue" style={{background:'red',color:'#ffffff',border:'none'}}>统计</Button>
                             <Button  onClick={this.reset} className="green" style={{background:'green',color:'#ffffff',border:'none'}}>重置</Button>   
 						<div className="clearfix" style={{marginTop:'30px',marginLeft:'20px'}}>

+ 63 - 1
js/component/manageCenter/set/userManagement/member.jsx

@@ -21,7 +21,8 @@ const Member = React.createClass({
                 pageSize: this.state.pagination.pageSize,
                 province: this.state.searchProvince,
                 mobile: this.state.searchMobile,
-                name: this.state.searchName
+                name: this.state.searchName,
+                department:this.state.departmentt
             },
             success: function (data) {
                 let theArr = [];
@@ -43,6 +44,8 @@ const Member = React.createClass({
                             number: thisdata.number,
                             province: thisdata.province,
                             position: thisdata.position,
+                            departmentName:thisdata.departmentName,
+                            departmentId:thisdata.departmentId,
                             superior: thisdata.superior,
                             superiorId: thisdata.superiorId,
                             createTimeFormattedDate: thisdata.createTimeFormattedDate
@@ -113,6 +116,7 @@ const Member = React.createClass({
             dataSource: [],
             selectedRowKeys: [],
             selectedRows: [],
+            departmentArr:[],
             loading: false,
             modalData: {},
             modalShow: false,
@@ -145,6 +149,10 @@ const Member = React.createClass({
                     title: '职位',
                     dataIndex: 'position',
                     key: 'position'
+                },{
+                    title: '部门',
+                    dataIndex: 'departmentName',
+                    key: 'departmentName'
                 }, {
                     title: '上级管理员',
                     dataIndex: 'superior',
@@ -170,9 +178,51 @@ const Member = React.createClass({
             ]
         }
     },
+    //部门
+	departmentList() {
+		this.setState({
+			loading: true
+		});
+		$.ajax({
+			method: "post",
+			dataType: "json",
+			crossDomain: false,
+			url: globalConfig.context + "/api/admin/organization/selectSuperId",
+			data: {
+				
+			},
+			success: function(data) {
+				let thedata = data.data;
+				let theArr=[];
+				if(!thedata) {
+					if(data.error && data.error.length) {
+						message.warning(data.error[0].message);
+					};
+					thedata = {};
+				}else{
+					thedata.map(function(item,index){
+						theArr.push({
+							key:index,
+							name:item.name,
+							id:item.id,
+							depNo:item.depNo
+						})
+					})
+				}
+				this.setState({
+					departmentArr:theArr,
+				})
+			}.bind(this),
+			}).always(function() {
+				this.setState({
+					loading: false
+				});
+			}.bind(this));
+	},
     componentWillMount() {
         this.state.provinceList = provinceSelect();
         this.loadData();
+        this.departmentList()
         this.loadInitialData();
         this.loadBindRoles();
     },
@@ -190,6 +240,7 @@ const Member = React.createClass({
         })
     },
     reset() {
+    	this.state.departmentt=undefined;
         this.state.searchMobile = undefined;
         this.state.searchName = undefined;
         this.state.searchProvince = undefined;
@@ -202,6 +253,7 @@ const Member = React.createClass({
         }
     },
     render() {
+    	let departmentArr = this.state.departmentArr || [];
         return (
             <Spin spinning={this.state.loading}>
                 <div className="set-content">
@@ -217,6 +269,15 @@ const Member = React.createClass({
                         <Input placeholder="管理员名字"
                             value={this.state.searchName}
                             onChange={(e) => { this.setState({ searchName: e.target.value }); }} />
+                        <Select placeholder="选择部门" style={{width:'120px'}}
+                            value={this.state.departmentt}
+                            onChange={(e) => { this.setState({ departmentt: e }) }}>
+                            {
+                                departmentArr.map(function (item) {
+                                        return <Select.Option key={item.id} >{item.name}</Select.Option>
+                                })
+                            }
+	                    </Select>
                         <Select style={{ width: 120 }}
                             placeholder="选择一个省份"
                             showSearch
@@ -238,6 +299,7 @@ const Member = React.createClass({
                         data={this.state.modalData}
                         onlyProvince={this.state.onlyProvince}
                         show={this.state.modalShow}
+                        departmentArr={this.state.departmentArr}
                         handleReturn={this.handleReturn} />
                     <Table className='member-table'
                         columns={this.state.columns}

+ 372 - 343
js/component/manageCenter/set/userManagement/modal.jsx

@@ -4,50 +4,52 @@ import { provinceSelect, provinceList, getProvince } from '../../../NewDicProvin
 import { companySearch } from '../../../tools.js';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
+import {customerStatus} from '../../../dataDic.js'
 
 const ProvinceAdd = React.createClass({
-    getInitialState() {
-        return {
-            cityOption: [],
-            theProvince: [],
-            citys: []
-        };
-    },
-    componentWillMount() {
-        let theArr = [];
-        this.state.theProvince = [this.props.locations[this.props.index].province];
-        this.state.citys = this.props.locations[this.props.index].city || [];
-        this.props.provinceList.map((item) => {
-            if (item.id == this.props.locations[this.props.index].province) {
-                item.cityList.map((city) => {
-                    theArr.push({
-                        value: city.id,
-                        label: city.name
-                    })
-                });
-            };
-        });
-        this.state.cityOption = theArr;
-    },
-    componentWillReceiveProps(nextProps) {
-        let theArr = [];
-        this.state.theProvince = [nextProps.locations[nextProps.index].province];
-        this.state.citys = nextProps.locations[nextProps.index].city || [];
-        this.props.provinceList.map((item) => {
-            if (item.id == nextProps.locations[nextProps.index].province) {
-                item.cityList.map((city) => {
-                    theArr.push({
-                        value: city.id,
-                        label: city.name
-                    })
-                });
-            };
-        });
-        this.state.cityOption = theArr;
-    },
-    render() {
-        return (
-            <div style={{ display: 'inline-block', marginRight: '20px', marginBottom: '10px' }}>
+	getInitialState() {
+		return {
+			cityOption: [],
+			theProvince: [],
+			citys: [],
+			departmentArr:[]
+		};
+	},
+	componentWillMount() {
+		let theArr = [];
+		this.state.theProvince = [this.props.locations[this.props.index].province];
+		this.state.citys = this.props.locations[this.props.index].city || [];
+		this.props.provinceList.map((item) => {
+			if(item.id == this.props.locations[this.props.index].province) {
+				item.cityList.map((city) => {
+					theArr.push({
+						value: city.id,
+						label: city.name
+					})
+				});
+			};
+		});
+		this.state.cityOption = theArr;
+	},
+	componentWillReceiveProps(nextProps) {
+		let theArr = [];
+		this.state.theProvince = [nextProps.locations[nextProps.index].province];
+		this.state.citys = nextProps.locations[nextProps.index].city || [];
+		this.props.provinceList.map((item) => {
+			if(item.id == nextProps.locations[nextProps.index].province) {
+				item.cityList.map((city) => {
+					theArr.push({
+						value: city.id,
+						label: city.name
+					})
+				});
+			};
+		});
+		this.state.cityOption = theArr;
+	},
+	render() {
+		return(
+			<div style={{ display: 'inline-block', marginRight: '20px', marginBottom: '10px' }}>
                 <Cascader placeholder="选择省份"
                     style={{ width: 80, marginRight: '20px', verticalAlign: 'middle' }}
                     options={this.props.provinceOption}
@@ -105,270 +107,284 @@ const ProvinceAdd = React.createClass({
                     <Icon type="minus" />
                 </Button>
             </div>
-        );
-    },
+		);
+	},
 })
 
 const TheModal = React.createClass({
-    postData() {
-        this.setState({
-            loading: true
-        });
-        let theArr = [];
-        let theLocations = this.state.locations.concat();
-        theLocations.map((item, i) => {
-            if (item.province) {
-                theArr.push(item);
-            };
-        });
-        theArr.map((item) => {
-            if (item.city && item.city.length) {
-                item.city = item.city.join(',');
-            } else {
-                item.city = null;
-            };
-        });
-        $.ajax({
-            type: "POST",
-            url: this.state.id ? globalConfig.context + "/api/admin/supervise/updateAdmin" : globalConfig.context + "/api/admin/supervise/insertAdmin",
-            data: {
-                data: JSON.stringify({
-                    'id': this.state.id,
-                    'name': this.state.name,
-                    'email': this.state.email,
-                    'mobile': this.state.mobile,
-                    'position': this.state.position,
-                    'locations': theArr,
-                    'superiorId': this.state.superiorId
-                }),
-                'roles': this.state.bindroles
-            }
-        }).done((res) => {
-            if (res.error.length) {
-                message.error(res.error[0].message);
-            } else {
-                message.success("保存成功");
-                this.setState({
-                    visible: false,
-                });
-                this.props.handleReturn(false, true);
-                //第二个参数表示保存
-            }
-        }).always(() => {
-            this.setState({
-                loading: false
-            })
-        })
-        this.props.postData;
-    },
-    getInitialState() {
-        return {
-            name: '',
-            email: '',
-            mobile: '',
-            roles: [],
-            visible: false,
-            loading: false,
-            theSwitch: true,
-            bindroles: [],
-            locations: [],
-            cityOption: [],
-            locationsObj: {},
-            adminSelectObj: {}
-        }
-    },
-    handleCancel() {
-        this.setState({
-            visible: false,
-            locations:[]
-        });
-        this.props.handleReturn(false, false);
-    },
-    loadAdminSelectList() {
-        this.setState({
-            loading: true
-        });
-        $.ajax({
-            url: globalConfig.context + '/api/admin/supervise/adminSelectList',
-            cache: false
-        }).done((data) => {
-            if (!data.data) {
-                if (data.error && data.error.length) {
-                    message.warning(data.error[0].message);
-                    return;
-                };
-            };
-            let theArr = [], i;
-            for (i in data.data) {
-                theArr.push(
-                    <Select.Option key={i}>{data.data[i]}</Select.Option>
-                )
-            };
-            this.setState({
-                adminSelectOption: theArr,
-                adminSelectObj: data.data,
-                loading: false
-            });
-        })
-    },
-    loadAdminOwnLocation() {
-        this.setState({
-            loading: true
-        });
-        $.ajax({
-            url: globalConfig.context + '/api/admin/supervise/adminOwnLocation',
-            cache: false
-        }).done((data) => {
-            if (!data.data) {
-                if (data.error && data.error.length) {
-                    message.warning(data.error[0].message);
-                    return;
-                };
-            };
-            let theArr = [], theList = [];
-            if ((typeof (data.data)).indexOf('string') == -1) {
-                data.data.map((item) => {
-                    theArr.push({
-                        value: item.province,
-                        label: getProvince(item.province)
-                    });
-                    let cityList = [];
-                    if (item.city) {
-                        item.city.split(',').map((c) => {
-                            cityList.push({
-                                id: Number(c),
-                                name: getProvince(c)
-                            });
-                        });
-                    };
-                    theList.push({
-                        id: item.province,
-                        name: getProvince(item.province),
-                        cityList: cityList.length ? cityList : null
-                    });
-                });
-            } else {
-                theArr = provinceSelect();
-                theList = provinceList;
-            }
-            this.setState({
-                provinceOption: theArr,
-                provinceList: theList,
-                loading: false
-            });
-        })
-    },
-    loadBindRoles(uid) {
-        this.setState({
-            loading: true
-        });
-        $.ajax({
-            url: globalConfig.context + '/api/admin/role',
-            cache: false,
-            data: {
-                "uid": uid
-            }
-        }).done((data) => {
-            if (!data.data) {
-                if (data.error && data.error.length) {
-                    message.warning(data.error[0].message);
-                };
-                return;
-            } else if (data.data) {
-                this.state.theSwitch = true;
-                for (let i = 0; i < data.data.length; i++) {
-                    for (let n = 0; n < this.props.currentRoles.length; n++) {
-                        if (data.data[i] === this.props.currentRoles[n] && uid != 1) {
-                            this.state.theSwitch = false;
-                        }
-                    }
-                };
-            };
-            this.setState({
-                bindroles: data.data || [],
-                theSwitch: this.state.theSwitch,
-                loading: false
-            });
-        })
-    },
-    loadLocations(id) {
-        this.setState({
-            loading: true
-        });
-        $.ajax({
-            url: globalConfig.context + '/api/admin/supervise/adminDetailLocation',
-            cache: false,
-            data: {
-                "id": id
-            }
-        }).done((data) => {
-            if (!data.data) {
-                if (data.error && data.error.length) {
-                    message.warning(data.error[0].message);
-                    return;
-                };
-            };
-            data.data.map((item) => {
-                if (item.city) {
-                    item.city = item.city.split(',');
-                }
-            });
-            this.setState({
-                locations: data.data,
-                loading: false
-            });
-        })
-    },
-    componentWillMount() {
-        this.loadAdminSelectList();
-        this.loadAdminOwnLocation();
-    },
-    componentWillReceiveProps(nextProps) {
-        if (!this.state.visible && nextProps.show) {
-            if (nextProps.data.id) {
-                this.loadBindRoles(nextProps.data.id);
-                this.loadLocations(nextProps.data.id);
-            }
-        };
-        let nextState = {
-            visible: nextProps.show,
-            id: nextProps.data ? nextProps.data.id : '',
-            name: nextProps.data ? nextProps.data.name : '',
-            email: nextProps.data ? nextProps.data.email : '',
-            mobile: nextProps.data ? nextProps.data.mobile : '',
-            position: nextProps.data ? nextProps.data.position : '',
-            superiorId: nextProps.data ? nextProps.data.superiorId : '',    
-        };
-        this.setState(nextState)
-    },
-    resetPwd(e) {
-        this.setState({
-            loading: true
-        })
-        $.ajax({
-            type: 'post',
-            url: globalConfig.context + "/api/admin/supervise/resetPwd",
-            dataType: "json",
-            data: {
-                id: this.state.id
-            }
-        }).done((res) => {
-            if (res.error && res.error.length) {
-                message.error(res.error[0].message);
-            } else {
-                message.success("密码重置成功");
-            }
-        }).always(() => {
-            this.setState({
-                loading: false
-            })
-        });
-    },
-    getRolesSelection() {
-        if (!this.state.id) {
-            return <li></li>
-        } else if (this.state.id != '1') {
-            return <li className="list">
+	postData() {
+		this.setState({
+			loading: true
+		});
+		let theArr = [];
+		let theLocations = this.state.locations.concat();
+		theLocations.map((item, i) => {
+			if(item.province) {
+				theArr.push(item);
+			};
+		});
+		theArr.map((item) => {
+			if(item.city && item.city.length) {
+				item.city = item.city.join(',');
+			} else {
+				item.city = null;
+			};
+		});
+		let departmentIds='';
+		if(!this.state.department){
+			departmentIds=''
+		}else if((this.state.department).length>30){
+			departmentIds=this.state.department
+		}else{
+			departmentIds=this.state.departmentId
+		}
+		$.ajax({
+			type: "POST",
+			url: this.state.id ? globalConfig.context + "/api/admin/supervise/updateAdmin" : globalConfig.context + "/api/admin/supervise/insertAdmin",
+			data: {
+				data: JSON.stringify({
+					'id': this.state.id,
+					'name': this.state.name,
+					'email': this.state.email,
+					'mobile': this.state.mobile,
+					'position': this.state.position,
+					'locations': theArr,
+					'departmentId':departmentIds,
+					'superiorId': this.state.superiorId
+				}),
+				'roles': this.state.bindroles
+			}
+		}).done((res) => {
+			if(res.error.length) {
+				message.error(res.error[0].message);
+			} else {
+				message.success("保存成功");
+				this.setState({
+					visible: false,
+				});
+				this.props.handleReturn(false, true);
+				//第二个参数表示保存
+			}
+		}).always(() => {
+			this.setState({
+				loading: false
+			})
+		})
+		this.props.postData;
+	},
+	getInitialState() {
+		return {
+			name: '',
+			email: '',
+			mobile: '',
+			roles: [],
+			visible: false,
+			loading: false,
+			theSwitch: true,
+			bindroles: [],
+			locations: [],
+			cityOption: [],
+			locationsObj: {},
+			adminSelectObj: {}
+		}
+	},
+	handleCancel() {
+		this.setState({
+			visible: false,
+			locations: []
+		});
+		this.props.handleReturn(false, false);
+	},
+	loadAdminSelectList() {
+		this.setState({
+			loading: true
+		});
+		$.ajax({
+			url: globalConfig.context + '/api/admin/supervise/adminSelectList',
+			cache: false
+		}).done((data) => {
+			if(!data.data) {
+				if(data.error && data.error.length) {
+					message.warning(data.error[0].message);
+					return;
+				};
+			};
+			let theArr = [],
+				i;
+			for(i in data.data) {
+				theArr.push(
+					<Select.Option key={i}>{data.data[i]}</Select.Option>
+				)
+			};
+			this.setState({
+				adminSelectOption: theArr,
+				adminSelectObj: data.data,
+				loading: false
+			});
+		})
+	},
+	loadAdminOwnLocation() {
+		this.setState({
+			loading: true
+		});
+		$.ajax({
+			url: globalConfig.context + '/api/admin/supervise/adminOwnLocation',
+			cache: false
+		}).done((data) => {
+			if(!data.data) {
+				if(data.error && data.error.length) {
+					message.warning(data.error[0].message);
+					return;
+				};
+			};
+			let theArr = [],
+				theList = [];
+			if((typeof(data.data)).indexOf('string') == -1) {
+				data.data.map((item) => {
+					theArr.push({
+						value: item.province,
+						label: getProvince(item.province)
+					});
+					let cityList = [];
+					if(item.city) {
+						item.city.split(',').map((c) => {
+							cityList.push({
+								id: Number(c),
+								name: getProvince(c)
+							});
+						});
+					};
+					theList.push({
+						id: item.province,
+						name: getProvince(item.province),
+						cityList: cityList.length ? cityList : null
+					});
+				});
+			} else {
+				theArr = provinceSelect();
+				theList = provinceList;
+			}
+			this.setState({
+				provinceOption: theArr,
+				provinceList: theList,
+				loading: false
+			});
+		})
+	},
+	loadBindRoles(uid) {
+		this.setState({
+			loading: true
+		});
+		$.ajax({
+			url: globalConfig.context + '/api/admin/role',
+			cache: false,
+			data: {
+				"uid": uid
+			}
+		}).done((data) => {
+			if(!data.data) {
+				if(data.error && data.error.length) {
+					message.warning(data.error[0].message);
+				};
+				return;
+			} else if(data.data) {
+				this.state.theSwitch = true;
+				for(let i = 0; i < data.data.length; i++) {
+					for(let n = 0; n < this.props.currentRoles.length; n++) {
+						if(data.data[i] === this.props.currentRoles[n] && uid != 1) {
+							this.state.theSwitch = false;
+						}
+					}
+				};
+			};
+			this.setState({
+				bindroles: data.data || [],
+				theSwitch: this.state.theSwitch,
+				loading: false
+			});
+		})
+	},
+	loadLocations(id) {
+		this.setState({
+			loading: true
+		});
+		$.ajax({
+			url: globalConfig.context + '/api/admin/supervise/adminDetailLocation',
+			cache: false,
+			data: {
+				"id": id
+			}
+		}).done((data) => {
+			if(!data.data) {
+				if(data.error && data.error.length) {
+					message.warning(data.error[0].message);
+					return;
+				};
+			};
+			data.data.map((item) => {
+				if(item.city) {
+					item.city = item.city.split(',');
+				}
+			});
+			this.setState({
+				locations: data.data,
+				loading: false
+			});
+		})
+	},
+	
+	componentWillMount() {
+		this.loadAdminSelectList();
+		this.loadAdminOwnLocation();
+	},
+	componentWillReceiveProps(nextProps) {
+		if(!this.state.visible && nextProps.show) {
+			if(nextProps.data.id) {
+				this.loadBindRoles(nextProps.data.id);
+				this.loadLocations(nextProps.data.id);
+			}
+		};
+		let nextState = {
+			visible: nextProps.show,
+			id: nextProps.data ? nextProps.data.id : '',
+			name: nextProps.data ? nextProps.data.name : '',
+			email: nextProps.data ? nextProps.data.email : '',
+			mobile: nextProps.data ? nextProps.data.mobile : '',
+			position: nextProps.data ? nextProps.data.position : '',
+			department: nextProps.data ? nextProps.data.departmentName : '',
+			departmentId:nextProps.data ? nextProps.data.departmentId : '',
+			superiorId: nextProps.data ? nextProps.data.superiorId : '',
+		};
+		this.setState(nextState)
+	},
+	resetPwd(e) {
+		this.setState({
+			loading: true
+		})
+		$.ajax({
+			type: 'post',
+			url: globalConfig.context + "/api/admin/supervise/resetPwd",
+			dataType: "json",
+			data: {
+				id: this.state.id
+			}
+		}).done((res) => {
+			if(res.error && res.error.length) {
+				message.error(res.error[0].message);
+			} else {
+				message.success("密码重置成功");
+			}
+		}).always(() => {
+			this.setState({
+				loading: false
+			})
+		});
+	},
+	getRolesSelection() {
+		if(!this.state.id) {
+			return <li></li>
+		} else if(this.state.id != '1') {
+			return <li className="list">
                 <span className='modal-text'>角色</span>
                 <Select
                     multiple
@@ -379,44 +395,45 @@ const TheModal = React.createClass({
                     {this.getRolesOptions()}
                 </Select>
             </li>
-        } else if (this.state.id == "1") {
-            return <li><span className='modal-text'>角色</span><span>系统管理员</span></li>
-        }
-    },
-    bindRoles(val) {
-        this.setState({
-            bindroles: val
-        });
-    },
-    getRolesOptions() {
-        let options = [];
-        for (let i = 0; i < this.props.roles.length; i++) {
-            options.push(<Select.Option key={String(this.props.roles[i].id)}>{this.props.roles[i].roleName}</Select.Option>);
-        }
-        return options;
-    },
-    getLocations(index, p, c) {
-        this.state.locations.map((item, i) => {
-            if (index == i) {
-                item.province = p;
-                item.city = c || [];
-            };
-        });
-    },
-    delLocations(index) {
-        this.state.locations.splice(index, 1);
-        this.setState({ locations: this.state.locations });
-    },
-    provinceAdd() {
-        this.state.locations.push({
-            province: null,
-            city: null
-        });
-        this.setState({ locations: this.state.locations });
-    },
-    render() {
-        return (
-            <div className="modal" >
+		} else if(this.state.id == "1") {
+			return <li><span className='modal-text'>角色</span><span  style={{width:'150px'}}>系统管理员</span></li>
+		}
+	},
+	bindRoles(val) {
+		this.setState({
+			bindroles: val
+		});
+	},
+	getRolesOptions() {
+		let options = [];
+		for(let i = 0; i < this.props.roles.length; i++) {
+			options.push(<Select.Option key={String(this.props.roles[i].id)}>{this.props.roles[i].roleName}</Select.Option>);
+		}
+		return options;
+	},
+	getLocations(index, p, c) {
+		this.state.locations.map((item, i) => {
+			if(index == i) {
+				item.province = p;
+				item.city = c || [];
+			};
+		});
+	},
+	delLocations(index) {
+		this.state.locations.splice(index, 1);
+		this.setState({ locations: this.state.locations });
+	},
+	provinceAdd() {
+		this.state.locations.push({
+			province: null,
+			city: null
+		});
+		this.setState({ locations: this.state.locations });
+	},
+	render() {
+		let departmentArr=this.props.departmentArr||[];
+		return(
+			<div className="modal" >
                 <Modal maskClosable={false} title="管理员详情"
                     closable={false} width={1000}
                     visible={this.state.visible}
@@ -434,6 +451,18 @@ const TheModal = React.createClass({
                                     <Input value={this.state.position} onChange={(e) => { this.state.position = e.target.value; this.setState({ position: this.state.position }); }} />
                                 </li>
                                 <li className="list">
+                                    <span className='modal-text'>部门</span>
+	                                <Select placeholder="选择部门" style={{width:'200px'}}
+			                            value={this.state.department}
+			                            onChange={(e) => { this.setState({ department: e }) }}>
+			                            {
+		                                    departmentArr.map(function (item) {
+		                                            return <Select.Option key={item.id} >{item.name}</Select.Option>
+		                                    })
+		                                }
+		                            </Select>
+                                </li>
+                                <li className="list">
                                     <span className='modal-text'>上级</span>
                                     <Select style={{ verticalAlign: 'middle', width: 200 }}
                                         placeholder="选择一个上级" notFoundContent="没有获取到管理员列表"
@@ -526,8 +555,8 @@ const TheModal = React.createClass({
                     </Spin>
                 </Modal>
             </div >
-        );
-    }
+		);
+	}
 })
 
 export default TheModal;

+ 22 - 0
js/component/manageCenter/set/userManagementS/addjurisdiction.jsx

@@ -149,6 +149,17 @@ const Addjurisdiction = Form.create()(React.createClass({
                 }else{
                 	createD=Times.getDate();
                 };
+                //秒、分处理
+                if(createS<10){
+                	createS='0'+Times.getSeconds()
+                }else{
+                	createS=Times.getSeconds();
+                };
+                if(createF<10){
+                	createF='0'+Times.getMinutes()
+                }else{
+                	createF=Times.getMinutes();
+                };
                 let createTimes=createY+'-'+createM+'-'+createD+' '+createH+':'+createF+':'+createS;
                 //更新时间
                 let updateY=upTimes.getFullYear();
@@ -166,6 +177,17 @@ const Addjurisdiction = Form.create()(React.createClass({
                 }else{
                 	updateD=upTimes.getDate();
                 };
+                //m秒。分处理
+                if(updateS<10){
+                	updateS='0'+upTimes.getSeconds()
+                }else{
+                	updateS=upTimes.getSeconds();
+                };
+                if(updateF<10){
+                	updateF='0'+upTimes.getMinutes()
+                }else{
+                	updateF=upTimes.getMinutes();
+                };
                 let updateTimes=updateY+'-'+updateM+'-'+updateD+' '+updateH+':'+updateF+':'+updateS;
                 this.setState({
                 	ids:thisData.id,

+ 11 - 5
js/component/manageCenter/set/userManagementS/jurisdiction.jsx

@@ -19,10 +19,15 @@ const Jurisdiction = Form.create()(React.createClass({
 			crossDomain: false,
 			url: globalConfig.context + '/api/admin/permissions',
 			success: function(data) {
-				let thisData = data.data.one;
-				this.setState({
-					dataSource: data.data.one,
-				});
+				if(!data.data || !data.data.one) {
+					if(data.error && data.error.length) {
+						message.warning(data.error[0].message);
+					};
+				} else {
+					this.setState({
+						dataSource: data.data.one,
+					});
+				}
 			}.bind(this),
 		}).always(function() {
 			this.setState({
@@ -76,6 +81,7 @@ const Jurisdiction = Form.create()(React.createClass({
 		this.state.userDetaile = true;
 		this.state.datauser = record;
 		this.setState({
+			ids:record.id,
 			showDesc: true
 		});
 	},
@@ -148,7 +154,7 @@ const Jurisdiction = Form.create()(React.createClass({
 			crossDomain: false,
 			url: globalConfig.context + '/api/admin/addPermission',
 			data: {
-				superId: this.state.preName,
+				superId: this.state.ids,
 				name: this.state.name, //接口名称
 				url: this.state.url //接口路径
 			}

+ 70 - 71
js/component/manageCenter/set/userManagementS/newRole.jsx

@@ -14,45 +14,22 @@ const Newrole = Form.create()(React.createClass({
 			method: "post",
 			dataType: "json",
 			crossDomain: false,
-			url: globalConfig.context + '/api/admin/customer/listAllPersonalCustomer',
+			url: globalConfig.context + '/api/admin/permissions',
 			data: {
 				pageNo: 1,
 				pageSize: 10,
 			},
 			success: function(data) {
 				let theArr = [];
-				if(!data.data || !data.data.list) {
+				if(!data.data || !data.data.one) {
 					if(data.error && data.error.length) {
 						message.warning(data.error[0].message);
 					};
 				} else {
-					for(let i = 0; i < data.data.list.length; i++) {
-						let thisdata = data.data.list[i];
-						let nub = Math.floor(Math.random() * 100000);
-						theArr.push({
-							key: 'AM' + nub,
-							id: 'nub' + i + 'b',
-							name: '成果录入' + i,
-							Interface: 'api/admin/customer' + i,
-							children: [{
-									key: 'BM' + nub,
-									id: 'nub' + i + 'b' + i,
-									name: '成果录入' + i + i,
-									Interface: 'api/admin/customer' + i + i + i,
-								},
-								{
-									key: 'BM' + nub + i,
-									id: 'nub' + i + 'c' + i,
-									name: '成果录入' + i + i,
-									Interface: 'api/admin/customer' + i + i + i,
-								}
-							]
-						});
-					};
+					this.setState({
+						Interface: data.data.one,
+					});
 				};
-				this.setState({
-					Interface: theArr,
-				});
 			}.bind(this),
 		}).always(function() {
 			this.setState({
@@ -78,31 +55,16 @@ const Newrole = Form.create()(React.createClass({
 	},
 	handleSubmit(e) {
 		e.preventDefault();
-		//let api=this.props.userDetaile?'保存':'新建';
+		//let api=this.props.userDetaile?'编辑':'新建';
 		this.props.form.validateFields((err, values) => {
-			let idsArr = this.state.selectedRowst || [];
-			let prekeys = this.state.selectedRowKeyst;
-			let Interfaces = this.state.Interface;
-			let ineIds = [];
-			let ids = [];
-			if(idsArr.length) {
-				idsArr.map(function(index) {
-					ids.push(
-						index.id
-					)
-					if(idsArr.children) {
-						idsArr.children.map(function(item) {
-							ids.push(
-								item.id
-							)
-						})
-					}
-				})
-			} else {
-				prekeys.map(function(item) {
-					ineIds.push(Interfaces[item].id)
-				});
-			}
+	        var tmp = [];
+	        let selectAllId=this.state.selectedRowKeyst;
+	        for(var i in selectAllId){
+	            //该元素在tmp内部不存在才允许追加
+	            if(tmp.indexOf(selectAllId[i])==-1){
+	                tmp.push(selectAllId[i]);
+	            }
+	        }
 			if(!err) {
 				this.setState({
 					loading: true
@@ -111,10 +73,10 @@ const Newrole = Form.create()(React.createClass({
 					method: "POST",
 					dataType: "json",
 					crossDomain: false,
-					url: globalConfig.context + '/api/admin/customer/addCustomer',
+					url: globalConfig.context + 'api',
 					data: {
 						roleName: this.state.roleName,
-						id: ids.length ? JSON.stringify(ids) : JSON.stringify(ineIds)
+						id:JSON.stringify(tmp)
 					}
 				}).done(function(data) {
 					this.setState({
@@ -150,9 +112,8 @@ const Newrole = Form.create()(React.createClass({
 						thisData = {};
 					};
 					this.setState({
-						detaileuser: thisData,
-						uids: thisData.uid,
-						//selectedRowKeyst:[0,1,2]
+						roleName: thisData.roleName,
+						selectedRowKeyst:["f9ded9d3-7987-417b-90e8-1ddd9622ada5", "cf637978-ebe8-4be6-9356-f50bc1b81172", "470aad28-e980-4bc5-a8fb-60992c6ee345"],
 					});
 				}.bind(this),
 			}).always(function() {
@@ -175,7 +136,6 @@ const Newrole = Form.create()(React.createClass({
 		this.props.closeDesc(false);
 	},
 	componentWillMount() {
-		
 		this.addloadData()
 	},
 	componentWillReceiveProps(nextProps) { //props改变时触发
@@ -189,28 +149,66 @@ const Newrole = Form.create()(React.createClass({
 			selectedRowKeyst: [],
 			datauser: {},
 		})
+
+	},
+	tableRowClick(record, index) {
+		console.log(record)
 	},
 	render() {
-		const theData = this.state.detaileuser || {};
 		const FormItem = Form.Item
 		const formItemLayout = {
 			labelCol: { span: 8 },
 			wrapperCol: { span: 14 },
 		};
 		const rowSelection = {
-            selectedRowKeys: this.state.selectedRowKeyst,
-            onChange: (selectedRowKeys, selectedRows) => {
-                this.setState({
-                    selectedRowst: selectedRows,
-                    selectedRowKeyst: selectedRowKeys
-                });
-            },
-            onSelect: (recordt, selected, selectedRows) => {			   
-			    this.setState({
-			    	recordt:recordt.id
-			    })
+			selectedRowKeys: this.state.selectedRowKeyst,
+			onChange: (selectedRowKeys, selectedRows) => {
+				let allList = this.state.Interface
+				let allId = [];
+				let autAll = [];
+				let selectId = [];
+				let rowKey = selectedRowKeys;
+				selectedRows.map(function(item, index) {
+					if(item.autNo.length == 4) {
+						let autoNo = item.autNo
+						allList.map(function(item) {
+							autAll.push(item.autNo);
+							allId.push(item.id)
+							if(item.children.length) {
+								item.children.map(function(ttm) {
+									autAll.push(ttm.autNo)
+									allId.push(ttm.id)
+									if(ttm.children.length) {
+										ttm.children.map(function(itt) {
+											autAll.push(itt.autNo)
+											allId.push(itt.id)
+										})
+									}
+								})
+							}
+						})
+						for(var i = 0; i < autAll.length; i++) {
+							if(autAll[i].indexOf(autoNo)) {} else {
+								selectId.push(allId[i])
+							}
+						}
+						rowKey = selectId
+						if(rowKey.length==2){
+							rowKey = selectedRowKeys
+						}
+						return rowKey;
+					}
+					if(item.autNo.length > 4) {
+						rowKey = selectedRowKeys
+					}
+				})
+				this.setState({
+					selectedRowst: selectedRows,
+					selectedRowKeyst: rowKey
+				});
+				console.log(rowKey)
 			},
-        };
+		};
 		return(
 			<div>
            <Modal maskClosable={false} visible={this.state.visible}
@@ -240,6 +238,7 @@ const Newrole = Form.create()(React.createClass({
 						                	<Table columns={this.state.addColumns}
 					                            dataSource={this.state.Interface}
 					                            rowSelection={rowSelection}
+					                            onRowClick={this.tableRowClick} 
 					                            scroll={{ y: 500 }}
 					                            pagination={false}
 					                            />

+ 4 - 10
js/component/manageCenter/set/userManagementS/roles.jsx

@@ -17,7 +17,7 @@ const Roles=Form.create()(React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + '/api/rol',
+            url: globalConfig.context + '/api/roles',
             data: {
                 pageNo: pageNo || 1,
                 pageSize: this.state.pagination.pageSize,
@@ -142,6 +142,7 @@ const Roles=Form.create()(React.createClass({
         });
     },
     closeDesc(e, s) {
+    	this.state.userDetaile=false;
         this.state.showDesc = e;
         if (s) {
             this.loadData();
@@ -158,17 +159,10 @@ const Roles=Form.create()(React.createClass({
         const rowSelection = {
             selectedRowKeys: this.state.selectedRowKeys,
             onChange: (selectedRowKeys, selectedRows) => {
-            	if(selectedRows.length=='10'){
-                	this.setState({
-                    selectedRows: [],
-                    selectedRowKeys: ''
-                });
-                }else{
 	                this.setState({
 	                    selectedRows: selectedRows.slice(-1),
 	                    selectedRowKeys: selectedRowKeys.slice(-1)
-	                });
-                }  
+	                }); 
             }
         };
         const hasSelected = this.state.selectedRowKeys.length > 0;
@@ -184,7 +178,7 @@ const Roles=Form.create()(React.createClass({
 	                    <Button style={{ background: "red", border: "none", color: "#fff" }}
 	                        disabled={!hasSelected}
 	                        onClick={this.delectRow}>删除<Icon type="minus" /></Button>
-	                    <Button type="primary" className="addButton" onClick={this.addClick} disabled>新增用户<Icon type="user" /></Button>
+	                    <Button type="primary" className="addButton" onClick={this.addClick} >新增用户<Icon type="user" /></Button>
 	                </div>
 	                <div className="patent-table">
 	                    <Spin spinning={this.state.loading}>