techAchievementDesc.jsx 66 KB

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