user.jsx 25 KB

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