| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999 | 
							- import React from 'react';
 
- import ReactDom from 'react-dom';
 
- import ajax from 'jquery/src/ajax/xhr.js';
 
- import $ from 'jquery/src/ajax';
 
- import { Form, Radio, Icon, Button, Input, Select, AutoComplete, Spin, Table, Switch, message, DatePicker, Modal, Upload,Popconfirm,Tabs } from 'antd';
 
- import Newuser from "./newUser.jsx"
 
- import './userMangagement.less'
 
- import { techAuditStatusList, station, post } from '../../../dataDic.js';
 
- import {getPost,getStation} from '../../../tools.js';
 
- const {TabPane} = Tabs
 
- const User = Form.create()(React.createClass({
 
- 	loadData(pageNo) {
 
- 		this.state.data = [];
 
- 		this.setState({
 
- 			userDetaile:false,
 
- 			loading: true,
 
- 			page:pageNo
 
- 		});
 
- 		var admin=window.adminData.isSuperAdmin||'';
 
- 		var departmentId=window.adminData.departmentId||'';
 
- 		$.ajax({
 
- 			method: "get",
 
- 			dataType: "json",
 
- 			crossDomain: false,
 
- 			url: globalConfig.context + '/api/admin/superviser/adminList',
 
- 			data: {
 
- 				pageNo: pageNo || 1,
 
- 				pageSize: this.state.pagination.pageSize,
 
- 				name: this.state.userNameSearch,
 
- 				departmentId: admin?this.state.organizationSearch:departmentId,
 
- 				rid: this.state.rolesSearch,
 
- 				duty: this.state.postSearch,
 
- 				position: this.state.stationSearch,
 
- 				status: this.state.statusSeach,
 
- 				mobile: this.state.signNameSearch,
 
- 				superiorId: this.state.theTypes
 
- 			},
 
- 			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: i,
 
- 							id: thisdata.id,
 
- 							mobile: thisdata.mobile,
 
- 							name: thisdata.name,
 
- 							email: thisdata.email,
 
- 							createTime: thisdata.createTime,
 
- 							province: thisdata.province,
 
- 							position: thisdata.position,
 
- 							superior: thisdata.superior, //上级名称
 
- 							superiorId: thisdata.superiorId, //上级Id
 
- 							duty: thisdata.duty, //职务
 
- 							status: thisdata.status,
 
- 							userNo: thisdata.userNo,
 
- 							departmentName: thisdata.departmentName, //部门名称
 
- 							departmentId: thisdata.departmentId, //部门id
 
- 							roles:thisdata.roles[0],
 
- 							rolesId:thisdata.rolesId,
 
- 							lastLoginTime:thisdata.lastLoginTime,
 
- 						});
 
- 					};
 
- 					this.state.pagination.current = data.data.pageNo ? data.data.pageNo : '0';
 
- 					this.state.pagination.total = data.data.totalCount ? data.data.totalCount : '0';
 
- 				};
 
- 				if(!data.data.list.length){
 
- 					this.state.pagination.current=0
 
- 					this.state.pagination.total=0
 
- 				}
 
- 				this.setState({
 
- 					dataSource: theArr,
 
- 					pagination: this.state.pagination,
 
- 					selectedRowKeys:[]
 
- 				});
 
- 			}.bind(this),
 
- 		}).always(function() {
 
- 			this.setState({
 
- 				loading: false
 
- 			});
 
- 		}.bind(this));
 
- 	},
 
