organization.jsx 73 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929
  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 { citySelect } from '../../../NewDicProvinceList';
  7. import {
  8. getNewDiccityArr,
  9. } from "@/tools.js";
  10. import { Form, Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload, Popconfirm, AutoComplete, Tabs, Tag } from 'antd';
  11. import { patternOrganization, conditionOrganization } from '../../../dataDic.js';
  12. import { getPattern, getCondition } from '../../../tools.js';
  13. import { ChooseList } from "../../order/orderNew/chooseList";
  14. import StaffSearch from '../../../../component/common/staffSearch';
  15. const confirm = Modal.confirm;
  16. const { TabPane } = Tabs
  17. const Organization = Form.create()(React.createClass({
  18. loadData(pageNo) {
  19. this.state.data = [];
  20. this.setState({
  21. loading: true,
  22. });
  23. $.ajax({
  24. method: "post",
  25. dataType: "json",
  26. crossDomain: false,
  27. url: globalConfig.context + '/api/admin/organization/listOrganizationManagement',
  28. data: {
  29. pageNo: pageNo || 1,
  30. pageSize: this.state.pagination.pageSize,
  31. name: this.state.name, //组织名称
  32. superId: this.state.superId,//上级组织
  33. type: this.state.type,//组织类型
  34. depNo: this.state.depNo1,//组织编号
  35. },
  36. success: function (data) {
  37. let theArr = [];
  38. if (!data.data || !data.data.list) {
  39. if (data.error && data.error.length) {
  40. message.warning(data.error[0].message);
  41. };
  42. } else {
  43. for (let i = 0; i < data.data.list.length; i++) {
  44. let thisdata = data.data.list[i];
  45. theArr.push({
  46. key: i,
  47. id: thisdata.id,//每一条记录的ID
  48. depNo: thisdata.depNo,//组织编号
  49. name: thisdata.name,//组织名称
  50. type: thisdata.type,//组织类型
  51. managerId: thisdata.managerName,//负责人
  52. superId: thisdata.superName,//上级组织
  53. status: thisdata.status,//组织状态
  54. workingHoursName: thisdata.workingHoursName,
  55. hideSign: thisdata.hideSign,//显示标识
  56. approval: thisdata.approval,
  57. });
  58. };
  59. this.state.pagination.current = data.data.pageNo;
  60. this.state.pagination.total = data.data.totalCount;
  61. this.setState({
  62. dataSource: theArr,
  63. page: data.data.pageNo,
  64. pagination: this.state.pagination
  65. });
  66. };
  67. }.bind(this),
  68. }).always(function () {
  69. this.setState({
  70. loading: false
  71. });
  72. }.bind(this));
  73. },
  74. getInitialState() {
  75. return {
  76. approval: 1,
  77. editvisible: false,
  78. workingHoursType: 0,
  79. searchMore: true,
  80. selectedRowKeys: [],
  81. selectedRows: [],
  82. loading: false,
  83. workTimeList: [],
  84. pagination: {
  85. defaultCurrent: 1,
  86. defaultPageSize: 10,
  87. showQuickJumper: true,
  88. pageSize: 10,
  89. onChange: function (page) {
  90. this.loadData(page);
  91. }.bind(this),
  92. showTotal: function (total) {
  93. return '共' + total + '条数据';
  94. }
  95. },
  96. columns: [
  97. {
  98. title: '组织编号',
  99. dataIndex: 'depNo',
  100. key: 'depNo',
  101. }, {
  102. title: '组织名称',
  103. dataIndex: 'name',
  104. key: 'name',
  105. }, {
  106. title: '负责人',
  107. dataIndex: 'managerId',
  108. key: 'managerId',
  109. }, {
  110. title: '组织类型',
  111. dataIndex: 'type',
  112. key: 'type',
  113. render: text => { return getPattern(text) }
  114. }, {
  115. title: '上级组织',
  116. dataIndex: 'superId',
  117. key: 'superId',
  118. }, {
  119. title: '组织状态',
  120. dataIndex: 'status',
  121. key: 'status',
  122. render: text => { return getCondition(text) }
  123. }, {
  124. title: '作息时间类型',
  125. dataIndex: 'workingHoursName',
  126. key: 'workingHoursName',
  127. }, {
  128. title: '显示标识',
  129. dataIndex: 'hideSign',
  130. key: 'hideSign',
  131. render: text => { return ["不显示", "显示"][text] }
  132. },
  133. ],
  134. dataSource: [],
  135. searchTime: [,],
  136. };
  137. },
  138. componentWillMount() {
  139. this.selectSuperId();
  140. this.getWorkTimeList();
  141. },
  142. //获取上级组织
  143. selectSuperId() {
  144. this.state.data = []
  145. $.ajax({
  146. method: "get",
  147. dataType: "json",
  148. crossDomain: false,
  149. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  150. data: {
  151. hideSign: 2,//查询所有(0不显示 1显示 2所有)
  152. },
  153. success: function (data) {
  154. let theArr = [];
  155. let theId = [];//用于保存上级组织的ID和名称
  156. let thedata = data.data;
  157. if (!thedata) {
  158. if (data.error && data.error.length) {
  159. message.warning(data.error[0].message);
  160. };
  161. thedata = {};
  162. };
  163. var contactIds = [];
  164. for (var i = 0; i < data.data.length; i++) {
  165. let theData = data.data[i];
  166. theArr.push(
  167. <Select.Option value={theData.id} key={theData.id}>{theData.name}</Select.Option>
  168. );
  169. theId.push(
  170. [theData.id, theData.name]
  171. );
  172. };
  173. this.setState({
  174. SuperArr: thedata,
  175. contactsOption: theArr,
  176. theId: theId,
  177. orderStatusOptions: data.data,
  178. });
  179. }.bind(this),
  180. }).always(function () {
  181. this.loadData(this.state.page);
  182. this.setState({
  183. loading: false
  184. });
  185. }.bind(this));
  186. },
  187. //获取作息时间
  188. getWorkTimeList() {
  189. $.ajax({
  190. method: "get",
  191. dataType: "json",
  192. crossDomain: false,
  193. url: globalConfig.context + "/api/admin/department/workingHours/list",
  194. data: {},
  195. success: function (data) {
  196. if (data.error.length === 0) {
  197. this.setState({
  198. workTimeList: data.data,
  199. });
  200. } else {
  201. message.warning(data.error[0].message);
  202. }
  203. }.bind(this),
  204. }).always(function () {
  205. this.setState({
  206. loading: false
  207. });
  208. }.bind(this));
  209. },
  210. //编辑部门,保存
  211. edithandleSubmit(e) {
  212. e.preventDefault();
  213. if (!this.state.depNo) {
  214. message.warning('请填写组织编号');
  215. return
  216. }
  217. //上级组织字典
  218. let nameText = this.state.SuperArr
  219. let superText = this.state.editSuperId;
  220. let upId = this.state.theId;
  221. let oldId = '';
  222. let superOne = this.state.editDataSource[0].editSuperId;
  223. if (superOne == superText) {
  224. for (let j = 0; j < upId.length; j++) {
  225. if (superText == upId[j][1]) {
  226. oldId = upId[j][0]
  227. }
  228. }
  229. };
  230. let remarksText = (this.state.editRemarks) ? this.state.editRemarks : '该组织没有职能说明,请完善!';
  231. let isStatus = this.state.editStatus;
  232. let _this = this;
  233. if (isStatus == 1) {
  234. confirm({
  235. title: '是否要解散该部门?',
  236. onOk() {
  237. if (!(superOne == superText)) {
  238. confirm({
  239. title: '上级组织已修改,是否保存?',
  240. onOk() {
  241. $.ajax({
  242. method: "post",
  243. dataType: "json",
  244. crossDomain: false,
  245. url:
  246. globalConfig.context +
  247. "/api/admin/organization/updateOrganization",
  248. data: {
  249. name: _this.state.editName, //组织名称
  250. type: _this.state.editType, //组织类型
  251. managerId: _this.state.theTypes
  252. ? _this.state.theTypes
  253. : _this.state.managerIdOrganizationId, //负责人ID
  254. financeId: _this.state.theTypes2
  255. ? _this.state.theTypes2
  256. : _this.state.financeId, //负责人ID
  257. approvalAid: _this.state.theTypes1
  258. ? _this.state.theTypes1
  259. : _this.state.approvalAid, //审核人ID
  260. retrialFinanceId: _this.state.theTypes3
  261. ? _this.state.theTypes3
  262. : _this.state.reviewerId, // 复审人
  263. expenseFinanceId: _this.state.theTypes4
  264. ? _this.state.theTypes4
  265. : _this.state.accountrId, // 报销审核人
  266. superId: _this.state.editSuperId, //上级组织
  267. status: _this.state.editStatus, //组织状态
  268. remarks: remarksText, //组织职能说明
  269. id: _this.state.editId, //组织ID
  270. updateOrganization: _this.state.updateOrganization,
  271. abbreviation: _this.state.abbreviation,
  272. workingHoursType: _this.state.workingHoursType,
  273. hideSign: _this.state.hideSign,//显示标识
  274. depNo: _this.state.depNo,//组织编号
  275. approval: _this.state.approval, //是否需要特批审核
  276. expenseRetrialFinanceExamine: _this.state.expenseRetrialFinanceExamine, // 财务复审
  277. ceoExamine: _this.state.ceoExamine, // 董事长审核
  278. cfoExamine: _this.state.cfoExamine, // 财务总监审核
  279. viceCeoExamine: _this.state.viceCeoExamine, // 集团副总审核
  280. cashierExamine: _this.state.cashierExamine, // 出纳审核
  281. techAdminId: _this.state.techAdminId, // 技术总监
  282. }
  283. }).done(
  284. function (data) {
  285. _this.setState({
  286. loading: false
  287. });
  288. if (!data.error.length) {
  289. message.success("保存成功!");
  290. _this.edithandleCancel();
  291. _this.selectSuperId();
  292. } else {
  293. message.warning(data.error[0].message);
  294. }
  295. }.bind(_this)
  296. );
  297. return false
  298. }
  299. })
  300. } else {
  301. $.ajax({
  302. method: "post",
  303. dataType: "json",
  304. crossDomain: false,
  305. url:
  306. globalConfig.context +
  307. "/api/admin/organization/updateOrganization",
  308. data: {
  309. name: _this.state.editName, //组织名称
  310. type: _this.state.editType, //组织类型
  311. managerId: _this.state.theTypes
  312. ? _this.state.theTypes
  313. : _this.state.managerIdOrganizationId, //负责人ID
  314. financeId: _this.state.theTypes2
  315. ? _this.state.theTypes2
  316. : _this.state.financeId, //负责人ID
  317. approvalAid: _this.state.theTypes1
  318. ? _this.state.theTypes1
  319. : _this.state.approvalAid, //审核人ID
  320. retrialFinanceId: _this.state.theTypes3
  321. ? _this.state.theTypes3
  322. : _this.state.reviewerId, // 复审人
  323. expenseFinanceId: _this.state.theTypes4
  324. ? _this.state.theTypes4
  325. : _this.state.accountrId, // 报销审核人
  326. superId: oldId, //上级组织
  327. status: _this.state.editStatus, //组织状态
  328. remarks: remarksText, //组织职能说明
  329. id: _this.state.editId, //组织ID
  330. abbreviation: _this.state.abbreviation,
  331. workingHoursType: _this.state.workingHoursType,
  332. hideSign: _this.state.hideSign,//显示标识
  333. depNo: _this.state.depNo,//组织编号
  334. approval: _this.state.approval, //是否需要特批审核
  335. expenseRetrialFinanceExamine: _this.state.expenseRetrialFinanceExamine, // 财务复审
  336. ceoExamine: _this.state.ceoExamine, // 董事长审核
  337. cfoExamine: _this.state.cfoExamine, // 财务总监审核
  338. viceCeoExamine: _this.state.viceCeoExamine, // 集团副总审核
  339. cashierExamine: _this.state.cashierExamine, // 出纳审核
  340. techAdminId: _this.state.techAdminId, // 技术总监
  341. }
  342. }).done(
  343. function (data) {
  344. _this.setState({
  345. loading: false
  346. });
  347. if (!data.error.length) {
  348. message.success("保存成功!");
  349. _this.edithandleCancel();
  350. _this.selectSuperId();
  351. } else {
  352. message.warning(data.error[0].message);
  353. }
  354. }.bind(_this)
  355. );
  356. }
  357. }
  358. })
  359. } else {
  360. if (!(superOne == superText)) {
  361. confirm({
  362. title: '上级组织已修改,是否保存?',
  363. onOk() {
  364. $.ajax({
  365. method: "post",
  366. dataType: "json",
  367. crossDomain: false,
  368. url:
  369. globalConfig.context +
  370. "/api/admin/organization/updateOrganization",
  371. data: {
  372. name: _this.state.editName, //组织名称
  373. type: _this.state.editType, //组织类型
  374. managerId: _this.state.theTypes
  375. ? _this.state.theTypes
  376. : _this.state.managerIdOrganizationId, //负责人ID
  377. financeId: _this.state.theTypes2
  378. ? _this.state.theTypes2
  379. : _this.state.financeId, //负责人ID
  380. approvalAid: _this.state.theTypes1
  381. ? _this.state.theTypes1
  382. : _this.state.approvalAid, //审核人ID
  383. retrialFinanceId: _this.state.theTypes3
  384. ? _this.state.theTypes3
  385. : _this.state.reviewerId, // 复审人
  386. expenseFinanceId: _this.state.theTypes4
  387. ? _this.state.theTypes4
  388. : _this.state.accountrId, // 报销审核人
  389. superId: _this.state.editSuperId, //上级组织
  390. status: _this.state.editStatus, //组织状态
  391. province: _this.state.province,//省份
  392. remarks: remarksText, //组织职能说明
  393. id: _this.state.editId, //组织ID
  394. abbreviation: _this.state.abbreviation,
  395. workingHoursType: _this.state.workingHoursType,
  396. hideSign: _this.state.hideSign,//显示标识
  397. depNo: _this.state.depNo,//组织编号
  398. approval: _this.state.approval, //是否需要特批审核
  399. expenseRetrialFinanceExamine: _this.state.expenseRetrialFinanceExamine, // 财务复审
  400. ceoExamine: _this.state.ceoExamine, // 董事长审核
  401. cfoExamine: _this.state.cfoExamine, // 财务总监审核
  402. viceCeoExamine: _this.state.viceCeoExamine, // 集团副总审核
  403. cashierExamine: _this.state.cashierExamine, // 出纳审核
  404. techAdminId: _this.state.techAdminId, // 技术总监
  405. }
  406. }).done(
  407. function (data) {
  408. _this.setState({
  409. loading: false
  410. });
  411. if (!data.error.length) {
  412. message.success("保存成功!");
  413. _this.edithandleCancel();
  414. _this.selectSuperId();
  415. } else {
  416. message.warning(data.error[0].message);
  417. }
  418. }.bind(_this)
  419. );
  420. return false
  421. }
  422. })
  423. } else {
  424. $.ajax({
  425. method: "post",
  426. dataType: "json",
  427. crossDomain: false,
  428. url:
  429. globalConfig.context +
  430. "/api/admin/organization/updateOrganization",
  431. data: {
  432. name: _this.state.editName, //组织名称
  433. type: _this.state.editType, //组织类型
  434. managerId: _this.state.theTypes
  435. ? _this.state.theTypes
  436. : _this.state.managerIdOrganizationId, //负责人ID
  437. financeId: _this.state.theTypes2
  438. ? _this.state.theTypes2
  439. : _this.state.financeId, //负责人ID
  440. approvalAid: _this.state.theTypes1
  441. ? _this.state.theTypes1
  442. : _this.state.approvalAid, //审核人ID
  443. retrialFinanceId: _this.state.theTypes3
  444. ? _this.state.theTypes3
  445. : _this.state.reviewerId, // 复审人
  446. expenseFinanceId: _this.state.theTypes4
  447. ? _this.state.theTypes4
  448. : _this.state.accountrId, // 报销审核人
  449. superId: oldId, //上级组织
  450. status: _this.state.editStatus, //组织状态
  451. remarks: remarksText, //组织职能说明
  452. id: _this.state.editId, //组织ID
  453. abbreviation: _this.state.abbreviation,
  454. province: _this.state.province,
  455. workingHoursType: _this.state.workingHoursType,
  456. hideSign: _this.state.hideSign,//显示标识
  457. depNo: _this.state.depNo,//组织编号
  458. approval: _this.state.approval, // 是否需要特批
  459. expenseRetrialFinanceExamine: _this.state.expenseRetrialFinanceExamine, // 财务复审
  460. ceoExamine: _this.state.ceoExamine, // 董事长审核
  461. cfoExamine: _this.state.cfoExamine, // 财务总监审核
  462. viceCeoExamine: _this.state.viceCeoExamine, // 集团副总审核
  463. cashierExamine: _this.state.cashierExamine, // 出纳审核
  464. techAdminId: _this.state.techAdminId, // 技术总监
  465. }
  466. }).done(
  467. function (data) {
  468. _this.setState({
  469. loading: false
  470. });
  471. if (!data.error.length) {
  472. message.success("保存成功!");
  473. _this.edithandleCancel();
  474. _this.selectSuperId();
  475. } else {
  476. message.warning(data.error[0].message);
  477. }
  478. }.bind(_this)
  479. );
  480. }
  481. }
  482. },
  483. //整行点击
  484. tableRowClick(record, index) {
  485. this.selectSuperId();
  486. this.state.RowData = record;
  487. this.setState({
  488. editvisible: true,
  489. selectedRowKeys: [],
  490. rowId: record.businessId,
  491. })
  492. $.ajax({
  493. method: "post",
  494. dataType: "json",
  495. crossDomain: false,
  496. url: globalConfig.context + "/api/admin/organization/selectAllById",
  497. data: {
  498. id: record.id
  499. },
  500. success: function (data) {
  501. let theArr = [];
  502. let thisdata = data.data;
  503. if (data.error.length === 0) {
  504. theArr.push({
  505. editId: thisdata.id, //每一条记录的ID
  506. editName: thisdata.name, //组织名称
  507. editManagerId: thisdata.managerId, //负责人
  508. editType: thisdata.type, //组织类型
  509. editStatus: thisdata.status, //组织状态
  510. province: thisdata.province,//省份
  511. editSuperId: thisdata.superId, //上级组织
  512. depNo: thisdata.depNo, //组织编号
  513. editCreateId: thisdata.createId, //创建人
  514. editTime: thisdata.createTime, //创建时间
  515. editRemarks: thisdata.remarks, //组织职能说明
  516. workingHoursType: thisdata.workingHoursType,//作息时间类型
  517. financeId: thisdata.financeId, // 财务负责人
  518. approvalAid: thisdata.approvalAid, // 审核人
  519. reviewerId: thisdata.retrialFinanceId, // 财务复审
  520. reviewerName: thisdata.retrialFinanceName,
  521. accountrId: thisdata.expenseFinanceId, // 报销审核
  522. accountrName: thisdata.expenseFinanceName,
  523. hideSign: thisdata.hideSign,//显示标识
  524. approval: thisdata.approval, // 特批审核
  525. expenseRetrialFinanceExamine: thisdata.expenseRetrialFinanceExamine, //财务复审
  526. expenseRetrialFinanceExamineList: thisdata.expenseRetrialFinanceExamineList,
  527. ceoExamine: thisdata.ceoExamine, //董事长审核
  528. ceoExamineList: thisdata.ceoExamineList,
  529. cfoExamine: thisdata.cfoExamine, //财务总监审核
  530. cfoExamineList: thisdata.cfoExamineList,
  531. viceCeoExamine: thisdata.viceCeoExamine, //集团副总审核
  532. viceCeoExamineList: thisdata.viceCeoExamineList,
  533. cashierExamine: thisdata.cashierExamine, //出纳审核
  534. cashierExamineList: thisdata.cashierExamineList,
  535. techAdminId: thisdata.techAdminId, // 技术总监
  536. techAdminName: thisdata.techAdminName,
  537. });
  538. this.setState({
  539. editId: thisdata.id, //每一条记录的ID
  540. financeId: thisdata.financeId,
  541. financeName: thisdata.financeName,
  542. approvalAid: thisdata.approvalAid, // 审核人
  543. approvalName: thisdata.approvalName, // 审核人
  544. editName: thisdata.name, //组织名称
  545. managerIdOrganization: thisdata.managerName, //负责人名字
  546. managerIdOrganizationId: thisdata.managerId, //负责人idmanagerName
  547. reviewerId: thisdata.retrialFinanceId, // 财务复审
  548. reviewerName: thisdata.retrialFinanceName,
  549. accountrId: thisdata.expenseFinanceId, // 报销审核
  550. accountrName: thisdata.expenseFinanceName,
  551. editType: thisdata.type, //组织类型
  552. editStatus: thisdata.status, //组织状态
  553. province: thisdata.province, //省份
  554. editSuperId: thisdata.superId, //上级组织
  555. depNo: thisdata.depNo, //组织编号
  556. editCreateId: thisdata.createId, //创建人
  557. editTime: thisdata.createTime, //创建时间
  558. editRemarks: thisdata.remarks, //组织职能说明
  559. workingHoursType: thisdata.workingHoursType,//作息时间类型
  560. editDataSource: theArr,
  561. abbreviation: thisdata.abbreviation,
  562. hideSign: thisdata.hideSign,//显示标识
  563. approval: thisdata.approval, // 特批审核
  564. expenseRetrialFinanceExamine: thisdata.expenseRetrialFinanceExamine, //财务复审
  565. expenseRetrialFinanceExamineList: thisdata.expenseRetrialFinanceExamineList,
  566. ceoExamine: thisdata.ceoExamine, //董事长审核
  567. ceoExamineList: thisdata.ceoExamineList,
  568. cfoExamine: thisdata.cfoExamine, //财务总监审核
  569. cfoExamineList: thisdata.cfoExamineList,
  570. viceCeoExamine: thisdata.viceCeoExamine, //集团副总审核
  571. viceCeoExamineList: thisdata.viceCeoExamineList,
  572. cashierExamine: thisdata.cashierExamine, //出纳审核
  573. cashierExamineList: thisdata.cashierExamineList,
  574. techAdminId: thisdata.techAdminId, // 技术总监
  575. techAdminName: thisdata.techAdminName,
  576. });
  577. } else {
  578. message.warning(data.error[0].message);
  579. }
  580. }.bind(this),
  581. }).always(function (data) {
  582. this.setState({
  583. loading: false
  584. });
  585. }.bind(this));
  586. },
  587. //整行删除
  588. delectRow() {
  589. let deletedIds = '';
  590. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  591. let rowItem = this.state.selectedRows[idx];
  592. if (rowItem.id) {
  593. deletedIds = rowItem.id;
  594. };
  595. };
  596. this.setState({
  597. selectedRowKeys: [],
  598. loading: deletedIds.length > 0
  599. });
  600. $.ajax({
  601. method: "POST",
  602. dataType: "json",
  603. crossDomain: false,
  604. url: globalConfig.context + "/api/admin/organization/deleteById",
  605. data: {
  606. id: deletedIds
  607. }
  608. }).done(function (data) {
  609. if (!data.error.length) {
  610. message.success('删除成功!');
  611. this.setState({
  612. loading: false,
  613. });
  614. } else {
  615. message.warning(data.error[0].message);
  616. };
  617. this.selectSuperId();
  618. }.bind(this));
  619. },
  620. //新增一个部门,保存
  621. addhandleSubmit(e) {
  622. e.preventDefault();
  623. // if(!this.state.theTypes){
  624. // message.warning('请输入负责人姓名');
  625. // return false;
  626. // }
  627. if (!this.state.typeOrganization) {
  628. message.warning('请选择组织类型');
  629. return false;
  630. }
  631. if (!this.state.upOrganization) {
  632. message.warning('请选择上级组织');
  633. return false;
  634. }
  635. if (!this.state.depNo) {
  636. message.warning('请填写组织编号');
  637. return false;
  638. }
  639. this.props.form.validateFields((err, values) => {
  640. if (!err) {
  641. this.setState({
  642. loading: true
  643. });
  644. $.ajax({
  645. method: "post",
  646. dataType: "json",
  647. crossDomain: false,
  648. url: globalConfig.context + '/api/admin/organization/addOrganization',
  649. data: {
  650. name: this.state.nameOrganization,//组织名称
  651. managerId: this.state.theTypes,//负责人ID
  652. type: this.state.typeOrganization, //组织类型
  653. superId: this.state.upOrganization,//上级组织
  654. remarks: this.state.remarksOrganization,//组织职能说明
  655. workingHoursType: this.state.workingHoursType,//作息时间
  656. hideSign: this.state.hideSign,//显示标识
  657. depNo: this.state.depNo,//组织编号
  658. }
  659. }).done(function (data) {
  660. this.setState({
  661. loading: false
  662. });
  663. if (!data.error.length) {
  664. message.success('保存成功!');
  665. this.handleCancel();
  666. this.selectSuperId();
  667. } else {
  668. message.warning(data.error[0].message);
  669. }
  670. }.bind(this));
  671. }
  672. });
  673. },
  674. //主管初始加载(自动补全)
  675. supervisor(e) {
  676. $.ajax({
  677. method: "post",
  678. dataType: "json",
  679. crossDomain: false,
  680. url: globalConfig.context + "/api/admin/organization/selectName",
  681. data: {
  682. name: e
  683. },
  684. success: function (data) {
  685. let thedata = data.data;
  686. if (!thedata) {
  687. if (data.error && data.error.length) {
  688. message.warning(data.error[0].message);
  689. };
  690. thedata = {};
  691. };
  692. this.setState({
  693. customerArr: thedata,
  694. });
  695. }.bind(this),
  696. }).always(function () {
  697. this.setState({
  698. loading: false
  699. });
  700. }.bind(this));
  701. },
  702. selectAutosel(value) {
  703. this.setState({
  704. adminName: value
  705. })
  706. let theType = '';
  707. let contactLists = this.state.customerArr || [];
  708. if (value) {
  709. contactLists.map(function (item) {
  710. if (item.name == value.toString()) {
  711. theType = item.id;
  712. }
  713. });
  714. }
  715. this.setState({
  716. aid: theType
  717. })
  718. },
  719. //上级主管输入框失去焦点是判断客户是否存在
  720. selectAuto(value, options) {
  721. this.setState({
  722. managerIdOrganization: value
  723. })
  724. let theType = '';
  725. let contactLists = this.state.customerArr || [];
  726. if (value) {
  727. contactLists.map(function (item) {
  728. if (item.name == value.toString()) {
  729. theType = item.id;
  730. }
  731. });
  732. }
  733. this.setState({
  734. theTypes: theType
  735. })
  736. },
  737. selectAuto1(value, options) {
  738. this.setState({
  739. approvalAid: value
  740. })
  741. let theType = '';
  742. let contactLists = this.state.customerArr || [];
  743. if (value) {
  744. contactLists.map(function (item) {
  745. if (item.name == value.toString()) {
  746. theType = item.id;
  747. }
  748. });
  749. }
  750. this.setState({
  751. theTypes1: theType
  752. })
  753. },
  754. selectAuto2(value, options) {
  755. this.setState({
  756. financeId: value
  757. })
  758. let theType = '';
  759. let contactLists = this.state.customerArr || [];
  760. if (value) {
  761. contactLists.map(function (item) {
  762. if (item.name == value.toString()) {
  763. theType = item.id;
  764. }
  765. });
  766. }
  767. this.setState({
  768. theTypes2: theType
  769. })
  770. },
  771. selectAuto3(value, options) {
  772. this.setState({
  773. reviewerId: value
  774. })
  775. let theType = '';
  776. let contactLists = this.state.customerArr || [];
  777. if (value) {
  778. contactLists.map(function (item) {
  779. if (item.name == value.toString()) {
  780. theType = item.id;
  781. }
  782. });
  783. }
  784. this.setState({
  785. theTypes3: theType
  786. })
  787. },
  788. selectAuto4(value, options) {
  789. this.setState({
  790. accountrId: value
  791. })
  792. let theType = '';
  793. let contactLists = this.state.customerArr || [];
  794. if (value) {
  795. contactLists.map(function (item) {
  796. if (item.name == value.toString()) {
  797. theType = item.id;
  798. }
  799. });
  800. }
  801. this.setState({
  802. theTypes4: theType
  803. })
  804. },
  805. //失去焦点时
  806. blurChange(e) {
  807. let theType = '';
  808. let contactLists = this.state.customerArr || [];
  809. if (e) {
  810. contactLists.map(function (item) {
  811. if (item.name == e.toString()) {
  812. theType = item.id
  813. }
  814. });
  815. } else {
  816. this.setState({
  817. reviewerId: null
  818. })
  819. }
  820. this.setState({
  821. theTypes3: theType,
  822. })
  823. },
  824. httpChangesel(e) {
  825. if (e.length >= 1) {
  826. this.supervisor(e);
  827. }
  828. this.setState({
  829. adminName: e
  830. })
  831. },
  832. //值改变时请求客户名称
  833. httpChange(e) {
  834. if (e.length >= 1) {
  835. this.supervisor(e);
  836. }
  837. this.setState({
  838. managerIdOrganization: e
  839. })
  840. },
  841. httpChange1(e) {
  842. if (e.length >= 1) {
  843. this.supervisor(e);
  844. }
  845. this.setState({
  846. approvalName: e
  847. })
  848. },
  849. httpChange2(e) {
  850. if (e.length >= 1) {
  851. this.supervisor(e);
  852. }
  853. this.setState({
  854. financeName: e
  855. })
  856. },
  857. httpChange3(e) {
  858. if (e.length >= 1) {
  859. this.supervisor(e);
  860. }
  861. this.setState({
  862. reviewerName: e
  863. })
  864. },
  865. httpChange4(e) {
  866. if (e.length >= 1) {
  867. this.supervisor(e);
  868. }
  869. this.setState({
  870. accountrName: e
  871. })
  872. },
  873. addClick() {
  874. this.state.DepN = '';//组织编号
  875. this.state.theTypes = '';
  876. this.state.nameOrganization = '';//组织名称清零
  877. this.state.managerIdOrganization = '';//负责人ID清零
  878. this.state.financeId = "";//负责人ID清零
  879. this.state.financeName = "";//负责人ID清零
  880. this.state.approvalAid = "";//审核人ID清零
  881. this.state.approvalName = "";//审核人清零
  882. this.state.techAdminId = ""; // 技术总监
  883. this.state.techAdminName = "";
  884. this.state.reviewerId = "";//复审人
  885. this.state.reviewerName = "";//复审人
  886. this.state.accountrId = "";//报销审核人
  887. this.state.accountrName = "";//报销审核人
  888. this.state.approvalName = ""; //特批审核人
  889. this.state.typeOrganization = undefined; //组织类型清零
  890. this.state.upOrganization = undefined;//上级组织清零
  891. this.state.remarksOrganization = '';//组织职能说明清零
  892. this.state.hideSign = 1;//显示标识默认为1(显示)
  893. this.state.approval = 1;//特批审核 1(需要)
  894. this.state.RowData = {};
  895. this.setState({
  896. workingHoursType: 0,
  897. visible: true
  898. });
  899. this.selectSuperId();
  900. },
  901. editClick() {
  902. this.state.RowData = {};
  903. this.setState({
  904. editvisible: true
  905. });
  906. },
  907. handleCancel() {
  908. this.setState({ visible: false })
  909. },
  910. edithandleCancel() {
  911. this.loadData(this.state.page);
  912. this.setState({ editvisible: false })
  913. },
  914. search() {
  915. this.loadData();
  916. },
  917. //把搜索的部分置零
  918. reset() {
  919. this.state.superId = undefined;//上级组织清零
  920. this.state.name = '';//组织名称清零
  921. this.state.type = undefined;//组织类型清零
  922. this.state.depNo1 = '';//组织编号清零
  923. this.loadData();
  924. },
  925. searchSwitch() {
  926. this.setState({
  927. searchMore: !this.state.searchMore
  928. });
  929. },
  930. changeList(arr) {
  931. const newArr = [];
  932. this.state.columns.forEach(item => {
  933. arr.forEach(val => {
  934. if (val === item.title) {
  935. newArr.push(item);
  936. }
  937. });
  938. });
  939. this.setState({
  940. changeList: newArr
  941. });
  942. },
  943. handleOk() {
  944. $.ajax({
  945. method: "post",
  946. dataType: "json",
  947. crossDomain: false,
  948. url: globalConfig.context + '/api/admin/expenseConfig/addDeTails',
  949. data: {
  950. type: this.state.addtype, // 类型
  951. aid: this.state.aid, // 管理员编号
  952. adminName: this.state.adminName, // 管理员名称
  953. depId: this.state.editId, // 部门编号
  954. }
  955. }).done(function (data) {
  956. this.setState({
  957. loading: false
  958. });
  959. if (!data.error.length) {
  960. message.success('添加成功!');
  961. let list = this.state.addtype == 1
  962. ? this.state.expenseRetrialFinanceExamineList : this.state.addtype == 2
  963. ? this.state.ceoExamineList : this.state.addtype == 3
  964. ? this.state.cfoExamineList : this.state.addtype == 4
  965. ? this.state.viceCeoExamineList : this.state.addtype == 5
  966. ? this.state.cashierExamineList : []
  967. list.push(data.data)
  968. if (this.state.addtype == 1) {
  969. this.setState({
  970. expenseRetrialFinanceExamineList: list
  971. })
  972. } else if (this.state.addtype == 2) {
  973. this.setState({
  974. ceoExamineList: list
  975. })
  976. } if (this.state.addtype == 3) {
  977. this.setState({
  978. cfoExamineList: list
  979. })
  980. } if (this.state.addtype == 4) {
  981. this.setState({
  982. viceCeoExamineList: list
  983. })
  984. } if (this.state.addtype == 5) {
  985. this.setState({
  986. cashierExamineList: list
  987. })
  988. }
  989. this.handleNo()
  990. } else {
  991. message.warning(data.error[0].message);
  992. }
  993. }.bind(this));
  994. },
  995. handleNo() {
  996. this.setState({
  997. addtype: -1,
  998. aid: "",
  999. adminName: "",
  1000. })
  1001. },
  1002. deleteDeTails(type, dataList, id) {
  1003. $.ajax({
  1004. method: "post",
  1005. dataType: "json",
  1006. crossDomain: false,
  1007. url: globalConfig.context + '/api/admin/expenseConfig/deleteDeTails',
  1008. data: {
  1009. id, //
  1010. }
  1011. }).done(function (data) {
  1012. this.setState({
  1013. loading: false
  1014. });
  1015. if (!data.error.length) {
  1016. message.success('移除成功!');
  1017. let lx = dataList.findIndex(item => item.id === id)
  1018. dataList.splice(lx, 1)
  1019. if (type == 1) {
  1020. this.setState({
  1021. expenseRetrialFinanceExamineList: dataList
  1022. })
  1023. } else if (type == 2) {
  1024. this.setState({
  1025. ceoExamineList: dataList
  1026. })
  1027. } if (type == 3) {
  1028. this.setState({
  1029. cfoExamineList: dataList
  1030. })
  1031. } if (type == 4) {
  1032. this.setState({
  1033. viceCeoExamineList: dataList
  1034. })
  1035. } if (type == 5) {
  1036. this.setState({
  1037. cashierExamineList: dataList
  1038. })
  1039. }
  1040. } else {
  1041. message.warning(data.error[0].message);
  1042. }
  1043. }.bind(this));
  1044. },
  1045. render() {
  1046. const FormItem = Form.Item
  1047. const rowSelection = {
  1048. selectedRowKeys: this.state.selectedRowKeys,
  1049. onChange: (selectedRowKeys, selectedRows) => {
  1050. this.setState({
  1051. selectedRows: selectedRows.slice(-1),
  1052. selectedRowKeys: selectedRowKeys.slice(-1)
  1053. });
  1054. },
  1055. onSelect: (recordt, selected, selectedRows) => {
  1056. this.setState({
  1057. recordt: recordt.id
  1058. })
  1059. },
  1060. };
  1061. const formItemLayout = {
  1062. labelCol: { span: 6 },
  1063. wrapperCol: { span: 18 },
  1064. };
  1065. const { getFieldDecorator } = this.props.form;
  1066. const hasSelected = this.state.selectedRowKeys.length > 0;
  1067. const { RangePicker } = DatePicker;
  1068. const dataSources = this.state.customerArr || [];
  1069. const options = dataSources.map((group, index) =>
  1070. <Option key={index} value={group.name}>{group.name}</Option>
  1071. )
  1072. const options2 = dataSources.map((group, index) =>
  1073. <Option key={index} value={group.name}>{group.name}</Option>
  1074. )
  1075. return (
  1076. <div className="user-content" >
  1077. <div className="content-title">
  1078. <Tabs
  1079. defaultActiveKey="1"
  1080. onChange={this.callback}
  1081. className="test">
  1082. <TabPane tab="搜索" key="1">
  1083. <div className="user-search">
  1084. <Input placeholder="组织名称" style={{ width: '150px', marginRight: '10px', marginBottom: '10px' }}
  1085. value={this.state.name}
  1086. onChange={(e) => { this.setState({ name: e.target.value }); }} />
  1087. <Select placeholder="上级组织"
  1088. style={{ width: '200px', marginRight: '10px' }}
  1089. value={this.state.superId}
  1090. onChange={(e) => { this.setState({ superId: e }) }} notFoundContent="未获取到上级组织列表">
  1091. {this.state.contactsOption}
  1092. </Select>
  1093. <Button type="primary" onClick={this.search} style={{ marginRight: '10px' }}>搜索</Button>
  1094. <Button onClick={this.reset} style={{ marginRight: '10px' }}>重置</Button>
  1095. <Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
  1096. <Button style={{ background: "#ea0862", border: "none", color: "#fff", marginRight: '10px', marginLeft: '10px' }}
  1097. disabled={!hasSelected}
  1098. >删除<Icon type="minus" />
  1099. </Button>
  1100. </Popconfirm>
  1101. <span style={{ marginRight: '20px' }}>更多搜索 <Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  1102. <div style={this.state.searchMore ? { display: 'none' } : { display: 'inline-block' }}>
  1103. <Input placeholder="组织编号" style={{ width: '150px', marginRight: '10px' }}
  1104. value={this.state.depNo1}
  1105. onChange={(e) => { this.setState({ depNo1: e.target.value }); }} />
  1106. <Select placeholder="组织类型"
  1107. style={{ width: '150px', marginRight: '50px' }}
  1108. value={this.state.type}
  1109. onChange={(e) => { this.setState({ type: e }) }}>
  1110. <Select.Option value="0" >公司</Select.Option>
  1111. <Select.Option value="1" >部门</Select.Option>
  1112. <Select.Option value="2" >团队</Select.Option>
  1113. </Select>
  1114. </div>
  1115. </div>
  1116. </TabPane>
  1117. <TabPane tab="新增组织" key="2" >
  1118. <Button
  1119. type="primary"
  1120. className="addButton"
  1121. onClick={this.addClick}
  1122. style={{ marginBottom: '10px', float: 'left' }}
  1123. >新增组织<Icon type="plus" /></Button>
  1124. </TabPane>
  1125. <TabPane tab="更改表格显示数据" key="3">
  1126. <div style={{ marginLeft: 10 }}>
  1127. <ChooseList
  1128. columns={this.state.columns}
  1129. changeFn={this.changeList}
  1130. changeList={this.state.changeList}
  1131. top={55}
  1132. margin={11}
  1133. />
  1134. </div>
  1135. </TabPane>
  1136. </Tabs>
  1137. <div className="patent-table">
  1138. <Spin spinning={this.state.loading}>
  1139. <Table size="middle" columns={
  1140. this.state.changeList
  1141. ? this.state.changeList
  1142. : this.state.columns
  1143. }
  1144. dataSource={this.state.dataSource}
  1145. rowSelection={rowSelection}
  1146. style={{
  1147. cursor: 'pointer',
  1148. }}
  1149. pagination={this.state.pagination}
  1150. onRowClick={this.tableRowClick} />
  1151. </Spin>
  1152. </div>
  1153. <div className="patent-desc">
  1154. <Modal maskClosable={false} visible={this.state.visible}
  1155. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  1156. width='600px'
  1157. title='新增组织'
  1158. footer=''
  1159. className="admin-desc-content">
  1160. <Form horizontal onSubmit={this.addhandleSubmit} id="add-form">
  1161. <Spin spinning={this.state.loading}>
  1162. <div className="clearfix">
  1163. <FormItem
  1164. labelCol={{ span: 7 }}
  1165. wrapperCol={{ span: 12 }}
  1166. label="组织名称" >
  1167. <Input placeholder="组织名称" value={this.state.nameOrganization} style={{ width: '95%' }}
  1168. onChange={(e) => { this.setState({ nameOrganization: e.target.value }) }} required="required" />
  1169. <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1170. </FormItem>
  1171. </div>
  1172. <div className="clearfix">
  1173. <FormItem
  1174. labelCol={{ span: 7 }}
  1175. wrapperCol={{ span: 12 }}
  1176. label="负责人"
  1177. >
  1178. <AutoComplete
  1179. className="certain-category-search"
  1180. dropdownClassName="certain-category-search-dropdown"
  1181. dropdownMatchSelectWidth={false}
  1182. dataSource={options}
  1183. placeholder="输入名称"
  1184. value={this.state.managerIdOrganization}
  1185. onChange={this.httpChange}
  1186. filterOption={true}
  1187. // onBlur={this.blurChange}
  1188. onSelect={this.selectAuto}
  1189. // style={{ width: '95%' }}
  1190. >
  1191. <Input />
  1192. </AutoComplete>
  1193. {/*<span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>*/}
  1194. </FormItem>
  1195. </div>
  1196. <div className="clearfix">
  1197. <FormItem
  1198. labelCol={{ span: 7 }}
  1199. wrapperCol={{ span: 12 }}
  1200. label="组织类型"
  1201. >
  1202. <Select placeholder="组织类型" value={this.state.typeOrganization}
  1203. onChange={(e) => { this.setState({ typeOrganization: e }) }} style={{ width: '95%' }} required="required">
  1204. {
  1205. patternOrganization.map(function (item) {
  1206. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1207. })
  1208. }
  1209. </Select>
  1210. <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1211. </FormItem>
  1212. </div>
  1213. <div className="clearfix">
  1214. <FormItem
  1215. labelCol={{ span: 7 }}
  1216. wrapperCol={{ span: 12 }}
  1217. label="上级组织"
  1218. >
  1219. <Select placeholder="请选择上级组织"
  1220. value={this.state.upOrganization}
  1221. onChange={(e) => { this.setState({ upOrganization: e }) }}
  1222. notFoundContent="未获取到上级组织列表"
  1223. style={{ width: '95%' }} required="required">
  1224. {this.state.contactsOption}
  1225. </Select>
  1226. <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1227. </FormItem>
  1228. </div>
  1229. <div className="clearfix">
  1230. <FormItem
  1231. labelCol={{ span: 7 }}
  1232. wrapperCol={{ span: 12 }}
  1233. label="选择作息时间类型"
  1234. >
  1235. <Select placeholder="请选择作息时间类型"
  1236. style={{ width: '95%' }}
  1237. value={this.state.workingHoursType}
  1238. onChange={(e) => { this.setState({ workingHoursType: e }) }}
  1239. notFoundContent="未获取到作息时间类型">
  1240. {this.state.workTimeList.map((v, k) => (
  1241. <Select.Option value={v.type} key={k}>{v.name}</Select.Option>
  1242. ))}
  1243. </Select>
  1244. </FormItem>
  1245. </div>
  1246. <div className="clearfix">
  1247. <FormItem
  1248. labelCol={{ span: 7 }}
  1249. wrapperCol={{ span: 12 }}
  1250. label="组织编号"
  1251. >
  1252. <Input
  1253. placeholder='组织编号'
  1254. value={this.state.depNo}
  1255. onChange={(e) => {
  1256. this.setState({
  1257. depNo: e.target.value
  1258. })
  1259. }}
  1260. />
  1261. </FormItem>
  1262. </div>
  1263. <div className="clearfix">
  1264. <FormItem
  1265. labelCol={{ span: 7 }}
  1266. wrapperCol={{ span: 12 }}
  1267. label="组织职能说明" >
  1268. <Input type="textarea" rows={4} placeholder="组织职能说明" value={this.state.remarksOrganization}
  1269. onChange={(e) => { this.setState({ remarksOrganization: e.target.value }) }} style={{ width: '95%' }} />
  1270. </FormItem>
  1271. </div>
  1272. <div className="clearfix">
  1273. <FormItem
  1274. labelCol={{ span: 7 }}
  1275. wrapperCol={{ span: 12 }}
  1276. label="显示标识"
  1277. >
  1278. <Select placeholder="显示标识"
  1279. value={this.state.hideSign}
  1280. onChange={(e) => { this.setState({ hideSign: e }) }}
  1281. style={{ width: '95%' }}
  1282. required="required"
  1283. >
  1284. <Option value={0}>不显示</Option>
  1285. <Option value={1}>显示</Option>
  1286. </Select>
  1287. <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1288. </FormItem>
  1289. </div>
  1290. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  1291. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1292. <Button className="set-submit" type="ghost" onClick={this.handleCancel} style={{ marginLeft: '100px' }}>取消</Button>
  1293. </FormItem>
  1294. </Spin>
  1295. </Form >
  1296. </Modal>
  1297. </div>
  1298. <div className="patent-desc">
  1299. <Modal maskClosable={false} visible={this.state.editvisible}
  1300. onOk={this.checkPatentProcess} onCancel={this.edithandleCancel}
  1301. width='1000px'
  1302. title='编辑组织'
  1303. footer=''
  1304. className="admin-desc-content">
  1305. <Form horizontal onSubmit={this.edithandleSubmit} id="edit-form">
  1306. <Spin spinning={this.state.loading}>
  1307. <div className="clearfix">
  1308. <FormItem
  1309. className="half-item"
  1310. {...formItemLayout}
  1311. label="组织名称" >
  1312. <Input placeholder="组织名称" value={this.state.editName}
  1313. style={{ width: '70%' }}
  1314. onChange={(e) => { this.setState({ editName: e.target.value }) }} />
  1315. </FormItem>
  1316. <FormItem
  1317. className="half-item"
  1318. {...formItemLayout}
  1319. label="特批审核"
  1320. >
  1321. <Select placeholder="特批审核"
  1322. value={this.state.approval}
  1323. style={{ width: '70%' }}
  1324. onChange={(e) => { this.setState({ approval: e }) }}
  1325. required="required"
  1326. >
  1327. <Option value={0}>不需要</Option>
  1328. <Option value={1}>需要</Option>
  1329. </Select>
  1330. <span style={{ color: "red" }}> 订单/合同特批</span>
  1331. </FormItem>
  1332. </div>
  1333. <div className="clearfix">
  1334. <FormItem
  1335. className="half-item"
  1336. {...formItemLayout}
  1337. label="负责人"
  1338. >
  1339. <AutoComplete
  1340. className="certain-category-search"
  1341. dropdownClassName="certain-category-search-dropdown"
  1342. dropdownMatchSelectWidth={false}
  1343. dataSource={options}
  1344. placeholder="输入名称"
  1345. value={this.state.managerIdOrganization}
  1346. onChange={this.httpChange}
  1347. filterOption={true}
  1348. // onBlur={this.blurChange}
  1349. onSelect={this.selectAuto}
  1350. style={{ width: '70%' }}
  1351. >
  1352. <Input />
  1353. </AutoComplete>
  1354. {/* <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span> */}
  1355. </FormItem>
  1356. <FormItem
  1357. className="half-item"
  1358. {...formItemLayout}
  1359. label="审核人"
  1360. >
  1361. <AutoComplete
  1362. disabled={this.state.approval != 1}
  1363. className="certain-category-search"
  1364. dropdownClassName="certain-category-search-dropdown"
  1365. dropdownMatchSelectWidth={false}
  1366. dataSource={options}
  1367. placeholder="输入名称"
  1368. value={this.state.approvalName}
  1369. onChange={this.httpChange1}
  1370. filterOption={true}
  1371. // onBlur={this.blurChange}
  1372. onSelect={this.selectAuto1}
  1373. style={{ width: '70%' }}
  1374. >
  1375. <Input />
  1376. </AutoComplete>
  1377. {/* <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>特批/变更审核</span> */}
  1378. </FormItem>
  1379. </div>
  1380. <div className="clearfix">
  1381. <FormItem
  1382. className="half-item"
  1383. {...formItemLayout}
  1384. label="组织类型"
  1385. >
  1386. <Select
  1387. placeholder="组织类型"
  1388. value={this.state.editType}
  1389. style={{ width: '70%' }}
  1390. onChange={(e) => { this.setState({ editType: e }) }}>
  1391. {
  1392. patternOrganization.map(function (item) {
  1393. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1394. })
  1395. }
  1396. </Select>
  1397. </FormItem>
  1398. <FormItem
  1399. className="half-item"
  1400. {...formItemLayout}
  1401. label="财务负责人"
  1402. >
  1403. <AutoComplete
  1404. className="certain-category-search"
  1405. dropdownClassName="certain-category-search-dropdown"
  1406. dropdownMatchSelectWidth={false}
  1407. dataSource={options2}
  1408. placeholder="输入名称"
  1409. value={this.state.financeName}
  1410. onChange={this.httpChange2}
  1411. filterOption={true}
  1412. // onBlur={this.blurChange}
  1413. onSelect={this.selectAuto2}
  1414. style={{ width: '70%' }}
  1415. >
  1416. <Input />
  1417. </AutoComplete>
  1418. {/* <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span> */}
  1419. </FormItem>
  1420. </div>
  1421. <div className="clearfix">
  1422. <FormItem
  1423. className="half-item"
  1424. {...formItemLayout}
  1425. label="组织状态"
  1426. >
  1427. <Select
  1428. placeholder="组织状态"
  1429. value={this.state.editStatus}
  1430. style={{ width: '70%' }}
  1431. onChange={(e) => { this.setState({ editStatus: e }) }}>
  1432. {
  1433. conditionOrganization.map(function (item) {
  1434. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1435. })
  1436. }
  1437. </Select>
  1438. </FormItem>
  1439. <FormItem
  1440. className="half-item"
  1441. {...formItemLayout}
  1442. label="财务复审"
  1443. >
  1444. <AutoComplete
  1445. className="certain-category-search"
  1446. dropdownClassName="certain-category-search-dropdown"
  1447. dropdownMatchSelectWidth={false}
  1448. dataSource={options}
  1449. placeholder="输入名称"
  1450. value={this.state.reviewerName}
  1451. onChange={this.httpChange3}
  1452. filterOption={true}
  1453. onBlur={this.blurChange}
  1454. onSelect={this.selectAuto3}
  1455. style={{ width: '70%' }}
  1456. >
  1457. <Input />
  1458. </AutoComplete>
  1459. <span style={{ color: 'red' }}> 订单/合同复审</span>
  1460. </FormItem>
  1461. </div>
  1462. <div className="clearfix">
  1463. <FormItem
  1464. className="half-item"
  1465. {...formItemLayout}
  1466. label="省份"
  1467. >
  1468. <Select
  1469. placeholder="请选择省份"
  1470. value={getNewDiccityArr(this.state.province)}
  1471. style={{ width: '70%' }}
  1472. onChange={e => {
  1473. this.setState({ province: e });
  1474. }}
  1475. >
  1476. {citySelect().map(function (item) {
  1477. return (
  1478. <Select.Option key={item.value} value={item.value}>{item.label}</Select.Option>
  1479. );
  1480. })}
  1481. </Select>
  1482. </FormItem>
  1483. <FormItem
  1484. className="half-item"
  1485. {...formItemLayout}
  1486. label="技术总监审核"
  1487. >
  1488. <StaffSearch
  1489. valueName={this.state.techAdminName}
  1490. placeholder="输入名称"
  1491. width="70%"
  1492. onBlurText={e => {
  1493. this.setState({
  1494. techAdminName: e.title
  1495. })
  1496. }}
  1497. onBlurChange={(obj) => {
  1498. this.setState({
  1499. techAdminId: obj.value,
  1500. })
  1501. }}
  1502. />
  1503. </FormItem>
  1504. </div>
  1505. <div className="clearfix">
  1506. <FormItem
  1507. className="half-item"
  1508. {...formItemLayout}
  1509. label="上级组织"
  1510. >
  1511. <Select placeholder="请选择上级组织"
  1512. value={this.state.editSuperId}
  1513. style={{ width: '70%' }}
  1514. onChange={(e) => { this.setState({ editSuperId: e }) }}
  1515. notFoundContent="未获取到上级组织列表">
  1516. {this.state.contactsOption}
  1517. </Select>
  1518. </FormItem>
  1519. <FormItem
  1520. className="half-item"
  1521. {...formItemLayout}
  1522. label="报销审核人"
  1523. >
  1524. <AutoComplete
  1525. className="certain-category-search"
  1526. dropdownClassName="certain-category-search-dropdown"
  1527. dropdownMatchSelectWidth={false}
  1528. dataSource={options}
  1529. placeholder="输入名称"
  1530. value={this.state.accountrName}
  1531. onChange={this.httpChange4}
  1532. filterOption={true}
  1533. // onBlur={this.blurChange}
  1534. onSelect={this.selectAuto4}
  1535. style={{ width: '70%' }}
  1536. >
  1537. <Input />
  1538. </AutoComplete>
  1539. {/* <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span> */}
  1540. </FormItem>
  1541. </div>
  1542. <div className="clearfix">
  1543. <FormItem
  1544. className="half-item"
  1545. {...formItemLayout}
  1546. label="缩写" >
  1547. <Input placeholder="缩写"
  1548. value={this.state.abbreviation}
  1549. style={{ width: '70%' }}
  1550. onChange={(e) => { this.setState({ abbreviation: e.target.value }) }} />
  1551. </FormItem>
  1552. <FormItem
  1553. className="half-item"
  1554. {...formItemLayout}
  1555. label="报销财务复审"
  1556. >
  1557. <Select placeholder="请选择"
  1558. value={this.state.expenseRetrialFinanceExamine}
  1559. style={{ width: '70%' }}
  1560. onChange={(e) => { this.setState({ expenseRetrialFinanceExamine: e }) }}
  1561. >
  1562. <Option value={0}>不需要</Option>
  1563. <Option value={1}>需要</Option>
  1564. </Select>
  1565. <div>
  1566. {
  1567. this.state.expenseRetrialFinanceExamine == 1 &&
  1568. !!this.state.expenseRetrialFinanceExamineList &&
  1569. this.state.expenseRetrialFinanceExamineList.map(item =>
  1570. <Popconfirm
  1571. title="是否确认删除?"
  1572. okText="确定"
  1573. onConfirm={() => {
  1574. this.deleteDeTails(1, this.state.expenseRetrialFinanceExamineList, item.id);
  1575. }}
  1576. cancelText="取消"
  1577. >
  1578. <Tag key={item.id}>
  1579. {item.adminName + " "}<Icon type="close" />
  1580. </Tag>
  1581. </Popconfirm>
  1582. )
  1583. }
  1584. {
  1585. this.state.expenseRetrialFinanceExamine == 1 &&
  1586. <Button
  1587. type="primary"
  1588. style={{ marginTop: 10 }}
  1589. onClick={() => {
  1590. this.setState({
  1591. addtype: 1
  1592. })
  1593. }}>添加</Button>
  1594. }
  1595. </div>
  1596. </FormItem>
  1597. </div>
  1598. <div className="clearfix">
  1599. <FormItem
  1600. className="half-item"
  1601. {...formItemLayout}
  1602. label="选择作息时间类型"
  1603. >
  1604. <Select placeholder="请选择作息时间类型"
  1605. value={this.state.workingHoursType}
  1606. style={{ width: '70%' }}
  1607. onChange={(e) => { this.setState({ workingHoursType: e }) }}
  1608. notFoundContent="未获取到作息时间类型">
  1609. {this.state.workTimeList.map((v, k) => (
  1610. <Select.Option value={v.type} key={k}>{v.name}</Select.Option>
  1611. ))}
  1612. </Select>
  1613. </FormItem>
  1614. <FormItem
  1615. className="half-item"
  1616. {...formItemLayout}
  1617. label="董事长特批"
  1618. >
  1619. <Select placeholder="请选择"
  1620. value={this.state.ceoExamine}
  1621. style={{ width: '70%' }}
  1622. onChange={(e) => { this.setState({ ceoExamine: e }) }}
  1623. >
  1624. <Option value={0}>不需要</Option>
  1625. <Option value={1}>需要</Option>
  1626. </Select>
  1627. <div>
  1628. {
  1629. this.state.ceoExamine == 1 &&
  1630. !!this.state.ceoExamineList &&
  1631. this.state.ceoExamineList.map(item =>
  1632. <Popconfirm
  1633. title="是否确认删除?"
  1634. okText="确定"
  1635. onConfirm={() => {
  1636. this.deleteDeTails(2, this.state.ceoExamineList, item.id);
  1637. }}
  1638. cancelText="取消"
  1639. >
  1640. <Tag key={item.id}>
  1641. {item.adminName + " "}<Icon type="close" />
  1642. </Tag>
  1643. </Popconfirm>
  1644. )
  1645. }
  1646. {
  1647. this.state.ceoExamine == 1 &&
  1648. <Button
  1649. type="primary"
  1650. style={{ marginTop: 10 }}
  1651. onClick={() => {
  1652. this.setState({
  1653. addtype: 2
  1654. })
  1655. }}>添加</Button>
  1656. }
  1657. </div>
  1658. <div style={{ color: "red" }}>注:启用董事长审核后,还需要财务指向,是否需要董事长特批</div>
  1659. </FormItem>
  1660. </div>
  1661. <div className="clearfix">
  1662. <FormItem
  1663. className="half-item"
  1664. {...formItemLayout}
  1665. label="组织编号"
  1666. >
  1667. <Input
  1668. placeholder='组织编号'
  1669. value={this.state.depNo}
  1670. style={{ width: '70%' }}
  1671. onChange={(e) => {
  1672. this.setState({
  1673. depNo: e.target.value
  1674. })
  1675. }}
  1676. />
  1677. </FormItem>
  1678. <FormItem
  1679. className="half-item"
  1680. {...formItemLayout}
  1681. label="财务总监审核"
  1682. >
  1683. <Select placeholder="请选择"
  1684. value={this.state.cfoExamine}
  1685. style={{ width: '70%' }}
  1686. onChange={(e) => { this.setState({ cfoExamine: e }) }}
  1687. >
  1688. <Option value={0}>不需要</Option>
  1689. <Option value={1}>需要</Option>
  1690. </Select>
  1691. <div>
  1692. {
  1693. this.state.cfoExamine == 1 &&
  1694. !!this.state.cfoExamineList &&
  1695. this.state.cfoExamineList.map(item =>
  1696. <Popconfirm
  1697. title="是否确认删除?"
  1698. okText="确定"
  1699. onConfirm={() => {
  1700. this.deleteDeTails(3, this.state.cfoExamineList, item.id);
  1701. }}
  1702. cancelText="取消"
  1703. >
  1704. <Tag key={item.id}>
  1705. {item.adminName + " "}<Icon type="close" />
  1706. </Tag>
  1707. </Popconfirm>
  1708. )
  1709. }
  1710. {
  1711. this.state.cfoExamine == 1 &&
  1712. <Button
  1713. type="primary"
  1714. style={{ marginTop: 10 }}
  1715. onClick={() => {
  1716. this.setState({
  1717. addtype: 3
  1718. })
  1719. }}>添加</Button>
  1720. }
  1721. </div>
  1722. </FormItem>
  1723. </div>
  1724. <div className="clearfix" >
  1725. <FormItem
  1726. className="half-item"
  1727. {...formItemLayout}
  1728. label="创建人"
  1729. >
  1730. <span>{this.state.editCreateId}</span>
  1731. </FormItem>
  1732. <FormItem
  1733. className="half-item"
  1734. {...formItemLayout}
  1735. label="集团副总复审"
  1736. >
  1737. <Select placeholder="请选择"
  1738. value={this.state.viceCeoExamine}
  1739. style={{ width: '70%' }}
  1740. onChange={(e) => { this.setState({ viceCeoExamine: e }) }}
  1741. >
  1742. <Option value={0}>不需要</Option>
  1743. <Option value={1}>需要</Option>
  1744. </Select>
  1745. <div>
  1746. {
  1747. this.state.viceCeoExamine == 1 &&
  1748. !!this.state.viceCeoExamineList &&
  1749. this.state.viceCeoExamineList.map(item =>
  1750. <Popconfirm
  1751. title="是否确认删除?"
  1752. okText="确定"
  1753. onConfirm={() => {
  1754. this.deleteDeTails(3, this.state.viceCeoExamineList, item.id);
  1755. }}
  1756. cancelText="取消"
  1757. >
  1758. <Tag key={item.id}>
  1759. {item.adminName + " "}<Icon type="close" />
  1760. </Tag>
  1761. </Popconfirm>
  1762. )
  1763. }
  1764. {
  1765. this.state.viceCeoExamine == 1 &&
  1766. <Button
  1767. type="primary"
  1768. style={{ marginTop: 10 }}
  1769. onClick={() => {
  1770. this.setState({
  1771. addtype: 4
  1772. })
  1773. }}>添加</Button>
  1774. }
  1775. </div>
  1776. </FormItem>
  1777. </div>
  1778. <div className="clearfix">
  1779. <FormItem
  1780. className="half-item"
  1781. {...formItemLayout}
  1782. label="创建时间"
  1783. >
  1784. <span>{this.state.editTime}</span>
  1785. </FormItem>
  1786. <FormItem
  1787. className="half-item"
  1788. {...formItemLayout}
  1789. label="报销出纳"
  1790. >
  1791. <Select placeholder="请选择"
  1792. value={this.state.cashierExamine}
  1793. style={{ width: '70%' }}
  1794. onChange={(e) => { this.setState({ cashierExamine: e }) }}
  1795. >
  1796. <Option value={0}>不需要</Option>
  1797. <Option value={1}>需要</Option>
  1798. </Select>
  1799. <div>
  1800. {
  1801. this.state.cashierExamine == 1 &&
  1802. !!this.state.cashierExamineList &&
  1803. this.state.cashierExamineList.map(item =>
  1804. <Popconfirm
  1805. title="是否确认删除?"
  1806. okText="确定"
  1807. onConfirm={() => {
  1808. this.deleteDeTails(3, this.state.cashierExamineList, item.id);
  1809. }}
  1810. cancelText="取消"
  1811. >
  1812. <Tag key={item.id}>
  1813. {item.adminName + " "}<Icon type="close" />
  1814. </Tag>
  1815. </Popconfirm>
  1816. )
  1817. }
  1818. {
  1819. this.state.cashierExamine == 1 &&
  1820. <Button
  1821. type="primary"
  1822. style={{ marginTop: 10 }}
  1823. onClick={() => {
  1824. this.setState({
  1825. addtype: 5
  1826. })
  1827. }}>添加</Button>
  1828. }
  1829. </div>
  1830. </FormItem>
  1831. </div>
  1832. <div className="clearfix">
  1833. <FormItem
  1834. className="half-item"
  1835. {...formItemLayout}
  1836. label="组织职能说明" >
  1837. <Input type="textarea"
  1838. rows={4}
  1839. placeholder="组织职能说明"
  1840. value={this.state.editRemarks}
  1841. style={{ width: '70%' }}
  1842. onChange={(e) => { this.setState({ editRemarks: e.target.value }) }} />
  1843. </FormItem>
  1844. </div>
  1845. <div className="clearfix">
  1846. <FormItem
  1847. className="half-item"
  1848. {...formItemLayout}
  1849. label="显示标识"
  1850. >
  1851. <Select placeholder="显示标识"
  1852. value={this.state.hideSign}
  1853. style={{ width: '70%' }}
  1854. onChange={(e) => { this.setState({ hideSign: e }) }}
  1855. required="required"
  1856. >
  1857. <Option value={0}>不显示</Option>
  1858. <Option value={1}>显示</Option>
  1859. </Select>
  1860. </FormItem>
  1861. </div>
  1862. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  1863. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1864. <Button className="set-submit" type="ghost" onClick={this.edithandleCancel} style={{ marginLeft: '100px' }}>取消</Button>
  1865. </FormItem>
  1866. </Spin>
  1867. </Form >
  1868. </Modal>
  1869. </div>
  1870. <Modal
  1871. title="设置审核名单"
  1872. width='300px'
  1873. visible={this.state.addtype > 0}
  1874. onOk={this.handleOk}
  1875. onCancel={this.handleNo}
  1876. okText="确认"
  1877. cancelText="取消"
  1878. >
  1879. <AutoComplete
  1880. className="certain-category-search"
  1881. dropdownClassName="certain-category-search-dropdown"
  1882. style={{ width: 250 }}
  1883. dropdownMatchSelectWidth={false}
  1884. dataSource={options}
  1885. placeholder="输入名称"
  1886. value={this.state.adminName}
  1887. onChange={this.httpChangesel}
  1888. filterOption={true}
  1889. onSelect={this.selectAutosel}
  1890. >
  1891. <Input />
  1892. </AutoComplete>
  1893. </Modal>
  1894. </div>
  1895. </div>
  1896. );
  1897. }
  1898. }));
  1899. export default Organization;