user.jsx 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034
  1. import React from 'react';
  2. import ReactDom from 'react-dom';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import { Form, Radio, Icon, Button, Input, Select, AutoComplete, Spin, Table, Switch, message, DatePicker, Modal, Upload,Popconfirm,Tabs } from 'antd';
  6. import Newuser from "./newUser.jsx"
  7. import './userMangagement.less'
  8. import { techAuditStatusList, station, post } from '../../../dataDic.js';
  9. import {getPost,getStation} from '../../../tools.js';
  10. import {ChooseList} from "../../order/orderNew/chooseList";
  11. const {TabPane} = Tabs
  12. const User = Form.create()(React.createClass({
  13. loadData(pageNo) {
  14. this.state.data = [];
  15. this.setState({
  16. userDetaile:false,
  17. loading: true,
  18. page:pageNo
  19. });
  20. var admin=window.adminData.isSuperAdmin||'';
  21. var departmentId=window.adminData.departmentId||'';
  22. $.ajax({
  23. method: "get",
  24. dataType: "json",
  25. crossDomain: false,
  26. url: globalConfig.context + '/api/admin/superviser/adminList',
  27. data: {
  28. pageNo: pageNo || 1,
  29. pageSize: this.state.pagination.pageSize,
  30. name: this.state.userNameSearch,
  31. departmentId: admin?this.state.organizationSearch:departmentId,
  32. rid: this.state.rolesSearch,
  33. duty: this.state.postSearch,
  34. position: this.state.stationSearch,
  35. status: this.state.statusSeach,
  36. mobile: this.state.signNameSearch,
  37. superiorId: this.state.theTypes
  38. },
  39. success: function(data) {
  40. let theArr = [];
  41. if(!data.data || !data.data.list) {
  42. if(data.error && data.error.length) {
  43. message.warning(data.error[0].message);
  44. };
  45. } else {
  46. for(let i = 0; i < data.data.list.length; i++) {
  47. let thisdata = data.data.list[i];
  48. theArr.push({
  49. key: i,
  50. id: thisdata.id,
  51. mobile: thisdata.mobile,
  52. name: thisdata.name,
  53. email: thisdata.email,
  54. createTime: thisdata.createTime,
  55. province: thisdata.province,
  56. position: thisdata.position,
  57. superior: thisdata.superior, //上级名称
  58. superiorId: thisdata.superiorId, //上级Id
  59. duty: thisdata.duty, //职务
  60. status: thisdata.status,
  61. userNo: thisdata.userNo,
  62. departmentName: thisdata.departmentName, //部门名称
  63. departmentId: thisdata.departmentId, //部门id
  64. roles:thisdata.roles[0],
  65. rolesId:thisdata.rolesId,
  66. lastLoginTime:thisdata.lastLoginTime,
  67. });
  68. };
  69. this.state.pagination.current = data.data.pageNo ? data.data.pageNo : '0';
  70. this.state.pagination.total = data.data.totalCount ? data.data.totalCount : '0';
  71. };
  72. if(!data.data.list.length){
  73. this.state.pagination.current=0
  74. this.state.pagination.total=0
  75. }
  76. this.setState({
  77. dataSource: theArr,
  78. pagination: this.state.pagination,
  79. selectedRowKeys:[]
  80. });
  81. }.bind(this),
  82. }).always(function() {
  83. this.setState({
  84. loading: false
  85. });
  86. }.bind(this));
  87. },
  88. loadDatas(pageNo) {
  89. this.state.data = [];
  90. this.setState({
  91. userDetaile:false,
  92. loading: true,
  93. });
  94. var admin=window.adminData.isSuperAdmin||'';
  95. var departmentId=window.adminData.departmentId||'';
  96. $.ajax({
  97. method: "get",
  98. dataType: "json",
  99. crossDomain: false,
  100. url: globalConfig.context + '/api/admin/superviser/adminList',
  101. data: {
  102. pageNo: pageNo || 1,
  103. pageSize: this.state.paginations.pageSize,
  104. name: this.state.userNameSearchs,
  105. status: "正常"
  106. // departmentId: admin?this.state.organizationSearch:departmentId,
  107. // rid: this.state.rolesSearch,
  108. // duty: this.state.postSearch,
  109. // position: this.state.stationSearch,
  110. // status: this.state.statusSeach,
  111. // mobile: this.state.signNameSearch,
  112. // superiorId: this.state.theTypes
  113. },
  114. success: function(data) {
  115. let theArr = [];
  116. if(!data.data || !data.data.list) {
  117. if(data.error && data.error.length) {
  118. message.warning(data.error[0].message);
  119. };
  120. } else {
  121. for(let i = 0; i < data.data.list.length; i++) {
  122. let thisdata = data.data.list[i];
  123. theArr.push({
  124. key: i,
  125. id: thisdata.id,
  126. mobile: thisdata.mobile,
  127. name: thisdata.name,
  128. email: thisdata.email,
  129. createTime: thisdata.createTime,
  130. province: thisdata.province,
  131. position: thisdata.position,
  132. superior: thisdata.superior, //上级名称
  133. superiorId: thisdata.superiorId, //上级Id
  134. duty: thisdata.duty, //职务
  135. status: thisdata.status,
  136. userNo: thisdata.userNo,
  137. departmentName: thisdata.departmentName, //部门名称
  138. departmentId: thisdata.departmentId, //部门id
  139. roles:thisdata.roles[0],
  140. rolesId:thisdata.rolesId
  141. });
  142. };
  143. this.state.paginations.current = data.data.pageNo ? data.data.pageNo : '0';
  144. this.state.paginations.total = data.data.totalCount ? data.data.totalCount : '0';
  145. };
  146. if(!data.data.list.length){
  147. this.state.paginations.current=0
  148. this.state.paginations.total=0
  149. }
  150. this.setState({
  151. dataSourceData: theArr,
  152. paginations: this.state.paginations,
  153. });
  154. }.bind(this),
  155. }).always(function() {
  156. this.setState({
  157. loading: false
  158. });
  159. }.bind(this));
  160. },
  161. getInitialState() {
  162. return {
  163. datauser: {},
  164. searchMore: true,
  165. selectedRowKeys: [],
  166. selectedRows: [],
  167. userDetaile: false,
  168. departmentArr: [],
  169. loading: false,
  170. roleArr:[],
  171. pagination: {
  172. defaultCurrent: 1,
  173. defaultPageSize: 10,
  174. showQuickJumper: true,
  175. pageSize: 10,
  176. onChange: function(page) {
  177. this.loadData(page);
  178. }.bind(this),
  179. showTotal: function(total) {
  180. return '共' + total + '条数据';
  181. }
  182. },
  183. paginations: {
  184. defaultCurrent: 1,
  185. defaultPageSize: 10,
  186. showQuickJumper: true,
  187. pageSize: 10,
  188. onChange: function(page) {
  189. this.loadDatas(page);
  190. }.bind(this),
  191. showTotal: function(total) {
  192. return '共' + total + '条数据';
  193. }
  194. },
  195. columns: [{
  196. title: '用户编号',
  197. dataIndex: 'userNo',
  198. key: 'userNo',
  199. }, {
  200. title: '登录用户名',
  201. dataIndex: 'mobile',
  202. key: 'mobile',
  203. }, {
  204. title: '角色',
  205. dataIndex: 'roles',
  206. key: 'roles',
  207. }, {
  208. title: '用户姓名',
  209. dataIndex: 'name',
  210. key: 'name',
  211. }, {
  212. title: '部门',
  213. dataIndex: 'departmentName',
  214. key: 'departmentName',
  215. }, {
  216. title: '职务',
  217. dataIndex: 'duty',
  218. key: 'duty',
  219. render: text => { return getPost(text) }
  220. },
  221. {
  222. title: '岗位',
  223. dataIndex: 'position',
  224. key: 'position',
  225. render: text => { return getStation(text) }
  226. },
  227. {
  228. title: '上级主管姓名',
  229. dataIndex: 'superior',
  230. key: 'superior',
  231. },
  232. {
  233. title: '状态',
  234. dataIndex: 'status',
  235. key: 'status',
  236. },
  237. {
  238. title: '最后登录时间',
  239. dataIndex: 'lastLoginTime',
  240. key: 'lastLoginTime',
  241. }
  242. ],
  243. column: [{
  244. title: '用户编号',
  245. dataIndex: 'userNo',
  246. key: 'userNo',
  247. }, {
  248. title: '登录用户名',
  249. dataIndex: 'mobile',
  250. key: 'mobile',
  251. }, {
  252. title: '角色',
  253. dataIndex: 'roles',
  254. key: 'roles',
  255. }, {
  256. title: '用户姓名',
  257. dataIndex: 'name',
  258. key: 'name',
  259. }, {
  260. title: '转交',
  261. dataIndex: 'ee',
  262. key: 'ee',
  263. render: (text, record, index) => {
  264. return <div>
  265. <Popconfirm title={'请确认转交【'+record.name+'】'} onConfirm={(e)=>{this.examineOK(record)}} okText="确认" cancelText="取消">
  266. <Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation()}} type="primary">转交</Button>
  267. </Popconfirm>
  268. </div>
  269. }
  270. },
  271. ],
  272. dataSourceData: [],
  273. };
  274. },
  275. //点击离职一键转交
  276. resources() {
  277. this.loadDatas();
  278. let deletedIds;
  279. let rowItem;
  280. for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
  281. rowItem = this.state.selectedRows[idx];
  282. // console.log(rowItem.id);
  283. if(rowItem.id) {
  284. deletedIds = rowItem.id;
  285. };
  286. };
  287. this.setState({
  288. visible: true,
  289. aid:deletedIds
  290. });
  291. },
  292. //关闭离职一键转交
  293. handleCancel(){
  294. this.setState({
  295. visible: false,
  296. selectedRowKeys:[]
  297. },()=>{
  298. this.loadData(this.state.page);
  299. });
  300. },
  301. //一键离职
  302. examineOK(record){
  303. console.log(record);
  304. this.setState({
  305. loading: true
  306. });
  307. $.ajax({
  308. method: "POST",
  309. dataType: "json",
  310. crossDomain: false,
  311. url: globalConfig.context + "/api/admin/role/dimission",
  312. data: {
  313. aid:this.state.aid,
  314. transferId:record.id,
  315. }
  316. }).done(function (data) {
  317. if (!data.error.length) {
  318. message.success('转交成功!');
  319. this.handleCancel()
  320. } else {
  321. message.warning(data.error[0].message);
  322. };
  323. this.setState({
  324. loading: false,
  325. visible2: false
  326. });
  327. }.bind(this));
  328. },
  329. componentWillMount() {
  330. this.loadData();
  331. this.departmentList();
  332. this.rolesList();
  333. },
  334. tableRowClick(record, index) {
  335. this.rolesArrS(record)
  336. this.setState({
  337. userDetaile:true,
  338. showDesc: true,
  339. datauser:record
  340. });
  341. },
  342. //新建获取id
  343. addIdS() {
  344. $.ajax({
  345. method: "get",
  346. dataType: "json",
  347. crossDomain: false,
  348. url: globalConfig.context + '/api/admin/superviser/newId',
  349. data: {},
  350. success: function(data) {
  351. this.setState({
  352. addId: data.data
  353. });
  354. }.bind(this),
  355. }).always(function() {
  356. this.setState({
  357. loading: false
  358. });
  359. }.bind(this));
  360. },
  361. //部门
  362. departmentList() {
  363. this.setState({
  364. loading: true
  365. });
  366. $.ajax({
  367. method: "get",
  368. dataType: "json",
  369. crossDomain: false,
  370. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  371. data: {
  372. },
  373. success: function(data) {
  374. let thedata = data.data;
  375. let theArr = [];
  376. if(!thedata) {
  377. if(data.error && data.error.length) {
  378. message.warning(data.error[0].message);
  379. };
  380. thedata = {};
  381. } else {
  382. thedata.map(function(item, index) {
  383. theArr.push({
  384. key: index,
  385. name: item.name,
  386. id: item.id,
  387. depNo: item.depNo
  388. })
  389. })
  390. }
  391. this.setState({
  392. departmentArr: theArr,
  393. })
  394. }.bind(this),
  395. }).always(function() {
  396. this.setState({
  397. loading: false
  398. });
  399. }.bind(this));
  400. },
  401. //修改时获取角色数组
  402. rolesArrS(e) {
  403. $.ajax({
  404. method: "get",
  405. dataType: "json",
  406. crossDomain: false,
  407. url: globalConfig.context + "/api/admin/role",
  408. data: {
  409. uid:e.id
  410. },
  411. success: function(data) {
  412. let thedata = data.data;
  413. let theArr = [];
  414. let theId=[]
  415. if(!thedata) {
  416. if(data.error && data.error.length) {
  417. message.warning(data.error[0].message);
  418. };
  419. thedata = {};
  420. } else {
  421. }
  422. this.setState({
  423. role:thedata
  424. })
  425. }.bind(this),
  426. }).always(function() {
  427. }.bind(this));
  428. },
  429. //角色
  430. rolesList() {
  431. this.setState({
  432. loading: true
  433. });
  434. $.ajax({
  435. method: "get",
  436. dataType: "json",
  437. crossDomain: false,
  438. url: globalConfig.context + "/api/roles",
  439. data: {
  440. },
  441. success: function(data) {
  442. let thedata = data.data;
  443. let theArr = [];
  444. if(!thedata) {
  445. if(data.error && data.error.length) {
  446. message.warning(data.error[0].message);
  447. };
  448. thedata = {};
  449. } else {
  450. thedata.map(function(item, index) {
  451. theArr.push({
  452. key: index,
  453. roleName: item.roleName,
  454. id: item.id,
  455. })
  456. })
  457. }
  458. this.setState({
  459. roleArr: theArr,
  460. })
  461. }.bind(this),
  462. }).always(function() {
  463. this.setState({
  464. loading: false
  465. });
  466. }.bind(this));
  467. },
  468. //锁定
  469. locking() {
  470. let deletedIds;
  471. let statust;
  472. let mobiles;
  473. let names;
  474. let rolesId=[];
  475. for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
  476. let rowItem = this.state.selectedRows[idx];
  477. if(rowItem.id) {
  478. deletedIds=rowItem.id;
  479. statust=rowItem.status;
  480. names=rowItem.name;
  481. mobiles=rowItem.mobile;
  482. rolesId=rowItem.rolesId
  483. };
  484. };
  485. this.setState({
  486. selectedRowKeys: [],
  487. loading: true
  488. });
  489. $.ajax({
  490. method: "POST",
  491. dataType: "json",
  492. crossDomain: false,
  493. url: globalConfig.context + "/api/admin/superviser/updateAdmin",
  494. data: {
  495. roles:rolesId,
  496. data:JSON.stringify({
  497. id: deletedIds,
  498. status: '锁定',
  499. name: names,
  500. mobile: mobiles,
  501. }),
  502. }
  503. }).done(function(data) {
  504. if(!data.error.length) {
  505. message.success('锁定成功!');
  506. this.setState({
  507. loading: false,
  508. });
  509. } else {
  510. message.warning(data.error[0].message);
  511. };
  512. this.loadData();
  513. }.bind(this));
  514. },
  515. //激活
  516. activation() {
  517. let deletedIds;
  518. let statust;
  519. let mobiles;
  520. let names;
  521. let rolesId=[]
  522. for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
  523. let rowItem = this.state.selectedRows[idx];
  524. if(rowItem.id) {
  525. deletedIds=rowItem.id;
  526. statust=rowItem.status;
  527. names=rowItem.name;
  528. mobiles=rowItem.mobile;
  529. rolesId=rowItem.rolesId
  530. };
  531. };
  532. this.setState({
  533. selectedRowKeys: [],
  534. loading: true
  535. });
  536. $.ajax({
  537. method: "POST",
  538. dataType: "json",
  539. crossDomain: false,
  540. url: globalConfig.context + "/api/admin/superviser/updateAdmin",
  541. data: {
  542. roles:rolesId,
  543. data:JSON.stringify({
  544. id: deletedIds,
  545. status: '正常',
  546. name: names,
  547. mobile: mobiles,
  548. })
  549. }
  550. }).done(function(data) {
  551. if(!data.error.length) {
  552. message.success('激活成功!');
  553. this.setState({
  554. loading: false,
  555. });
  556. } else {
  557. message.warning(data.error[0].message);
  558. };
  559. this.loadData();
  560. }.bind(this));
  561. },
  562. //删除
  563. delectRow() {
  564. let deletedIds;
  565. for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
  566. let rowItem = this.state.selectedRows[idx];
  567. if(rowItem.id) {
  568. deletedIds=rowItem.id;
  569. };
  570. };
  571. this.setState({
  572. selectedRowKeys: [],
  573. loading: true
  574. });
  575. $.ajax({
  576. method: "POST",
  577. dataType: "json",
  578. crossDomain: false,
  579. url: globalConfig.context + "/api/admin/superviser/deleteById",
  580. data: {
  581. id: deletedIds,
  582. }
  583. }).done(function(data) {
  584. if(!data.error.length) {
  585. message.success('删除成功!');
  586. this.setState({
  587. loading: false,
  588. });
  589. } else {
  590. message.warning(data.error[0].message);
  591. };
  592. this.loadData(this.state.page);
  593. }.bind(this));
  594. },
  595. addClick() {
  596. this.addIdS()
  597. this.state.userDetaile = false;
  598. this.setState({
  599. showDesc: true
  600. });
  601. },
  602. closeDesc(e, s) {
  603. this.state.userDetaile=false;
  604. this.state.showDesc = e;
  605. if(s) {
  606. this.loadData(this.state.page);
  607. };
  608. },
  609. search() {
  610. this.state.userDetaile = false
  611. this.loadData();
  612. },
  613. searchs() {
  614. this.state.userDetaile = false
  615. this.loadDatas();
  616. },
  617. reset() {
  618. this.state.userNameSearch = '';
  619. this.state.organizationSearch = undefined;
  620. this.state.rolesSearch = undefined;
  621. this.state.postSearch = undefined;
  622. this.state.stationSearch = undefined;
  623. this.state.statusSeach = undefined;
  624. this.state.signNameSearch = '';
  625. this.state.mobileSearch = '';
  626. this.state.auto = '';
  627. this.state.theTypes='';
  628. this.loadData();
  629. },
  630. resets() {
  631. this.state.userNameSearchs = '';
  632. this.state.organizationSearch = undefined;
  633. this.state.rolesSearch = undefined;
  634. this.state.postSearch = undefined;
  635. this.state.stationSearch = undefined;
  636. this.state.statusSeach = undefined;
  637. this.state.signNameSearch = '';
  638. this.state.mobileSearch = '';
  639. this.state.auto = '';
  640. this.state.theTypes='';
  641. this.loadDatas();
  642. },
  643. searchSwitch() {
  644. this.setState({
  645. searchMore: !this.state.searchMore
  646. });
  647. },
  648. //主管初始加载(自动补全)
  649. supervisor(e) {
  650. $.ajax({
  651. method: "post",
  652. dataType: "json",
  653. crossDomain: false,
  654. url: globalConfig.context + "/api/admin/organization/selectName",
  655. data: {
  656. name: e
  657. },
  658. success: function(data) {
  659. let thedata = data.data;
  660. if(!thedata) {
  661. if(data.error && data.error.length) {
  662. message.warning(data.error[0].message);
  663. };
  664. thedata = {};
  665. };
  666. this.setState({
  667. customerArr: thedata,
  668. });
  669. }.bind(this),
  670. }).always(function() {
  671. this.setState({
  672. loading: false
  673. });
  674. }.bind(this));
  675. },
  676. //上级主管输入框失去焦点是判断客户是否存在
  677. selectAuto(value, options) {
  678. this.setState({
  679. auto: value
  680. })
  681. },
  682. blurChange(e) {
  683. let theType = '';
  684. let contactLists = this.state.customerArr || [];
  685. if(e) {
  686. contactLists.map(function(item) {
  687. if(item.name == e.toString()) {
  688. theType = item.id;
  689. }
  690. });
  691. }
  692. this.setState({
  693. theTypes: theType
  694. })
  695. },
  696. //值改变时请求客户名称
  697. httpChange(e) {
  698. if(e.length >= 1) {
  699. this.supervisor(e);
  700. }
  701. this.setState({
  702. auto: e
  703. })
  704. },
  705. changeList(arr) {
  706. const newArr = [];
  707. this.state.columns.forEach(item => {
  708. arr.forEach(val => {
  709. if (val === item.title) {
  710. newArr.push(item);
  711. }
  712. });
  713. });
  714. this.setState({
  715. changeList: newArr
  716. });
  717. },
  718. render() {
  719. const rowSelection = {
  720. selectedRowKeys: this.state.selectedRowKeys,
  721. onChange: (selectedRowKeys, selectedRows) => {
  722. this.setState({
  723. selectedRows: selectedRows.slice(-1),
  724. selectedRowKeys: selectedRowKeys.slice(-1)
  725. });
  726. },
  727. onSelectAll: (selected, selectedRows, changeRows) => {
  728. this.setState({
  729. selectedRowKeys: []
  730. })
  731. },
  732. };
  733. const dataSources = this.state.customerArr || [];
  734. const options = dataSources.map((group, index) =>
  735. <Select.Option key={index} value={group.name}>{group.name}</Select.Option>
  736. )
  737. const hasSelected = this.state.selectedRowKeys.length > 0;
  738. const { RangePicker } = DatePicker;
  739. let departmentArr = this.state.departmentArr || [];
  740. let roleArr = this.state.roleArr || [];
  741. return (
  742. <div className="user-content">
  743. <div className="content-title">
  744. <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
  745. <TabPane tab="搜索" key="1">
  746. <div className="user-search">
  747. <Input
  748. placeholder="用户姓名"
  749. style={{ width: "150px" }}
  750. value={this.state.userNameSearch}
  751. onChange={e => {
  752. this.setState({ userNameSearch: e.target.value });
  753. }}
  754. />
  755. {window.adminData.isSuperAdmin ? (
  756. <Select
  757. placeholder="部门"
  758. style={{ width: 160 }}
  759. value={this.state.organizationSearch}
  760. onChange={e => {
  761. this.setState({ organizationSearch: e });
  762. }}
  763. >
  764. {departmentArr.map(function(item) {
  765. return (
  766. <Select.Option key={item.id}>{item.name}</Select.Option>
  767. );
  768. })}
  769. </Select>
  770. ) : (
  771. ""
  772. )}
  773. <Select
  774. placeholder="角色"
  775. style={{ width: 160 }}
  776. value={this.state.rolesSearch}
  777. onChange={e => {
  778. this.setState({ rolesSearch: e });
  779. }}
  780. >
  781. {roleArr.map(function(item) {
  782. return (
  783. <Select.Option key={item.id}>
  784. {item.roleName}
  785. </Select.Option>
  786. );
  787. })}
  788. </Select>
  789. <div
  790. className="search-more"
  791. style={{ display: "inline-block" }}
  792. >
  793. <Select
  794. placeholder="职务"
  795. style={{ width: 160 }}
  796. value={this.state.postSearch}
  797. onChange={e => {
  798. this.setState({ postSearch: e });
  799. }}
  800. >
  801. {post.map(function(item) {
  802. return (
  803. <Select.Option key={item.value}>
  804. {item.key}
  805. </Select.Option>
  806. );
  807. })}
  808. </Select>
  809. <Select
  810. placeholder="岗位"
  811. style={{ width: 160 }}
  812. value={this.state.stationSearch}
  813. onChange={e => {
  814. this.setState({ stationSearch: e });
  815. }}
  816. >
  817. {station.map(function(item) {
  818. return (
  819. <Select.Option key={item.value}>
  820. {item.key}
  821. </Select.Option>
  822. );
  823. })}
  824. </Select>
  825. <Select
  826. placeholder="状态"
  827. style={{ width: 160 }}
  828. value={this.state.statusSeach}
  829. onChange={e => {
  830. this.setState({ statusSeach: e });
  831. }}
  832. >
  833. <Select.Option value="正常">正常</Select.Option>
  834. <Select.Option value="锁定">锁定</Select.Option>
  835. <Select.Option value="注销">注销</Select.Option>
  836. </Select>
  837. <Input
  838. placeholder="登录用户名"
  839. style={{ width: "150px" }}
  840. value={this.state.signNameSearch}
  841. onChange={e => {
  842. this.setState({ signNameSearch: e.target.value });
  843. }}
  844. />
  845. <AutoComplete
  846. className="certain-category-search"
  847. dropdownClassName="certain-category-search-dropdown"
  848. dropdownMatchSelectWidth={false}
  849. dropdownStyle={{ width: 200 }}
  850. size="large"
  851. style={{
  852. width: "150px",
  853. height: "28px",
  854. marginLeft: "10px"
  855. }}
  856. dataSource={options}
  857. placeholder="输入上级主管名字"
  858. value={this.state.auto}
  859. onChange={this.httpChange}
  860. filterOption={true}
  861. onBlur={this.blurChange}
  862. onSelect={this.selectAuto}
  863. >
  864. <Input />
  865. </AutoComplete>
  866. </div>
  867. <Button type="primary" onClick={this.search}>
  868. 搜索
  869. </Button>
  870. <Button onClick={this.reset}>重置</Button>
  871. <Button
  872. style={{ background: "red", border: "none", color: "#fff" }}
  873. disabled={!hasSelected}
  874. onClick={this.delectRow}
  875. style={{ display: "none" }}
  876. >
  877. 删除
  878. <Icon type="minus" />
  879. </Button>
  880. {/* <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span> */}
  881. </div>
  882. </TabPane>
  883. <TabPane tab="操作" key="2">
  884. <Button
  885. style={{
  886. background: "#333333",
  887. border: "none",
  888. color: "#fff",
  889. marginBottom: 10,
  890. marginTop: 12,
  891. marginRight: 10
  892. }}
  893. disabled={!hasSelected}
  894. onClick={this.locking}
  895. >
  896. 锁定
  897. <Icon type="lock" />
  898. </Button>
  899. <Button
  900. style={{ background: "green", border: "none", color: "#fff", marginTop: 12 }}
  901. disabled={!hasSelected}
  902. onClick={this.activation}
  903. >
  904. 激活
  905. <Icon type="unlock" />
  906. </Button>
  907. {/* </TabPane>
  908. <TabPane tab="新增" key="3"> */}
  909. <Button
  910. type="primary"
  911. className="addButton"
  912. style={{ float: "left", marginBottom: 10, marginTop: 12 }}
  913. onClick={this.addClick}
  914. >
  915. 新增用户
  916. <Icon type="user" />
  917. </Button>
  918. {/* </TabPane>
  919. <TabPane tab="离职转交" key="4"> */}
  920. <Button
  921. type="primary"
  922. className="addButton"
  923. style={{ float: "left", marginBottom: 10, marginTop: 12 }}
  924. onClick={this.resources}
  925. disabled={!hasSelected}
  926. >
  927. 离职一键转交
  928. <Icon type="user" />
  929. </Button>
  930. </TabPane>
  931. <TabPane tab="更改表格显示数据" key="3">
  932. <div style={{ marginLeft: 10 }}>
  933. <ChooseList
  934. columns={this.state.columns}
  935. changeFn={this.changeList}
  936. changeList={this.state.changeList}
  937. top={55}
  938. margin={11}
  939. />
  940. </div>
  941. </TabPane>
  942. </Tabs>
  943. <div className="patent-table">
  944. <Spin spinning={this.state.loading}>
  945. <Table
  946. columns={
  947. this.state.changeList
  948. ? this.state.changeList
  949. : this.state.columns
  950. }
  951. style={{
  952. cursor: 'pointer',
  953. }}
  954. dataSource={this.state.dataSource}
  955. rowSelection={rowSelection}
  956. pagination={this.state.pagination}
  957. onRowClick={this.tableRowClick}
  958. />
  959. </Spin>
  960. </div>
  961. <Newuser
  962. role={this.state.role}
  963. addId={this.state.addId}
  964. roleArr={this.state.roleArr}
  965. departmentArr={this.state.departmentArr}
  966. userDetaile={this.state.userDetaile}
  967. datauser={this.state.datauser}
  968. showDesc={this.state.showDesc}
  969. closeDesc={this.closeDesc}
  970. />
  971. <div className="patent-desc">
  972. <Modal
  973. maskClosable={false}
  974. visible={this.state.visible}
  975. onOk={this.checkResources}
  976. onCancel={this.handleCancel}
  977. width="800px"
  978. title="离职一键转交"
  979. footer=""
  980. className="admin-desc-content"
  981. >
  982. <Input
  983. placeholder="用户姓名"
  984. style={{
  985. width: "150px",
  986. marginRight: "10px",
  987. marginBottom: "10px"
  988. }}
  989. value={this.state.userNameSearchs}
  990. onChange={e => {
  991. this.setState({ userNameSearchs: e.target.value });
  992. }}
  993. />
  994. <Button type="primary" onClick={this.searchs}>
  995. 搜索
  996. </Button>
  997. <Button onClick={this.resets}>重置</Button>
  998. <div className="patent-table">
  999. <Spin spinning={this.state.loading}>
  1000. <Table
  1001. columns={this.state.column}
  1002. dataSource={this.state.dataSourceData}
  1003. pagination={this.state.paginations}
  1004. style={{
  1005. cursor: 'pointer',
  1006. }}
  1007. onRowClick={this.tableRowClick}
  1008. />
  1009. </Spin>
  1010. </div>
  1011. </Modal>
  1012. </div>
  1013. </div>
  1014. </div>
  1015. );
  1016. }
  1017. }));
  1018. export default User;