techAchievementDesc.jsx 39 KB

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