releaseResults.jsx 47 KB

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