techAchievementDesc.jsx 77 KB

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