techAchievementDesc.jsx 68 KB

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