techAchievementDesc.jsx 86 KB

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