techAchievementDesc.jsx 68 KB

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