user.jsx 25 KB

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