crmAchievement.jsx 83 KB

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