techAchievementDesc.jsx 78 KB

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