techAchievementDesc.jsx 83 KB

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