techAchievementQueryDesc.jsx 85 KB

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