techAchievementDesc.jsx 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421
  1. import React from 'react';
  2. import { Icon, Tabs, Table, Tooltip, Modal, message, Spin, Upload, Input, InputNumber, Select, DatePicker, Button, Radio, Form, Cascader, Tag } from 'antd';
  3. import moment from 'moment';
  4. import './techAchievement.less';
  5. import ajax from 'jquery/src/ajax/xhr.js';
  6. import $ from 'jquery/src/ajax';
  7. import { IndustryObject, getIndustryCategory } from '../../DicIndustryList.js';
  8. import { beforeUploadFile, splitUrl, getAchievementCategory, getDemandType } from '../../tools.js';
  9. const KeyWordTagGroup = React.createClass({
  10. getInitialState() {
  11. return {
  12. tags: [],
  13. inputVisible: false,
  14. inputValue: ''
  15. };
  16. },
  17. handleClose(removedTag) {
  18. const tags = this.state.tags.filter(tag => tag !== removedTag);
  19. this.props.tagsArr(tags);
  20. this.setState({ tags });
  21. },
  22. showInput() {
  23. this.setState({ inputVisible: true }, () => this.input.focus());
  24. },
  25. handleInputChange(e) {
  26. this.setState({ inputValue: e.target.value });
  27. },
  28. handleInputConfirm() {
  29. const state = this.state;
  30. const inputValue = state.inputValue;
  31. let tags = state.tags;
  32. if (inputValue && tags.indexOf(inputValue) === -1 && inputValue.replace(/(^\s*)|(\s*$)/g, "").length != 0) {
  33. tags = [...tags, inputValue.replace(/(^\s*)|(\s*$)/g, "")];
  34. }
  35. this.props.tagsArr(tags);
  36. this.setState({
  37. tags,
  38. inputVisible: false,
  39. inputValue: '',
  40. });
  41. },
  42. componentWillMount() {
  43. this.state.tags = this.props.keyWordArr;
  44. },
  45. componentWillReceiveProps(nextProps) {
  46. if (this.props.keyWordArr != nextProps.keyWordArr) {
  47. this.state.tags = nextProps.keyWordArr;
  48. };
  49. },
  50. render() {
  51. const { tags, inputVisible, inputValue } = this.state;
  52. return (
  53. <div className="keyWord-tips">
  54. {tags.map((tag, index) => {
  55. const isLongTag = tag.length > 10;
  56. const tagElem = (
  57. <Tag key={tag} closable={index !== -1} afterClose={() => this.handleClose(tag)}>
  58. {isLongTag ? `${tag.slice(0, 10)}...` : tag}
  59. </Tag>
  60. );
  61. return isLongTag ? <Tooltip title={tag}>{tagElem}</Tooltip> : tagElem;
  62. })}
  63. {inputVisible && (
  64. <Input
  65. ref={input => this.input = input}
  66. type="text"
  67. style={{ width: 78 }}
  68. value={inputValue}
  69. onChange={this.handleInputChange}
  70. onBlur={this.handleInputConfirm}
  71. onPressEnter={this.handleInputConfirm}
  72. />
  73. )}
  74. {!inputVisible && <Button className="addtips" type="dashed" disabled={tags.length > 9 ? true : false} onClick={this.showInput}>+ 新关键词</Button>}
  75. </div>
  76. );
  77. }
  78. });
  79. const PicturesWall = React.createClass({
  80. getInitialState() {
  81. return {
  82. previewVisible: false,
  83. previewImage: '',
  84. fileList: [],
  85. }
  86. },
  87. handleCancel() {
  88. this.setState({ previewVisible: false })
  89. },
  90. handlePreview(file) {
  91. this.setState({
  92. previewImage: file.url || file.thumbUrl,
  93. previewVisible: true,
  94. });
  95. },
  96. handleChange(info) {
  97. let fileList = info.fileList;
  98. this.setState({ fileList });
  99. this.props.fileList(fileList);
  100. },
  101. componentWillReceiveProps(nextProps) {
  102. this.state.fileList = nextProps.pictureUrl;
  103. },
  104. render() {
  105. const { previewVisible, previewImage, fileList } = this.state;
  106. const uploadButton = (
  107. <div>
  108. <Icon type="plus" />
  109. <div className="ant-upload-text">点击上传</div>
  110. </div>
  111. );
  112. return (
  113. <div className="clearfix">
  114. <Upload
  115. beforeUpload={beforeUploadFile}
  116. action={globalConfig.context + "/api/user/achievement/uploadPicture"}
  117. data={{ 'sign': this.props.pictureSign }}
  118. listType="picture-card"
  119. multiple
  120. fileList={fileList}
  121. onPreview={this.handlePreview}
  122. onChange={this.handleChange} >
  123. {uploadButton}
  124. </Upload>
  125. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  126. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  127. </Modal>
  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" 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. pictureSign="achievement_technical_picture"
  924. fileList={this.getTechnicalPictureUrl}
  925. pictureUrl={this.state.technicalPictureUrl} />
  926. <p>图片建议:专利证书或专利申请书图片、技术图纸、样品图片、技术相关网络图片;成熟度处于非研发阶段的项目,必须上传样品图片,如未上传,成熟度将视为处在研发阶段。</p>
  927. </FormItem>
  928. <FormItem
  929. labelCol={{ span: 4 }}
  930. wrapperCol={{ span: 18 }}
  931. label="应用领域" >
  932. {getFieldDecorator('field', {
  933. rules: [{ type: 'array', required: true, message: '此项为必填项!' }],
  934. initialValue: [theData.fieldA, theData.fieldB]
  935. })(
  936. <Cascader style={{ width: 300 }} options={IndustryObject} placeholder="应用领域" />
  937. )}
  938. </FormItem>
  939. <div className="clearfix">
  940. <FormItem className="half-item"
  941. {...formItemLayout}
  942. label="成熟度" >
  943. {getFieldDecorator('maturity', {
  944. rules: [{ type: 'string', required: true, message: '此项为必填项!' }],
  945. initialValue: theData.maturity
  946. })(
  947. <Select placeholder="选择成熟度" style={{ width: 160 }} >
  948. <Select.Option value="0" >正在研发</Select.Option>
  949. <Select.Option value="1" >已有样品</Select.Option>
  950. <Select.Option value="2" >通过小试</Select.Option>
  951. <Select.Option value="3" >通过中试</Select.Option>
  952. <Select.Option value="4" >可以量产</Select.Option>
  953. </Select>
  954. )}
  955. </FormItem>
  956. <FormItem className="half-item"
  957. {...formItemLayout}
  958. label="创新度" >
  959. {getFieldDecorator('innovation', {
  960. initialValue: theData.innovation
  961. })(
  962. <Select placeholder="选择创新度" style={{ width: 160 }} >
  963. <Select.Option value="0" >行业先进</Select.Option>
  964. <Select.Option value="1" >行业领先</Select.Option>
  965. <Select.Option value="2" >国内先进</Select.Option>
  966. <Select.Option value="3" >国内领先</Select.Option>
  967. <Select.Option value="4" >国际先进</Select.Option>
  968. <Select.Option value="5" >国际领先</Select.Option>
  969. </Select>
  970. )}
  971. </FormItem>
  972. </div>
  973. <FormItem
  974. labelCol={{ span: 4 }}
  975. wrapperCol={{ span: 18 }}
  976. label="成熟度证明材料(图片)" >
  977. <PicturesWall
  978. pictureSign="achievement_maturity_picture"
  979. fileList={this.getMaturityPictureUrl}
  980. pictureUrl={this.state.maturityPictureUrl} />
  981. </FormItem>
  982. <FormItem
  983. labelCol={{ span: 4 }}
  984. wrapperCol={{ span: 6 }}
  985. label="成熟度证明材料(文本)" >
  986. <Upload
  987. name="ratepay"
  988. action={globalConfig.context + "/api/user/achievement/uploadTextFile"}
  989. data={{ 'sign': 'achievement_maturity_text_file' }}
  990. beforeUpload={beforeUploadFile}
  991. fileList={this.state.textFileList}
  992. onChange={(info) => {
  993. if (info.file.status !== 'uploading') {
  994. console.log(info.file, info.fileList);
  995. }
  996. if (info.file.status === 'done') {
  997. if (!info.file.response.error.length) {
  998. message.success(`${info.file.name} 文件上传成功!`);
  999. } else {
  1000. message.warning(info.file.response.error[0].message);
  1001. return;
  1002. };
  1003. this.state.maturityTextFileUrl = info.file.response.data;
  1004. } else if (info.file.status === 'error') {
  1005. message.error(`${info.file.name} 文件上传失败。`);
  1006. };
  1007. this.setState({ textFileList: info.fileList.slice(-1) });
  1008. }} >
  1009. <Button><Icon type="upload" /> 上传成熟度证明文本 </Button>
  1010. </Upload>
  1011. <p style={{ marginTop: '10px' }}>{theData.maturityTextFileUrl ?
  1012. <span className="download-file">
  1013. <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_maturity_text_file') }}>{theData.maturityTextFileDownloadFileName}</a>
  1014. </span>
  1015. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  1016. </FormItem>
  1017. <FormItem
  1018. labelCol={{ span: 4 }}
  1019. wrapperCol={{ span: 18 }}
  1020. label="成熟度证明材料(视频地址)" >
  1021. {getFieldDecorator('maturityVideoUrl', {
  1022. initialValue: theData.maturityVideoUrl
  1023. })(
  1024. <Input />
  1025. )}
  1026. </FormItem>
  1027. <div className="clearfix">
  1028. <FormItem className="half-item"
  1029. {...formItemLayout}
  1030. label="合作方式" >
  1031. {getFieldDecorator('cooperationMode', {
  1032. rules: [{ required: true, message: '此项为必填项!' }],
  1033. initialValue: theData.cooperationMode
  1034. })(
  1035. <Radio.Group>
  1036. <Radio value="0">技术转让</Radio>
  1037. <Radio value="1">授权生产</Radio>
  1038. </Radio.Group>
  1039. )}
  1040. </FormItem>
  1041. <FormItem className="half-item"
  1042. {...formItemLayout}
  1043. label="转让方式" >
  1044. {getFieldDecorator('transferMode', {
  1045. initialValue: theData.transferMode
  1046. })(
  1047. <Select placeholder="选择转让方式" style={{ width: 160 }} >
  1048. <Select.Option value="0" >完全转让</Select.Option>
  1049. <Select.Option value="1" >许可转让</Select.Option>
  1050. <Select.Option value="2" >技术入股</Select.Option>
  1051. </Select>
  1052. )}
  1053. </FormItem>
  1054. </div>
  1055. <div className="clearfix">
  1056. <FormItem className="half-item"
  1057. {...formItemLayout}
  1058. label="议价方式" >
  1059. {getFieldDecorator('bargainingMode', {
  1060. initialValue: theData.bargainingMode
  1061. })(
  1062. <Radio.Group onChange={((e) => { this.setState({ transferPriceDis: (e.target.value == 1 ? true : false) }) })}>
  1063. <Radio value="0">面议</Radio>
  1064. <Radio value="1">定价</Radio>
  1065. </Radio.Group>
  1066. )}
  1067. </FormItem>
  1068. {this.state.transferPriceDis ? <FormItem className="half-item"
  1069. {...formItemLayout}
  1070. label="转让价格" >
  1071. {getFieldDecorator('transferPrice', {
  1072. initialValue: theData.transferPrice
  1073. })(
  1074. <InputNumber min={0} max={999999} step={0.01} />
  1075. )}
  1076. <span style={{ marginLeft: '20px' }}>万元</span>
  1077. </FormItem> : <div></div>}
  1078. </div>
  1079. <FormItem
  1080. labelCol={{ span: 4 }}
  1081. wrapperCol={{ span: 18 }}
  1082. label="技术场景" >
  1083. {getFieldDecorator('technicalScene', {
  1084. initialValue: theData.technicalScene
  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('breakthrough', {
  1094. initialValue: theData.breakthrough
  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('patentCase', {
  1104. initialValue: theData.patentCase
  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('awards', {
  1114. initialValue: theData.awards
  1115. })(
  1116. <Input type="textarea" rows={2} placeholder="一个“技术”可能存在社会奖励情况,需要说明社会奖励情况。" />
  1117. )}
  1118. </FormItem>
  1119. <FormItem
  1120. labelCol={{ span: 4 }}
  1121. wrapperCol={{ span: 18 }}
  1122. label="技术团队情况" >
  1123. {getFieldDecorator('teamDes', {
  1124. initialValue: theData.teamDes
  1125. })(
  1126. <Input type="textarea" rows={2} placeholder="一个“技术”、“项目”可能存在团队,需要说明团队情况。" />
  1127. )}
  1128. </FormItem>
  1129. <FormItem
  1130. labelCol={{ span: 4 }}
  1131. wrapperCol={{ span: 18 }}
  1132. label="技术参数" >
  1133. {getFieldDecorator('parameter', {
  1134. initialValue: theData.parameter
  1135. })(
  1136. <Input type="textarea" rows={2} placeholder="描述技术参数信息" />
  1137. )}
  1138. </FormItem>
  1139. <FormItem
  1140. labelCol={{ span: 4 }}
  1141. wrapperCol={{ span: 6 }}
  1142. label="技术方案" >
  1143. <Upload
  1144. name="ratepay"
  1145. action={globalConfig.context + "/api/user/achievement/uploadTextFile"}
  1146. data={{ 'sign': 'achievement_tech_plan' }}
  1147. beforeUpload={beforeUploadFile}
  1148. fileList={this.state.techPlanFileList}
  1149. onChange={(info) => {
  1150. if (info.file.status !== 'uploading') {
  1151. console.log(info.file, info.fileList);
  1152. }
  1153. if (info.file.status === 'done') {
  1154. if (!info.file.response.error.length) {
  1155. message.success(`${info.file.name} 文件上传成功!`);
  1156. } else {
  1157. message.warning(info.file.response.error[0].message);
  1158. return;
  1159. };
  1160. this.state.techPlanUrl = info.file.response.data;
  1161. } else if (info.file.status === 'error') {
  1162. message.error(`${info.file.name} 文件上传失败。`);
  1163. };
  1164. this.setState({ techPlanFileList: info.fileList.slice(-1) });
  1165. }} >
  1166. <Button><Icon type="upload" /> 上传技术方案文件 </Button>
  1167. </Upload>
  1168. <p style={{ marginTop: '10px' }}>{theData.techPlanUrl ?
  1169. <span className="download-file">
  1170. <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_tech_plan') }}>{theData.techPlanDownloadFileName}</a>
  1171. </span>
  1172. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  1173. </FormItem>
  1174. <FormItem
  1175. labelCol={{ span: 4 }}
  1176. wrapperCol={{ span: 6 }}
  1177. label="商业计划书" >
  1178. <Upload
  1179. name="ratepay"
  1180. action={globalConfig.context + "/api/user/achievement/uploadTextFile"}
  1181. data={{ 'sign': 'achievement_business_plan' }}
  1182. beforeUpload={beforeUploadFile}
  1183. fileList={this.state.businessPlanFileList}
  1184. onChange={(info) => {
  1185. if (info.file.status !== 'uploading') {
  1186. console.log(info.file, info.fileList);
  1187. }
  1188. if (info.file.status === 'done') {
  1189. if (!info.file.response.error.length) {
  1190. message.success(`${info.file.name} 文件上传成功!`);
  1191. } else {
  1192. message.warning(info.file.response.error[0].message);
  1193. return;
  1194. };
  1195. this.state.businessPlanUrl = info.file.response.data;
  1196. } else if (info.file.status === 'error') {
  1197. message.error(`${info.file.name} 文件上传失败。`);
  1198. };
  1199. this.setState({ businessPlanFileList: info.fileList.slice(-1) });
  1200. }} >
  1201. <Button><Icon type="upload" /> 上传商业计划书文件 </Button>
  1202. </Upload>
  1203. <p style={{ marginTop: '10px' }}>{theData.businessPlanUrl ?
  1204. <span className="download-file">
  1205. <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_business_plan') }}>{theData.businessPlanDownloadFileName}</a>
  1206. </span>
  1207. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  1208. </FormItem>
  1209. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  1210. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1211. <Button className="set-submit" type="ghost" onClick={(e) => { this.state.auditStatus = 1; }} htmlType="submit">发布</Button>
  1212. <Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>取消</Button>
  1213. </FormItem>
  1214. </Spin>
  1215. </Form >
  1216. )
  1217. }
  1218. }));
  1219. const AchievementDetail = React.createClass({
  1220. getInitialState() {
  1221. return {
  1222. visible: false,
  1223. tabsKey: 1,
  1224. contactsObj: {},
  1225. columns: [
  1226. {
  1227. title: '编号',
  1228. dataIndex: 'serialNumber',
  1229. key: 'serialNumber',
  1230. }, {
  1231. title: '名称',
  1232. dataIndex: 'name',
  1233. key: 'name',
  1234. }, {
  1235. title: '关键字',
  1236. dataIndex: 'keyword',
  1237. key: 'keyword',
  1238. }, {
  1239. title: '类型',
  1240. dataIndex: 'demandType',
  1241. key: 'demandType',
  1242. render: text => { return getDemandType(text); }
  1243. }, {
  1244. title: '所有人名称',
  1245. dataIndex: 'theName',
  1246. key: 'theName',
  1247. }, {
  1248. title: '发布时间',
  1249. dataIndex: 'releaseDateFormattedDate',
  1250. key: 'releaseDateFormattedDate',
  1251. }, {
  1252. title: '有效期限',
  1253. dataIndex: 'validityPeriodFormattedDate',
  1254. key: 'validityPeriodFormattedDate',
  1255. },
  1256. ],
  1257. dataSource: [],
  1258. };
  1259. },
  1260. getTableList() {
  1261. this.setState({
  1262. loading: true
  1263. });
  1264. $.ajax({
  1265. method: "get",
  1266. dataType: "json",
  1267. crossDomain: false,
  1268. url: globalConfig.context + "/api/user/achievement/achievementDemand",
  1269. data: { id: this.props.data.id },
  1270. success: function (data) {
  1271. let theArr = [];
  1272. if (!data.data) {
  1273. if (data.error && data.error.length) {
  1274. message.warning(data.error[0].message);
  1275. };
  1276. } else if (data.data.length) {
  1277. for (let i = 0; i < data.data.length; i++) {
  1278. let thisdata = data.data[i];
  1279. theArr.push({
  1280. key: i,
  1281. id: thisdata.id,
  1282. serialNumber: thisdata.serialNumber,
  1283. dataCategory: thisdata.dataCategory,
  1284. name: thisdata.name,
  1285. keyword: thisdata.keyword,
  1286. demandType: thisdata.demandType,
  1287. theName: thisdata.username || thisdata.unitName,
  1288. releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
  1289. validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate
  1290. });
  1291. };
  1292. };
  1293. this.setState({
  1294. dataSource: theArr,
  1295. });
  1296. }.bind(this),
  1297. }).always(function () {
  1298. this.setState({
  1299. loading: false
  1300. });
  1301. }.bind(this));
  1302. },
  1303. tableRowClick(record, index) {
  1304. window.open(globalConfig.context + '/portal/detail/demandDetail.html?id=' + record.id + '&type=' + record.dataCategory);
  1305. },
  1306. showModal() {
  1307. this.setState({
  1308. visible: true,
  1309. });
  1310. },
  1311. handleCancel(e) {
  1312. this.setState({
  1313. visible: false,
  1314. });
  1315. this.props.closeDesc(false);
  1316. },
  1317. handleOk(e) {
  1318. this.setState({
  1319. visible: false,
  1320. });
  1321. this.props.closeDesc(false, true);
  1322. },
  1323. componentWillMount() {
  1324. this.getContactsOption();
  1325. },
  1326. getContactsOption() {
  1327. let theOption = [], theObj = {};
  1328. $.ajax({
  1329. method: "get",
  1330. dataType: "json",
  1331. crossDomain: false,
  1332. url: globalConfig.context + '/api/user/getContacts',
  1333. success: function (data) {
  1334. if (!data.data) {
  1335. if (data.error && data.error.length) {
  1336. message.warning(data.error[0].message);
  1337. };
  1338. } else {
  1339. for (let item in data.data) {
  1340. let theData = data.data[item];
  1341. theOption.push(
  1342. <Select.Option value={item} key={theData}>{theData}</Select.Option>
  1343. );
  1344. };
  1345. theObj = data.data;
  1346. };
  1347. this.setState({
  1348. contactsOption: theOption,
  1349. contactsObj: theObj
  1350. });
  1351. }.bind(this)
  1352. });
  1353. },
  1354. componentWillReceiveProps(nextProps) {
  1355. if (nextProps.showDesc) {
  1356. this.state.tabsKey = "1";
  1357. this.state.tabBool = true;
  1358. };
  1359. this.state.visible = nextProps.showDesc;
  1360. },
  1361. render() {
  1362. if (this.props.data) {
  1363. return (
  1364. <div className="patent-desc">
  1365. <Modal maskClosable={false} visible={this.state.visible}
  1366. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  1367. width='1000px'
  1368. footer=''
  1369. className="admin-desc-content">
  1370. <Tabs activeKey={this.state.tabsKey}
  1371. onChange={(e) => {
  1372. this.setState({ tabsKey: e });
  1373. if (e == "2" && this.state.tabBool) {
  1374. this.getTableList();
  1375. this.state.tabBool = false;
  1376. };
  1377. }} >
  1378. <Tabs.TabPane tab="成果详情" key="1">
  1379. {(() => {
  1380. if (this.props.data.id && this.props.data.auditStatus != "0" && this.props.data.auditStatus != "4") {
  1381. return <AchievementDetailShow
  1382. data={this.props.data}
  1383. closeDesc={this.handleCancel}
  1384. visible={this.state.visible}
  1385. contactsObj={this.state.contactsObj}
  1386. handleOk={this.handleOk} />
  1387. } else {
  1388. return <AchievementDetailForm
  1389. data={this.props.data}
  1390. achievementCategoryOption={this.props.achievementCategoryOption}
  1391. closeDesc={this.handleCancel}
  1392. contactsOption={this.state.contactsOption}
  1393. visible={this.state.visible}
  1394. handleOk={this.handleOk} />
  1395. }
  1396. })()}
  1397. </Tabs.TabPane>
  1398. <Tabs.TabPane tab="匹配列表" key="2">
  1399. <Table columns={this.state.columns}
  1400. dataSource={this.state.dataSource}
  1401. pagination={false}
  1402. onRowClick={this.tableRowClick} />
  1403. </Tabs.TabPane>
  1404. </Tabs>
  1405. </Modal>
  1406. </div>
  1407. );
  1408. } else {
  1409. return <div></div>
  1410. }
  1411. },
  1412. });
  1413. export default AchievementDetail;