user.jsx 26 KB

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