- 	loadDatas(pageNo) {
 
- 		this.state.data = [];
 
- 		this.setState({
 
- 			userDetaile:false,
 
- 			loading: true,
 
- 			page:pageNo
 
- 		});
 
- 		var admin=window.adminData.isSuperAdmin||'';
 
- 		var departmentId=window.adminData.departmentId||'';
 
- 		$.ajax({
 
- 			method: "get",
 
- 			dataType: "json",
 
- 			crossDomain: false,
 
- 			url: globalConfig.context + '/api/admin/superviser/adminList',
 
- 			data: {
 
- 				pageNo: pageNo || 1,
 
- 				pageSize: this.state.paginations.pageSize,
 
- 				name: this.state.userNameSearchs,
 
- 				status: "正常"
 
- 				// departmentId: admin?this.state.organizationSearch:departmentId,
 
- 				// rid: this.state.rolesSearch,
 
- 				// duty: this.state.postSearch,
 
- 				// position: this.state.stationSearch,
 
- 				// status: this.state.statusSeach,
 
- 				// mobile: this.state.signNameSearch,
 
- 				// superiorId: this.state.theTypes
 
- 			},
 
- 			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: i,
 
- 							id: thisdata.id,
 
- 							mobile: thisdata.mobile,
 
- 							name: thisdata.name,
 
- 							email: thisdata.email,
 
- 							createTime: thisdata.createTime,
 
- 							province: thisdata.province,
 
- 							position: thisdata.position,
 
- 							superior: thisdata.superior, //上级名称
 
- 							superiorId: thisdata.superiorId, //上级Id
 
- 							duty: thisdata.duty, //职务
 
- 							status: thisdata.status,
 
- 							userNo: thisdata.userNo,
 
- 							departmentName: thisdata.departmentName, //部门名称
 
- 							departmentId: thisdata.departmentId, //部门id
 
- 							roles:thisdata.roles[0],
 
- 							rolesId:thisdata.rolesId
 
- 						});
 
- 					};
 
- 					this.state.paginations.current = data.data.pageNo ? data.data.pageNo : '0';
 
- 					this.state.paginations.total = data.data.totalCount ? data.data.totalCount : '0';
 
- 				};
 
- 				if(!data.data.list.length){
 
- 					this.state.paginations.current=0
 
- 					this.state.paginations.total=0
 
- 				}
 
- 				this.setState({
 
- 					dataSourceData: theArr,
 
- 					paginations: this.state.paginations,
 
- 					selectedRowKeys:[]
 
- 				});
 
- 			}.bind(this),
 
- 		}).always(function() {
 
- 			this.setState({
 
- 				loading: false
 
- 			});
 
- 		}.bind(this));
 
- 	},
 
- 	getInitialState() {
 
- 		return {
 
- 			datauser: {},
 
- 			searchMore: true,
 
- 			selectedRowKeys: [],
 
- 			selectedRows: [],
 
- 			userDetaile: false,
 
- 			departmentArr: [],
 
- 			loading: false,
 
- 			roleArr:[],
 
- 			pagination: {
 
- 				defaultCurrent: 1,
 
- 				defaultPageSize: 10,
 
- 				showQuickJumper: true,
 
- 				pageSize: 10,
 
- 				onChange: function(page) {
 
- 					this.loadData(page);
 
- 				}.bind(this),
 
- 				showTotal: function(total) {
 
- 					return '共' + total + '条数据';
 
- 				}
 
- 			},
 
- 			paginations: {
 
- 				defaultCurrent: 1,
 
- 				defaultPageSize: 10,
 
- 				showQuickJumper: true,
 
- 				pageSize: 10,
 
- 				onChange: function(page) {
 
- 					this.loadDatas(page);
 
- 				}.bind(this),
 
- 				showTotal: function(total) {
 
- 					return '共' + total + '条数据';
 
- 				}
 
- 			},
 
- 			columns: [{
 
- 					title: '用户编号',
 
- 					dataIndex: 'userNo',
 
- 					key: 'userNo',
 
- 				}, {
 
- 					title: '登录用户名',
 
- 					dataIndex: 'mobile',
 
- 					key: 'mobile',
 
- 				}, {
 
- 					title: '角色',
 
- 					dataIndex: 'roles',
 
- 					key: 'roles',
 
- 				}, {
 
- 					title: '用户姓名',
 
- 					dataIndex: 'name',
 
- 					key: 'name',
 
- 				}, {
 
- 					title: '部门',
 
- 					dataIndex: 'departmentName',
 
- 					key: 'departmentName',
 
- 				}, {
 
- 					title: '职务',
 
- 					dataIndex: 'duty',
 
- 					key: 'duty',
 
- 					render: text => { return getPost(text) }
 
- 				},
 
- 				{
 
- 					title: '岗位',
 
- 					dataIndex: 'position',
 
- 					key: 'position',
 
- 					render: text => { return getStation(text) }
 
- 				},
 
- 				{
 
- 					title: '上级主管姓名',
 
- 					dataIndex: 'superior',
 
- 					key: 'superior',
 
- 				},
 
- 				{
 
- 					title: '状态',
 
- 					dataIndex: 'status',
 
- 					key: 'status',
 
- 				},
 
- 				{
 
- 					title: '最后登录时间',
 
- 					dataIndex: 'lastLoginTime',
 
- 					key: 'lastLoginTime',
 
- 				}
 
- 			],
 
- 			column: [{
 
- 					title: '用户编号',
 
- 					dataIndex: 'userNo',
 
- 					key: 'userNo',
 
- 				}, {
 
- 					title: '登录用户名',
 
- 					dataIndex: 'mobile',
 
- 					key: 'mobile',
 
- 				}, {
 
- 					title: '角色',
 
- 					dataIndex: 'roles',
 
- 					key: 'roles',
 
- 				}, {
 
- 					title: '用户姓名',
 
- 					dataIndex: 'name',
 
- 					key: 'name',
 
- 				}, {
 
-                     title: '转交',
 
-                     dataIndex: 'ee',
 
-                     key: 'ee',
 
-                     render: (text, record, index) => {
 
-                     	return <div>
 
- 							<Popconfirm title={'请确认转交【'+record.name+'】'} onConfirm={(e)=>{this.examineOK(record)}} okText="确认" cancelText="取消">
 
- 							    <Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation()}} type="primary">转交</Button>                 
 
- 							</Popconfirm>
 
-                         </div>
 
- 					}
 
-                 },
 
- 			],
 
