techAchievementDesc.jsx 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870
  1. import React from 'react';
  2. import { Icon, 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 } from '../../DicIndustryList.js';
  8. import { beforeUploadFile, splitUrl, companySearch } 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) {
  33. tags = [...tags, inputValue];
  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 AchievementDetailForm = 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 + "/api/user/achievement/detail",
  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. let d = new Date()
  164. if (thisData && thisData.dateOfBirthMonth && thisData.dateOfBirthYear) {
  165. d.setMonth(thisData.dateOfBirthMonth - 1);
  166. d.setYear(parseInt(thisData.dateOfBirthYear));
  167. };
  168. this.setState({
  169. data: thisData,
  170. orgDisplay: thisData.ownerType,
  171. tags: thisData.keyword ? thisData.keyword.split(",") : [],
  172. technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
  173. maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : []
  174. });
  175. }.bind(this),
  176. }).always(function () {
  177. this.setState({
  178. loading: false
  179. });
  180. }.bind(this));
  181. },
  182. getTagsArr(e) {
  183. this.setState({ tags: e });
  184. },
  185. getMaturityPictureUrl(e) {
  186. this.setState({ maturityPictureUrl: e });
  187. },
  188. getTechnicalPictureUrl(e) {
  189. this.setState({ technicalPictureUrl: e });
  190. },
  191. handleSubmit(e) {
  192. e.preventDefault();
  193. this.props.form.validateFields((err, values) => {
  194. //keyword长度判断
  195. if (this.state.tags.length < 3) {
  196. message.warning('关键词数量不能小于3个!');
  197. return;
  198. };
  199. //url转化
  200. let theTechnicalPictureUrl = [];
  201. if (this.state.technicalPictureUrl.length) {
  202. let picArr = [];
  203. this.state.technicalPictureUrl.map(function (item) {
  204. picArr.push(item.response.data);
  205. });
  206. theTechnicalPictureUrl = picArr.join(",");
  207. };
  208. let theMaturityPictureUrl = [];
  209. if (this.state.maturityPictureUrl.length) {
  210. let picArr = [];
  211. this.state.maturityPictureUrl.map(function (item) {
  212. picArr.push(item.response.data);
  213. });
  214. theMaturityPictureUrl = picArr.join(",");
  215. };
  216. if (!err) {
  217. this.setState({
  218. loading: true
  219. });
  220. $.ajax({
  221. method: "POST",
  222. dataType: "json",
  223. crossDomain: false,
  224. url: this.props.data.id ? globalConfig.context + '/api/user/achievement/update' : globalConfig.context + '/api/user/achievement/apply',
  225. data: {
  226. id: this.props.data.id,
  227. dataCategory: values.dataCategory,
  228. serialNumber: this.props.data.serialNumber,
  229. name: values.name,
  230. keyword: this.state.tags ? this.state.tags.join(",") : [],
  231. category: values.category,
  232. summary: values.summary,
  233. introduction: values.introduction,
  234. technicalPictureUrl: theTechnicalPictureUrl,
  235. fieldA: values.field ? values.field[0] : undefined,
  236. fieldB: values.field ? values.field[1] : undefined,
  237. maturity: values.maturity,
  238. maturityPictureUrl: theMaturityPictureUrl,
  239. maturityTextFileUrl: this.state.maturityTextFileUrl,
  240. maturityVideoUrl: values.maturityVideoUrl,
  241. innovation: values.innovation,
  242. ownerName: values.ownerName,
  243. ownerType: values.ownerType,
  244. ownerIdNumber: values.ownerIdNumber,
  245. ownerMobile: values.ownerMobile,
  246. ownerEmail: values.ownerEmail,
  247. ownerPostalAddress: values.ownerPostalAddress,
  248. cooperationMode: values.cooperationMode,
  249. transferMode: values.transferMode,
  250. bargainingMode: values.bargainingMode,
  251. transferPrice: values.transferPrice,
  252. technicalScene: values.technicalScene,
  253. breakthrough: values.breakthrough,
  254. patentCase: values.patentCase,
  255. awards: values.awards,
  256. teamDes: values.teamDes,
  257. parameter: values.parameter,
  258. orgId: values.orgId,
  259. orgName: values.orgName,
  260. orgAddress: values.orgAddress,
  261. orgEmail: values.orgEmail,
  262. orgContacts: values.orgContacts,
  263. orgContactsMobile: values.orgContactsMobile,
  264. releaseStatus: values.releaseStatus,
  265. techPlanUrl: this.state.techPlanUrl,
  266. businessPlanUrl: this.state.businessPlanUrl
  267. }
  268. }).done(function (data) {
  269. if (!data.error.length) {
  270. message.success('保存成功!');
  271. this.setState({
  272. visible: false
  273. });
  274. this.props.handleOk();
  275. } else {
  276. message.warning(data.error[0].message);
  277. }
  278. }.bind(this));
  279. }
  280. });
  281. },
  282. componentWillMount() {
  283. if (this.props.data.id) {
  284. this.loadData(this.props.data.id);
  285. } else {
  286. this.state.data = {};
  287. };
  288. },
  289. componentWillReceiveProps(nextProps) {
  290. if (!this.props.visible && nextProps.visible) {
  291. this.state.textFileList = [];
  292. this.state.techPlanFileList = [];
  293. this.state.businessPlanFileList = [];
  294. if (nextProps.data.id) {
  295. this.loadData(nextProps.data.id);
  296. } else {
  297. this.state.data = {};
  298. this.state.tags = [];
  299. this.state.maturityPictureUrl = [];
  300. this.state.technicalPictureUrl = [];
  301. };
  302. this.props.form.resetFields();
  303. };
  304. },
  305. render() {
  306. const theData = this.state.data || {};
  307. const { getFieldDecorator } = this.props.form;
  308. const FormItem = Form.Item
  309. const formItemLayout = {
  310. labelCol: { span: 8 },
  311. wrapperCol: { span: 14 },
  312. };
  313. return (
  314. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  315. <div className="clearfix">
  316. <FormItem className="half-item"
  317. {...formItemLayout}
  318. label="编号" >
  319. <span>{theData.serialNumber}</span>
  320. </FormItem>
  321. <FormItem className="half-item"
  322. {...formItemLayout}
  323. label="名称" >
  324. {getFieldDecorator('name', {
  325. rules: [{ required: true, message: '此项为必填项!' }],
  326. initialValue: theData.name
  327. })(
  328. <Input />
  329. )}
  330. </FormItem>
  331. <FormItem className="half-item"
  332. {...formItemLayout}
  333. label="数据类别" >
  334. {getFieldDecorator('dataCategory', {
  335. rules: [{ required: true, message: '此项为必填项!' }],
  336. initialValue: theData.dataCategory
  337. })(
  338. <Select placeholder="选择数据类型" style={{ width: 160 }} >
  339. <Select.Option value="0" >成果</Select.Option>
  340. <Select.Option value="1" >技术</Select.Option>
  341. <Select.Option value="2" >项目</Select.Option>
  342. </Select>
  343. )}
  344. </FormItem>
  345. <FormItem className="half-item"
  346. {...formItemLayout}
  347. label="类型" >
  348. {getFieldDecorator('category', {
  349. rules: [{ required: true, message: '此项为必填项!' }],
  350. initialValue: theData.category
  351. })(
  352. <Select style={{ width: 160 }} placeholder="请选择成果类型">
  353. {this.props.achievementCategoryOption}
  354. </Select>
  355. )}
  356. </FormItem>
  357. <FormItem className="half-item"
  358. {...formItemLayout}
  359. label="是否发布" >
  360. {getFieldDecorator('releaseStatus', {
  361. initialValue: theData.releaseStatus
  362. })(
  363. <Radio.Group>
  364. <Radio value="0">未发布</Radio>
  365. <Radio value="1">发布</Radio>
  366. </Radio.Group>
  367. )}
  368. </FormItem>
  369. <FormItem className="half-item"
  370. {...formItemLayout}
  371. label="发布时间" >
  372. <span>{theData.releaseDateFormattedDate}</span>
  373. </FormItem>
  374. </div>
  375. <FormItem
  376. labelCol={{ span: 4 }}
  377. wrapperCol={{ span: 18 }}
  378. label="关键词" >
  379. <KeyWordTagGroup
  380. keyWordArr={this.state.tags}
  381. tagsArr={this.getTagsArr}
  382. visible={this.props.visible} />
  383. </FormItem>
  384. <FormItem
  385. labelCol={{ span: 4 }}
  386. wrapperCol={{ span: 18 }}
  387. label="摘要" >
  388. {getFieldDecorator('summary', {
  389. initialValue: theData.summary
  390. })(
  391. <Input type="textarea" rows={4} />
  392. )}
  393. </FormItem>
  394. <FormItem
  395. labelCol={{ span: 4 }}
  396. wrapperCol={{ span: 18 }}
  397. label="成果简介" >
  398. {getFieldDecorator('introduction', {
  399. initialValue: theData.introduction
  400. })(
  401. <Input type="textarea" rows={4} placeholder="项目成果简介;项目核心创新点;项目详细用途;预期效益说明;主要技术(性能)指标;市场前景;应用范围;发展历程。" />
  402. )}
  403. </FormItem>
  404. <FormItem
  405. labelCol={{ span: 4 }}
  406. wrapperCol={{ span: 18 }}
  407. label="技术图片" >
  408. <PicturesWall
  409. pictureSign="achievement_technical_picture"
  410. fileList={this.getTechnicalPictureUrl}
  411. pictureUrl={this.state.technicalPictureUrl} />
  412. <p>图片建议:专利证书或专利申请书图片、技术图纸、样品图片、技术相关网络图片;成熟度处于非研发阶段的项目,必须上传样品图片,如未上传,成熟度将视为处在研发阶段。</p>
  413. </FormItem>
  414. <FormItem
  415. labelCol={{ span: 4 }}
  416. wrapperCol={{ span: 18 }}
  417. label="应用领域" >
  418. {getFieldDecorator('field', {
  419. rules: [{ type: 'array', required: true, message: '此项为必填项!' }],
  420. initialValue: [theData.fieldA, theData.fieldB]
  421. })(
  422. <Cascader style={{ width: 300 }} options={IndustryObject} placeholder="应用领域" />
  423. )}
  424. </FormItem>
  425. <div className="clearfix">
  426. <FormItem className="half-item"
  427. {...formItemLayout}
  428. label="成熟度" >
  429. {getFieldDecorator('maturity', {
  430. initialValue: theData.maturity
  431. })(
  432. <Select placeholder="选择成熟度" style={{ width: 160 }} >
  433. <Select.Option value="0" >正在研发</Select.Option>
  434. <Select.Option value="1" >已有样品</Select.Option>
  435. <Select.Option value="2" >通过小试</Select.Option>
  436. <Select.Option value="3" >通过中试</Select.Option>
  437. <Select.Option value="4" >可以量产</Select.Option>
  438. </Select>
  439. )}
  440. </FormItem>
  441. <FormItem className="half-item"
  442. {...formItemLayout}
  443. label="创新度" >
  444. {getFieldDecorator('innovation', {
  445. initialValue: theData.innovation
  446. })(
  447. <Select placeholder="选择创新度" style={{ width: 160 }} >
  448. <Select.Option value="0" >行业先进</Select.Option>
  449. <Select.Option value="1" >行业领先</Select.Option>
  450. <Select.Option value="2" >国内先进</Select.Option>
  451. <Select.Option value="3" >国内领先</Select.Option>
  452. <Select.Option value="4" >国际先进</Select.Option>
  453. <Select.Option value="5" >国际领先</Select.Option>
  454. </Select>
  455. )}
  456. </FormItem>
  457. </div>
  458. <FormItem
  459. labelCol={{ span: 4 }}
  460. wrapperCol={{ span: 18 }}
  461. label="成熟度证明材料(图片)" >
  462. <PicturesWall
  463. pictureSign="achievement_maturity_picture"
  464. fileList={this.getMaturityPictureUrl}
  465. pictureUrl={this.state.maturityPictureUrl} />
  466. </FormItem>
  467. <FormItem
  468. labelCol={{ span: 4 }}
  469. wrapperCol={{ span: 6 }}
  470. label="成熟度证明材料(文本)" >
  471. <Upload
  472. name="ratepay"
  473. action={globalConfig.context + "/api/user/achievement/uploadTextFile"}
  474. data={{ 'sign': 'achievement_maturity_text_file' }}
  475. beforeUpload={beforeUploadFile}
  476. fileList={this.state.textFileList}
  477. onChange={(info) => {
  478. if (info.file.status !== 'uploading') {
  479. console.log(info.file, info.fileList);
  480. }
  481. if (info.file.status === 'done') {
  482. if (!info.file.response.error.length) {
  483. message.success(`${info.file.name} 文件上传成功!`);
  484. } else {
  485. message.warning(info.file.response.error[0].message);
  486. return;
  487. };
  488. this.state.maturityTextFileUrl = info.file.response.data;
  489. } else if (info.file.status === 'error') {
  490. message.error(`${info.file.name} 文件上传失败。`);
  491. };
  492. this.setState({ textFileList: info.fileList.slice(-1) });
  493. }} >
  494. <Button><Icon type="upload" /> 上传需求文本文件 </Button>
  495. </Upload>
  496. <p style={{ marginTop: '10px' }}>{theData.maturityTextFileUrl ?
  497. <span className="download-file">
  498. <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_maturity_text_file') }}>成熟度证明材料(文本文件)</a>
  499. </span>
  500. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  501. </FormItem>
  502. <FormItem
  503. labelCol={{ span: 4 }}
  504. wrapperCol={{ span: 18 }}
  505. label="成熟度证明材料(视频地址)" >
  506. {getFieldDecorator('maturityVideoUrl', {
  507. initialValue: theData.maturityVideoUrl
  508. })(
  509. <Input />
  510. )}
  511. </FormItem>
  512. <div className="clearfix" >
  513. <FormItem className="half-item"
  514. {...formItemLayout}
  515. label="成果所有人名称" >
  516. {getFieldDecorator('ownerName', {
  517. rules: [{ required: true, message: '此项为必填项!' }],
  518. initialValue: theData.ownerName
  519. })(
  520. <Input />
  521. )}
  522. </FormItem>
  523. <FormItem className="half-item"
  524. {...formItemLayout}
  525. label="所有人证件号" >
  526. {getFieldDecorator('ownerIdNumber', {
  527. rules: [{ required: true, message: '此项为必填项!' }],
  528. initialValue: theData.ownerIdNumber
  529. })(
  530. <Input />
  531. )}
  532. </FormItem>
  533. <FormItem className="half-item"
  534. {...formItemLayout}
  535. label="所有人联系电话" >
  536. {getFieldDecorator('ownerMobile', {
  537. rules: [{ required: true, message: '此项为必填项!' }],
  538. initialValue: theData.ownerMobile
  539. })(
  540. <Input />
  541. )}
  542. </FormItem>
  543. <FormItem className="half-item"
  544. {...formItemLayout}
  545. label="所有人电子邮箱" >
  546. {getFieldDecorator('ownerEmail', {
  547. rules: [{ required: true, message: '此项为必填项!' }],
  548. initialValue: theData.ownerEmail
  549. })(
  550. <Input />
  551. )}
  552. </FormItem>
  553. <FormItem className="half-item"
  554. {...formItemLayout}
  555. label="所有人通信地址" >
  556. {getFieldDecorator('ownerPostalAddress', {
  557. rules: [{ required: true, message: '此项为必填项!' }],
  558. initialValue: theData.ownerPostalAddress
  559. })(
  560. <Input />
  561. )}
  562. </FormItem>
  563. </div>
  564. <div className="clearfix">
  565. <FormItem className="half-item"
  566. {...formItemLayout}
  567. label="所有人类型" >
  568. {getFieldDecorator('ownerType', {
  569. rules: [{ required: true, message: '此项为必填项!' }],
  570. initialValue: theData.ownerType
  571. })(
  572. <Radio.Group onChange={(e) => { this.setState({ orgDisplay: e.target.value }); }}>
  573. <Radio value="0">个人</Radio>
  574. <Radio value="1">组织</Radio>
  575. </Radio.Group>
  576. )}
  577. </FormItem>
  578. </div>
  579. <div className="clearfix" style={{ display: this.state.orgDisplay == '1' ? 'block' : 'none' }}>
  580. <FormItem className="half-item"
  581. {...formItemLayout}
  582. label="所属组织名称" >
  583. {getFieldDecorator('orgName', {
  584. initialValue: theData.orgName
  585. })(
  586. <Input />
  587. )}
  588. </FormItem>
  589. <FormItem className="half-item"
  590. {...formItemLayout}
  591. label="所属组织地址" >
  592. {getFieldDecorator('orgAddress', {
  593. initialValue: theData.orgAddress
  594. })(
  595. <Input />
  596. )}
  597. </FormItem>
  598. <FormItem className="half-item"
  599. {...formItemLayout}
  600. label="所属组织邮箱" >
  601. {getFieldDecorator('orgEmail', {
  602. initialValue: theData.orgEmail
  603. })(
  604. <Input />
  605. )}
  606. </FormItem>
  607. <FormItem className="half-item"
  608. {...formItemLayout}
  609. label="所属组织联系人名称" >
  610. {getFieldDecorator('orgContacts', {
  611. initialValue: theData.orgContacts
  612. })(
  613. <Input />
  614. )}
  615. </FormItem>
  616. <FormItem className="half-item"
  617. {...formItemLayout}
  618. label="所属组织联系人电话" >
  619. {getFieldDecorator('orgContactsMobile', {
  620. initialValue: theData.orgContactsMobile
  621. })(
  622. <Input />
  623. )}
  624. </FormItem>
  625. </div>
  626. <div className="clearfix">
  627. <FormItem className="half-item"
  628. {...formItemLayout}
  629. label="合作方式" >
  630. {getFieldDecorator('cooperationMode', {
  631. rules: [{ required: true, message: '此项为必填项!' }],
  632. initialValue: theData.cooperationMode
  633. })(
  634. <Radio.Group>
  635. <Radio value="0">技术转让</Radio>
  636. <Radio value="1">授权生产</Radio>
  637. </Radio.Group>
  638. )}
  639. </FormItem>
  640. <FormItem className="half-item"
  641. {...formItemLayout}
  642. label="转让方式" >
  643. {getFieldDecorator('transferMode', {
  644. initialValue: theData.transferMode
  645. })(
  646. <Select placeholder="选择转让方式" style={{ width: 160 }} >
  647. <Select.Option value="0" >完全转让</Select.Option>
  648. <Select.Option value="1" >许可转让</Select.Option>
  649. <Select.Option value="2" >技术入股</Select.Option>
  650. </Select>
  651. )}
  652. </FormItem>
  653. </div>
  654. <div className="clearfix">
  655. <FormItem className="half-item"
  656. {...formItemLayout}
  657. label="议价方式" >
  658. {getFieldDecorator('bargainingMode', {
  659. initialValue: theData.bargainingMode
  660. })(
  661. <Radio.Group>
  662. <Radio value="0">面议</Radio>
  663. <Radio value="1">定价</Radio>
  664. </Radio.Group>
  665. )}
  666. </FormItem>
  667. <FormItem className="half-item"
  668. {...formItemLayout}
  669. label="转让价格" >
  670. {getFieldDecorator('transferPrice', {
  671. initialValue: theData.transferPrice
  672. })(
  673. <InputNumber />
  674. )}
  675. <span style={{ marginLeft: '20px' }}>万元</span>
  676. </FormItem>
  677. </div>
  678. <FormItem
  679. labelCol={{ span: 4 }}
  680. wrapperCol={{ span: 18 }}
  681. label="技术场景" >
  682. {getFieldDecorator('technicalScene', {
  683. initialValue: theData.technicalScene
  684. })(
  685. <Input type="textarea" rows={2} placeholder="说明解决了什么问题。" />
  686. )}
  687. </FormItem>
  688. <FormItem
  689. labelCol={{ span: 4 }}
  690. wrapperCol={{ span: 18 }}
  691. label="技术突破" >
  692. {getFieldDecorator('breakthrough', {
  693. initialValue: theData.breakthrough
  694. })(
  695. <Input type="textarea" rows={2} placeholder="说明该技术成果突破性的研究。" />
  696. )}
  697. </FormItem>
  698. <FormItem
  699. labelCol={{ span: 4 }}
  700. wrapperCol={{ span: 18 }}
  701. label="专利情况" >
  702. {getFieldDecorator('patentCase', {
  703. initialValue: theData.patentCase
  704. })(
  705. <Input type="textarea" rows={2} placeholder="一个“技术”可能由多个专利构成,需要说明技术-专利的关系。" />
  706. )}
  707. </FormItem>
  708. <FormItem
  709. labelCol={{ span: 4 }}
  710. wrapperCol={{ span: 18 }}
  711. label="获奖情况" >
  712. {getFieldDecorator('awards', {
  713. initialValue: theData.awards
  714. })(
  715. <Input type="textarea" rows={2} placeholder="一个“技术”可能存在社会奖励情况,需要说明社会奖励情况。" />
  716. )}
  717. </FormItem>
  718. <FormItem
  719. labelCol={{ span: 4 }}
  720. wrapperCol={{ span: 18 }}
  721. label="技术团队情况" >
  722. {getFieldDecorator('teamDes', {
  723. initialValue: theData.teamDes
  724. })(
  725. <Input type="textarea" rows={2} placeholder="一个“技术”、“项目”可能存在团队,需要说明团队情况。" />
  726. )}
  727. </FormItem>
  728. <FormItem
  729. labelCol={{ span: 4 }}
  730. wrapperCol={{ span: 18 }}
  731. label="技术参数" >
  732. {getFieldDecorator('parameter', {
  733. initialValue: theData.parameter
  734. })(
  735. <Input type="textarea" rows={2} placeholder="描述技术参数信息" />
  736. )}
  737. </FormItem>
  738. <FormItem
  739. labelCol={{ span: 4 }}
  740. wrapperCol={{ span: 6 }}
  741. label="技术方案" >
  742. <Upload
  743. name="ratepay"
  744. action={globalConfig.context + "/api/user/achievement/uploadTextFile"}
  745. data={{ 'sign': 'achievement_tech_plan' }}
  746. beforeUpload={beforeUploadFile}
  747. fileList={this.state.techPlanFileList}
  748. onChange={(info) => {
  749. if (info.file.status !== 'uploading') {
  750. console.log(info.file, info.fileList);
  751. }
  752. if (info.file.status === 'done') {
  753. if (!info.file.response.error.length) {
  754. message.success(`${info.file.name} 文件上传成功!`);
  755. } else {
  756. message.warning(info.file.response.error[0].message);
  757. return;
  758. };
  759. this.state.techPlanUrl = info.file.response.data;
  760. } else if (info.file.status === 'error') {
  761. message.error(`${info.file.name} 文件上传失败。`);
  762. };
  763. this.setState({ techPlanFileList: info.fileList.slice(-1) });
  764. }} >
  765. <Button><Icon type="upload" /> 上传技术方案文件 </Button>
  766. </Upload>
  767. <p style={{ marginTop: '10px' }}>{theData.techPlanUrl ?
  768. <span className="download-file">
  769. <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_tech_plan') }}>技术方案</a>
  770. </span>
  771. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  772. </FormItem>
  773. <FormItem
  774. labelCol={{ span: 4 }}
  775. wrapperCol={{ span: 6 }}
  776. label="商业计划书" >
  777. <Upload
  778. name="ratepay"
  779. action={globalConfig.context + "/api/user/achievement/uploadTextFile"}
  780. data={{ 'sign': 'achievement_business_plan' }}
  781. beforeUpload={beforeUploadFile}
  782. fileList={this.state.businessPlanFileList}
  783. onChange={(info) => {
  784. if (info.file.status !== 'uploading') {
  785. console.log(info.file, info.fileList);
  786. }
  787. if (info.file.status === 'done') {
  788. if (!info.file.response.error.length) {
  789. message.success(`${info.file.name} 文件上传成功!`);
  790. } else {
  791. message.warning(info.file.response.error[0].message);
  792. return;
  793. };
  794. this.state.businessPlanUrl = info.file.response.data;
  795. } else if (info.file.status === 'error') {
  796. message.error(`${info.file.name} 文件上传失败。`);
  797. };
  798. this.setState({ businessPlanFileList: info.fileList.slice(-1) });
  799. }} >
  800. <Button><Icon type="upload" /> 上传商业计划书文件 </Button>
  801. </Upload>
  802. <p style={{ marginTop: '10px' }}>{theData.businessPlanUrl ?
  803. <span className="download-file">
  804. <a onClick={() => { window.open(globalConfig.context + '/api/user/achievement/download?id=' + this.props.data.id + '&sign=achievement_business_plan') }}>商业计划书</a>
  805. </span>
  806. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  807. </FormItem>
  808. <FormItem wrapperCol={{ span: 12, offset: 3 }}>
  809. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  810. <Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>取消</Button>
  811. </FormItem>
  812. </Form >
  813. )
  814. }
  815. }));
  816. const AchievementDetail = React.createClass({
  817. getInitialState() {
  818. return {
  819. visible: false
  820. };
  821. },
  822. showModal() {
  823. this.setState({
  824. visible: true,
  825. });
  826. },
  827. handleCancel(e) {
  828. this.setState({
  829. visible: false,
  830. });
  831. this.props.closeDesc(false);
  832. },
  833. handleOk(e) {
  834. this.setState({
  835. visible: false,
  836. });
  837. this.props.closeDesc(false, true);
  838. },
  839. componentWillReceiveProps(nextProps) {
  840. this.state.visible = nextProps.showDesc;
  841. },
  842. render() {
  843. if (this.props.data) {
  844. return (
  845. <div className="patent-desc">
  846. <Modal maskClosable={false} title="成果详情" visible={this.state.visible}
  847. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  848. width='1000px'
  849. footer=''
  850. className="admin-desc-content">
  851. <AchievementDetailForm
  852. data={this.props.data}
  853. achievementCategoryOption={this.props.achievementCategoryOption}
  854. closeDesc={this.handleCancel}
  855. visible={this.state.visible}
  856. handleOk={this.handleOk} />
  857. </Modal>
  858. </div>
  859. );
  860. } else {
  861. return <div></div>
  862. }
  863. },
  864. });
  865. export default AchievementDetail;