user.jsx 26 KB

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