- 			dataSourceData: [],
 
- 		};
 
- 	},
 
- 	//点击离职一键转交
 
- 	resources() {
 
- 		this.loadDatas();
 
- 		let deletedIds;
 
- 		let rowItem;
 
- 		for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
 
- 			rowItem = this.state.selectedRows[idx];
 
- 			// console.log(rowItem.id);
 
- 			if(rowItem.id) {
 
- 				deletedIds = rowItem.id;
 
- 			};
 
- 		};
 
- 		this.setState({
 
- 			visible: true,
 
- 			aid:deletedIds
 
- 		});
 
- 	},
 
- 	//关闭离职一键转交
 
- 	handleCancel(){
 
- 		this.setState({
 
- 			visible: false
 
- 		});
 
- 		this.resets();
 
- 	},
 
- 	//一键离职
 
- 	examineOK(record){
 
- 		console.log(record);
 
-         this.setState({
 
-             selectedRowKeys: [],
 
-             loading: true
 
-         });
 
-         $.ajax({
 
-             method: "POST",
 
-             dataType: "json",
 
-             crossDomain: false,
 
-             url: globalConfig.context + "/api/admin/role/dimission",
 
-             data: {
 
-             	aid:this.state.aid,
 
-             	transferId:record.id,
 
-                 
 
-             }
 
-         }).done(function (data) {
 
-             if (!data.error.length) {
 
-                 message.success('转交成功!');
 
-                 this.handleCancel()
 
-             } else {
 
-                 message.warning(data.error[0].message);
 
-             };
 
-             this.setState({
 
-                     loading: false,
 
-                     visible2: false
 
-                 });
 
-         }.bind(this));
 
- 	},
 
- 	componentWillMount() {
 
- 		this.loadData();
 
- 		this.departmentList();
 
- 		this.rolesList();
 
- 	},
 
- 	tableRowClick(record, index) {
 
- 		this.rolesArrS(record)
 
- 		this.setState({
 
- 			userDetaile:true,
 
- 			showDesc: true,
 
- 			datauser:record
 
- 		});
 
- 	},
 
- 	//新建获取id
 
- 	addIdS() {
 
- 		$.ajax({
 
- 			method: "get",
 
- 			dataType: "json",
 
- 			crossDomain: false,
 
- 			url: globalConfig.context + '/api/admin/superviser/newId',
 
- 			data: {},
 
- 			success: function(data) {
 
- 				this.setState({
 
- 					addId: data.data
 
- 				});
 
- 			}.bind(this),
 
- 		}).always(function() {
 
- 			this.setState({
 
- 				loading: false
 
- 			});
 
- 		}.bind(this));
 
- 	},
 
- 	//部门
 
- 	departmentList() {
 
- 		this.setState({
 
- 			loading: true
 
- 		});
 
- 		$.ajax({
 
- 			method: "get",
 
- 			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));
 
- 	},
 
- 	//修改时获取角色数组 
 
