techAchievementQueryDesc.jsx 86 KB

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