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.userNameSearch,
  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. } else {
  312. message.warning(data.error[0].message);
  313. };
  314. this.setState({
  315. loading: false,
  316. visible2: false
  317. });
  318. }.bind(this));
  319. },
  320. componentWillMount() {
  321. this.loadData();
  322. this.departmentList();
  323. this.rolesList();
  324. },
  325. tableRowClick(record, index) {
  326. this.rolesArrS(record)
  327. this.setState({
  328. userDetaile:true,
  329. showDesc: true,
  330. datauser:record
  331. });
  332. },
  333. //新建获取id
  334. addIdS() {
  335. $.ajax({
  336. method: "post",
  337. dataType: "json",
  338. crossDomain: false,
  339. url: globalConfig.context + '/api/admin/superviser/newId',
  340. data: {},
  341. success: function(data) {
  342. this.setState({
  343. addId: data.data
  344. });
  345. }.bind(this),
  346. }).always(function() {
  347. this.setState({
  348. loading: false
  349. });
  350. }.bind(this));
  351. },
  352. //部门
  353. departmentList() {
  354. this.setState({
  355. loading: true
  356. });
  357. $.ajax({
  358. method: "post",
  359. dataType: "json",
  360. crossDomain: false,
  361. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  362. data: {
  363. },
  364. success: function(data) {
  365. let thedata = data.data;
  366. let theArr = [];
  367. if(!thedata) {
  368. if(data.error && data.error.length) {
  369. message.warning(data.error[0].message);
  370. };
  371. thedata = {};
  372. } else {
  373. thedata.map(function(item, index) {
  374. theArr.push({
  375. key: index,
  376. name: item.name,
  377. id: item.id,
  378. depNo: item.depNo
  379. })
  380. })
  381. }
  382. this.setState({
  383. departmentArr: theArr,
  384. })
  385. }.bind(this),
  386. }).always(function() {
  387. this.setState({
  388. loading: false
  389. });
  390. }.bind(this));
  391. },
  392. //修改时获取角色数组
  393. rolesArrS(e) {
  394. $.ajax({
  395. method: "get",
  396. dataType: "json",
  397. crossDomain: false,
  398. url: globalConfig.context + "/api/admin/role",
  399. data: {
  400. uid:e.id
  401. },
  402. success: function(data) {
  403. let thedata = data.data;
  404. let theArr = [];
  405. let theId=[]
  406. if(!thedata) {
  407. if(data.error && data.error.length) {
  408. message.warning(data.error[0].message);
  409. };
  410. thedata = {};
  411. } else {
  412. }
  413. this.setState({
  414. role:thedata
  415. })
  416. }.bind(this),
  417. }).always(function() {
  418. }.bind(this));
  419. },
  420. //角色
  421. rolesList() {
  422. this.setState({
  423. loading: true
  424. });
  425. $.ajax({
  426. method: "get",
  427. dataType: "json",
  428. crossDomain: false,
  429. url: globalConfig.context + "/api/roles",
  430. data: {
  431. },
  432. success: function(data) {
  433. let thedata = data.data;
  434. let theArr = [];
  435. if(!thedata) {
  436. if(data.error && data.error.length) {
  437. message.warning(data.error[0].message);
  438. };
  439. thedata = {};
  440. } else {
  441. thedata.map(function(item, index) {
  442. theArr.push({
  443. key: index,
  444. roleName: item.roleName,
  445. id: item.id,
  446. })
  447. })
  448. }
  449. this.setState({
  450. roleArr: theArr,
  451. })
  452. }.bind(this),
  453. }).always(function() {
  454. this.setState({
  455. loading: false
  456. });
  457. }.bind(this));
  458. },
  459. //锁定
  460. locking() {
  461. let deletedIds;
  462. let statust;
  463. let mobiles;
  464. let names;
  465. let rolesId=[];
  466. for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
  467. let rowItem = this.state.selectedRows[idx];
  468. if(rowItem.id) {
  469. deletedIds=rowItem.id;
  470. statust=rowItem.status;
  471. names=rowItem.name;
  472. mobiles=rowItem.mobile;
  473. rolesId=rowItem.rolesId
  474. };
  475. };
  476. this.setState({
  477. selectedRowKeys: [],
  478. loading: true
  479. });
  480. $.ajax({
  481. method: "POST",
  482. dataType: "json",
  483. crossDomain: false,
  484. url: globalConfig.context + "/api/admin/superviser/updateAdmin",
  485. data: {
  486. roles:rolesId,
  487. data:JSON.stringify({
  488. id: deletedIds,
  489. status: '锁定',
  490. name: names,
  491. mobile: mobiles,
  492. }),
  493. }
  494. }).done(function(data) {
  495. if(!data.error.length) {
  496. message.success('锁定成功!');
  497. this.setState({
  498. loading: false,
  499. });
  500. } else {
  501. message.warning(data.error[0].message);
  502. };
  503. this.loadData();
  504. }.bind(this));
  505. },
  506. //激活
  507. activation() {
  508. let deletedIds;
  509. let statust;
  510. let mobiles;
  511. let names;
  512. let rolesId=[]
  513. for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
  514. let rowItem = this.state.selectedRows[idx];
  515. if(rowItem.id) {
  516. deletedIds=rowItem.id;
  517. statust=rowItem.status;
  518. names=rowItem.name;
  519. mobiles=rowItem.mobile;
  520. rolesId=rowItem.rolesId
  521. };
  522. };
  523. this.setState({
  524. selectedRowKeys: [],
  525. loading: true
  526. });
  527. $.ajax({
  528. method: "POST",
  529. dataType: "json",
  530. crossDomain: false,
  531. url: globalConfig.context + "/api/admin/superviser/updateAdmin",
  532. data: {
  533. roles:rolesId,
  534. data:JSON.stringify({
  535. id: deletedIds,
  536. status: '正常',
  537. name: names,
  538. mobile: mobiles,
  539. })
  540. }
  541. }).done(function(data) {
  542. if(!data.error.length) {
  543. message.success('激活成功!');
  544. this.setState({
  545. loading: false,
  546. });
  547. } else {
  548. message.warning(data.error[0].message);
  549. };
  550. this.loadData();
  551. }.bind(this));
  552. },
  553. //删除
  554. delectRow() {
  555. let deletedIds;
  556. for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
  557. let rowItem = this.state.selectedRows[idx];
  558. if(rowItem.id) {
  559. deletedIds=rowItem.id;
  560. };
  561. };
  562. this.setState({
  563. selectedRowKeys: [],
  564. loading: true
  565. });
  566. $.ajax({
  567. method: "POST",
  568. dataType: "json",
  569. crossDomain: false,
  570. url: globalConfig.context + "/api/admin/superviser/deleteById",
  571. data: {
  572. id: deletedIds,
  573. }
  574. }).done(function(data) {
  575. if(!data.error.length) {
  576. message.success('删除成功!');
  577. this.setState({
  578. loading: false,
  579. });
  580. } else {
  581. message.warning(data.error[0].message);
  582. };
  583. this.loadData(this.state.page);
  584. }.bind(this));
  585. },
  586. addClick() {
  587. this.addIdS()
  588. this.state.userDetaile = false;
  589. this.setState({
  590. showDesc: true
  591. });
  592. },
  593. closeDesc(e, s) {
  594. this.state.userDetaile=false;
  595. this.state.showDesc = e;
  596. if(s) {
  597. this.loadData(this.state.page);
  598. };
  599. },
  600. search() {
  601. this.state.userDetaile = false
  602. this.loadData();
  603. },
  604. searchs() {
  605. this.state.userDetaile = false
  606. this.loadDatas();
  607. },
  608. reset() {
  609. this.state.userNameSearch = '';
  610. this.state.organizationSearch = undefined;
  611. this.state.rolesSearch = undefined;
  612. this.state.postSearch = undefined;
  613. this.state.stationSearch = undefined;
  614. this.state.statusSeach = undefined;
  615. this.state.signNameSearch = '';
  616. this.state.mobileSearch = '';
  617. this.state.auto = '';
  618. this.state.theTypes='';
  619. this.loadData();
  620. },
  621. resets() {
  622. this.state.userNameSearch = '';
  623. this.state.organizationSearch = undefined;
  624. this.state.rolesSearch = undefined;
  625. this.state.postSearch = undefined;
  626. this.state.stationSearch = undefined;
  627. this.state.statusSeach = undefined;
  628. this.state.signNameSearch = '';
  629. this.state.mobileSearch = '';
  630. this.state.auto = '';
  631. this.state.theTypes='';
  632. this.loadDatas();
  633. },
  634. searchSwitch() {
  635. this.setState({
  636. searchMore: !this.state.searchMore
  637. });
  638. },
  639. //主管初始加载(自动补全)
  640. supervisor(e) {
  641. $.ajax({
  642. method: "post",
  643. dataType: "json",
  644. crossDomain: false,
  645. url: globalConfig.context + "/api/admin/organization/selectName",
  646. data: {
  647. name: e
  648. },
  649. success: function(data) {
  650. let thedata = data.data;
  651. if(!thedata) {
  652. if(data.error && data.error.length) {
  653. message.warning(data.error[0].message);
  654. };
  655. thedata = {};
  656. };
  657. this.setState({
  658. customerArr: thedata,
  659. });
  660. }.bind(this),
  661. }).always(function() {
  662. this.setState({
  663. loading: false
  664. });
  665. }.bind(this));
  666. },
  667. //上级主管输入框失去焦点是判断客户是否存在
  668. selectAuto(value, options) {
  669. this.setState({
  670. auto: value
  671. })
  672. },
  673. blurChange(e) {
  674. let theType = '';
  675. let contactLists = this.state.customerArr || [];
  676. if(e) {
  677. contactLists.map(function(item) {
  678. if(item.name == e.toString()) {
  679. theType = item.id;
  680. }
  681. });
  682. }
  683. this.setState({
  684. theTypes: theType
  685. })
  686. },
  687. //值改变时请求客户名称
  688. httpChange(e) {
  689. if(e.length >= 1) {
  690. this.supervisor(e);
  691. }
  692. this.setState({
  693. auto: e
  694. })
  695. },
  696. render() {
  697. const rowSelection = {
  698. selectedRowKeys: this.state.selectedRowKeys,
  699. onChange: (selectedRowKeys, selectedRows) => {
  700. this.setState({
  701. selectedRows: selectedRows.slice(-1),
  702. selectedRowKeys: selectedRowKeys.slice(-1)
  703. });
  704. },
  705. onSelectAll: (selected, selectedRows, changeRows) => {
  706. this.setState({
  707. selectedRowKeys: []
  708. })
  709. },
  710. };
  711. const dataSources = this.state.customerArr || [];
  712. const options = dataSources.map((group, index) =>
  713. <Select.Option key={index} value={group.name}>{group.name}</Select.Option>
  714. )
  715. const hasSelected = this.state.selectedRowKeys.length > 0;
  716. const { RangePicker } = DatePicker;
  717. let departmentArr = this.state.departmentArr || [];
  718. let roleArr = this.state.roleArr || [];
  719. return(
  720. <div className="user-content" >
  721. <div className="content-title">
  722. <div className="user-search">
  723. <Input placeholder="用户姓名" style={{width:'150px'}}
  724. value={this.state.userNameSearch}
  725. onChange={(e) => { this.setState({ userNameSearch: e.target.value }); }} />
  726. {window.adminData.isSuperAdmin?<Select placeholder="部门"
  727. style={{ width: 160 }}
  728. value={this.state.organizationSearch}
  729. onChange={(e) => { this.setState({ organizationSearch: e }) }}>
  730. {
  731. departmentArr.map(function (item) {
  732. return <Select.Option key={item.id} >{item.name}</Select.Option>
  733. })
  734. }
  735. </Select>:''}
  736. <Select placeholder="角色"
  737. style={{ width: 160 }}
  738. value={this.state.rolesSearch}
  739. onChange={(e) => { this.setState({ rolesSearch: e }) }}>
  740. {
  741. roleArr.map(function (item) {
  742. return <Select.Option key={item.id} >{item.roleName}</Select.Option>
  743. })
  744. }
  745. </Select>
  746. <Button type="primary" onClick={this.search}>搜索</Button>
  747. <Button onClick={this.reset}>重置</Button>
  748. <Button style={{ background: "red", border: "none", color: "#fff" }}
  749. disabled={!hasSelected}
  750. onClick={this.delectRow} style={{display:"none"}}>删除<Icon type="minus" /></Button>
  751. <Button style={{ background: "#333333", border: "none", color: "#fff" }}
  752. disabled={!hasSelected}
  753. onClick={this.locking}>锁定<Icon type="lock" /></Button>
  754. <Button style={{ background: "green", border: "none", color: "#fff" }}
  755. disabled={!hasSelected}
  756. onClick={this.activation}>激活<Icon type="unlock" /></Button>
  757. <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  758. <Button type="primary" className="addButton" onClick={this.resources} disabled={!hasSelected} >离职一键转交<Icon type="user" /></Button>
  759. <Button type="primary" className="addButton" onClick={this.addClick} >新增用户<Icon type="user" /></Button>
  760. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  761. <Select placeholder="职务"
  762. style={{ width: 160 }}
  763. value={this.state.postSearch}
  764. onChange={(e) => { this.setState({ postSearch: e }) }}>
  765. {
  766. post.map(function (item) {
  767. return <Select.Option key={item.value} >{item.key}</Select.Option>
  768. })
  769. }
  770. </Select>
  771. <Select placeholder="岗位"
  772. style={{ width: 160 }}
  773. value={this.state.stationSearch}
  774. onChange={(e) => { this.setState({ stationSearch: e }) }}>
  775. {
  776. station.map(function (item) {
  777. return <Select.Option key={item.value} >{item.key}</Select.Option>
  778. })
  779. }
  780. </Select>
  781. <Select placeholder="状态"
  782. style={{ width: 160 }}
  783. value={this.state.statusSeach}
  784. onChange={(e) => { this.setState({ statusSeach: e }) }}>
  785. <Select.Option value="正常" >正常</Select.Option>
  786. <Select.Option value="锁定" >锁定</Select.Option>
  787. </Select>
  788. <Input placeholder="登录用户名" style={{width:'150px'}}
  789. value={this.state.signNameSearch}
  790. onChange={(e) => { this.setState({ signNameSearch: e.target.value }); }} />
  791. <AutoComplete
  792. className="certain-category-search"
  793. dropdownClassName="certain-category-search-dropdown"
  794. dropdownMatchSelectWidth={false}
  795. dropdownStyle={{ width: 200 }}
  796. size="large"
  797. style={{ width: '150px',height:'28px' ,marginLeft:'10px'}}
  798. dataSource={options}
  799. placeholder="输入上级主管名字"
  800. value={this.state.auto}
  801. onChange={this.httpChange}
  802. filterOption={true}
  803. onBlur={this.blurChange}
  804. onSelect={this.selectAuto}
  805. >
  806. <Input/>
  807. </AutoComplete>
  808. </div>
  809. </div>
  810. <div className="patent-table">
  811. <Spin spinning={this.state.loading}>
  812. <Table columns={this.state.columns}
  813. dataSource={this.state.dataSource}
  814. rowSelection={rowSelection}
  815. pagination={this.state.pagination}
  816. onRowClick={this.tableRowClick} />
  817. </Spin>
  818. </div>
  819. <Newuser
  820. role={this.state.role}
  821. addId={this.state.addId}
  822. roleArr={this.state.roleArr}
  823. departmentArr={this.state.departmentArr}
  824. userDetaile={this.state.userDetaile}
  825. datauser={this.state.datauser}
  826. showDesc={this.state.showDesc}
  827. closeDesc={this.closeDesc} />
  828. <div className="patent-desc">
  829. <Modal maskClosable={false} visible={this.state.visible}
  830. onOk={this.checkResources} onCancel={this.handleCancel}
  831. width='800px'
  832. title='离职一键转交'
  833. footer=''
  834. className="admin-desc-content">
  835. <Input placeholder="用户姓名" style={{width:'150px',marginRight:"10px",marginBottom:"10px"}}
  836. value={this.state.userNameSearch}
  837. onChange={(e) => { this.setState({ userNameSearch: e.target.value }); }} />
  838. <Button type="primary" onClick={this.searchs}>搜索</Button>
  839. <Button onClick={this.resets}>重置</Button>
  840. <div className="patent-table">
  841. <Spin spinning={this.state.loading}>
  842. <Table columns={this.state.column}
  843. dataSource={this.state.dataSourceData}
  844. pagination={this.state.paginations}
  845. onRowClick={this.tableRowClick} />
  846. </Spin>
  847. </div>
  848. </Modal>
  849. </div>
  850. </div >
  851. </div>
  852. );
  853. }
  854. }));
  855. export default User;