techAchievementDesc.jsx 81 KB

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