techAchievementDesc.jsx 87 KB

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