techAchievementDesc.jsx 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906
  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/demand/uploadPicture"}
  116. data={{ 'sign': 'demand_picture', 'uid': this.props.uid }}
  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, detailApiUrl) {
  144. this.setState({
  145. loading: true
  146. });
  147. $.ajax({
  148. method: "get",
  149. dataType: "json",
  150. crossDomain: false,
  151. url: globalConfig.context + detailApiUrl,
  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. tags: thisData.keyword ? thisData.keyword.split(",") : [],
  171. pictureUrl: thisData.pictureUrl ? splitUrl(thisData.pictureUrl, ',', globalConfig.avatarHost + '/upload') : []
  172. });
  173. }.bind(this),
  174. }).always(function () {
  175. this.setState({
  176. loading: false
  177. });
  178. }.bind(this));
  179. },
  180. getSalesmanList() {
  181. this.setState({
  182. loading: true
  183. });
  184. $.ajax({
  185. method: "get",
  186. dataType: "json",
  187. crossDomain: false,
  188. url: globalConfig.context + "/api/admin/salesman",
  189. success: function (data) {
  190. if (!data.data) {
  191. if (data.error && data.error.length) {
  192. message.warning(data.error[0].message);
  193. }
  194. return;
  195. };
  196. let _me = this, theArr = [];
  197. for (var item in data.data) {
  198. theArr.push(
  199. <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
  200. )
  201. };
  202. this.setState({
  203. salesmanOption: theArr
  204. });
  205. }.bind(this),
  206. }).always(function () {
  207. this.setState({
  208. loading: false
  209. });
  210. }.bind(this));
  211. },
  212. getTagsArr(e) {
  213. this.setState({ tags: e });
  214. },
  215. getMaturityPictureUrl(e) {
  216. this.setState({ maturityPictureUrl: e });
  217. },
  218. getTechnicalPictureUrl(e) {
  219. this.setState({ technicalPictureUrl: e });
  220. },
  221. handleSubmit(e) {
  222. e.preventDefault();
  223. this.props.form.validateFields((err, values) => {
  224. //keyword长度判断
  225. if (this.state.tags.length < 3) {
  226. message.warning('关键词数量不能小于3个!');
  227. };
  228. //url转化
  229. let theTechnicalPictureUrl = [];
  230. if (this.state.technicalPictureUrl.length) {
  231. let picArr = [];
  232. this.state.technicalPictureUrl.map(function (item) {
  233. picArr.push(item.response.data);
  234. });
  235. theTechnicalPictureUrl = picArr.join(",");
  236. };
  237. let theMaturityPictureUrl = [];
  238. if (this.state.maturityPictureUrl.length) {
  239. let picArr = [];
  240. this.state.maturityPictureUrl.map(function (item) {
  241. picArr.push(item.response.data);
  242. });
  243. theMaturityPictureUrl = picArr.join(",");
  244. };
  245. if (!err) {
  246. this.setState({
  247. loading: true
  248. });
  249. $.ajax({
  250. method: "POST",
  251. dataType: "json",
  252. crossDomain: false,
  253. url: this.props.data.id ? globalConfig.context + '/api/admin/achievement/update' : globalConfig.context + '/api/admin/achievement/apply',
  254. data: {
  255. id: this.props.data.id,
  256. dataCategory: values.dataCategory,
  257. serialNumber: this.props.data.serialNumber,
  258. name: values.name,
  259. keyword: this.state.tags ? this.state.tags.join(",") : [],
  260. category: values.category,
  261. summary: values.summary,
  262. introduction: values.introduction,
  263. technicalPictureUrl: theTechnicalPictureUrl,
  264. fieldA: values.field ? values.field[0] : undefined,
  265. fieldB: values.field ? values.field[1] : undefined,
  266. maturity: values.maturity,
  267. maturityPictureUrl: theMaturityPictureUrl,
  268. maturityTextFileUrl: this.state.maturityTextFileUrl,
  269. maturityVideoUrl: values.maturityVideoUrl,
  270. innovation: values.innovation,
  271. ownerName: values.ownerName,
  272. ownerType: values.ownerType,
  273. ownerIdNumber: values.ownerIdNumber,
  274. ownerMobile: values.ownerMobile,
  275. ownerEmail: values.ownerEmail,
  276. ownerPostalAddress: values.ownerPostalAddress,
  277. cooperationMode: values.cooperationMode,
  278. transferMode: values.transferMode,
  279. bargainingMode: values.bargainingMode,
  280. transferPrice: values.transferPrice,
  281. technicalScene: values.technicalScene,
  282. breakthrough: values.breakthrough,
  283. patentCase: values.patentCase,
  284. awards: values.awards,
  285. teamDes: values.teamDes,
  286. parameter: values.parameter,
  287. orgId: values.orgId,
  288. orgName: values.orgName,
  289. orgAddress: values.orgAddress,
  290. orgEmail: values.orgEmail,
  291. orgContacts: values.orgContacts,
  292. orgContactsMobile: values.orgContactsMobile,
  293. releaseStatus: values.releaseStatus,
  294. techPlanUrl: this.state.techPlanUrl,
  295. businessPlanUrl: this.state.businessPlanUrl
  296. }
  297. }).done(function (data) {
  298. if (!data.error.length) {
  299. message.success('保存成功!');
  300. this.setState({
  301. visible: false
  302. });
  303. this.props.handleOk();
  304. } else {
  305. message.warning(data.error[0].message);
  306. }
  307. }.bind(this));
  308. }
  309. });
  310. },
  311. componentWillMount() {
  312. this.getSalesmanList();
  313. if (this.props.data.id) {
  314. this.loadData(this.props.data.id, this.props.detailApiUrl);
  315. } else {
  316. this.state.data = {};
  317. };
  318. },
  319. componentWillReceiveProps(nextProps) {
  320. if (!this.props.visible && nextProps.visible) {
  321. this.state.textFileList = [];
  322. this.state.techPlanFileList = [];
  323. this.state.businessPlanFileList = [];
  324. if (nextProps.data.id) {
  325. this.loadData(nextProps.data.id, nextProps.detailApiUrl);
  326. if (nextProps.data.employerId && nextProps.detailApiUrl.indexOf('org') >= 0) {
  327. this.getContactsList(nextProps.data.employerId)
  328. };
  329. } else {
  330. this.state.data = {};
  331. this.state.tags = [];
  332. this.state.pictureUrl = [];
  333. this.state.technicalPictureUrl = [];
  334. this.props.form.resetFields();
  335. };
  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. uid={theData.uid}
  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. uid={theData.uid}
  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/demand/uploadTextFile"}
  507. data={{ 'sign': 'demand_text_file', 'uid': theData.uid }}
  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,
  522. maturity_video_url = info.file.response.data;
  523. } else if (info.file.status === 'error') {
  524. message.error(`${info.file.name} 文件上传失败。`);
  525. };
  526. this.setState({ textFileList: info.fileList.slice(-1) });
  527. }} >
  528. <Button><Icon type="upload" /> 上传需求文本文件 </Button>
  529. </Upload>
  530. <p style={{ marginTop: '10px' }}>{theData.maturityTextFileUrl ?
  531. <span className="download-file">
  532. <a onClick={() => { window.open(globalConfig.context + '/api/admin/demand/download?id=' + this.props.data.id) }}>成熟度证明材料(文本文件)</a>
  533. </span>
  534. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  535. </FormItem>
  536. <FormItem
  537. labelCol={{ span: 4 }}
  538. wrapperCol={{ span: 18 }}
  539. label="成熟度证明材料(视频地址)" >
  540. {getFieldDecorator('maturityVideoUrl', {
  541. initialValue: theData.maturityVideoUrl
  542. })(
  543. <Input />
  544. )}
  545. </FormItem>
  546. <div className="clearfix" >
  547. <FormItem className="half-item"
  548. {...formItemLayout}
  549. label="成果所有人名称" >
  550. {getFieldDecorator('ownerName', {
  551. rules: [{ required: true, message: '此项为必填项!' }],
  552. initialValue: theData.ownerName
  553. })(
  554. <Input />
  555. )}
  556. </FormItem>
  557. <FormItem className="half-item"
  558. {...formItemLayout}
  559. label="所有人证件号" >
  560. {getFieldDecorator('ownerIdNumber', {
  561. rules: [{ required: true, message: '此项为必填项!' }],
  562. initialValue: theData.ownerIdNumber
  563. })(
  564. <Input />
  565. )}
  566. </FormItem>
  567. <FormItem className="half-item"
  568. {...formItemLayout}
  569. label="所有人联系电话" >
  570. {getFieldDecorator('ownerMobile', {
  571. rules: [{ required: true, message: '此项为必填项!' }],
  572. initialValue: theData.ownerMobile
  573. })(
  574. <Input />
  575. )}
  576. </FormItem>
  577. <FormItem className="half-item"
  578. {...formItemLayout}
  579. label="所有人电子邮箱" >
  580. {getFieldDecorator('ownerEmail', {
  581. rules: [{ required: true, message: '此项为必填项!' }],
  582. initialValue: theData.ownerEmail
  583. })(
  584. <Input />
  585. )}
  586. </FormItem>
  587. <FormItem className="half-item"
  588. {...formItemLayout}
  589. label="所有人通信地址" >
  590. {getFieldDecorator('ownerPostalAddress', {
  591. rules: [{ required: true, message: '此项为必填项!' }],
  592. initialValue: theData.ownerPostalAddress
  593. })(
  594. <Input />
  595. )}
  596. </FormItem>
  597. </div>
  598. <div className="clearfix">
  599. <FormItem className="half-item"
  600. {...formItemLayout}
  601. label="所有人类型" >
  602. {getFieldDecorator('ownerType', {
  603. rules: [{ required: true, message: '此项为必填项!' }],
  604. initialValue: theData.ownerType
  605. })(
  606. <Radio.Group onChange={(e) => { this.setState({ orgDisplay: e.target.value }); }}>
  607. <Radio value="0">个人</Radio>
  608. <Radio value="1">组织</Radio>
  609. </Radio.Group>
  610. )}
  611. </FormItem>
  612. </div>
  613. <div className="clearfix" style={{ display: this.state.orgDisplay == '1' ? 'block' : 'none' }}>
  614. <FormItem className="half-item"
  615. {...formItemLayout}
  616. label="所属组织名称" >
  617. {getFieldDecorator('orgName', {
  618. initialValue: theData.orgName
  619. })(
  620. <Input />
  621. )}
  622. </FormItem>
  623. <FormItem className="half-item"
  624. {...formItemLayout}
  625. label="所属组织地址" >
  626. {getFieldDecorator('orgAddress', {
  627. initialValue: theData.orgAddress
  628. })(
  629. <Input />
  630. )}
  631. </FormItem>
  632. <FormItem className="half-item"
  633. {...formItemLayout}
  634. label="所属组织邮箱" >
  635. {getFieldDecorator('orgEmail', {
  636. initialValue: theData.orgEmail
  637. })(
  638. <Input />
  639. )}
  640. </FormItem>
  641. <FormItem className="half-item"
  642. {...formItemLayout}
  643. label="所属组织联系人名称" >
  644. {getFieldDecorator('orgContacts', {
  645. initialValue: theData.orgContacts
  646. })(
  647. <Input />
  648. )}
  649. </FormItem>
  650. <FormItem className="half-item"
  651. {...formItemLayout}
  652. label="所属组织联系人电话" >
  653. {getFieldDecorator('orgContactsMobile', {
  654. initialValue: theData.orgContactsMobile
  655. })(
  656. <Input />
  657. )}
  658. </FormItem>
  659. </div>
  660. <div className="clearfix">
  661. <FormItem className="half-item"
  662. {...formItemLayout}
  663. label="合作方式" >
  664. {getFieldDecorator('cooperationMode', {
  665. rules: [{ required: true, message: '此项为必填项!' }],
  666. initialValue: theData.cooperationMode
  667. })(
  668. <Radio.Group>
  669. <Radio value="0">技术转让</Radio>
  670. <Radio value="1">授权生产</Radio>
  671. </Radio.Group>
  672. )}
  673. </FormItem>
  674. <FormItem className="half-item"
  675. {...formItemLayout}
  676. label="转让方式" >
  677. {getFieldDecorator('transferMode', {
  678. initialValue: theData.transferMode
  679. })(
  680. <Select placeholder="选择转让方式" style={{ width: 160 }} >
  681. <Select.Option value="0" >完全转让</Select.Option>
  682. <Select.Option value="1" >许可转让</Select.Option>
  683. <Select.Option value="2" >技术入股</Select.Option>
  684. </Select>
  685. )}
  686. </FormItem>
  687. </div>
  688. <div className="clearfix">
  689. <FormItem className="half-item"
  690. {...formItemLayout}
  691. label="议价方式" >
  692. {getFieldDecorator('bargainingMode', {
  693. initialValue: theData.bargainingMode
  694. })(
  695. <Radio.Group>
  696. <Radio value="0">面议</Radio>
  697. <Radio value="1">定价</Radio>
  698. </Radio.Group>
  699. )}
  700. </FormItem>
  701. <FormItem className="half-item"
  702. {...formItemLayout}
  703. label="转让价格" >
  704. {getFieldDecorator('transferPrice', {
  705. initialValue: theData.transferPrice
  706. })(
  707. <InputNumber />
  708. )}
  709. <span style={{ marginLeft: '20px' }}>万元</span>
  710. </FormItem>
  711. </div>
  712. <FormItem
  713. labelCol={{ span: 4 }}
  714. wrapperCol={{ span: 18 }}
  715. label="技术场景" >
  716. {getFieldDecorator('technicalScene', {
  717. initialValue: theData.technicalScene
  718. })(
  719. <Input type="textarea" rows={2} placeholder="说明解决了什么问题。" />
  720. )}
  721. </FormItem>
  722. <FormItem
  723. labelCol={{ span: 4 }}
  724. wrapperCol={{ span: 18 }}
  725. label="技术突破" >
  726. {getFieldDecorator('breakthrough', {
  727. initialValue: theData.breakthrough
  728. })(
  729. <Input type="textarea" rows={2} placeholder="说明该技术成果突破性的研究。" />
  730. )}
  731. </FormItem>
  732. <FormItem
  733. labelCol={{ span: 4 }}
  734. wrapperCol={{ span: 18 }}
  735. label="专利情况" >
  736. {getFieldDecorator('patentCase', {
  737. initialValue: theData.patentCase
  738. })(
  739. <Input type="textarea" rows={2} placeholder="一个“技术”可能由多个专利构成,需要说明技术-专利的关系。" />
  740. )}
  741. </FormItem>
  742. <FormItem
  743. labelCol={{ span: 4 }}
  744. wrapperCol={{ span: 18 }}
  745. label="获奖情况" >
  746. {getFieldDecorator('awards', {
  747. initialValue: theData.awards
  748. })(
  749. <Input type="textarea" rows={2} placeholder="一个“技术”可能存在社会奖励情况,需要说明社会奖励情况。" />
  750. )}
  751. </FormItem>
  752. <FormItem
  753. labelCol={{ span: 4 }}
  754. wrapperCol={{ span: 18 }}
  755. label="技术团队情况" >
  756. {getFieldDecorator('teamDes', {
  757. initialValue: theData.teamDes
  758. })(
  759. <Input type="textarea" rows={2} placeholder="一个“技术”、“项目”可能存在团队,需要说明团队情况。" />
  760. )}
  761. </FormItem>
  762. <FormItem
  763. labelCol={{ span: 4 }}
  764. wrapperCol={{ span: 18 }}
  765. label="技术参数" >
  766. {getFieldDecorator('parameter', {
  767. initialValue: theData.parameter
  768. })(
  769. <Input type="textarea" rows={2} placeholder="描述技术参数信息" />
  770. )}
  771. </FormItem>
  772. <FormItem
  773. labelCol={{ span: 4 }}
  774. wrapperCol={{ span: 6 }}
  775. label="技术方案" >
  776. <Upload
  777. name="ratepay"
  778. action={globalConfig.context + "/api/admin/demand/uploadTextFile"}
  779. data={{ 'sign': 'tech_plan', 'uid': theData.uid }}
  780. beforeUpload={beforeUploadFile}
  781. fileList={this.state.techPlanFileList}
  782. onChange={(info) => {
  783. if (info.file.status !== 'uploading') {
  784. console.log(info.file, info.fileList);
  785. }
  786. if (info.file.status === 'done') {
  787. if (!info.file.response.error.length) {
  788. message.success(`${info.file.name} 文件上传成功!`);
  789. } else {
  790. message.warning(info.file.response.error[0].message);
  791. return;
  792. };
  793. this.state.techPlanUrl = info.file.response.data;
  794. } else if (info.file.status === 'error') {
  795. message.error(`${info.file.name} 文件上传失败。`);
  796. };
  797. this.setState({ techPlanFileList: info.fileList.slice(-1) });
  798. }} >
  799. <Button><Icon type="upload" /> 上传技术方案文件 </Button>
  800. </Upload>
  801. <p style={{ marginTop: '10px' }}>{theData.techPlanUrl ?
  802. <span className="download-file">
  803. <a onClick={() => { window.open(globalConfig.context + '/api/admin/demand/download?id=' + this.props.data.id) }}>技术方案</a>
  804. </span>
  805. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  806. </FormItem>
  807. <FormItem
  808. labelCol={{ span: 4 }}
  809. wrapperCol={{ span: 6 }}
  810. label="商业计划书" >
  811. <Upload
  812. name="ratepay"
  813. action={globalConfig.context + "/api/admin/demand/uploadTextFile"}
  814. data={{ 'sign': 'business_plan_url', 'uid': theData.uid }}
  815. beforeUpload={beforeUploadFile}
  816. fileList={this.state.businessPlanFileList}
  817. onChange={(info) => {
  818. if (info.file.status !== 'uploading') {
  819. console.log(info.file, info.fileList);
  820. }
  821. if (info.file.status === 'done') {
  822. if (!info.file.response.error.length) {
  823. message.success(`${info.file.name} 文件上传成功!`);
  824. } else {
  825. message.warning(info.file.response.error[0].message);
  826. return;
  827. };
  828. this.state.businessPlanUrl = info.file.response.data;
  829. } else if (info.file.status === 'error') {
  830. message.error(`${info.file.name} 文件上传失败。`);
  831. };
  832. this.setState({ businessPlanFileList: info.fileList.slice(-1) });
  833. }} >
  834. <Button><Icon type="upload" /> 上传需求文本文件 </Button>
  835. </Upload>
  836. <p style={{ marginTop: '10px' }}>{theData.businessPlanUrl ?
  837. <span className="download-file">
  838. <a onClick={() => { window.open(globalConfig.context + '/api/admin/demand/download?id=' + this.props.data.id) }}>商业计划书</a>
  839. </span>
  840. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  841. </FormItem>
  842. <FormItem wrapperCol={{ span: 12, offset: 3 }}>
  843. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  844. <Button className="set-submit" type="ghost" onClick={this.props.closeDesc}>取消</Button>
  845. </FormItem>
  846. </Form >
  847. )
  848. }
  849. }));
  850. const AchievementDetail = React.createClass({
  851. getInitialState() {
  852. return {
  853. visible: false
  854. };
  855. },
  856. showModal() {
  857. this.setState({
  858. visible: true,
  859. });
  860. },
  861. handleCancel(e) {
  862. this.setState({
  863. visible: false,
  864. });
  865. this.props.closeDesc(false);
  866. },
  867. handleOk(e) {
  868. this.setState({
  869. visible: false,
  870. });
  871. this.props.closeDesc(false, true);
  872. },
  873. componentWillReceiveProps(nextProps) {
  874. this.state.visible = nextProps.showDesc;
  875. },
  876. render() {
  877. if (this.props.data) {
  878. return (
  879. <div className="patent-desc">
  880. <Modal maskClosable={false} title="成果详情" visible={this.state.visible}
  881. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  882. width='1000px'
  883. footer=''
  884. className="admin-desc-content">
  885. <AchievementDetailForm
  886. data={this.props.data}
  887. companyOption={this.props.companyOption}
  888. userOption={this.props.userOption}
  889. achievementCategoryOption={this.props.achievementCategoryOption}
  890. closeDesc={this.handleCancel}
  891. visible={this.state.visible}
  892. handleOk={this.handleOk} />
  893. </Modal>
  894. </div>
  895. );
  896. } else {
  897. return <div></div>
  898. }
  899. },
  900. });
  901. export default AchievementDetail;