techAchievementDesc.jsx 64 KB

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