- 	rolesArrS(e) {
 
- 		$.ajax({
 
- 			method: "get",
 
- 			dataType: "json",
 
- 			crossDomain: false,
 
- 			url: globalConfig.context + "/api/admin/role",
 
- 			data: {
 
- 				uid:e.id
 
- 			},
 
- 			success: function(data) {
 
- 				let thedata = data.data;
 
- 				let theArr = [];
 
- 				let theId=[]
 
- 				if(!thedata) {
 
- 					if(data.error && data.error.length) {
 
- 						message.warning(data.error[0].message);
 
- 					};
 
- 					thedata = {};
 
- 				} else {
 
- 				
 
- 				}
 
- 				this.setState({
 
- 					role:thedata
 
- 				})
 
- 			}.bind(this),
 
- 		}).always(function() {
 
- 		}.bind(this));
 
- 	},
 
- 	//角色
 
- 	rolesList() {
 
- 		this.setState({
 
- 			loading: true
 
- 		});
 
- 		$.ajax({
 
- 			method: "get",
 
- 			dataType: "json",
 
- 			crossDomain: false,
 
- 			url: globalConfig.context + "/api/roles",
 
- 			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,
 
- 							roleName: item.roleName,
 
- 							id: item.id,
 
- 						})
 
- 					})
 
- 				}
 
- 				this.setState({
 
- 					roleArr: theArr,
 
- 				})
 
- 			}.bind(this),
 
- 		}).always(function() {
 
- 			this.setState({
 
- 				loading: false
 
- 			});
 
- 		}.bind(this));
 
- 	},
 
- 	
 
- 	//锁定
 
- 	locking() {
 
- 		let deletedIds;
 
- 		let statust;
 
- 		let mobiles;
 
- 		let names;
 
- 		let rolesId=[];
 
- 		for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
 
- 			let rowItem = this.state.selectedRows[idx];
 
- 			if(rowItem.id) {
 
- 				deletedIds=rowItem.id;
 
- 				statust=rowItem.status;
 
- 				names=rowItem.name;
 
- 				mobiles=rowItem.mobile;
 
- 				rolesId=rowItem.rolesId
 
- 			};
 
- 		};
 
- 			this.setState({
 
- 				selectedRowKeys: [],
 
- 				loading: true
 
- 			});
 
- 			$.ajax({
 
- 				method: "POST",
 
- 				dataType: "json",
 
- 				crossDomain: false,
 
- 				url: globalConfig.context + "/api/admin/superviser/updateAdmin",
 
- 				data: {
 
- 					roles:rolesId,
 
- 					data:JSON.stringify({
 
- 						id: deletedIds,
 
- 						status: '锁定',
 
- 						name: names,
 
- 						mobile: mobiles,
 
- 					}),
 
- 				}
 
- 			}).done(function(data) {
 
- 				if(!data.error.length) {
 
- 					message.success('锁定成功!');
 
- 					this.setState({
 
- 						loading: false,
 
- 					});
 
- 				} else {
 
- 					message.warning(data.error[0].message);
 
- 				};
 
- 				this.loadData();
 
- 			}.bind(this));
 
- 	
 
- 	},
 
- 	//激活
 
- 	activation() {
 
- 		let deletedIds;
 
- 		let statust;
 
- 		let mobiles;
 
- 		let names;
 
- 		let rolesId=[]
 
- 		for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
 
- 			let rowItem = this.state.selectedRows[idx];
 
- 			if(rowItem.id) {
 
- 				deletedIds=rowItem.id;
 
- 				statust=rowItem.status;
 
- 				names=rowItem.name;
 
- 				mobiles=rowItem.mobile;
 
- 				rolesId=rowItem.rolesId
 
- 			};
 
- 		};
 
- 		
 
- 			this.setState({
 
- 				selectedRowKeys: [],
 
- 				loading: true
 
- 			});
 
- 			$.ajax({
 
- 				method: "POST",
 
- 				dataType: "json",
 
- 				crossDomain: false,
 
- 				url: globalConfig.context + "/api/admin/superviser/updateAdmin",
 
- 				data: {
 
- 					roles:rolesId,
 
- 					data:JSON.stringify({
 
- 						id: deletedIds,
 
- 						status: '正常',
 
- 						name: names,
 
- 						mobile: mobiles,
 
- 					})
 
- 				}
 
- 			}).done(function(data) {
 
- 				if(!data.error.length) {
 
- 					message.success('激活成功!');
 
- 					this.setState({
 
- 						loading: false,
 
- 					});
 
- 				} else {
 
- 					message.warning(data.error[0].message);
 
- 				};
 
- 				this.loadData();
 
- 			}.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: true
 
- 		});
 
