releaseExpert.jsx 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062
  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 { Form,Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload,Popconfirm,AutoComplete } from 'antd';
  7. import {patternOrganization,conditionOrganization,client,stick,auditStatusL,industry } from '../../../dataDic.js';
  8. import {getPattern,getAchievementCategory,getboutique,getClient,getSocialAttribute,getCertification,getAuditStatus,getWhether,getStick,getIndustry} from '../../../tools.js';
  9. const Organization=Form.create()(React.createClass({
  10. loadData(pageNo) {
  11. this.state.data = [];
  12. this.setState({
  13. loading: true,
  14. ispage:pageNo,
  15. });
  16. let nameText=this.state.SuperArr;
  17. let superText=(this.state.superId)?nameText[parseInt(this.state.superId)].id:undefined;
  18. let nameTexts=this.state.SuperArrs;
  19. let superTexts=(this.state.publishPage)?nameTexts[parseInt(this.state.publishPage)].id:undefined;
  20. $.ajax({
  21. method: "get",
  22. dataType: "json",
  23. crossDomain: false,
  24. url: globalConfig.context + '/api/admin/expert/listPublish',
  25. data: {
  26. pageNo: pageNo || 1,
  27. pageSize: this.state.pagination.pageSize,
  28. name: this.state.name, //成果名称
  29. publishPlatform:superText,//发布子平台
  30. publishClient:this.state.publishClient,//发布客户端
  31. publishPage:superTexts,//发布页面
  32. ifTop:this.state.ifTop,//是否置顶
  33. },
  34. success: function (data) {
  35. let theArr = [];
  36. if (!data.data || !data.data.list) {
  37. if (data.error && data.error.length) {
  38. message.warning(data.error[0].message);
  39. };
  40. } else {
  41. for (let i = 0; i < data.data.list.length; i++) {
  42. let thisdata = data.data.list[i];
  43. theArr.push({
  44. key: i,
  45. id: thisdata.id,//发布成果ID
  46. achievementId:thisdata.expertId,//成果ID
  47. publishPlatform:thisdata.publishPlatform,//发布子平台ID
  48. platformName:thisdata.platformName,//发布子平台
  49. publishClient:thisdata.publishClient.toString(),//发布客户端
  50. publishPage:thisdata.publishPage,//发布页面
  51. publishPageName:thisdata.publishPageName,//发布页面
  52. ifTop:thisdata.ifTop.toString(),//是否置顶
  53. industry:thisdata.industry,//行业
  54. topNumber:thisdata.topNumber,//置顶编号
  55. showNumber:thisdata.showNumber,//显示编号
  56. publisher:thisdata.publisher,//发布人ID
  57. publishTime:thisdata.publishTime,//发布时间
  58. name:thisdata.name,//成果名称
  59. publisherName:thisdata.publisherName,//发布人名称
  60. publishTimeFormattedDate:thisdata.publishTimeFormattedDate,//发布时间
  61. });
  62. };
  63. this.state.pagination.current = data.data.pageNo;
  64. this.state.pagination.total = data.data.totalCount;
  65. };
  66. if(data.data&&data.data.list&&!data.data.list.length){
  67. this.state.pagination.current=0
  68. this.state.pagination.total=0
  69. };
  70. this.setState({
  71. dataSource: theArr,
  72. pagination: this.state.pagination
  73. });
  74. }.bind(this),
  75. }).always(function () {
  76. this.setState({
  77. loading: false
  78. });
  79. }.bind(this));
  80. },
  81. loadDatas(pageNo, apiUrl) {
  82. this.state.data = [];
  83. this.setState({
  84. loading: true,
  85. });
  86. $.ajax({
  87. method: "post",
  88. dataType: "json",
  89. crossDomain: false,
  90. url: globalConfig.context + '/api/admin/customer/listAllPersonalCustomer',
  91. data: {
  92. pageNo: pageNo || 1,
  93. pageSize: this.state.pagination.pageSize,
  94. expertAudit:2,
  95. type: this.state.typeSearch, //名称1
  96. name: this.state.nameSearch,
  97. status: this.state.statusSearch,
  98. industry: this.state.industrySearch,
  99. businessAudit: this.state.serviceCertificationSearch,
  100. auditStatus: this.state.userCertificationSearch,
  101. currentMemberStatus: this.state.currentMemberStatusSearch,
  102. lvl: this.state.lvlSearch,
  103. listed: this.state.listedSearch, //是否上市
  104. highTechZone: this.state.highTechZoneSearch, //是否高新
  105. startDate: this.state.releaseDate[0],
  106. endDate: this.state.releaseDate[1],
  107. isMember: this.state.isMemberSearch,
  108. international: this.state.internationalSearch,
  109. celebrity: this.state.celebritySearch,
  110. expert: this.state.expertSearch,
  111. industry: this.state.industrySearch,
  112. shareType: this.state.shareTypeSearch,
  113. },
  114. success: function(data) {
  115. let theArr = [];
  116. if(data.error.length || data.data.list == "") {
  117. if(data.error && data.error.length) {
  118. message.warning(data.error[0].message);
  119. };
  120. } else {
  121. for(let i = 0; i < data.data.list.length; i++) {
  122. let thisdata = data.data.list[i];
  123. theArr.push({
  124. key: thisdata.uid,
  125. id: thisdata.uid,
  126. type: thisdata.type,
  127. name: thisdata.name,
  128. status: thisdata.status,
  129. contacts: thisdata.contacts,
  130. contactMobile: thisdata.contactMobile,
  131. industry: thisdata.industry,
  132. createTime: thisdata.createTime,
  133. businessAudit: thisdata.businessAudit,
  134. auditStatus: thisdata.auditStatus,
  135. lvl: thisdata.lvl,
  136. shareType: thisdata.shareType,
  137. isMember: thisdata.isMember,
  138. consultant: thisdata.consultant,
  139. societyTag: thisdata.societyTag,
  140. currentMemberStatus: thisdata.currentMemberStatus,
  141. international: thisdata.international,
  142. listed: thisdata.listed,
  143. international: thisdata.international,
  144. expert: thisdata.expert,
  145. celebrity: thisdata.celebrity,
  146. adminName: thisdata.adminName,
  147. releaseStatus: thisdata.releaseStatus,
  148. highTechZone: thisdata.highTechZone,
  149. locationProvince: thisdata.province ? thisdata.province + '-' + thisdata.city || '' + '-' + thisdata.area : '--'
  150. });
  151. };
  152. this.state.paginations.current = data.data.pageNo ;
  153. this.state.paginations.total = data.data.totalCount ;
  154. };
  155. this.setState({
  156. dataSourcesli: theArr,
  157. paginations: this.state.paginations,
  158. selectedRowKeys:[]
  159. });
  160. }.bind(this),
  161. }).always(function() {
  162. this.setState({
  163. loading: false,
  164. visible: true
  165. });
  166. }.bind(this));
  167. },
  168. getInitialState() {
  169. return {
  170. searchMore: true,
  171. selectedRowKeys: [],
  172. selectedRowKeysli:[],
  173. selectedRows: [],
  174. releaseDate: [],
  175. releaseDateS: [],
  176. loading: false,
  177. pagination: {
  178. defaultCurrent: 1,
  179. defaultPageSize: 10,
  180. showQuickJumper: true,
  181. pageSize: 10,
  182. onChange: function (page) {
  183. this.loadData(page);
  184. }.bind(this),
  185. showTotal: function (total) {
  186. return '共' + total + '条数据';
  187. }
  188. },
  189. paginations: {
  190. defaultCurrent: 1,
  191. defaultPageSize: 10,
  192. showQuickJumper: true,
  193. pageSize: 10,
  194. onChange: function (page) {
  195. this.loadDatas(page);
  196. }.bind(this),
  197. showTotal: function (total) {
  198. return '共' + total + '条数据';
  199. }
  200. },
  201. columns: [
  202. {
  203. title: '专家名称',
  204. dataIndex: 'name',
  205. key: 'name',
  206. },{
  207. title: '行业',
  208. dataIndex: 'industry',
  209. key: 'industry',
  210. render: text => { return getIndustry(text) }
  211. }, {
  212. title: '发布子平台',
  213. dataIndex: 'platformName',
  214. key: 'platformName',
  215. },{
  216. title: '发布客户端',
  217. dataIndex: 'publishClient',
  218. key: 'publishClient',
  219. render: text => { return getClient(text) }
  220. }, {
  221. title: '发布页面',
  222. dataIndex: 'publishPageName',
  223. key: 'publishPageName',
  224. },{
  225. title: '是否置顶',
  226. dataIndex: 'ifTop',
  227. key: 'ifTop',
  228. render: text => { return getStick(text) }
  229. }, {
  230. title: '展示序号',
  231. dataIndex: 'showNumber',
  232. key: 'showNumber',
  233. }, {
  234. title: '置顶序号',
  235. dataIndex: 'topNumber',
  236. key: 'topNumber',
  237. }, {
  238. title: '发布人',
  239. dataIndex: 'publisherName',
  240. key: 'publisherName',
  241. }, {
  242. title: '发布时间',
  243. dataIndex: 'publishTimeFormattedDate',
  244. key: 'publishTimeFormattedDate',
  245. }, {
  246. title: '操作',
  247. dataIndex: 'ee',
  248. key: 'ee',
  249. render: (text, record, index) => {
  250. return <div>
  251. <Popconfirm title={'请确认撤销发布专家【'+record.name+'】'} onConfirm={(e)=>{this.examine(record)}} okText="确认" cancelText="取消">
  252. <Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation()}} type="danger">撤销发布</Button>
  253. </Popconfirm>
  254. </div>
  255. }
  256. }
  257. ],
  258. dataSource: [],
  259. searchTime: [,],
  260. column: [{
  261. title: '专家姓名',
  262. dataIndex: 'name',
  263. key: 'name',
  264. },
  265. {
  266. title: '公共客户',
  267. dataIndex: 'shareType',
  268. key: 'shareType',
  269. render: (text, record) => { return record.shareType == '1' ? <span>公共客户</span> : <span>个人客户</span> }
  270. },
  271. {
  272. title: '行业',
  273. dataIndex: 'industry',
  274. key: 'industry',
  275. },
  276. {
  277. title: '社会性质',
  278. dataIndex: 'societyTag',
  279. key: 'societyTag',
  280. render: text => { return getSocialAttribute(text) }
  281. },
  282. {
  283. title: '创建时间',
  284. dataIndex: 'createTime',
  285. key: 'createTime',
  286. },{
  287. title: '所属人',
  288. dataIndex: 'adminName',
  289. key: 'adminName',
  290. },
  291. {
  292. title: '业务认证',
  293. dataIndex: 'businessAudit',
  294. key: 'businessAudit',
  295. render: text => { return getCertification(text) }
  296. },
  297. {
  298. title: '实名认证',
  299. dataIndex: 'auditStatus',
  300. key: 'auditStatus',
  301. render: text => { return getAuditStatus(text) }
  302. },
  303. {
  304. title: '是否国际',
  305. dataIndex: 'international',
  306. key: 'international',
  307. render: text => { return getWhether(text) }
  308. }
  309. ],
  310. dataSourcesli: [],
  311. searchTime: [,]
  312. };
  313. },
  314. componentWillMount() {
  315. this.selectSuperIds();
  316. //行业
  317. let intentionalArr = [];
  318. industry.map(function(item) {
  319. intentionalArr.push(
  320. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  321. )
  322. });
  323. this.state.intentionalOption = intentionalArr;
  324. },
  325. examine(record) {
  326. this.setState({
  327. selectedRowKeys: [],
  328. });
  329. $.ajax({
  330. method: "get",
  331. dataType: "json",
  332. crossDomain: false,
  333. url: globalConfig.context + '/api/admin/expert/deletePublish',
  334. data: {
  335. id:record.id,
  336. }
  337. }).done(function (data) {
  338. if (!data.error.length) {
  339. message.success('操作成功');
  340. this.setState({
  341. loading: false,
  342. });
  343. } else {
  344. message.warning(data.error[0].message);
  345. };
  346. this.loadData(this.state.ispage);
  347. }.bind(this));
  348. },
  349. //获取发布子平台
  350. selectSuperId() {
  351. this.state.data = []
  352. $.ajax({
  353. method: "get",
  354. dataType: "json",
  355. crossDomain: false,
  356. url: globalConfig.context + "/api/admin/achievement/getBranchInformation",
  357. data:{
  358. },
  359. success: function (data) {
  360. let theArr = [];
  361. let thedata=data.data;
  362. if (!thedata) {
  363. if (data.error && data.error.length) {
  364. message.warning(data.error[0].message);
  365. };
  366. thedata = {};
  367. };
  368. var contactIds=[];
  369. for(var i=0;i<data.data.length;i++){
  370. let theData = data.data[i];
  371. theArr.push(
  372. <Select.Option value={i.toString()} key={theData.platformName}>{theData.platformName}</Select.Option>
  373. );
  374. };
  375. this.setState({
  376. SuperArr:thedata,
  377. contactsOption: theArr,
  378. orderStatusOptions:data.data,
  379. });
  380. }.bind(this),
  381. }).always(function () {
  382. this.loadData();
  383. this.setState({
  384. loading: false
  385. });
  386. }.bind(this));
  387. },
  388. //获取发布页面
  389. selectSuperIds() {
  390. this.state.data = []
  391. $.ajax({
  392. method: "get",
  393. dataType: "json",
  394. crossDomain: false,
  395. url: globalConfig.context + "/api/admin/expert/getPublishPage",
  396. data:{
  397. },
  398. success: function (data) {
  399. let theArr = [];
  400. let thedata=data.data;
  401. if (!thedata) {
  402. if (data.error && data.error.length) {
  403. message.warning(data.error[0].message);
  404. };
  405. thedata = {};
  406. };
  407. var contactIds=[];
  408. for(var i=0;i<data.data.length;i++){
  409. let theData = data.data[i];
  410. theArr.push(
  411. <Select.Option value={i.toString()} key={theData.name}>{theData.name}</Select.Option>
  412. );
  413. };
  414. this.setState({
  415. SuperArrs:thedata,
  416. contactsOptions: theArr,
  417. orderStatusOptions:data.data,
  418. });
  419. }.bind(this),
  420. }).always(function () {
  421. this.selectSuperId();
  422. this.setState({
  423. loading: false
  424. });
  425. }.bind(this));
  426. },
  427. //编辑部门,保存
  428. edithandleSubmit(e){
  429. e.preventDefault();
  430. if(!this.state.editifTop){
  431. message.warning('请确认是否置顶');
  432. return false;
  433. }
  434. let topNumbers=(this.state.edittopNumber==9999999)?undefined:this.state.edittopNumber;
  435. topNumbers=topNumbers?topNumbers:undefined;
  436. if(this.state.editifTop==0){
  437. if(!topNumbers){
  438. message.warning('请输入置顶序号');
  439. return false;
  440. }
  441. let b=this.state.edittopNumber.toString().split('');
  442. for(var i=0;i<b.length;i++){
  443. if(parseInt(b[i]).toString()=='NaN'){
  444. message.warning('置顶序号请输入数字');
  445. return false;
  446. };
  447. }
  448. }else{
  449. if(topNumbers){
  450. message.warning('请清空置顶序号');
  451. return false;
  452. }
  453. if(!this.state.editshowNumber){
  454. message.warning('请输入展示序号');
  455. return false;
  456. }
  457. let b=this.state.editshowNumber.toString().split('');
  458. for(var i=0;i<b.length;i++){
  459. if(parseInt(b[i]).toString()=='NaN'){
  460. message.warning('展示序号请输入数字');
  461. return false;
  462. };
  463. }
  464. }
  465. //上级组织字典
  466. let nameText=this.state.SuperArr;
  467. let nameTexts=this.state.SuperArrs;
  468. let superText=(parseInt(this.state.editpublishPlatform).toString()=='NaN')?undefined:nameText[parseInt(this.state.editpublishPlatform)].id;
  469. let superTexts=(parseInt(this.state.editpublishPage).toString()=='NaN')?undefined:nameTexts[parseInt(this.state.editpublishPage)].id;
  470. $.ajax({
  471. method: "get",
  472. dataType: "json",
  473. crossDomain: false,
  474. url:globalConfig.context + '/api/admin/expert/updatePublish',
  475. data:{
  476. id:this.state.editid,//成果发布ID
  477. expertId:this.state.editachievementId, //成果ID
  478. publishPlatform:superText,//发布平台
  479. publishClient:this.state.editpublishClient,//发布客户端
  480. publishPage:superTexts,//发布页面
  481. ifTop:this.state.editifTop,//是否置顶
  482. topNumber:topNumbers,//置顶序号
  483. showNumber:this.state.editshowNumber,//展示序号
  484. }
  485. }).done(function (data) {
  486. this.setState({
  487. loading: false
  488. });
  489. if (!data.error.length) {
  490. message.success('保存成功!');
  491. this.edithandleCancel();
  492. this.selectSuperId();
  493. } else {
  494. message.warning(data.error[0].message);
  495. }
  496. }.bind(this));
  497. },
  498. //整行点击
  499. tableRowClick(record, index) {
  500. this.selectSuperIds();
  501. this.state.RowData = record;
  502. this.setState({
  503. editvisible: true,
  504. selectedRowKeys:[],
  505. editid:record.id,
  506. editachievementId:record.achievementId,
  507. editpublishPlatform:record.platformName,
  508. editpublishClient:record.publishClient,
  509. editpublishPage:record.publishPageName,
  510. editifTop:record.ifTop,
  511. edittopNumber:record.topNumber,
  512. editshowNumber:record.showNumber,
  513. editserialNumber:record.serialNumber,
  514. editname:record.name,
  515. edituserName:record.userName,
  516. })
  517. },
  518. //新增一个部门,保存
  519. addhandleSubmit(e){
  520. e.preventDefault();
  521. if(!this.state.publishPlatform){
  522. message.warning('请选择发布子平台');
  523. return false;
  524. }
  525. if(!this.state.publishClient){
  526. message.warning('请选择发布客户端');
  527. return false;
  528. }
  529. if(!this.state.publishPage){
  530. message.warning('请选择发布页面');
  531. return false;
  532. }
  533. if(!this.state.ifTop){
  534. message.warning('请确认是否置顶');
  535. return false;
  536. }
  537. if(this.state.ifTop==0){
  538. if(!this.state.topNumber){
  539. message.warning('请输入置顶序号');
  540. return false;
  541. }
  542. let b=this.state.topNumber.split('');
  543. for(var i=0;i<b.length;i++){
  544. if(parseInt(b[i]).toString()=='NaN'){
  545. message.warning('置顶序号请输入数字');
  546. return false;
  547. };
  548. }
  549. }else{
  550. if(this.state.topNumber){
  551. message.warning('请清空置顶序号');
  552. return false;
  553. }
  554. if(!this.state.showNumber){
  555. message.warning('请输入展示序号');
  556. return false;
  557. }
  558. let b=this.state.showNumber.split('');
  559. for(var i=0;i<b.length;i++){
  560. if(parseInt(b[i]).toString()=='NaN'){
  561. message.warning('展示序号请输入数字');
  562. return false;
  563. };
  564. }
  565. }
  566. this.props.form.validateFields((err, values) => {
  567. if (!err) {
  568. this.setState({
  569. loading: true
  570. });
  571. let nameText=this.state.SuperArr;
  572. let superText=nameText[parseInt(this.state.publishPlatform)].id;
  573. let nameTexts=this.state.SuperArrs;
  574. let superTexts=nameTexts[parseInt(this.state.publishPage)].id;
  575. $.ajax({
  576. method: "post",
  577. dataType: "json",
  578. crossDomain: false,
  579. url:globalConfig.context + '/api/admin/expert/addExpertPublish',
  580. data:{
  581. ExpertId:this.state.selectedRowKeysli?this.state.selectedRowKeysli.join(","):undefined,//成果ID
  582. publishPlatform:superText,//发布平台
  583. publishClient:this.state.publishClient,//发布客户端
  584. publishPage:superTexts, //发布页面
  585. ifTop:this.state.ifTop,//是否置顶
  586. topNumber:this.state.topNumber,//置顶序号
  587. showNumber:this.state.showNumber,//展示序号
  588. }
  589. }).done(function (data) {
  590. this.setState({
  591. loading: false
  592. });
  593. if (!data.error.length) {
  594. message.success('保存成功!');
  595. this.handleCancel();
  596. this.reset();
  597. } else {
  598. message.warning(data.error[0].message);
  599. }
  600. }.bind(this));
  601. }
  602. });
  603. },
  604. //主管初始加载(自动补全)
  605. supervisor(e){
  606. $.ajax({
  607. method: "post",
  608. dataType: "json",
  609. crossDomain: false,
  610. url: globalConfig.context + "/api/admin/organization/selectName",
  611. data:{
  612. name:e
  613. },
  614. success: function (data) {
  615. let thedata=data.data;
  616. if (!thedata) {
  617. if (data.error && data.error.length) {
  618. message.warning(data.error[0].message);
  619. };
  620. thedata = {};
  621. };
  622. this.setState({
  623. customerArr:thedata,
  624. });
  625. }.bind(this),
  626. }).always(function () {
  627. this.setState({
  628. loading: false
  629. });
  630. }.bind(this));
  631. },
  632. //上级主管输入框失去焦点是判断客户是否存在
  633. selectAuto(value,options){
  634. this.setState({
  635. managerIdOrganization:value
  636. })
  637. },
  638. //失去焦点时
  639. blurChange(e){
  640. // let theType='';
  641. // let contactLists=this.state.customerArr||[];
  642. // if (e) {
  643. // contactLists.map(function (item) {
  644. // if (item.name == e.toString()) {
  645. // theType = item.id;
  646. // }
  647. // });
  648. // }
  649. this.setState({
  650. theTypes:e
  651. })
  652. },
  653. //值改变时请求客户名称
  654. httpChange(e){
  655. if(e.length>=2){
  656. this.supervisor(e);
  657. }
  658. this.setState({
  659. managerIdOrganization:e
  660. })
  661. },
  662. addClick() {
  663. this.state.name = undefined;//成果名称清零
  664. this.state.publishPlatform = undefined;//发布子平台清零
  665. this.state.publishClient = undefined;//发布客户端清零
  666. this.state.publishPage = undefined;//发布页面清零
  667. this.state.ifTop = undefined;//是否置顶清零
  668. this.state.topNumber = undefined;//置顶序号清零
  669. this.state.showNumber = undefined;//展示序号清零
  670. this.state.selectedRowKeysli=undefined;//选定的成果ID清零
  671. this.state.RowData = {};
  672. this.selectSuperId();
  673. this.loadDatas();
  674. },
  675. editClick() {
  676. this.state.RowData = {};
  677. this.setState({
  678. editvisible: true
  679. });
  680. },
  681. handleCancel() {
  682. this.setState({ visible: false })
  683. },
  684. edithandleCancel() {
  685. this.setState({ editvisible: false })
  686. },
  687. search() {
  688. this.loadData();
  689. },
  690. searchs() {
  691. this.loadDatas();
  692. },
  693. //把搜索的部分置零
  694. reset() {
  695. this.state.name = undefined;//成果名称清零
  696. this.state.superId = undefined;//发布子平台清零
  697. this.state.publishClient = undefined;//发布客户端清零
  698. this.state.publishPage = undefined;//发布页面清零
  699. this.state.ifTop = undefined;//是否置顶清零
  700. this.selectSuperId();
  701. },
  702. resets() {
  703. this.state.expertSearch = undefined;
  704. this.state.celebritySearch = undefined;
  705. this.state.shareTypeSearch = undefined;
  706. this.state.typeSearch = undefined; //名称1
  707. this.state.nameSearch = '';
  708. this.state.addressSearch = [];
  709. this.state.provinceSearch = undefined;
  710. this.state.citySearch = undefined;
  711. this.state.statusSearch = undefined;
  712. this.state.contactsSearch = undefined;
  713. this.state.contactMobileSearch = undefined;
  714. this.state.industrySearch = undefined;
  715. this.state.serviceCertificationSearch = undefined;
  716. this.state.userCertificationSearch = undefined;
  717. this.state.currentMemberStatusSearch = undefined;
  718. this.state.lvlSearch = undefined;
  719. this.state.listedSearch = undefined;
  720. this.state.highTechZoneSearch = undefined;
  721. this.state.releaseDate[0] = undefined;
  722. this.state.releaseDate[1] = undefined;
  723. this.loadDatas();
  724. },
  725. searchSwitch() {
  726. this.setState({
  727. searchMore: !this.state.searchMore
  728. });
  729. },
  730. render() {
  731. const FormItem = Form.Item
  732. const rowSelection = {
  733. selectedRowKeys: this.state.selectedRowKeys,
  734. onChange: (selectedRowKeys, selectedRows) => {
  735. this.setState({
  736. selectedRows: selectedRows.slice(-1),
  737. selectedRowKeys: selectedRowKeys.slice(-1)
  738. });
  739. },
  740. onSelect: (recordt, selected, selectedRows) => {
  741. this.setState({
  742. recordt:recordt.id
  743. })
  744. },
  745. };
  746. const rowSelections = {
  747. selectedRowKeysli: this.state.selectedRowKeysli,
  748. onChange: (selectedRowKeysli, selectedRows) => {
  749. this.setState({
  750. selectedRows: selectedRows,
  751. selectedRowKeysli: selectedRowKeysli
  752. });
  753. },
  754. onSelect: (recordt, selected, selectedRows) => {
  755. this.setState({
  756. recordt:recordt.id
  757. })
  758. },
  759. };
  760. const formItemLayout = {
  761. labelCol: { span: 8 },
  762. wrapperCol: { span: 14 },
  763. };
  764. const { getFieldDecorator } = this.props.form;
  765. const hasSelected = this.state.selectedRowKeys.length > 0;
  766. const { RangePicker } = DatePicker;
  767. const dataSources=this.state.customerArr || [];
  768. const options = dataSources.map((group,index) =>
  769. <Option key={index} value={group.name}>{group.name}</Option>
  770. )
  771. return (
  772. <div className="user-content" >
  773. <div className="content-title">
  774. <div className="user-search">
  775. <Input placeholder="专家名称" style={{width:'150px',marginRight:'10px',marginBottom:'10px'}}
  776. value={this.state.name}
  777. onChange={(e) => { this.setState({ name: e.target.value }); }} />
  778. <Select placeholder="发布子平台"
  779. style={{ width:'200px',marginRight:'10px' }}
  780. value={this.state.superId}
  781. onChange={(e) => { this.setState({ superId: e }) }} notFoundContent="未获取到上级组织列表">
  782. {this.state.contactsOption}
  783. </Select>
  784. <Select placeholder="发布客户端"
  785. style={{width:'150px',marginRight:'20px'}}
  786. value={this.state.publishClient}
  787. onChange={(e) => { this.setState({ publishClient: e }) }}>
  788. <Select.Option value="0" >网站</Select.Option>
  789. <Select.Option value="1" >APP</Select.Option>
  790. </Select>
  791. <Button type="primary" onClick={this.search} style={{marginRight:'10px'}}>搜索</Button>
  792. <Button onClick={this.reset} style={{marginRight:'10px'}}>重置</Button>
  793. <span style={{marginRight:'20px'}}>更多搜索 <Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  794. <div style={this.state.searchMore ? { display: 'none' } : {display: 'inline-block'}}>
  795. <Select placeholder="发布页面"
  796. style={{ width:'200px',marginRight:'10px' }}
  797. value={this.state.publishPage}
  798. onChange={(e) => { this.setState({ publishPage: e }) }} notFoundContent="未获取到发布页面">
  799. {this.state.contactsOptions}
  800. </Select>
  801. <Select placeholder="是否置顶"
  802. style={{width:'150px',marginRight:'50px'}}
  803. value={this.state.ifTop}
  804. onChange={(e) => { this.setState({ ifTop: e }) }}>
  805. <Select.Option value="0" >置顶</Select.Option>
  806. <Select.Option value="1" >不置顶</Select.Option>
  807. </Select>
  808. </div>
  809. <Button type="primary" className="addButton" onClick={this.addClick} style={{marginBottom:'10px'}}>发布专家<Icon type="plus" /></Button>
  810. </div>
  811. <div className="patent-table">
  812. <Spin spinning={this.state.loading}>
  813. <Table columns={this.state.columns}
  814. dataSource={this.state.dataSource}
  815. rowSelection={rowSelection}
  816. style={{
  817. cursor: 'pointer',
  818. }}
  819. pagination={this.state.pagination}
  820. onRowClick={this.tableRowClick} />
  821. </Spin>
  822. </div>
  823. <div className="patent-desc">
  824. <Modal maskClosable={false} visible={this.state.visible}
  825. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  826. width='1200px'
  827. title='发布专家'
  828. footer=''
  829. className="admin-desc-content">
  830. <Form horizontal onSubmit={this.addhandleSubmit} id="add-form">
  831. <Spin spinning={this.state.loading}>
  832. <div className="clearfix">
  833. <FormItem className="half-item"
  834. labelCol={{ span: 7 }}
  835. wrapperCol={{ span: 12 }}
  836. label="发布子平台"
  837. >
  838. <Select placeholder="请选择子平台" value={this.state.publishPlatform} onChange={(e)=>{this.setState({publishPlatform:e})}}
  839. notFoundContent="未获取到子平台">
  840. {this.state.contactsOption}
  841. </Select>
  842. </FormItem>
  843. <FormItem className="half-item"
  844. labelCol={{ span: 7 }}
  845. wrapperCol={{ span: 12 }}
  846. label="发布客户端"
  847. >
  848. <Select placeholder="选择客户端" value={this.state.publishClient}
  849. onChange={(e)=>{this.setState({publishClient:e})}}>
  850. {
  851. client.map(function (item) {
  852. return <Select.Option key={item.value} >{item.key}</Select.Option>
  853. })
  854. }
  855. </Select>
  856. </FormItem>
  857. </div>
  858. <div className="clearfix">
  859. <FormItem className="half-item"
  860. labelCol={{ span: 7 }}
  861. wrapperCol={{ span: 12 }}
  862. label="发布页面位置"
  863. >
  864. <Select placeholder="请选择页面位置" value={this.state.publishPage} onChange={(e)=>{this.setState({publishPage:e})}}
  865. notFoundContent="未获取到页面位置">
  866. {this.state.contactsOptions}
  867. </Select>
  868. </FormItem>
  869. <FormItem className="half-item"
  870. labelCol={{ span: 7 }}
  871. wrapperCol={{ span: 12 }}
  872. label="是否置顶"
  873. >
  874. <Select placeholder="选择是否置顶" value={this.state.ifTop}
  875. onChange={(e)=>{this.setState({ifTop:e})}}>
  876. {
  877. stick.map(function (item) {
  878. return <Select.Option key={item.value} >{item.key}</Select.Option>
  879. })
  880. }
  881. </Select>
  882. </FormItem>
  883. </div>
  884. <div className="clearfix">
  885. <FormItem className="half-item"
  886. labelCol={{ span: 7 }}
  887. wrapperCol={{ span: 12 }}
  888. label="置顶序号" >
  889. <Input placeholder="请输入置顶序号" value={this.state.topNumber}
  890. onChange={(e)=>{this.setState({topNumber:e.target.value})}}/>
  891. </FormItem>
  892. <FormItem className="half-item"
  893. labelCol={{ span: 7 }}
  894. wrapperCol={{ span: 12}}
  895. label="展示序号" >
  896. <Input placeholder="请输入展示序号" value={this.state.showNumber}
  897. onChange={(e)=>{this.setState({showNumber:e.target.value})}}/>
  898. </FormItem>
  899. </div>
  900. <div className="user-search">
  901. <Input placeholder="专家姓名" style={{"width":"150px","display":"inlineBlock","marginRight":"10px",'marginBottom':"5px"}}
  902. value={this.state.nameSearch}
  903. onChange={(e) => { this.setState({ nameSearch: e.target.value }); }} />
  904. <Select placeholder="行业" style={{"width":"150px","display":"inlineBlock","marginRight":"10px"}}
  905. value={this.state.industrySearch}
  906. onChange={(e) => { this.setState({ industrySearch: e }) }}>
  907. {this.state.intentionalOption}
  908. </Select>
  909. <Select placeholder="实名认证" style={{"width":"130px","display":"inlineBlock","marginRight":"10px"}}
  910. value={this.state.userCertificationSearch}
  911. onChange={(e) => { this.setState({ userCertificationSearch: e }) }}>
  912. {
  913. auditStatusL.map(function (item) {
  914. return <Select.Option key={item.value} >{item.key}</Select.Option>
  915. })
  916. }
  917. </Select>
  918. <Select placeholder="国际" style={{"width":"100px","display":"inlineBlock","marginRight":"10px"}}
  919. value={this.state.internationalSearch}
  920. onChange={(e) => { this.setState({ internationalSearch: e }) }}>
  921. <Select.Option value="0" >否</Select.Option>
  922. <Select.Option value="1" >是</Select.Option>
  923. </Select>
  924. <span style={{"marginRight":"5px"}}>创建时间 :</span>
  925. <RangePicker style={{"marginRight":"10px"}}
  926. value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
  927. this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
  928. onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
  929. <Button type="primary" onClick={this.searchs} style={{"display":"inlineBlock",'marginRight':'10px'}}>搜索</Button>
  930. <Button onClick={this.resets} style={{"display":"inlineBlock"}}>重置</Button>
  931. </div>
  932. <div className="patent-table">
  933. <Spin spinning={this.state.loading}>
  934. <Table columns={this.state.column}
  935. dataSource={this.state.dataSourcesli}
  936. rowSelection={rowSelections}
  937. pagination={this.state.paginations}
  938. />
  939. </Spin>
  940. </div>
  941. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  942. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  943. <Button className="set-submit" type="ghost" onClick={this.handleCancel} style={{marginLeft:'100px'}}>取消</Button>
  944. </FormItem>
  945. </Spin>
  946. </Form >
  947. </Modal>
  948. </div>
  949. <div className="patent-desc">
  950. <Modal maskClosable={false} visible={this.state.editvisible}
  951. onOk={this.checkPatentProcess} onCancel={this.edithandleCancel}
  952. width='1200px'
  953. title='编辑发布'
  954. footer=''
  955. className="admin-desc-content">
  956. <Form horizontal onSubmit={this.edithandleSubmit} id="edit-form">
  957. <Spin spinning={this.state.loading}>
  958. <div className="clearfix">
  959. <FormItem className="half-item"
  960. labelCol={{ span: 6 }}
  961. wrapperCol={{ span: 12 }}
  962. label="发布子平台"
  963. >
  964. <Select placeholder="请选择子平台" value={this.state.editpublishPlatform} onChange={(e)=>{this.setState({editpublishPlatform:e})}}
  965. notFoundContent="未获取到子平台">
  966. {this.state.contactsOption}
  967. </Select>
  968. </FormItem>
  969. <FormItem className="half-item"
  970. labelCol={{ span: 6 }}
  971. wrapperCol={{ span: 12 }}
  972. label="发布客户端"
  973. >
  974. <Select placeholder="选择客户端" value={this.state.editpublishClient}
  975. onChange={(e)=>{this.setState({editpublishClient:e})}}>
  976. {
  977. client.map(function (item) {
  978. return <Select.Option key={item.value} >{item.key}</Select.Option>
  979. })
  980. }
  981. </Select>
  982. </FormItem>
  983. </div>
  984. <div className="clearfix">
  985. <FormItem className="half-item"
  986. labelCol={{ span: 6 }}
  987. wrapperCol={{ span: 12 }}
  988. label="发布页面位置"
  989. >
  990. <Select placeholder="请选择页面位置" value={this.state.editpublishPage} onChange={(e)=>{this.setState({editpublishPage:e})}}
  991. notFoundContent="未获取到页面位置">
  992. {this.state.contactsOptions}
  993. </Select>
  994. </FormItem>
  995. <FormItem className="half-item"
  996. labelCol={{ span: 6 }}
  997. wrapperCol={{ span: 12 }}
  998. label="是否置顶"
  999. >
  1000. <Select placeholder="选择是否置顶" value={this.state.editifTop}
  1001. onChange={(e)=>{this.setState({editifTop:e})}}>
  1002. {
  1003. stick.map(function (item) {
  1004. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1005. })
  1006. }
  1007. </Select>
  1008. </FormItem>
  1009. </div>
  1010. <div className="clearfix">
  1011. <FormItem className="half-item"
  1012. labelCol={{ span: 6 }}
  1013. wrapperCol={{ span: 12 }}
  1014. label="置顶序号" >
  1015. <Input placeholder="请输入置顶序号" value={this.state.edittopNumber}
  1016. onChange={(e)=>{this.setState({edittopNumber:e.target.value})}}/>
  1017. </FormItem>
  1018. <FormItem className="half-item"
  1019. labelCol={{ span: 6 }}
  1020. wrapperCol={{ span: 12}}
  1021. label="展示序号" >
  1022. <Input placeholder="请输入展示序号" value={this.state.editshowNumber}
  1023. onChange={(e)=>{this.setState({editshowNumber:e.target.value})}}/>
  1024. </FormItem>
  1025. </div>
  1026. <div className="clearfix">
  1027. <FormItem
  1028. labelCol={{ span: 3 }}
  1029. wrapperCol={{ span: 18 }}
  1030. label="专家名称"
  1031. >
  1032. <span>{this.state.editname}</span>
  1033. </FormItem>
  1034. </div>
  1035. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  1036. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1037. <Button className="set-submit" type="ghost" onClick={this.edithandleCancel} style={{marginLeft:'100px'}}>取消</Button>
  1038. </FormItem>
  1039. </Spin>
  1040. </Form >
  1041. </Modal>
  1042. </div>
  1043. </div>
  1044. </div>
  1045. );
  1046. }
  1047. }));
  1048. export default Organization;