systemMessage.jsx 70 KB

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