- 		$.ajax({
 
- 			method: "POST",
 
- 			dataType: "json",
 
- 			crossDomain: false,
 
- 			url: globalConfig.context + "/api/admin/superviser/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.loadData(this.state.page);
 
- 		}.bind(this));
 
- 	},
 
- 	addClick() {
 
- 		this.addIdS()
 
- 		this.state.userDetaile = false;
 
- 		this.setState({
 
- 			showDesc: true
 
- 		});
 
- 	},
 
- 	
 
- 	closeDesc(e, s) {
 
- 		this.state.userDetaile=false;
 
- 		this.state.showDesc = e;
 
- 		if(s) {
 
- 			this.loadData(this.state.page);
 
- 		};
 
- 	},
 
- 	search() {
 
- 		this.state.userDetaile = false
 
- 		this.loadData();
 
- 	},
 
- 	searchs() {
 
- 		this.state.userDetaile = false
 
- 		this.loadDatas();
 
- 	},
 
- 	reset() {
 
- 		this.state.userNameSearch = '';
 
- 		this.state.organizationSearch = undefined;
 
- 		this.state.rolesSearch = undefined;
 
- 		this.state.postSearch = undefined;
 
- 		this.state.stationSearch = undefined;
 
- 		this.state.statusSeach = undefined;
 
- 		this.state.signNameSearch = '';
 
- 		this.state.mobileSearch = '';
 
- 		this.state.auto = '';
 
- 		this.state.theTypes='';
 
- 		this.loadData();
 
- 	},
 
- 	resets() {
 
- 		this.state.userNameSearchs = '';
 
- 		this.state.organizationSearch = undefined;
 
- 		this.state.rolesSearch = undefined;
 
- 		this.state.postSearch = undefined;
 
- 		this.state.stationSearch = undefined;
 
- 		this.state.statusSeach = undefined;
 
- 		this.state.signNameSearch = '';
 
- 		this.state.mobileSearch = '';
 
- 		this.state.auto = '';
 
- 		this.state.theTypes='';
 
- 		this.loadDatas();
 
- 	},
 
- 	searchSwitch() {
 
- 		this.setState({
 
- 			searchMore: !this.state.searchMore
 
- 		});
 
- 	},
 
- 	//主管初始加载(自动补全)
 
- 	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({
 
- 			auto: value
 
- 		})
 
- 	},
 
- 	blurChange(e) {
 
- 		let theType = '';
 
- 		let contactLists = this.state.customerArr || [];
 
- 		if(e) {
 
- 			contactLists.map(function(item) {
 
- 				if(item.name == e.toString()) {
 
- 					theType = item.id;
 
- 				}
 
- 			});
 
- 		}
 
- 		this.setState({
 
- 			theTypes: theType
 
- 		})
 
- 	},
 
- 	//值改变时请求客户名称
 
- 	httpChange(e) {
 
- 		if(e.length >= 1) {
 
- 			this.supervisor(e);
 
- 		}
 
- 		this.setState({
 
- 			auto: e
 
- 		})
 
- 	},
 
