techAchievementDesc.jsx 85 KB

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