crmAchievement.jsx 81 KB

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