organization.jsx 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972
  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 '../content.less';
  6. import { Form,Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload,Popconfirm,AutoComplete } from 'antd';
  7. import {patternOrganization,conditionOrganization} from '../../../dataDic.js';
  8. import {getPattern,getCondition} from '../../../tools.js';
  9. const Organization=Form.create()(React.createClass({
  10. loadData(pageNo) {
  11. this.state.data = [];
  12. this.setState({
  13. loading: true,
  14. ispage:pageNo,
  15. });
  16. $.ajax({
  17. method: "post",
  18. dataType: "json",
  19. crossDomain: false,
  20. url: globalConfig.context + '/api/admin/organization/listOrganizationManagement',
  21. data: {
  22. pageNo: pageNo || 1,
  23. pageSize: this.state.pagination.pageSize,
  24. name: this.state.name, //组织名称
  25. superId:this.state.superId,//上级组织
  26. type:this.state.type,//组织类型
  27. depNo:this.state.depNo,//组织编号
  28. },
  29. success: function (data) {
  30. let theArr = [];
  31. if (!data.data || !data.data.list) {
  32. if (data.error && data.error.length) {
  33. message.warning(data.error[0].message);
  34. };
  35. } else {
  36. for (let i = 0; i < data.data.list.length; i++) {
  37. let thisdata = data.data.list[i];
  38. theArr.push({
  39. key: i,
  40. id: thisdata.id,//每一条记录的ID
  41. depNo:thisdata.depNo,//组织编号
  42. name:thisdata.name,//组织名称
  43. type:thisdata.type,//组织类型
  44. managerId:thisdata.managerName,//负责人
  45. superId:thisdata.superName,//上级组织
  46. status:thisdata.status,//组织状态
  47. });
  48. };
  49. this.state.pagination.current = data.data.pageNo;
  50. this.state.pagination.total = data.data.totalCount;
  51. };
  52. this.setState({
  53. dataSource: theArr,
  54. pagination: this.state.pagination
  55. });
  56. }.bind(this),
  57. }).always(function () {
  58. this.setState({
  59. loading: false
  60. });
  61. }.bind(this));
  62. },
  63. getInitialState() {
  64. return {
  65. searchMore: true,
  66. selectedRowKeys: [],
  67. selectedRows: [],
  68. loading: false,
  69. pagination: {
  70. defaultCurrent: 1,
  71. defaultPageSize: 10,
  72. showQuickJumper: true,
  73. pageSize: 10,
  74. onChange: function (page) {
  75. this.loadData(page);
  76. }.bind(this),
  77. showTotal: function (total) {
  78. return '共' + total + '条数据';
  79. }
  80. },
  81. columns: [
  82. {
  83. title: '组织编号',
  84. dataIndex: 'depNo',
  85. key: 'depNo',
  86. }, {
  87. title: '组织名称',
  88. dataIndex: 'name',
  89. key: 'name',
  90. }, {
  91. title: '负责人',
  92. dataIndex: 'managerId',
  93. key: 'managerId',
  94. },{
  95. title: '组织类型',
  96. dataIndex: 'type',
  97. key: 'type',
  98. render: text => { return getPattern(text) }
  99. }, {
  100. title: '上级组织',
  101. dataIndex: 'superId',
  102. key: 'superId',
  103. },{
  104. title: '组织状态',
  105. dataIndex: 'status',
  106. key: 'status',
  107. render: text => { return getCondition(text) }
  108. }
  109. ],
  110. dataSource: [],
  111. searchTime: [,]
  112. };
  113. },
  114. componentWillMount() {
  115. this.selectSuperId();
  116. },
  117. //获取上级组织
  118. selectSuperId() {
  119. this.state.data = []
  120. $.ajax({
  121. method: "get",
  122. dataType: "json",
  123. crossDomain: false,
  124. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  125. data:{
  126. },
  127. success: function (data) {
  128. let theArr = [];
  129. let theId=[];//用于保存上级组织的ID和名称
  130. let thedata=data.data;
  131. if (!thedata) {
  132. if (data.error && data.error.length) {
  133. message.warning(data.error[0].message);
  134. };
  135. thedata = {};
  136. };
  137. var contactIds=[];
  138. for(var i=0;i<data.data.length;i++){
  139. let theData = data.data[i];
  140. theArr.push(
  141. <Select.Option value={theData.id} key={theData.id}>{theData.name}</Select.Option>
  142. );
  143. theId.push(
  144. [theData.id,theData.name]
  145. );
  146. };
  147. this.setState({
  148. SuperArr:thedata,
  149. contactsOption: theArr,
  150. theId: theId,
  151. orderStatusOptions:data.data,
  152. });
  153. }.bind(this),
  154. }).always(function () {
  155. this.loadData();
  156. this.setState({
  157. loading: false
  158. });
  159. }.bind(this));
  160. },
  161. //编辑部门,保存
  162. edithandleSubmit(e){
  163. e.preventDefault();
  164. //上级组织字典
  165. let nameText=this.state.SuperArr
  166. let superText=this.state.editSuperId;
  167. let upId=this.state.theId;
  168. let oldId='';
  169. let superOne=this.state.editDataSource[0].editSuperId;
  170. if(superOne==superText){
  171. for(let j=0;j<upId.length;j++){
  172. if(superText==upId[j][1]){
  173. oldId=upId[j][0]
  174. }
  175. }
  176. };
  177. let remarksText=(this.state.editRemarks)?this.state.editRemarks:'该组织没有职能说明,请完善!';
  178. let isStatus=this.state.editStatus;
  179. if(isStatus==1){
  180. if(confirm('是否要解散该部门?')){
  181. if(!(superOne==superText)){
  182. if(confirm('上级组织已修改,是否保存?')){
  183. $.ajax({
  184. method: "post",
  185. dataType: "json",
  186. crossDomain: false,
  187. url:
  188. globalConfig.context +
  189. "/api/admin/organization/updateOrganization",
  190. data: {
  191. name: this.state.editName, //组织名称
  192. type: this.state.editType, //组织类型
  193. managerId: this.state.theTypes
  194. ? this.state.theTypes
  195. : this.state.managerIdOrganizationId, //负责人ID
  196. financeId: this.state.theTypes2
  197. ? this.state.theTypes2
  198. : this.state.financeId, //负责人ID
  199. superId: this.state.editSuperId, //上级组织
  200. status: this.state.editStatus, //组织状态
  201. remarks: remarksText, //组织职能说明
  202. id: this.state.editId, //组织ID
  203. updateOrganization: this.state.updateOrganization,
  204. abbreviation: this.state.abbreviation
  205. }
  206. }).done(
  207. function(data) {
  208. this.setState({
  209. loading: false
  210. });
  211. if (!data.error.length) {
  212. message.success("保存成功!");
  213. this.edithandleCancel();
  214. this.selectSuperId();
  215. } else {
  216. message.warning(data.error[0].message);
  217. }
  218. }.bind(this)
  219. );
  220. return false
  221. }
  222. }else {
  223. $.ajax({
  224. method: "post",
  225. dataType: "json",
  226. crossDomain: false,
  227. url:
  228. globalConfig.context +
  229. "/api/admin/organization/updateOrganization",
  230. data: {
  231. name: this.state.editName, //组织名称
  232. type: this.state.editType, //组织类型
  233. managerId: this.state.theTypes
  234. ? this.state.theTypes
  235. : this.state.managerIdOrganizationId, //负责人ID
  236. financeId: this.state.theTypes2
  237. ? this.state.theTypes2
  238. : this.state.financeId, //负责人ID
  239. superId: oldId, //上级组织
  240. status: this.state.editStatus, //组织状态
  241. remarks: remarksText, //组织职能说明
  242. id: this.state.editId, //组织ID
  243. abbreviation: this.state.abbreviation
  244. }
  245. }).done(
  246. function(data) {
  247. this.setState({
  248. loading: false
  249. });
  250. if (!data.error.length) {
  251. message.success("保存成功!");
  252. this.edithandleCancel();
  253. this.selectSuperId();
  254. } else {
  255. message.warning(data.error[0].message);
  256. }
  257. }.bind(this)
  258. );
  259. }
  260. }
  261. }else{
  262. if(!(superOne==superText)){
  263. if(confirm('上级组织已修改,是否保存?')){
  264. console.log(this.state.editSuperId);
  265. $.ajax({
  266. method: "post",
  267. dataType: "json",
  268. crossDomain: false,
  269. url:
  270. globalConfig.context +
  271. "/api/admin/organization/updateOrganization",
  272. data: {
  273. name: this.state.editName, //组织名称
  274. type: this.state.editType, //组织类型
  275. managerId: this.state.theTypes
  276. ? this.state.theTypes
  277. : this.state.managerIdOrganizationId, //负责人ID
  278. financeId: this.state.theTypes2
  279. ? this.state.theTypes2
  280. : this.state.financeId, //负责人ID
  281. superId: this.state.editSuperId, //上级组织
  282. status: this.state.editStatus, //组织状态
  283. remarks: remarksText, //组织职能说明
  284. id: this.state.editId, //组织ID
  285. abbreviation: this.state.abbreviation
  286. }
  287. }).done(
  288. function(data) {
  289. this.setState({
  290. loading: false
  291. });
  292. if (!data.error.length) {
  293. message.success("保存成功!");
  294. this.edithandleCancel();
  295. this.selectSuperId();
  296. } else {
  297. message.warning(data.error[0].message);
  298. }
  299. }.bind(this)
  300. );
  301. return false
  302. }
  303. }else {
  304. console.log(this.state.editSuperId);
  305. $.ajax({
  306. method: "post",
  307. dataType: "json",
  308. crossDomain: false,
  309. url:
  310. globalConfig.context +
  311. "/api/admin/organization/updateOrganization",
  312. data: {
  313. name: this.state.editName, //组织名称
  314. type: this.state.editType, //组织类型
  315. managerId: this.state.theTypes
  316. ? this.state.theTypes
  317. : this.state.managerIdOrganizationId, //负责人ID
  318. financeId: this.state.theTypes2
  319. ? this.state.theTypes2
  320. : this.state.financeId, //负责人ID
  321. superId: oldId, //上级组织
  322. status: this.state.editStatus, //组织状态
  323. remarks: remarksText, //组织职能说明
  324. id: this.state.editId, //组织ID
  325. abbreviation: this.state.abbreviation
  326. }
  327. }).done(
  328. function(data) {
  329. this.setState({
  330. loading: false
  331. });
  332. if (!data.error.length) {
  333. message.success("保存成功!");
  334. this.edithandleCancel();
  335. this.selectSuperId();
  336. } else {
  337. message.warning(data.error[0].message);
  338. }
  339. }.bind(this)
  340. );
  341. }
  342. }
  343. },
  344. //整行点击
  345. tableRowClick(record, index) {
  346. this.selectSuperId();
  347. this.state.RowData = record;
  348. this.setState({
  349. editvisible: true,
  350. selectedRowKeys:[],
  351. rowId:record.businessId,
  352. })
  353. $.ajax({
  354. method: "post",
  355. dataType: "json",
  356. crossDomain: false,
  357. url: globalConfig.context +"/api/admin/organization/selectAllById" ,
  358. data: {
  359. id: record.id
  360. },
  361. success: function (data) {
  362. let theArr = [];
  363. let thisdata = data;
  364. if (!data) {
  365. if (data.error && data.error.length) {
  366. message.warning(data.error[0].message);
  367. };
  368. } else {
  369. theArr.push({
  370. editId: thisdata.id, //每一条记录的ID
  371. editName: thisdata.name, //组织名称
  372. editManagerId: thisdata.managerId, //负责人
  373. editType: thisdata.type, //组织类型
  374. editStatus: thisdata.status, //组织状态
  375. editSuperId: thisdata.superId, //上级组织
  376. editDepNo: thisdata.depNo, //组织编号
  377. editCreateId: thisdata.createId, //创建人
  378. editTime: thisdata.createTime, //创建时间
  379. editRemarks: thisdata.remarks, //组织职能说明
  380. financeId: thisdata.financeId
  381. });
  382. };
  383. this.setState({
  384. editId: thisdata.id, //每一条记录的ID
  385. financeId: thisdata.financeId,
  386. financeName: thisdata.financeName,
  387. editName: thisdata.name, //组织名称
  388. managerIdOrganization: thisdata.managerName, //负责人名字
  389. managerIdOrganizationId: thisdata.managerId, //负责人idmanagerName
  390. editType: thisdata.type, //组织类型
  391. editStatus: thisdata.status, //组织状态
  392. editSuperId: thisdata.superId, //上级组织
  393. editDepNo: thisdata.depNo, //组织编号
  394. editCreateId: thisdata.createId, //创建人
  395. editTime: thisdata.createTime, //创建时间
  396. editRemarks: thisdata.remarks, //组织职能说明
  397. editDataSource: theArr,
  398. abbreviation: thisdata.abbreviation
  399. });
  400. }.bind(this),
  401. }).always(function (data) {
  402. // if (data.error.length) {
  403. // message.warn(data.error[0].message);
  404. // };
  405. this.setState({
  406. loading: false
  407. });
  408. }.bind(this));
  409. },
  410. //整行删除
  411. delectRow() {
  412. let deletedIds ='';
  413. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  414. let rowItem = this.state.selectedRows[idx];
  415. if (rowItem.id) {
  416. deletedIds=rowItem.id;
  417. };
  418. };
  419. this.setState({
  420. selectedRowKeys: [],
  421. loading: deletedIds.length > 0
  422. });
  423. $.ajax({
  424. method: "POST",
  425. dataType: "json",
  426. crossDomain: false,
  427. url: globalConfig.context + "/api/admin/organization/deleteById",
  428. data: {
  429. id: deletedIds
  430. }
  431. }).done(function (data) {
  432. if (!data.error.length) {
  433. message.success('删除成功!');
  434. this.setState({
  435. loading: false,
  436. });
  437. } else {
  438. message.warning(data.error[0].message);
  439. };
  440. this.selectSuperId();
  441. }.bind(this));
  442. },
  443. //新增一个部门,保存
  444. addhandleSubmit(e){
  445. e.preventDefault();
  446. // if(!this.state.theTypes){
  447. // message.warning('请输入负责人姓名');
  448. // return false;
  449. // }
  450. if(!this.state.typeOrganization){
  451. message.warning('请选择组织类型');
  452. return false;
  453. }
  454. if(!this.state.upOrganization){
  455. message.warning('请选择上级组织');
  456. return false;
  457. }
  458. this.props.form.validateFields((err, values) => {
  459. if (!err) {
  460. this.setState({
  461. loading: true
  462. });
  463. $.ajax({
  464. method: "post",
  465. dataType: "json",
  466. crossDomain: false,
  467. url:globalConfig.context + '/api/admin/organization/addOrganization',
  468. data:{
  469. name:this.state.nameOrganization,//组织名称
  470. managerId:this.state.theTypes,//负责人ID
  471. type:this.state.typeOrganization, //组织类型
  472. superId:this.state.upOrganization,//上级组织
  473. remarks:this.state.remarksOrganization,//组织职能说明
  474. }
  475. }).done(function (data) {
  476. this.setState({
  477. loading: false
  478. });
  479. if (!data.error.length) {
  480. message.success('保存成功!');
  481. this.handleCancel();
  482. this.selectSuperId();
  483. } else {
  484. message.warning(data.error[0].message);
  485. }
  486. }.bind(this));
  487. }
  488. });
  489. },
  490. //主管初始加载(自动补全)
  491. supervisor(e){
  492. $.ajax({
  493. method: "post",
  494. dataType: "json",
  495. crossDomain: false,
  496. url: globalConfig.context + "/api/admin/organization/selectName",
  497. data:{
  498. name:e
  499. },
  500. success: function (data) {
  501. let thedata=data.data;
  502. if (!thedata) {
  503. if (data.error && data.error.length) {
  504. message.warning(data.error[0].message);
  505. };
  506. thedata = {};
  507. };
  508. this.setState({
  509. customerArr:thedata,
  510. });
  511. }.bind(this),
  512. }).always(function () {
  513. this.setState({
  514. loading: false
  515. });
  516. }.bind(this));
  517. },
  518. //上级主管输入框失去焦点是判断客户是否存在
  519. selectAuto(value,options){
  520. this.setState({
  521. managerIdOrganization:value
  522. })
  523. let theType='';
  524. let contactLists=this.state.customerArr||[];
  525. if (value) {
  526. contactLists.map(function (item) {
  527. if (item.name == value.toString()) {
  528. theType = item.id;
  529. }
  530. });
  531. }
  532. this.setState({
  533. theTypes:theType
  534. })
  535. },
  536. selectAuto2(value,options){
  537. this.setState({
  538. financeId:value
  539. })
  540. let theType='';
  541. let contactLists=this.state.customerArr||[];
  542. if (value) {
  543. contactLists.map(function (item) {
  544. if (item.name == value.toString()) {
  545. theType = item.id;
  546. }
  547. });
  548. }
  549. this.setState({
  550. theTypes2:theType
  551. })
  552. },
  553. //失去焦点时
  554. blurChange(e){
  555. },
  556. //值改变时请求客户名称
  557. httpChange(e){
  558. if(e.length>=1){
  559. this.supervisor(e);
  560. }
  561. this.setState({
  562. managerIdOrganization:e
  563. })
  564. },
  565. httpChange2(e){
  566. if(e.length>=1){
  567. this.supervisor(e);
  568. }
  569. this.setState({
  570. financeName:e
  571. })
  572. },
  573. addClick() {
  574. this.state.theTypes='';
  575. this.state.nameOrganization='';//组织名称清零
  576. this.state.managerIdOrganization= '';//负责人ID清零
  577. this.state.financeId = "";//负责人ID清零
  578. this.state.financeName = "";//负责人ID清零
  579. this.state.typeOrganization= undefined; //组织类型清零
  580. this.state.upOrganization= undefined;//上级组织清零
  581. this.state.remarksOrganization= '';//组织职能说明清零
  582. this.state.RowData = {};
  583. this.setState({
  584. visible: true
  585. });
  586. this.selectSuperId();
  587. },
  588. editClick() {
  589. this.state.RowData = {};
  590. this.setState({
  591. editvisible: true
  592. });
  593. },
  594. handleCancel() {
  595. this.setState({ visible: false })
  596. },
  597. edithandleCancel() {
  598. this.setState({ editvisible: false })
  599. },
  600. search() {
  601. this.loadData();
  602. },
  603. //把搜索的部分置零
  604. reset() {
  605. this.state.superId = undefined;//上级组织清零
  606. this.state.name = '';//组织名称清零
  607. this.state.type = undefined;//组织类型清零
  608. this.state.depNo = '';//组织编号清零
  609. this.loadData();
  610. },
  611. searchSwitch() {
  612. this.setState({
  613. searchMore: !this.state.searchMore
  614. });
  615. },
  616. render() {
  617. const FormItem = Form.Item
  618. const rowSelection = {
  619. selectedRowKeys: this.state.selectedRowKeys,
  620. onChange: (selectedRowKeys, selectedRows) => {
  621. this.setState({
  622. selectedRows: selectedRows.slice(-1),
  623. selectedRowKeys: selectedRowKeys.slice(-1)
  624. });
  625. },
  626. onSelect: (recordt, selected, selectedRows) => {
  627. this.setState({
  628. recordt:recordt.id
  629. })
  630. },
  631. };
  632. const formItemLayout = {
  633. labelCol: { span: 8 },
  634. wrapperCol: { span: 14 },
  635. };
  636. const { getFieldDecorator } = this.props.form;
  637. const hasSelected = this.state.selectedRowKeys.length > 0;
  638. const { RangePicker } = DatePicker;
  639. const dataSources=this.state.customerArr || [];
  640. const options = dataSources.map((group,index) =>
  641. <Option key={index} value={group.name}>{group.name}</Option>
  642. )
  643. const options2 = dataSources.map((group,index) =>
  644. <Option key={index} value={group.name}>{group.name}</Option>
  645. )
  646. return (
  647. <div className="user-content" >
  648. <div className="content-title">
  649. <div className="user-search">
  650. <Input placeholder="组织名称" style={{width:'150px',marginRight:'10px',marginBottom:'10px'}}
  651. value={this.state.name}
  652. onChange={(e) => { this.setState({ name: e.target.value }); }} />
  653. <Select placeholder="上级组织"
  654. style={{ width:'200px',marginRight:'10px' }}
  655. value={this.state.superId}
  656. onChange={(e) => { this.setState({ superId: e }) }} notFoundContent="未获取到上级组织列表">
  657. {this.state.contactsOption}
  658. </Select>
  659. <Button type="primary" onClick={this.search} style={{marginRight:'10px'}}>搜索</Button>
  660. <Button onClick={this.reset} style={{marginRight:'10px'}}>重置</Button>
  661. <Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
  662. <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
  663. disabled={!hasSelected}
  664. >删除<Icon type="minus" />
  665. </Button>
  666. </Popconfirm>
  667. <span style={{marginRight:'20px'}}>更多搜索 <Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  668. <div style={this.state.searchMore ? { display: 'none' } : {display: 'inline-block'}}>
  669. <Input placeholder="组织编号" style={{width:'150px',marginRight:'10px'}}
  670. value={this.state.depNo}
  671. onChange={(e) => { this.setState({ depNo: e.target.value }); }} />
  672. <Select placeholder="组织类型"
  673. style={{width:'150px',marginRight:'50px'}}
  674. value={this.state.type}
  675. onChange={(e) => { this.setState({ type: e }) }}>
  676. <Select.Option value="0" >公司</Select.Option>
  677. <Select.Option value="1" >部门</Select.Option>
  678. <Select.Option value="2" >团队</Select.Option>
  679. </Select>
  680. </div>
  681. <Button type="primary" className="addButton" onClick={this.addClick} style={{marginBottom:'10px'}}>新增组织<Icon type="plus" /></Button>
  682. </div>
  683. <div className="patent-table">
  684. <Spin spinning={this.state.loading}>
  685. <Table columns={this.state.columns}
  686. dataSource={this.state.dataSource}
  687. rowSelection={rowSelection}
  688. pagination={this.state.pagination}
  689. onRowClick={this.tableRowClick} />
  690. </Spin>
  691. </div>
  692. <div className="patent-desc">
  693. <Modal maskClosable={false} visible={this.state.visible}
  694. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  695. width='600px'
  696. title='新增组织'
  697. footer=''
  698. className="admin-desc-content">
  699. <Form horizontal onSubmit={this.addhandleSubmit} id="add-form">
  700. <Spin spinning={this.state.loading}>
  701. <div className="clearfix">
  702. <FormItem
  703. labelCol={{ span: 7 }}
  704. wrapperCol={{ span: 12 }}
  705. label="组织名称" >
  706. <Input placeholder="组织名称" value={this.state.nameOrganization} style={{width:'95%'}}
  707. onChange={(e)=>{this.setState({nameOrganization:e.target.value})}} required="required"/>
  708. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  709. </FormItem>
  710. </div>
  711. <div className="clearfix">
  712. <FormItem
  713. labelCol={{ span: 7 }}
  714. wrapperCol={{ span: 12}}
  715. label="负责人"
  716. >
  717. <AutoComplete
  718. className="certain-category-search"
  719. dropdownClassName="certain-category-search-dropdown"
  720. dropdownMatchSelectWidth={false}
  721. dataSource={options}
  722. placeholder="输入名称"
  723. value={this.state.managerIdOrganization}
  724. onChange={this.httpChange}
  725. filterOption={true}
  726. onBlur={this.blurChange}
  727. onSelect={this.selectAuto}
  728. style={{width:'95%'}}
  729. >
  730. <Input />
  731. </AutoComplete>
  732. {/*<span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>*/}
  733. </FormItem>
  734. </div>
  735. <div className="clearfix">
  736. <FormItem
  737. labelCol={{ span: 7 }}
  738. wrapperCol={{ span: 12 }}
  739. label="组织类型"
  740. >
  741. <Select placeholder="组织类型" value={this.state.typeOrganization}
  742. onChange={(e)=>{this.setState({typeOrganization:e})}} style={{width:'95%'}} required="required">
  743. {
  744. patternOrganization.map(function (item) {
  745. return <Select.Option key={item.value} >{item.key}</Select.Option>
  746. })
  747. }
  748. </Select>
  749. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  750. </FormItem>
  751. </div>
  752. <div className="clearfix">
  753. <FormItem
  754. labelCol={{ span: 7 }}
  755. wrapperCol={{ span: 12 }}
  756. label="上级组织"
  757. >
  758. <Select placeholder="请选择上级组织"
  759. value={this.state.upOrganization}
  760. onChange={(e)=>{this.setState({upOrganization:e})}}
  761. notFoundContent="未获取到上级组织列表"
  762. style={{width:'95%'}} required="required">
  763. {this.state.contactsOption}
  764. </Select>
  765. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  766. </FormItem>
  767. </div>
  768. <div className="clearfix">
  769. <FormItem
  770. labelCol={{ span: 7 }}
  771. wrapperCol={{ span: 12 }}
  772. label="组织职能说明" >
  773. <Input type="textarea" rows={4} placeholder="组织职能说明" value={this.state.remarksOrganization}
  774. onChange={(e) => { this.setState({ remarksOrganization: e.target.value }) }} style={{width:'95%'}}/>
  775. </FormItem>
  776. </div>
  777. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  778. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  779. <Button className="set-submit" type="ghost" onClick={this.handleCancel} style={{marginLeft:'100px'}}>取消</Button>
  780. </FormItem>
  781. </Spin>
  782. </Form >
  783. </Modal>
  784. </div>
  785. <div className="patent-desc">
  786. <Modal maskClosable={false} visible={this.state.editvisible}
  787. onOk={this.checkPatentProcess} onCancel={this.edithandleCancel}
  788. width='600px'
  789. title='编辑组织'
  790. footer=''
  791. className="admin-desc-content">
  792. <Form horizontal onSubmit={this.edithandleSubmit} id="edit-form">
  793. <Spin spinning={this.state.loading}>
  794. <div className="clearfix">
  795. <FormItem
  796. labelCol={{ span: 7 }}
  797. wrapperCol={{ span: 12 }}
  798. label="组织名称" >
  799. <Input placeholder="组织名称" value={this.state.editName}
  800. onChange={(e)=>{this.setState({editName:e.target.value})}}/>
  801. </FormItem>
  802. </div>
  803. <div className="clearfix">
  804. <FormItem
  805. labelCol={{ span: 7 }}
  806. wrapperCol={{ span: 12}}
  807. label="负责人"
  808. >
  809. <AutoComplete
  810. className="certain-category-search"
  811. dropdownClassName="certain-category-search-dropdown"
  812. dropdownMatchSelectWidth={false}
  813. dataSource={options}
  814. placeholder="输入名称"
  815. value={this.state.managerIdOrganization}
  816. onChange={this.httpChange}
  817. filterOption={true}
  818. onBlur={this.blurChange}
  819. onSelect={this.selectAuto}
  820. style={{width:'95%'}}
  821. >
  822. <Input />
  823. </AutoComplete>
  824. {/* <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span> */}
  825. </FormItem>
  826. </div>
  827. <div className="clearfix">
  828. <FormItem
  829. labelCol={{ span: 7 }}
  830. wrapperCol={{ span: 12 }}
  831. label="组织类型"
  832. >
  833. <Select placeholder="组织类型" value={this.state.editType}
  834. onChange={(e)=>{this.setState({editType:e})}}>
  835. {
  836. patternOrganization.map(function (item) {
  837. return <Select.Option key={item.value} >{item.key}</Select.Option>
  838. })
  839. }
  840. </Select>
  841. </FormItem>
  842. </div>
  843. <div className="clearfix">
  844. <FormItem
  845. labelCol={{ span: 7 }}
  846. wrapperCol={{ span: 12 }}
  847. label="组织状态"
  848. >
  849. <Select placeholder="组织状态" value={this.state.editStatus}
  850. onChange={(e)=>{this.setState({editStatus:e})}}>
  851. {
  852. conditionOrganization.map(function (item) {
  853. return <Select.Option key={item.value} >{item.key}</Select.Option>
  854. })
  855. }
  856. </Select>
  857. </FormItem>
  858. </div>
  859. <div className="clearfix">
  860. <FormItem
  861. labelCol={{ span: 7 }}
  862. wrapperCol={{ span: 12 }}
  863. label="上级组织"
  864. >
  865. <Select placeholder="请选择上级组织"
  866. value={this.state.editSuperId}
  867. onChange={(e)=>{this.setState({editSuperId:e})}}
  868. notFoundContent="未获取到上级组织列表">
  869. {this.state.contactsOption}
  870. </Select>
  871. </FormItem>
  872. </div>
  873. <div className="clearfix">
  874. <FormItem
  875. labelCol={{ span: 7 }}
  876. wrapperCol={{ span: 12 }}
  877. label="缩写" >
  878. <Input placeholder="缩写" value={this.state.abbreviation}
  879. onChange={(e)=>{this.setState({abbreviation:e.target.value})}}/>
  880. </FormItem>
  881. </div>
  882. <div className="clearfix">
  883. <FormItem
  884. labelCol={{ span: 7 }}
  885. wrapperCol={{ span: 12}}
  886. label="财务负责人"
  887. >
  888. <AutoComplete
  889. className="certain-category-search"
  890. dropdownClassName="certain-category-search-dropdown"
  891. dropdownMatchSelectWidth={false}
  892. dataSource={options2}
  893. placeholder="输入名称"
  894. value={this.state.financeName}
  895. onChange={this.httpChange2}
  896. filterOption={true}
  897. onBlur={this.blurChange}
  898. onSelect={this.selectAuto2}
  899. style={{width:'95%'}}
  900. >
  901. <Input />
  902. </AutoComplete>
  903. {/* <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span> */}
  904. </FormItem>
  905. </div>
  906. <div className="clearfix">
  907. <FormItem
  908. labelCol={{ span: 7 }}
  909. wrapperCol={{ span: 12 }}
  910. label="组织编号"
  911. >
  912. <span>{this.state.editDepNo}</span>
  913. </FormItem>
  914. </div>
  915. <div className="clearfix" >
  916. <FormItem
  917. labelCol={{ span: 7 }}
  918. wrapperCol={{ span: 12 }}
  919. label="创建人"
  920. >
  921. <span>{this.state.editCreateId}</span>
  922. </FormItem>
  923. </div>
  924. <div className="clearfix">
  925. <FormItem
  926. labelCol={{ span: 7 }}
  927. wrapperCol={{ span: 12 }}
  928. label="创建时间"
  929. >
  930. <span>{this.state.editTime}</span>
  931. </FormItem>
  932. </div>
  933. <div className="clearfix">
  934. <FormItem
  935. labelCol={{ span: 7 }}
  936. wrapperCol={{ span: 12 }}
  937. label="组织职能说明" >
  938. <Input type="textarea" rows={4} placeholder="组织职能说明" value={this.state.editRemarks}
  939. onChange={(e) => { this.setState({ editRemarks: e.target.value }) }}/>
  940. </FormItem>
  941. </div>
  942. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  943. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  944. <Button className="set-submit" type="ghost" onClick={this.edithandleCancel} style={{marginLeft:'100px'}}>取消</Button>
  945. </FormItem>
  946. </Spin>
  947. </Form >
  948. </Modal>
  949. </div>
  950. </div>
  951. </div>
  952. );
  953. }
  954. }));
  955. export default Organization;