techAchievementDesc.jsx 86 KB

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