techAchievementDesc.jsx 87 KB

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