techAchievementDesc.jsx 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360
  1. import React from 'react';
  2. import { Icon, Tabs, Table, Tooltip, Modal, message, Spin, Upload, Input, InputNumber, Select, DatePicker, Button, Radio, Form, Cascader, Tag } from 'antd';
  3. import moment from 'moment';
  4. import './techAchievement.less';
  5. import ajax from 'jquery/src/ajax/xhr.js';
  6. import $ from 'jquery/src/ajax';
  7. import { IndustryObject, getIndustryCategory } from '../../DicIndustryList.js';
  8. import { beforeUploadFile, splitUrl, getAchievementCategory, getDemandType } from '../../tools.js';
  9. const KeyWordTagGroup = React.createClass({
  10. getInitialState() {
  11. return {
  12. tags: [],
  13. inputVisible: false,
  14. inputValue: ''
  15. };
  16. },
  17. handleClose(removedTag) {
  18. const tags = this.state.tags.filter(tag => tag !== removedTag);
  19. this.props.tagsArr(tags);
  20. this.setState({ tags });
  21. },
  22. showInput() {
  23. this.setState({ inputVisible: true }, () => this.input.focus());
  24. },
  25. handleInputChange(e) {
  26. this.setState({ inputValue: e.target.value });
  27. },
  28. handleInputConfirm() {
  29. const state = this.state;
  30. const inputValue = state.inputValue;
  31. let tags = state.tags;
  32. if (inputValue && tags.indexOf(inputValue) === -1 && inputValue.replace(/(^\s*)|(\s*$)/g, "").length != 0) {
  33. tags = [...tags, inputValue.replace(/(^\s*)|(\s*$)/g, "")];
  34. }
  35. this.props.tagsArr(tags);
  36. this.setState({
  37. tags,
  38. inputVisible: false,
  39. inputValue: '',
  40. });
  41. },
  42. componentWillMount() {
  43. this.state.tags = this.props.keyWordArr;
  44. },
  45. componentWillReceiveProps(nextProps) {
  46. if (this.props.keyWordArr != nextProps.keyWordArr) {
  47. this.state.tags = nextProps.keyWordArr;
  48. };
  49. },
  50. render() {
  51. const { tags, inputVisible, inputValue } = this.state;
  52. return (
  53. <div className="keyWord-tips">
  54. {tags.map((tag, index) => {
  55. const isLongTag = tag.length > 10;
  56. const tagElem = (
  57. <Tag key={tag} closable={index !== -1} afterClose={() => this.handleClose(tag)}>
  58. {isLongTag ? `${tag.slice(0, 10)}...` : tag}
  59. </Tag>
  60. );
  61. return isLongTag ? <Tooltip title={tag}>{tagElem}</Tooltip> : tagElem;
  62. })}
  63. {inputVisible && (
  64. <Input
  65. ref={input => this.input = input}
  66. type="text"
  67. style={{ width: 78 }}
  68. value={inputValue}
  69. onChange={this.handleInputChange}
  70. onBlur={this.handleInputConfirm}
  71. onPressEnter={this.handleInputConfirm}
  72. />
  73. )}
  74. {!inputVisible && <Button className="addtips" type="dashed" disabled={tags.length > 9 ? true : false} onClick={this.showInput}>+ 新关键词</Button>}
  75. </div>
  76. );
  77. }
  78. });
  79. const PicturesWall = React.createClass({
  80. getInitialState() {
  81. return {
  82. previewVisible: false,
  83. previewImage: '',
  84. fileList: [],
  85. }
  86. },
  87. handleCancel() {
  88. this.setState({ previewVisible: false })
  89. },
  90. handlePreview(file) {
  91. this.setState({
  92. previewImage: file.url || file.thumbUrl,
  93. previewVisible: true,
  94. });
  95. },
  96. handleChange(info) {
  97. let fileList = info.fileList;
  98. this.setState({ fileList });
  99. this.props.fileList(fileList);
  100. },
  101. componentWillReceiveProps(nextProps) {
  102. this.state.fileList = nextProps.pictureUrl;
  103. },
  104. render() {
  105. const { previewVisible, previewImage, fileList } = this.state;
  106. const uploadButton = (
  107. <div>
  108. <Icon type="plus" />
  109. <div className="ant-upload-text">点击上传</div>
  110. </div>
  111. );
  112. return (
  113. <div className="clearfix">
  114. <Upload
  115. action={globalConfig.context + "/api/user/achievement/uploadPicture"}
  116. data={{ 'sign': this.props.pictureSign }}
  117. listType="picture-card"
  118. fileList={fileList}
  119. onPreview={this.handlePreview}
  120. onChange={this.handleChange} >
  121. {fileList.length >= 5 ? null : uploadButton}
  122. </Upload>
  123. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  124. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  125. </Modal>
  126. </div>
  127. );
  128. }
  129. });
  130. const AchievementDetailShow = Form.create()(React.createClass({
  131. getInitialState() {
  132. return {
  133. visible: false,
  134. loading: false,
  135. textFileList: [],
  136. techPlanFileList: [],
  137. businessPlanFileList: [],
  138. maturityPictureUrl: [],
  139. technicalPictureUrl: [],
  140. tags: []
  141. };
  142. },
  143. loadData(id) {
  144. this.setState({
  145. loading: true
  146. });
  147. $.ajax({
  148. method: "get",
  149. dataType: "json",
  150. crossDomain: false,
  151. url: globalConfig.context + (window.userData.type == "1" ? "/api/user/achievement/orgDetail" : "/api/user/achievement/userDetail"),
  152. data: {
  153. id: id
  154. },
  155. success: function (data) {
  156. let thisData = data.data;
  157. if (!thisData) {
  158. if (data.error && data.error.length) {
  159. message.warning(data.error[0].message);
  160. };
  161. thisData = {};
  162. };
  163. this.setState({
  164. data: thisData,
  165. tags: thisData.keyword ? thisData.keyword.split(",") : [],
  166. technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
  167. maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
  168. });
  169. }.bind(this),
  170. }).always(function () {
  171. this.setState({
  172. loading: false
  173. });
  174. }.bind(this));
  175. },
  176. offShelf() {
  177. this.setState({
  178. loading: true
  179. });
  180. $.ajax({
  181. method: "post",
  182. dataType: "json",
  183. crossDomain: false,
  184. url: globalConfig.context + "/api/user/achievement/offShelf",
  185. data: { "id": this.props.data.id }
  186. }).done(function (data) {
  187. this.setState({
  188. loading: false
  189. });
  190. if (!data.error.length) {
  191. message.success('撤销成功!');
  192. this.setState({
  193. visible: false,
  194. releaseSubmitVisible: false
  195. });
  196. this.props.handleOk();
  197. } else {
  198. message.warning(data.error[0].message);
  199. }
  200. }.bind(this));
  201. },
  202. componentWillMount() {
  203. if (this.props.data.id) {
  204. this.loadData(this.props.data.id);
  205. } else {
  206. this.state.data = {};
  207. };
  208. },
  209. componentWillReceiveProps(nextProps) {
  210. if (!this.props.visible && nextProps.visible) {
  211. this.state.textFileList = [];
  212. this.state.techPlanFileList = [];
  213. this.state.businessPlanFileList = [];
  214. if (nextProps.data.id) {
  215. this.loadData(nextProps.data.id);
  216. } else {
  217. this.state.data = {};
  218. this.state.tags = [];
  219. this.state.maturityPictureUrl = [];
  220. this.state.technicalPictureUrl = [];
  221. };
  222. this.props.form.resetFields();
  223. };
  224. },
  225. render() {
  226. const theData = this.state.data || {};
  227. const { getFieldDecorator } = this.props.form;
  228. const FormItem = Form.Item
  229. const formItemLayout = {
  230. labelCol: { span: 8 },
  231. wrapperCol: { span: 14 },
  232. };
  233. return (
  234. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  235. <Spin spinning={this.state.loading}>
  236. <div className="clearfix">
  237. <FormItem className="half-item"
  238. {...formItemLayout}
  239. label="编号" >
  240. <span>{theData.serialNumber}</span>
  241. </FormItem>
  242. <FormItem className="half-item"
  243. {...formItemLayout}
  244. label="名称" >
  245. <span>{theData.name}</span>
  246. </FormItem>
  247. <FormItem className="half-item"
  248. {...formItemLayout}
  249. label="数据类别" >
  250. {(() => {
  251. switch (theData.dataCategory) {
  252. case "0":
  253. return <span>成果</span>;
  254. case "1":
  255. return <span>技术</span>;
  256. case "2":
  257. return <span>项目</span>;
  258. }
  259. })()}
  260. </FormItem>
  261. <FormItem className="half-item"
  262. {...formItemLayout}
  263. label="类型" >
  264. <span>{getAchievementCategory(theData.category)}</span>
  265. </FormItem>
  266. </div>
  267. <div className="clearfix">
  268. <FormItem className="half-item"
  269. {...formItemLayout}
  270. label="是否发布" >
  271. {(() => {
  272. switch (theData.releaseStatus) {
  273. case "0":
  274. return <span>未发布</span>;
  275. case "1":
  276. return <div>
  277. <span>已发布</span>
  278. <Button style={{ marginLeft: '10px' }} onClick={() => { this.setState({ releaseSubmitVisible: true }); }}>撤消发布</Button>
  279. <Modal maskClosable={false} title="确认"
  280. visible={this.state.releaseSubmitVisible}
  281. width='300px'
  282. footer={null}
  283. onCancel={() => { this.setState({ releaseSubmitVisible: false }) }} >
  284. <span>确认要撤销发布吗?</span>
  285. <Button className="modal-submit" type="primary" onClick={this.offShelf} >确认</Button>
  286. <Button className="modal-submit" type="ghost" onClick={() => { this.setState({ releaseSubmitVisible: false }) }}>取消</Button>
  287. </Modal>
  288. </div>;
  289. }
  290. })()}
  291. </FormItem>
  292. <FormItem className="half-item"
  293. {...formItemLayout}
  294. label="发布时间" >
  295. <span>{theData.releaseDateFormattedDate}</span>
  296. </FormItem>
  297. <FormItem className="half-item"
  298. {...formItemLayout}
  299. label="审核状态" >
  300. {(() => {
  301. switch (theData.auditStatus) {
  302. case "0":
  303. return <span>未提交审核(草稿)</span>;
  304. case "1":
  305. return <span>提交审核</span>;
  306. case "2":
  307. return <span>审核中</span>;
  308. case "3":
  309. return <span>审核通过</span>;
  310. case "4":
  311. return <span>审核未通过</span>;
  312. }
  313. })()}
  314. </FormItem>
  315. </div>
  316. <FormItem
  317. labelCol={{ span: 4 }}
  318. wrapperCol={{ span: 18 }}
  319. label="关键词" >
  320. {this.state.tags.map((tag) => {
  321. return <Tooltip key={tag} title={tag}>
  322. <Tag key={tag}>{tag}</Tag>
  323. </Tooltip>;
  324. })}
  325. </FormItem>
  326. <FormItem
  327. labelCol={{ span: 4 }}
  328. wrapperCol={{ span: 18 }}
  329. label="摘要" >
  330. <span>{theData.summary}</span>
  331. </FormItem>
  332. <FormItem
  333. labelCol={{ span: 4 }}
  334. wrapperCol={{ span: 18 }}
  335. label="成果简介" >
  336. <span>{theData.introduction}</span>
  337. </FormItem>
  338. <FormItem
  339. labelCol={{ span: 4 }}
  340. wrapperCol={{ span: 18 }}
  341. label="技术图片" >
  342. <div className="clearfix">
  343. <Upload className="demandDetailShow-upload"
  344. listType="picture-card"
  345. fileList={this.state.technicalPictureUrl}
  346. onPreview={(file) => {
  347. this.setState({
  348. previewImage: file.url || file.thumbUrl,
  349. previewVisible: true,
  350. });
  351. }} >
  352. </Upload>
  353. <Modal maskClosable={false} footer={null}
  354. visible={this.state.previewVisible}
  355. onCancel={() => { this.setState({ previewVisible: false }) }}>
  356. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  357. </Modal>
  358. </div>
  359. </FormItem>
  360. <FormItem
  361. labelCol={{ span: 4 }}
  362. wrapperCol={{ span: 18 }}
  363. label="应用领域" >
  364. <span>{getIndustryCategory(theData.fieldA, theData.fieldB)}</span>
  365. </FormItem>
  366. <div className="clearfix">
  367. <FormItem className="half-item"
  368. {...formItemLayout}
  369. label="成熟度" >
  370. {(() => {
  371. switch (theData.maturity) {
  372. case "0":
  373. return <span>正在研发</span>;
  374. case "1":
  375. return <span>已有样品</span>;
  376. case "2":
  377. return <span>通过小试</span>;
  378. case "3":
  379. return <span>通过中试</span>;
  380. case "4":
  381. return <span>可以量产</span>;
  382. }
  383. })()}
  384. </FormItem>
  385. <FormItem className="half-item"
  386. {...formItemLayout}
  387. label="创新度" >
  388. {(() => {
  389. switch (theData.innovation) {
  390. case "0":
  391. return <span>行业先进</span>;
  392. case "1":
  393. return <span>行业领先</span>;
  394. case "2":
  395. return <span>国内先进</span>;
  396. case "3":
  397. return <span>国内领先</span>;
  398. case "4":
  399. return <span>国际先进</span>;
  400. case "5":
  401. return <span>国际领先</span>;
  402. }
  403. })()}
  404. </FormItem>
  405. </div>
  406. <FormItem
  407. labelCol={{ span: 4 }}
  408. wrapperCol={{ span: 18 }}
  409. label="成熟度证明材料(图片)" >
  410. <Upload className="demandDetailShow-upload"
  411. listType="picture-card"
  412. fileList={this.state.maturityPictureUrl}
  413. onPreview={(file) => {
  414. this.setState({
  415. previewImage: file.url || file.thumbUrl,
  416. previewVisible: true,
  417. });
  418. }} >
  419. </Upload>
  420. </FormItem>
  421. <FormItem
  422. labelCol={{ span: 4 }}
  423. wrapperCol={{ span: 6 }}
  424. label="成熟度证明材料(文本)" >
  425. <p>{theData.maturityTextFileUrl ?
  426. <span className="download-file">
  427. <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_maturity_text_file') }}>成熟度证明材料(文本文件)</a>
  428. </span>
  429. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  430. </FormItem>
  431. <FormItem
  432. labelCol={{ span: 4 }}
  433. wrapperCol={{ span: 18 }}
  434. label="成熟度证明材料(视频地址)" >
  435. <span>{theData.maturityVideoUrl}</span>
  436. </FormItem>
  437. <div className="clearfix" >
  438. <FormItem className="half-item"
  439. {...formItemLayout}
  440. label="成果所有人名称" >
  441. <span>{theData.iOwnerName || theData.ownerName}</span>
  442. </FormItem>
  443. <FormItem className="half-item"
  444. {...formItemLayout}
  445. label="所有人证件号" >
  446. <span>{theData.iOwnerIdNumber || theData.ownerIdNumber}</span>
  447. </FormItem>
  448. <FormItem className="half-item"
  449. {...formItemLayout}
  450. label="所有人联系电话" >
  451. <span>{theData.iOwnerMobile || theData.ownerMobile}</span>
  452. </FormItem>
  453. <FormItem className="half-item"
  454. {...formItemLayout}
  455. label="所有人电子邮箱" >
  456. <span>{theData.iOwnerEmail || theData.ownerEmail}</span>
  457. </FormItem>
  458. <FormItem className="half-item"
  459. {...formItemLayout}
  460. label="所有人通信地址" >
  461. <span>{theData.iOwnerPostalAddress || theData.ownerPostalAddress}</span>
  462. </FormItem>
  463. </div>
  464. <div className="clearfix">
  465. <FormItem className="half-item"
  466. {...formItemLayout}
  467. label="所有人类型" >
  468. {(() => {
  469. switch (theData.ownerType) {
  470. case "0":
  471. return <span>个人</span>;
  472. case "1":
  473. return <span>组织</span>;
  474. }
  475. })()}
  476. </FormItem>
  477. </div>
  478. {theData.ownerType == "9" ? <div className="clearfix">
  479. <FormItem className="half-item"
  480. {...formItemLayout}
  481. label="所属组织名称" >
  482. <span>{theData.orgName}</span>
  483. </FormItem>
  484. <FormItem className="half-item"
  485. {...formItemLayout}
  486. label="所属组织地址" >
  487. <span>{theData.orgAddress}</span>
  488. </FormItem>
  489. <FormItem className="half-item"
  490. {...formItemLayout}
  491. label="所属组织邮箱" >
  492. <span>{theData.orgEmail}</span>
  493. </FormItem>
  494. <FormItem className="half-item"
  495. {...formItemLayout}
  496. label="所属组织联系人名称" >
  497. <span>{theData.orgContacts}</span>
  498. </FormItem>
  499. <FormItem className="half-item"
  500. {...formItemLayout}
  501. label="所属组织联系人电话" >
  502. <span>{theData.orgContactsMobile}</span>
  503. </FormItem>
  504. </div> : <div></div>}
  505. <div className="clearfix">
  506. <FormItem className="half-item"
  507. {...formItemLayout}
  508. label="合作方式" >
  509. {(() => {
  510. switch (theData.cooperationMode) {
  511. case "0":
  512. return <span>技术转让</span>;
  513. case "1":
  514. return <span>授权生产</span>;
  515. }
  516. })()}
  517. </FormItem>
  518. <FormItem className="half-item"
  519. {...formItemLayout}
  520. label="转让方式" >
  521. {(() => {
  522. switch (theData.transferMode) {
  523. case "0":
  524. return <span>完全转让</span>;
  525. case "1":
  526. return <span>许可转让</span>;
  527. case "2":
  528. return <span>技术入股</span>;
  529. }
  530. })()}
  531. </FormItem>
  532. </div>
  533. <div className="clearfix">
  534. {theData.bargainingMode == 1 ? <FormItem className="half-item"
  535. {...formItemLayout}
  536. label="转让价格" >
  537. <span>{theData.transferPrice} 万元</span>
  538. </FormItem> : <FormItem className="half-item"
  539. {...formItemLayout}
  540. label="转让价格" >
  541. <span>面议</span>
  542. </FormItem>}
  543. </div>
  544. <FormItem
  545. labelCol={{ span: 4 }}
  546. wrapperCol={{ span: 18 }}
  547. label="技术场景" >
  548. <span>{theData.technicalScene}</span>
  549. </FormItem>
  550. <FormItem
  551. labelCol={{ span: 4 }}
  552. wrapperCol={{ span: 18 }}
  553. label="技术突破" >
  554. <span>{theData.breakthrough}</span>
  555. </FormItem>
  556. <FormItem
  557. labelCol={{ span: 4 }}
  558. wrapperCol={{ span: 18 }}
  559. label="专利情况" >
  560. <span>{theData.patentCase}</span>
  561. </FormItem>
  562. <FormItem
  563. labelCol={{ span: 4 }}
  564. wrapperCol={{ span: 18 }}
  565. label="获奖情况" >
  566. <span>{theData.awards}</span>
  567. </FormItem>
  568. <FormItem
  569. labelCol={{ span: 4 }}
  570. wrapperCol={{ span: 18 }}
  571. label="技术团队情况" >
  572. <span>{theData.teamDes}</span>
  573. </FormItem>
  574. <FormItem
  575. labelCol={{ span: 4 }}
  576. wrapperCol={{ span: 18 }}
  577. label="技术参数" >
  578. <span>{theData.parameter}</span>
  579. </FormItem>
  580. <FormItem
  581. labelCol={{ span: 4 }}
  582. wrapperCol={{ span: 6 }}
  583. label="技术方案" >
  584. <p>{theData.techPlanUrl ?
  585. <span className="download-file">
  586. <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_tech_plan') }}>技术方案</a>
  587. </span>
  588. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  589. </FormItem>
  590. <FormItem
  591. labelCol={{ span: 4 }}
  592. wrapperCol={{ span: 6 }}
  593. label="商业计划书" >
  594. <p>{theData.businessPlanUrl ?
  595. <span className="download-file">
  596. <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_business_plan') }}>商业计划书</a>
  597. </span>
  598. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  599. </FormItem>
  600. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  601. <Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>取消</Button>
  602. </FormItem>
  603. </Spin>
  604. </Form >
  605. )
  606. }
  607. }));
  608. const AchievementDetailForm = Form.create()(React.createClass({
  609. getInitialState() {
  610. return {
  611. visible: false,
  612. loading: false,
  613. auditStatus: 0,
  614. textFileList: [],
  615. techPlanFileList: [],
  616. businessPlanFileList: [],
  617. maturityPictureUrl: [],
  618. technicalPictureUrl: [],
  619. tags: []
  620. };
  621. },
  622. loadData(id) {
  623. this.setState({
  624. loading: true
  625. });
  626. $.ajax({
  627. method: "get",
  628. dataType: "json",
  629. crossDomain: false,
  630. url: globalConfig.context + (window.userData.type == "1" ? "/api/user/achievement/orgDetail" : "/api/user/achievement/userDetail"),
  631. data: {
  632. id: id
  633. },
  634. success: function (data) {
  635. let thisData = data.data;
  636. if (!thisData) {
  637. if (data.error && data.error.length) {
  638. message.warning(data.error[0].message);
  639. };
  640. thisData = {};
  641. };
  642. this.setState({
  643. data: thisData,
  644. orgDisplay: thisData.ownerType,
  645. transferPriceDis: thisData.transferMode == 1 ? true : false,
  646. tags: thisData.keyword ? thisData.keyword.split(",") : [],
  647. technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
  648. maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
  649. });
  650. }.bind(this),
  651. }).always(function () {
  652. this.setState({
  653. loading: false
  654. });
  655. }.bind(this));
  656. },
  657. getTagsArr(e) {
  658. this.setState({ tags: e });
  659. },
  660. getMaturityPictureUrl(e) {
  661. this.setState({ maturityPictureUrl: e });
  662. },
  663. getTechnicalPictureUrl(e) {
  664. this.setState({ technicalPictureUrl: e });
  665. },
  666. handleSubmit(e) {
  667. e.preventDefault();
  668. this.props.form.validateFields((err, values) => {
  669. //keyword长度判断
  670. if (this.state.tags.length < 3) {
  671. message.warning('关键词数量不能小于3个!');
  672. return;
  673. };
  674. //url转化
  675. let theTechnicalPictureUrl = [];
  676. if (this.state.technicalPictureUrl.length) {
  677. let picArr = [];
  678. this.state.technicalPictureUrl.map(function (item) {
  679. picArr.push(item.response.data);
  680. });
  681. theTechnicalPictureUrl = picArr.join(",");
  682. };
  683. let theMaturityPictureUrl = [];
  684. if (this.state.maturityPictureUrl.length) {
  685. let picArr = [];
  686. this.state.maturityPictureUrl.map(function (item) {
  687. picArr.push(item.response.data);
  688. });
  689. theMaturityPictureUrl = picArr.join(",");
  690. };
  691. if (!err) {
  692. this.setState({
  693. loading: true
  694. });
  695. $.ajax({
  696. method: "POST",
  697. dataType: "json",
  698. crossDomain: false,
  699. url: this.props.data.id ? globalConfig.context + '/api/user/achievement/update' : globalConfig.context + '/api/user/achievement/apply',
  700. data: {
  701. id: this.props.data.id,
  702. dataCategory: values.dataCategory,
  703. serialNumber: this.props.data.serialNumber,
  704. name: values.name,
  705. keyword: this.state.tags ? this.state.tags.join(",") : [],
  706. keywords: this.state.tags,
  707. category: values.category,
  708. summary: values.summary,
  709. introduction: values.introduction,
  710. technicalPictureUrl: theTechnicalPictureUrl,
  711. fieldA: values.field ? values.field[0] : undefined,
  712. fieldB: values.field ? values.field[1] : undefined,
  713. maturity: values.maturity,
  714. maturityPictureUrl: theMaturityPictureUrl,
  715. maturityTextFileUrl: this.state.maturityTextFileUrl,
  716. maturityVideoUrl: values.maturityVideoUrl,
  717. innovation: values.innovation,
  718. cooperationMode: values.cooperationMode,
  719. transferMode: values.transferMode,
  720. bargainingMode: values.bargainingMode,
  721. transferPrice: values.transferPrice,
  722. technicalScene: values.technicalScene,
  723. breakthrough: values.breakthrough,
  724. patentCase: values.patentCase,
  725. awards: values.awards,
  726. teamDes: values.teamDes,
  727. parameter: values.parameter,
  728. releaseStatus: values.releaseStatus,
  729. techPlanUrl: this.state.techPlanUrl,
  730. businessPlanUrl: this.state.businessPlanUrl,
  731. auditStatus: this.state.auditStatus,
  732. ownerType: window.userData.type // 所有人类型
  733. }
  734. }).done(function (data) {
  735. this.state.auditStatus = 0;
  736. this.setState({
  737. loading: false
  738. });
  739. if (!data.error.length) {
  740. message.success('保存成功!');
  741. this.props.handleOk();
  742. } else {
  743. message.warning(data.error[0].message);
  744. }
  745. }.bind(this));
  746. }
  747. });
  748. },
  749. componentWillMount() {
  750. if (this.props.data.id) {
  751. this.loadData(this.props.data.id);
  752. } else {
  753. this.state.data = {};
  754. };
  755. },
  756. componentWillReceiveProps(nextProps) {
  757. if (!this.props.visible && nextProps.visible) {
  758. this.state.textFileList = [];
  759. this.state.techPlanFileList = [];
  760. this.state.businessPlanFileList = [];
  761. if (nextProps.data.id) {
  762. this.loadData(nextProps.data.id);
  763. } else {
  764. this.state.data = {};
  765. this.state.tags = [];
  766. this.state.maturityPictureUrl = [];
  767. this.state.technicalPictureUrl = [];
  768. };
  769. this.props.form.resetFields();
  770. };
  771. },
  772. render() {
  773. const theData = this.state.data || {};
  774. const { getFieldDecorator } = this.props.form;
  775. const FormItem = Form.Item
  776. const formItemLayout = {
  777. labelCol: { span: 8 },
  778. wrapperCol: { span: 14 },
  779. };
  780. return (
  781. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  782. <Spin spinning={this.state.loading}>
  783. <div className="clearfix">
  784. <FormItem className="half-item"
  785. {...formItemLayout}
  786. label="编号" >
  787. <span>{theData.serialNumber}</span>
  788. </FormItem>
  789. <FormItem className="half-item"
  790. {...formItemLayout}
  791. label="名称" >
  792. {getFieldDecorator('name', {
  793. rules: [{ required: true, message: '此项为必填项!' }],
  794. initialValue: theData.name
  795. })(
  796. <Input />
  797. )}
  798. </FormItem>
  799. <FormItem className="half-item"
  800. {...formItemLayout}
  801. label="数据类别" >
  802. {getFieldDecorator('dataCategory', {
  803. rules: [{ required: true, message: '此项为必填项!' }],
  804. initialValue: theData.dataCategory
  805. })(
  806. <Select placeholder="选择数据类型" style={{ width: 160 }} >
  807. <Select.Option value="0" >成果</Select.Option>
  808. <Select.Option value="1" >技术</Select.Option>
  809. <Select.Option value="2" >项目</Select.Option>
  810. </Select>
  811. )}
  812. </FormItem>
  813. <FormItem className="half-item"
  814. {...formItemLayout}
  815. label="类型" >
  816. {getFieldDecorator('category', {
  817. rules: [{ required: true, message: '此项为必填项!' }],
  818. initialValue: theData.category
  819. })(
  820. <Select style={{ width: 160 }} placeholder="请选择成果类型">
  821. {this.props.achievementCategoryOption}
  822. </Select>
  823. )}
  824. </FormItem>
  825. <div className="clearfix">
  826. <FormItem className="half-item"
  827. {...formItemLayout}
  828. label="是否发布" >
  829. {(() => {
  830. switch (theData.releaseStatus) {
  831. case "0":
  832. return <span>未发布</span>;
  833. case "1":
  834. return <span>已发布</span>;
  835. }
  836. })()}
  837. </FormItem>
  838. <FormItem className="half-item"
  839. {...formItemLayout}
  840. label="发布时间" >
  841. <span>{theData.releaseDateFormattedDate}</span>
  842. </FormItem>
  843. <FormItem className="half-item"
  844. {...formItemLayout}
  845. label="审核状态" >
  846. {(() => {
  847. switch (theData.auditStatus) {
  848. case "0":
  849. return <span>未提交审核(草稿)</span>;
  850. case "1":
  851. return <span>提交审核</span>;
  852. case "2":
  853. return <span>审核中</span>;
  854. case "3":
  855. return <span>审核通过</span>;
  856. case "4":
  857. return <span>审核未通过</span>;
  858. }
  859. })()}
  860. </FormItem>
  861. </div>
  862. </div>
  863. <FormItem
  864. labelCol={{ span: 4 }}
  865. wrapperCol={{ span: 18 }}
  866. label="关键词" >
  867. <KeyWordTagGroup
  868. keyWordArr={this.state.tags}
  869. tagsArr={this.getTagsArr}
  870. visible={this.props.visible} />
  871. </FormItem>
  872. <FormItem
  873. labelCol={{ span: 4 }}
  874. wrapperCol={{ span: 18 }}
  875. label="摘要" >
  876. {getFieldDecorator('summary', {
  877. initialValue: theData.summary
  878. })(
  879. <Input type="textarea" rows={4} />
  880. )}
  881. </FormItem>
  882. <FormItem
  883. labelCol={{ span: 4 }}
  884. wrapperCol={{ span: 18 }}
  885. label="成果简介" >
  886. {getFieldDecorator('introduction', {
  887. initialValue: theData.introduction
  888. })(
  889. <Input type="textarea" rows={4} placeholder="项目成果简介;项目核心创新点;项目详细用途;预期效益说明;主要技术(性能)指标;市场前景;应用范围;发展历程。" />
  890. )}
  891. </FormItem>
  892. <FormItem
  893. labelCol={{ span: 4 }}
  894. wrapperCol={{ span: 18 }}
  895. label="技术图片" >
  896. <PicturesWall
  897. pictureSign="achievement_technical_picture"
  898. fileList={this.getTechnicalPictureUrl}
  899. pictureUrl={this.state.technicalPictureUrl} />
  900. <p>图片建议:专利证书或专利申请书图片、技术图纸、样品图片、技术相关网络图片;成熟度处于非研发阶段的项目,必须上传样品图片,如未上传,成熟度将视为处在研发阶段。</p>
  901. </FormItem>
  902. <FormItem
  903. labelCol={{ span: 4 }}
  904. wrapperCol={{ span: 18 }}
  905. label="应用领域" >
  906. {getFieldDecorator('field', {
  907. rules: [{ type: 'array', required: true, message: '此项为必填项!' }],
  908. initialValue: [theData.fieldA, theData.fieldB]
  909. })(
  910. <Cascader style={{ width: 300 }} options={IndustryObject} placeholder="应用领域" />
  911. )}
  912. </FormItem>
  913. <div className="clearfix">
  914. <FormItem className="half-item"
  915. {...formItemLayout}
  916. label="成熟度" >
  917. {getFieldDecorator('maturity', {
  918. initialValue: theData.maturity
  919. })(
  920. <Select placeholder="选择成熟度" style={{ width: 160 }} >
  921. <Select.Option value="0" >正在研发</Select.Option>
  922. <Select.Option value="1" >已有样品</Select.Option>
  923. <Select.Option value="2" >通过小试</Select.Option>
  924. <Select.Option value="3" >通过中试</Select.Option>
  925. <Select.Option value="4" >可以量产</Select.Option>
  926. </Select>
  927. )}
  928. </FormItem>
  929. <FormItem className="half-item"
  930. {...formItemLayout}
  931. label="创新度" >
  932. {getFieldDecorator('innovation', {
  933. initialValue: theData.innovation
  934. })(
  935. <Select placeholder="选择创新度" style={{ width: 160 }} >
  936. <Select.Option value="0" >行业先进</Select.Option>
  937. <Select.Option value="1" >行业领先</Select.Option>
  938. <Select.Option value="2" >国内先进</Select.Option>
  939. <Select.Option value="3" >国内领先</Select.Option>
  940. <Select.Option value="4" >国际先进</Select.Option>
  941. <Select.Option value="5" >国际领先</Select.Option>
  942. </Select>
  943. )}
  944. </FormItem>
  945. </div>
  946. <FormItem
  947. labelCol={{ span: 4 }}
  948. wrapperCol={{ span: 18 }}
  949. label="成熟度证明材料(图片)" >
  950. <PicturesWall
  951. pictureSign="achievement_maturity_picture"
  952. fileList={this.getMaturityPictureUrl}
  953. pictureUrl={this.state.maturityPictureUrl} />
  954. </FormItem>
  955. <FormItem
  956. labelCol={{ span: 4 }}
  957. wrapperCol={{ span: 6 }}
  958. label="成熟度证明材料(文本)" >
  959. <Upload
  960. name="ratepay"
  961. action={globalConfig.context + "/api/user/achievement/uploadTextFile"}
  962. data={{ 'sign': 'achievement_maturity_text_file' }}
  963. beforeUpload={beforeUploadFile}
  964. fileList={this.state.textFileList}
  965. onChange={(info) => {
  966. if (info.file.status !== 'uploading') {
  967. console.log(info.file, info.fileList);
  968. }
  969. if (info.file.status === 'done') {
  970. if (!info.file.response.error.length) {
  971. message.success(`${info.file.name} 文件上传成功!`);
  972. } else {
  973. message.warning(info.file.response.error[0].message);
  974. return;
  975. };
  976. this.state.maturityTextFileUrl = info.file.response.data;
  977. } else if (info.file.status === 'error') {
  978. message.error(`${info.file.name} 文件上传失败。`);
  979. };
  980. this.setState({ textFileList: info.fileList.slice(-1) });
  981. }} >
  982. <Button><Icon type="upload" /> 上传需求文本文件 </Button>
  983. </Upload>
  984. <p style={{ marginTop: '10px' }}>{theData.maturityTextFileUrl ?
  985. <span className="download-file">
  986. <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_maturity_text_file') }}>成熟度证明材料(文本文件)</a>
  987. </span>
  988. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  989. </FormItem>
  990. <FormItem
  991. labelCol={{ span: 4 }}
  992. wrapperCol={{ span: 18 }}
  993. label="成熟度证明材料(视频地址)" >
  994. {getFieldDecorator('maturityVideoUrl', {
  995. initialValue: theData.maturityVideoUrl
  996. })(
  997. <Input />
  998. )}
  999. </FormItem>
  1000. <div className="clearfix">
  1001. <FormItem className="half-item"
  1002. {...formItemLayout}
  1003. label="合作方式" >
  1004. {getFieldDecorator('cooperationMode', {
  1005. rules: [{ required: true, message: '此项为必填项!' }],
  1006. initialValue: theData.cooperationMode
  1007. })(
  1008. <Radio.Group>
  1009. <Radio value="0">技术转让</Radio>
  1010. <Radio value="1">授权生产</Radio>
  1011. </Radio.Group>
  1012. )}
  1013. </FormItem>
  1014. <FormItem className="half-item"
  1015. {...formItemLayout}
  1016. label="转让方式" >
  1017. {getFieldDecorator('transferMode', {
  1018. initialValue: theData.transferMode
  1019. })(
  1020. <Select placeholder="选择转让方式" style={{ width: 160 }} >
  1021. <Select.Option value="0" >完全转让</Select.Option>
  1022. <Select.Option value="1" >许可转让</Select.Option>
  1023. <Select.Option value="2" >技术入股</Select.Option>
  1024. </Select>
  1025. )}
  1026. </FormItem>
  1027. </div>
  1028. <div className="clearfix">
  1029. <FormItem className="half-item"
  1030. {...formItemLayout}
  1031. label="议价方式" >
  1032. {getFieldDecorator('bargainingMode', {
  1033. initialValue: theData.bargainingMode
  1034. })(
  1035. <Radio.Group onChange={((e) => { this.setState({ transferPriceDis: (e.target.value == 1 ? true : false) }) })}>
  1036. <Radio value="0">面议</Radio>
  1037. <Radio value="1">定价</Radio>
  1038. </Radio.Group>
  1039. )}
  1040. </FormItem>
  1041. {this.state.transferPriceDis ? <FormItem className="half-item"
  1042. {...formItemLayout}
  1043. label="转让价格" >
  1044. {getFieldDecorator('transferPrice', {
  1045. initialValue: theData.transferPrice
  1046. })(
  1047. <InputNumber min={0} max={999999} step={0.01} />
  1048. )}
  1049. <span style={{ marginLeft: '20px' }}>万元</span>
  1050. </FormItem> : <div></div>}
  1051. </div>
  1052. <FormItem
  1053. labelCol={{ span: 4 }}
  1054. wrapperCol={{ span: 18 }}
  1055. label="技术场景" >
  1056. {getFieldDecorator('technicalScene', {
  1057. initialValue: theData.technicalScene
  1058. })(
  1059. <Input type="textarea" rows={2} placeholder="说明解决了什么问题。" />
  1060. )}
  1061. </FormItem>
  1062. <FormItem
  1063. labelCol={{ span: 4 }}
  1064. wrapperCol={{ span: 18 }}
  1065. label="技术突破" >
  1066. {getFieldDecorator('breakthrough', {
  1067. initialValue: theData.breakthrough
  1068. })(
  1069. <Input type="textarea" rows={2} placeholder="说明该技术成果突破性的研究。" />
  1070. )}
  1071. </FormItem>
  1072. <FormItem
  1073. labelCol={{ span: 4 }}
  1074. wrapperCol={{ span: 18 }}
  1075. label="专利情况" >
  1076. {getFieldDecorator('patentCase', {
  1077. initialValue: theData.patentCase
  1078. })(
  1079. <Input type="textarea" rows={2} placeholder="一个“技术”可能由多个专利构成,需要说明技术-专利的关系。" />
  1080. )}
  1081. </FormItem>
  1082. <FormItem
  1083. labelCol={{ span: 4 }}
  1084. wrapperCol={{ span: 18 }}
  1085. label="获奖情况" >
  1086. {getFieldDecorator('awards', {
  1087. initialValue: theData.awards
  1088. })(
  1089. <Input type="textarea" rows={2} placeholder="一个“技术”可能存在社会奖励情况,需要说明社会奖励情况。" />
  1090. )}
  1091. </FormItem>
  1092. <FormItem
  1093. labelCol={{ span: 4 }}
  1094. wrapperCol={{ span: 18 }}
  1095. label="技术团队情况" >
  1096. {getFieldDecorator('teamDes', {
  1097. initialValue: theData.teamDes
  1098. })(
  1099. <Input type="textarea" rows={2} placeholder="一个“技术”、“项目”可能存在团队,需要说明团队情况。" />
  1100. )}
  1101. </FormItem>
  1102. <FormItem
  1103. labelCol={{ span: 4 }}
  1104. wrapperCol={{ span: 18 }}
  1105. label="技术参数" >
  1106. {getFieldDecorator('parameter', {
  1107. initialValue: theData.parameter
  1108. })(
  1109. <Input type="textarea" rows={2} placeholder="描述技术参数信息" />
  1110. )}
  1111. </FormItem>
  1112. <FormItem
  1113. labelCol={{ span: 4 }}
  1114. wrapperCol={{ span: 6 }}
  1115. label="技术方案" >
  1116. <Upload
  1117. name="ratepay"
  1118. action={globalConfig.context + "/api/user/achievement/uploadTextFile"}
  1119. data={{ 'sign': 'achievement_tech_plan' }}
  1120. beforeUpload={beforeUploadFile}
  1121. fileList={this.state.techPlanFileList}
  1122. onChange={(info) => {
  1123. if (info.file.status !== 'uploading') {
  1124. console.log(info.file, info.fileList);
  1125. }
  1126. if (info.file.status === 'done') {
  1127. if (!info.file.response.error.length) {
  1128. message.success(`${info.file.name} 文件上传成功!`);
  1129. } else {
  1130. message.warning(info.file.response.error[0].message);
  1131. return;
  1132. };
  1133. this.state.techPlanUrl = info.file.response.data;
  1134. } else if (info.file.status === 'error') {
  1135. message.error(`${info.file.name} 文件上传失败。`);
  1136. };
  1137. this.setState({ techPlanFileList: info.fileList.slice(-1) });
  1138. }} >
  1139. <Button><Icon type="upload" /> 上传技术方案文件 </Button>
  1140. </Upload>
  1141. <p style={{ marginTop: '10px' }}>{theData.techPlanUrl ?
  1142. <span className="download-file">
  1143. <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_tech_plan') }}>技术方案</a>
  1144. </span>
  1145. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  1146. </FormItem>
  1147. <FormItem
  1148. labelCol={{ span: 4 }}
  1149. wrapperCol={{ span: 6 }}
  1150. label="商业计划书" >
  1151. <Upload
  1152. name="ratepay"
  1153. action={globalConfig.context + "/api/user/achievement/uploadTextFile"}
  1154. data={{ 'sign': 'achievement_business_plan' }}
  1155. beforeUpload={beforeUploadFile}
  1156. fileList={this.state.businessPlanFileList}
  1157. onChange={(info) => {
  1158. if (info.file.status !== 'uploading') {
  1159. console.log(info.file, info.fileList);
  1160. }
  1161. if (info.file.status === 'done') {
  1162. if (!info.file.response.error.length) {
  1163. message.success(`${info.file.name} 文件上传成功!`);
  1164. } else {
  1165. message.warning(info.file.response.error[0].message);
  1166. return;
  1167. };
  1168. this.state.businessPlanUrl = info.file.response.data;
  1169. } else if (info.file.status === 'error') {
  1170. message.error(`${info.file.name} 文件上传失败。`);
  1171. };
  1172. this.setState({ businessPlanFileList: info.fileList.slice(-1) });
  1173. }} >
  1174. <Button><Icon type="upload" /> 上传商业计划书文件 </Button>
  1175. </Upload>
  1176. <p style={{ marginTop: '10px' }}>{theData.businessPlanUrl ?
  1177. <span className="download-file">
  1178. <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_business_plan') }}>商业计划书</a>
  1179. </span>
  1180. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  1181. </FormItem>
  1182. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  1183. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1184. <Button className="set-submit" type="ghost" onClick={(e) => { this.state.auditStatus = 1; }} htmlType="submit">发布</Button>
  1185. <Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>取消</Button>
  1186. </FormItem>
  1187. </Spin>
  1188. </Form >
  1189. )
  1190. }
  1191. }));
  1192. const AchievementDetail = React.createClass({
  1193. getInitialState() {
  1194. return {
  1195. visible: false,
  1196. tabsKey: 1,
  1197. columns: [
  1198. {
  1199. title: '编号',
  1200. dataIndex: 'serialNumber',
  1201. key: 'serialNumber',
  1202. }, {
  1203. title: '名称',
  1204. dataIndex: 'name',
  1205. key: 'name',
  1206. }, {
  1207. title: '关键字',
  1208. dataIndex: 'keyword',
  1209. key: 'keyword',
  1210. }, {
  1211. title: '类型',
  1212. dataIndex: 'demandType',
  1213. key: 'demandType',
  1214. render: text => { return getDemandType(text); }
  1215. }, {
  1216. title: '所有人名称',
  1217. dataIndex: 'theName',
  1218. key: 'theName',
  1219. }, {
  1220. title: '发布时间',
  1221. dataIndex: 'releaseDateFormattedDate',
  1222. key: 'releaseDateFormattedDate',
  1223. }, {
  1224. title: '有效期限',
  1225. dataIndex: 'validityPeriodFormattedDate',
  1226. key: 'validityPeriodFormattedDate',
  1227. },
  1228. ],
  1229. dataSource: [],
  1230. };
  1231. },
  1232. getTableList() {
  1233. this.setState({
  1234. loading: true
  1235. });
  1236. $.ajax({
  1237. method: "get",
  1238. dataType: "json",
  1239. crossDomain: false,
  1240. url: globalConfig.context + "/api/user/achievement/achievementDemand",
  1241. data: { id: this.props.data.id },
  1242. success: function (data) {
  1243. let theArr = [];
  1244. if (!data.data) {
  1245. if (data.error && data.error.length) {
  1246. message.warning(data.error[0].message);
  1247. };
  1248. } else if (data.data.length) {
  1249. for (let i = 0; i < data.data.length; i++) {
  1250. let thisdata = data.data[i];
  1251. theArr.push({
  1252. key: i,
  1253. id: thisdata.id,
  1254. serialNumber: thisdata.serialNumber,
  1255. dataCategory: thisdata.dataCategory,
  1256. name: thisdata.name,
  1257. keyword: thisdata.keyword,
  1258. demandType: thisdata.demandType,
  1259. theName: thisdata.username || thisdata.unitName,
  1260. releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
  1261. validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate
  1262. });
  1263. };
  1264. };
  1265. this.setState({
  1266. dataSource: theArr,
  1267. });
  1268. }.bind(this),
  1269. }).always(function () {
  1270. this.setState({
  1271. loading: false
  1272. });
  1273. }.bind(this));
  1274. },
  1275. tableRowClick(record, index) {
  1276. window.open(globalConfig.context + '/portal/detail/demandDetail.html?id=' + record.id + '&type=' + record.dataCategory);
  1277. },
  1278. showModal() {
  1279. this.setState({
  1280. visible: true,
  1281. });
  1282. },
  1283. handleCancel(e) {
  1284. this.setState({
  1285. visible: false,
  1286. });
  1287. this.props.closeDesc(false);
  1288. },
  1289. handleOk(e) {
  1290. this.setState({
  1291. visible: false,
  1292. });
  1293. this.props.closeDesc(false, true);
  1294. },
  1295. componentWillReceiveProps(nextProps) {
  1296. if (nextProps.showDesc) {
  1297. this.state.tabsKey = "1";
  1298. this.state.tabBool = true;
  1299. };
  1300. this.state.visible = nextProps.showDesc;
  1301. },
  1302. render() {
  1303. if (this.props.data) {
  1304. return (
  1305. <div className="patent-desc">
  1306. <Modal maskClosable={false} visible={this.state.visible}
  1307. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  1308. width='1000px'
  1309. footer=''
  1310. className="admin-desc-content">
  1311. <Tabs activeKey={this.state.tabsKey}
  1312. onChange={(e) => {
  1313. this.setState({ tabsKey: e });
  1314. if (e == "2" && this.state.tabBool) {
  1315. this.getTableList();
  1316. this.state.tabBool = false;
  1317. };
  1318. }} >
  1319. <Tabs.TabPane tab="成果详情" key="1">
  1320. {(() => {
  1321. if (this.props.data.id && this.props.data.auditStatus != "0" && this.props.data.auditStatus != "4") {
  1322. return <AchievementDetailShow
  1323. data={this.props.data}
  1324. closeDesc={this.handleCancel}
  1325. visible={this.state.visible}
  1326. handleOk={this.handleOk} />
  1327. } else {
  1328. return <AchievementDetailForm
  1329. data={this.props.data}
  1330. achievementCategoryOption={this.props.achievementCategoryOption}
  1331. closeDesc={this.handleCancel}
  1332. visible={this.state.visible}
  1333. handleOk={this.handleOk} />
  1334. }
  1335. })()}
  1336. </Tabs.TabPane>
  1337. <Tabs.TabPane tab="匹配列表" key="2">
  1338. <Table columns={this.state.columns}
  1339. dataSource={this.state.dataSource}
  1340. pagination={false}
  1341. onRowClick={this.tableRowClick} />
  1342. </Tabs.TabPane>
  1343. </Tabs>
  1344. </Modal>
  1345. </div>
  1346. );
  1347. } else {
  1348. return <div></div>
  1349. }
  1350. },
  1351. });
  1352. export default AchievementDetail;