systemMessage.jsx 69 KB

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