user.jsx 27 KB

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