crmAchievement.jsx 83 KB

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