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