techAchievementDesc.jsx 68 KB

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