techAchievementDesc.jsx 64 KB

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