techAchievementDesc.jsx 41 KB

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