organization.jsx 74 KB

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