systemMessage.jsx 72 KB

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