techAchievementDesc.jsx 85 KB

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