- 	render() {
 
- 		const rowSelection = {
 
- 			selectedRowKeys: this.state.selectedRowKeys,
 
- 			onChange: (selectedRowKeys, selectedRows) => {
 
- 				this.setState({
 
- 					selectedRows: selectedRows.slice(-1),
 
- 					selectedRowKeys: selectedRowKeys.slice(-1)
 
- 				});
 
- 			},
 
- 			onSelectAll: (selected, selectedRows, changeRows) => {
 
- 				this.setState({
 
- 					selectedRowKeys: []
 
- 				})
 
- 			},
 
- 		};
 
- 		const dataSources = this.state.customerArr || [];
 
- 		const options = dataSources.map((group, index) =>
 
- 			<Select.Option key={index} value={group.name}>{group.name}</Select.Option>
 
- 		)
 
- 		const hasSelected = this.state.selectedRowKeys.length > 0;
 
- 		const { RangePicker } = DatePicker;
 
- 		let departmentArr = this.state.departmentArr || [];
 
- 		let roleArr = this.state.roleArr || [];
 
- 		return (
 
-       <div className="user-content">
 
-         <div className="content-title">
 
-           <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
 
-             <TabPane tab="搜索" key="1">
 
-               <div className="user-search">
 
-                 <Input
 
-                   placeholder="用户姓名"
 
-                   style={{ width: "150px" }}
 
-                   value={this.state.userNameSearch}
 
-                   onChange={e => {
 
-                     this.setState({ userNameSearch: e.target.value });
 
-                   }}
 
-                 />
 
-                 {window.adminData.isSuperAdmin ? (
 
-                   <Select
 
-                     placeholder="部门"
 
-                     style={{ width: 160 }}
 
-                     value={this.state.organizationSearch}
 
-                     onChange={e => {
 
-                       this.setState({ organizationSearch: e });
 
-                     }}
 
-                   >
 
-                     {departmentArr.map(function(item) {
 
-                       return (
 
-                         <Select.Option key={item.id}>{item.name}</Select.Option>
 
-                       );
 
-                     })}
 
-                   </Select>
 
-                 ) : (
 
-                   ""
 
-                 )}
 
-                 <Select
 
-                   placeholder="角色"
 
-                   style={{ width: 160 }}
 
-                   value={this.state.rolesSearch}
 
-                   onChange={e => {
 
-                     this.setState({ rolesSearch: e });
 
-                   }}
 
-                 >
 
-                   {roleArr.map(function(item) {
 
-                     return (
 
-                       <Select.Option key={item.id}>
 
-                         {item.roleName}
 
-                       </Select.Option>
 
-                     );
 
-                   })}
 
-                 </Select>
 
-                 <div
 
-                   className="search-more"
 
-                   style={{ display: "inline-block" }}
 
-                 >
 
-                   <Select
 
-                     placeholder="职务"
 
-                     style={{ width: 160 }}
 
-                     value={this.state.postSearch}
 
-                     onChange={e => {
 
-                       this.setState({ postSearch: e });
 
-                     }}
 
-                   >
 
-                     {post.map(function(item) {
 
-                       return (
 
-                         <Select.Option key={item.value}>
 
-                           {item.key}
 
-                         </Select.Option>
 
-                       );
 
-                     })}
 
-                   </Select>
 
-                   <Select
 
-                     placeholder="岗位"
 
-                     style={{ width: 160 }}
 
-                     value={this.state.stationSearch}
 
-                     onChange={e => {
 
-                       this.setState({ stationSearch: e });
 
-                     }}
 
-                   >
 
-                     {station.map(function(item) {
 
-                       return (
 
-                         <Select.Option key={item.value}>
 
-                           {item.key}
 
-                         </Select.Option>
 
-                       );
 
-                     })}
 
-                   </Select>
 
-                   <Select
 
-                     placeholder="状态"
 
-                     style={{ width: 160 }}
 
-                     value={this.state.statusSeach}
 
-                     onChange={e => {
 
-                       this.setState({ statusSeach: e });
 
-                     }}
 
-                   >
 
-                     <Select.Option value="正常">正常</Select.Option>
 
-                     <Select.Option value="锁定">锁定</Select.Option>
 
-                     <Select.Option value="注销">注销</Select.Option>
 
-                   </Select>
 
-                   <Input
 
-                     placeholder="登录用户名"
 
-                     style={{ width: "150px" }}
 
-                     value={this.state.signNameSearch}
 
-                     onChange={e => {
 
-                       this.setState({ signNameSearch: e.target.value });
 
-                     }}
 
-                   />
 
-                   <AutoComplete
 
-                     className="certain-category-search"
 
-                     dropdownClassName="certain-category-search-dropdown"
 
-                     dropdownMatchSelectWidth={false}
 
-                     dropdownStyle={{ width: 200 }}
 
-                     size="large"
 
-                     style={{
 
-                       width: "150px",
 
-                       height: "28px",
 
-                       marginLeft: "10px"
 
-                     }}
 
-                     dataSource={options}
 
-                     placeholder="输入上级主管名字"
 
-                     value={this.state.auto}
 
-                     onChange={this.httpChange}
 
-                     filterOption={true}
 
-                     onBlur={this.blurChange}
 
-                     onSelect={this.selectAuto}
 
-                   >
 
-                     <Input />
 
-                   </AutoComplete>
 
-                 </div>
 
-                 <Button type="primary" onClick={this.search}>
 
-                   搜索
 
-                 </Button>
 
-                 <Button onClick={this.reset}>重置</Button>
 
-                 <Button
 
-                   style={{ background: "red", border: "none", color: "#fff" }}
 
-                   disabled={!hasSelected}
 
-                   onClick={this.delectRow}
 
-                   style={{ display: "none" }}
 
-                 >
 
-                   删除
 
-                   <Icon type="minus" />
 
-                 </Button>
 
-                 {/* <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span> */}
 
-               </div>
 
-             </TabPane>
 
-             <TabPane tab="操作" key="2">
 
-               <Button
 
-                 style={{
 
-                   background: "#333333",
 
-                   border: "none",
 
-                   color: "#fff",
 
- 				  marginBottom: 10,
 
- 				  marginTop: 12,
 
-                   marginRight: 10
 
-                 }}
 
-                 disabled={!hasSelected}
 
-                 onClick={this.locking}
 
-               >
 
-                 锁定
 
-                 <Icon type="lock" />
 
-               </Button>
 
-               <Button
 
-                 style={{ background: "green", border: "none", color: "#fff", marginTop: 12 }}
 
-                 disabled={!hasSelected}
 
-                 onClick={this.activation}
 
-               >
 
-                 激活
 
-                 <Icon type="unlock" />
 
-               </Button>
 
-               {/* </TabPane>
 
- 					 <TabPane tab="新增" key="3"> */}
 
-               <Button
 
-                 type="primary"
 
-                 className="addButton"
 
-                 style={{ float: "left", marginBottom: 10, marginTop: 12 }}
 
-                 onClick={this.addClick}
 
-               >
 
-                 新增用户
 
-                 <Icon type="user" />
 
-               </Button>
 
-               {/* </TabPane>
 
- 					 <TabPane tab="离职转交" key="4"> */}
 
-               <Button
 
-                 type="primary"
 
-                 className="addButton"
 
-                 style={{ float: "left", marginBottom: 10, marginTop: 12 }}
 
-                 onClick={this.resources}
 
-                 disabled={!hasSelected}
 
-               >
 
-                 离职一键转交
 
-                 <Icon type="user" />
 
-               </Button>
 
-             </TabPane>
 
-           </Tabs>
 
-           <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>
 
-           <Newuser
 
-             role={this.state.role}
 
-             addId={this.state.addId}
 
-             roleArr={this.state.roleArr}
 
-             departmentArr={this.state.departmentArr}
 
-             userDetaile={this.state.userDetaile}
 
-             datauser={this.state.datauser}
 
-             showDesc={this.state.showDesc}
 
-             closeDesc={this.closeDesc}
 
-           />
 
-           <div className="patent-desc">
 
-             <Modal
 
-               maskClosable={false}
 
-               visible={this.state.visible}
 
-               onOk={this.checkResources}
 
-               onCancel={this.handleCancel}
 
-               width="800px"
 
-               title="离职一键转交"
 
-               footer=""
 
-               className="admin-desc-content"
 
-             >
 
-               <Input
 
-                 placeholder="用户姓名"
 
-                 style={{
 
-                   width: "150px",
 
-                   marginRight: "10px",
 
-                   marginBottom: "10px"
 
-                 }}
 
-                 value={this.state.userNameSearchs}
 
-                 onChange={e => {
 
-                   this.setState({ userNameSearchs: e.target.value });
 
-                 }}
 
-               />
 
-               <Button type="primary" onClick={this.searchs}>
 
-                 搜索
 
-               </Button>
 
-               <Button onClick={this.resets}>重置</Button>
 
-               <div className="patent-table">
 
-                 <Spin spinning={this.state.loading}>
 
-                   <Table
 
-                     columns={this.state.column}
 
-                     dataSource={this.state.dataSourceData}
 
-                     pagination={this.state.paginations}
 
-                     onRowClick={this.tableRowClick}
 
-                   />
 
-                 </Spin>
 
-               </div>
 
-             </Modal>
 
-           </div>
 
-         </div>
 
-       </div>
 
-     );
 
- 	}
 
- }));
 
- export default User;
 
 
  |