organization.jsx 71 KB

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