auditDesc.jsx 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958
  1. import React from 'react';
  2. import { Tabs, Table, Icon, Tooltip, Modal, message, AutoComplete, Spin, Upload, Input, InputNumber, Select, Button, Radio, Form, Cascader, Tag, Switch } from 'antd';
  3. import '../techAchievement.less';
  4. import ajax from 'jquery/src/ajax/xhr.js';
  5. import $ from 'jquery/src/ajax';
  6. import { maturityList, innovationList, transferModeList } from '../../../dataDic';
  7. import { IndustryObject, getIndustryCategory } from '../../../DicIndustryList.js';
  8. import { beforeUploadFile, splitUrl, companySearch, getTransferMode, getAchievementCategory, getTechAuditStatus, getDemandType, getMaturity, getInnovation,beforeUpload, getBase64,getboutique } from '../../../tools.js';
  9. import throttle from '../../../throttle.js';
  10. const KeyWordTagGroup = React.createClass({
  11. getInitialState() {
  12. return {
  13. tags: [],
  14. inputVisible: false,
  15. inputValue: ''
  16. };
  17. },
  18. handleClose(removedTag) {
  19. const tags = this.state.tags.filter(tag => tag !== removedTag);
  20. this.props.tagsArr(tags);
  21. this.setState({ tags });
  22. },
  23. showInput() {
  24. this.setState({ inputVisible: true }, () => this.input.focus());
  25. },
  26. handleInputChange(e) {
  27. this.setState({ inputValue: e.target.value });
  28. },
  29. handleInputConfirm() {
  30. const state = this.state;
  31. const inputValue = state.inputValue;
  32. let tags = state.tags;
  33. if (inputValue && tags.indexOf(inputValue) === -1 && inputValue.replace(/(^\s*)|(\s*$)/g, "").length != 0) {
  34. tags = [...tags, inputValue.replace(/(^\s*)|(\s*$)/g, "")];
  35. };
  36. this.props.tagsArr(tags);
  37. this.setState({
  38. tags,
  39. inputVisible: false,
  40. inputValue: '',
  41. });
  42. },
  43. componentWillMount() {
  44. this.state.tags = this.props.keyWordArr;
  45. },
  46. componentWillReceiveProps(nextProps) {
  47. if (this.props.keyWordArr != nextProps.keyWordArr) {
  48. this.state.tags = nextProps.keyWordArr;
  49. };
  50. },
  51. render() {
  52. const { tags, inputVisible, inputValue } = this.state;
  53. return (
  54. <div className="keyWord-tips">
  55. {tags.map((tag, index) => {
  56. const isLongTag = tag.length > 10;
  57. const tagElem = (
  58. <Tag key={tag} closable={index !== -1} afterClose={() => this.handleClose(tag)}>
  59. {isLongTag ? `${tag.slice(0, 10)}...` : tag}
  60. </Tag>
  61. );
  62. return isLongTag ? <Tooltip key={tag} title={tag}>{tagElem}</Tooltip> : tagElem;
  63. })}
  64. {inputVisible && (
  65. <Input
  66. ref={input => this.input = input}
  67. type="text"
  68. style={{ width: 78 }}
  69. value={inputValue}
  70. onChange={this.handleInputChange}
  71. onBlur={this.handleInputConfirm}
  72. onPressEnter={this.handleInputConfirm}
  73. />
  74. )}
  75. {!inputVisible && <Button className="addtips" type="dashed" disabled={tags.length > 9 ? true : false} onClick={this.showInput}>+ 新关键词</Button>}
  76. </div>
  77. );
  78. }
  79. });
  80. const PicturesWall = React.createClass({
  81. getInitialState() {
  82. return {
  83. previewVisible: false,
  84. previewImage: '',
  85. fileList: [],
  86. }
  87. },
  88. handleCancel() {
  89. this.setState({ previewVisible: false })
  90. },
  91. handlePreview(file) {
  92. this.setState({
  93. previewImage: file.url || file.thumbUrl,
  94. previewVisible: true,
  95. });
  96. },
  97. handleChange(info) {
  98. let fileList = info.fileList;
  99. this.setState({ fileList });
  100. this.props.fileList(fileList);
  101. },
  102. componentWillReceiveProps(nextProps) {
  103. this.state.fileList = nextProps.pictureUrl;
  104. },
  105. render() {
  106. const { previewVisible, previewImage, fileList } = this.state;
  107. const uploadButton = (
  108. <div>
  109. <Icon type="plus" />
  110. <div className="ant-upload-text">点击上传</div>
  111. </div>
  112. );
  113. return (
  114. <div className="clearfix">
  115. <Upload
  116. action={globalConfig.context + "/api/admin/achievement/uploadPicture"}
  117. data={{ 'sign': this.props.pictureSign }}
  118. listType="picture-card"
  119. fileList={fileList}
  120. multiple={true}
  121. onPreview={this.handlePreview}
  122. onChange={this.handleChange} >
  123. {uploadButton}
  124. </Upload>
  125. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  126. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  127. </Modal>
  128. </div>
  129. );
  130. }
  131. });
  132. const AchievementDetailShow = Form.create()(React.createClass({
  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 + detailApiUrl,
  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. ShelfCancel(){
  190. let api=0;
  191. this.offShelf(api);
  192. },
  193. ShelfOk(){
  194. let api=1;
  195. this.offShelf(api);
  196. },
  197. offShelf(nub) {
  198. this.setState({
  199. loading: true
  200. });
  201. $.ajax({
  202. method: "post",
  203. dataType: "json",
  204. crossDomain: false,
  205. url: globalConfig.context + "/api/admin/achievement/offShelf",
  206. data: {
  207. "id": this.props.data.id,
  208. releaseStatus:nub,
  209. auditStatus:3,
  210. }
  211. }).done(function (data) {
  212. if (!data.error.length) {
  213. message.success('操作成功!');
  214. this.setState({
  215. visible: false,
  216. releaseSubmitVisible: false
  217. });
  218. this.props.handleOk();
  219. } else {
  220. message.warning(data.error[0].message);
  221. }
  222. }.bind(this));
  223. },
  224. modifyBroker() {
  225. this.props.form.validateFields((err, values) => {
  226. if (!err) {
  227. this.setState({
  228. loading: true
  229. });
  230. $.ajax({
  231. method: "POST",
  232. dataType: "json",
  233. crossDomain: false,
  234. url: globalConfig.context + '/api/admin/audit/modifyAchievementTechBroker',
  235. data: {
  236. id: this.props.data.id,
  237. techBrokerId: values.modifyTechBrokerId
  238. }
  239. }).done(function (data) {
  240. this.state.auditStatus = 0;
  241. this.setState({
  242. loading: false
  243. });
  244. if (data.error && data.error.length) {
  245. message.warning(data.error[0].message);
  246. } else {
  247. message.success('保存成功!');
  248. this.props.handleOk();
  249. };
  250. }.bind(this));
  251. }
  252. });
  253. },
  254. formSubmit() {
  255. this.props.form.validateFields((err, values) => {
  256. if (values.auditStatus == 3 && !values.techBrokerId) {
  257. message.warning('必须选择一个技术经纪人!');
  258. return
  259. };
  260. if (!err) {
  261. this.setState({
  262. loading: true
  263. });
  264. $.ajax({
  265. method: "POST",
  266. dataType: "json",
  267. crossDomain: false,
  268. url: globalConfig.context + '/api/admin/audit/achievement',
  269. data: {
  270. id: this.props.data.id,
  271. techBroderId: values.techBrokerId,
  272. auditStatus: values.auditStatus
  273. }
  274. }).done(function (data) {
  275. this.state.auditStatus = 0;
  276. this.setState({
  277. loading: false
  278. });
  279. if (!data.error.length) {
  280. message.success('保存成功!');
  281. this.setState({
  282. formSubmitVisible: false
  283. });
  284. this.props.handleOk();
  285. } else {
  286. message.warning(data.error[0].message);
  287. };
  288. }.bind(this));
  289. }
  290. });
  291. },
  292. handleSubmit(e) {
  293. e.preventDefault();
  294. this.props.form.validateFields((err, values) => {
  295. if (values.auditStatus == 4) {
  296. this.setState({
  297. formSubmitVisible: true
  298. });
  299. } else {
  300. this.formSubmit();
  301. };
  302. });
  303. },
  304. buildMatchList() {
  305. this.setState({
  306. buttonLoading: true
  307. });
  308. $.ajax({
  309. method: "POST",
  310. dataType: "json",
  311. crossDomain: false,
  312. url: globalConfig.context + '/api/admin/achievement/matchDemand',
  313. data: {
  314. id: this.props.data.id,
  315. }
  316. }).done(function (data) {
  317. this.setState({
  318. buttonLoading: false
  319. });
  320. if (!data.error.length) {
  321. message.success('匹配完成!匹配到' + data.data + '条记录');
  322. } else {
  323. message.warning(data.error[0].message);
  324. };
  325. }.bind(this));
  326. },
  327. getContactsList(theUid) {
  328. $.ajax({
  329. method: "get",
  330. dataType: "json",
  331. crossDomain: false,
  332. url: globalConfig.context + "/api/admin/getContacts",
  333. data: {
  334. uid: theUid
  335. },
  336. success: function (data) {
  337. if (!data.data) {
  338. if (data.error && data.error.length) {
  339. message.warning(data.error[0].message);
  340. return;
  341. };
  342. } else {
  343. this.setState({
  344. contactsObj: data.data || {}
  345. });
  346. };
  347. }.bind(this),
  348. });
  349. },
  350. componentWillMount() {
  351. this.loadData(this.props.data.id, this.props.detailApiUrl,this.props.data.ownerType);
  352. },
  353. componentWillReceiveProps(nextProps) {
  354. if (!this.props.visible && nextProps.visible) {
  355. this.loadData(nextProps.data.id, nextProps.detailApiUrl,nextProps.data.ownerType);
  356. this.state.textFileList = [];
  357. this.state.techPlanFileList = [];
  358. this.state.businessPlanFileList = [];
  359. this.props.form.resetFields();
  360. };
  361. },
  362. render() {
  363. const theData = this.state.data || {};
  364. const { getFieldDecorator } = this.props.form;
  365. const FormItem = Form.Item
  366. const formItemLayout = {
  367. labelCol: { span: 8 },
  368. wrapperCol: { span: 14 },
  369. };
  370. return (
  371. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  372. <Spin spinning={this.state.loading}>
  373. <div className="clearfix">
  374. <FormItem className="half-item"
  375. {...formItemLayout}
  376. label="编号" >
  377. <span>{theData.serialNumber}</span>
  378. </FormItem>
  379. <FormItem className="half-item"
  380. {...formItemLayout}
  381. label="名称" >
  382. <span>{theData.name}</span>
  383. </FormItem>
  384. <FormItem className="half-item"
  385. {...formItemLayout}
  386. label="数据类别" >
  387. {(() => {
  388. switch (theData.dataCategory) {
  389. case "0":
  390. return <span>成果</span>;
  391. case "1":
  392. return <span>技术</span>;
  393. case "2":
  394. return <span>项目</span>;
  395. }
  396. })()}
  397. </FormItem>
  398. <FormItem className="half-item"
  399. {...formItemLayout}
  400. label="类型" >
  401. <span>{getAchievementCategory(theData.category)}</span>
  402. </FormItem>
  403. <FormItem className="half-item"
  404. {...formItemLayout}
  405. label="精品成果" >
  406. {(() => {
  407. switch (theData.boutique) {
  408. case "0":
  409. return <span>否</span>;
  410. case "1":
  411. return <span>是</span>;
  412. }
  413. })()}
  414. </FormItem>
  415. </div>
  416. {this.state.radios==true ?<FormItem
  417. labelCol={{ span: 4 }}
  418. wrapperCol={{ span: 18 }}
  419. label="首页展示图片:" >
  420. <div className="clearfix">
  421. <Upload className="demandDetailShow-upload"
  422. listType="picture-card"
  423. fileList={this.state.coverImg}
  424. onPreview={(file) => {
  425. this.setState({
  426. previewImage: file.url || file.thumbUrl,
  427. previewVisible: true,
  428. });
  429. }} >
  430. </Upload>
  431. <Modal maskClosable={false} footer={null}
  432. visible={this.state.previewVisible}
  433. onCancel={() => { this.setState({ previewVisible: false }) }}>
  434. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  435. </Modal>
  436. </div>
  437. </FormItem>:<div></div>}
  438. <div className="clearfix">
  439. <FormItem className="half-item"
  440. {...formItemLayout}
  441. label="是否发布" >
  442. {(() => {
  443. switch (theData.releaseStatus) {
  444. case "0":
  445. return <div><span>未发布</span>
  446. <Button style={{ marginLeft: '10px' }} onClick={() => { this.setState({ releaseSubmitVisible: true }); }}>发布</Button>
  447. <Modal maskClosable={false} title="确认"
  448. visible={this.state.releaseSubmitVisible}
  449. width='400px'
  450. footer={null}
  451. onCancel={() => { this.setState({ releaseSubmitVisible: false }) }} >
  452. <span>确认要发布吗?</span>
  453. <Button className="modal-submit" type="primary" onClick={this.ShelfOk} >确认</Button>
  454. <Button className="modal-submit" type="ghost" onClick={() => { this.setState({ releaseSubmitVisible: false }) }}>取消</Button>
  455. </Modal></div>
  456. ;
  457. case "1":
  458. return <div>
  459. <span>已发布</span>
  460. <Button style={{ marginLeft: '10px' }} onClick={() => { this.setState({ releaseSubmitVisible: true }); }}>撤消发布</Button>
  461. <Modal maskClosable={false} title="确认"
  462. visible={this.state.releaseSubmitVisible}
  463. width='400px'
  464. footer={null}
  465. onCancel={() => { this.setState({ releaseSubmitVisible: false }) }} >
  466. <span>确认要撤销发布吗?</span>
  467. <Button className="modal-submit" type="primary" onClick={this.ShelfCancel} >确认</Button>
  468. <Button className="modal-submit" type="ghost" onClick={() => { this.setState({ releaseSubmitVisible: false }) }}>取消</Button>
  469. </Modal>
  470. </div>;
  471. }
  472. })()}
  473. </FormItem>
  474. <FormItem className="half-item"
  475. {...formItemLayout}
  476. label="发布时间" >
  477. <span>{theData.releaseDateFormattedDate}</span>
  478. </FormItem>
  479. <FormItem className="half-item"
  480. {...formItemLayout}
  481. label="审核状态" >
  482. <span>{getTechAuditStatus(theData.auditStatus)}</span>
  483. </FormItem>
  484. <FormItem className="half-item"
  485. {...formItemLayout}
  486. label="是否国际" >
  487. <span>{getboutique(theData.internationalFlag)}</span>
  488. </FormItem>
  489. </div>
  490. <FormItem
  491. labelCol={{ span: 4 }}
  492. wrapperCol={{ span: 18 }}
  493. label="关键词" >
  494. {this.state.tags.map((tag) => {
  495. return <Tooltip key={tag} title={tag}>
  496. <Tag key={tag}>{tag}</Tag>
  497. </Tooltip>;
  498. })}
  499. </FormItem>
  500. <FormItem
  501. labelCol={{ span: 4 }}
  502. wrapperCol={{ span: 18 }}
  503. label="摘要" >
  504. <span>{theData.summary}</span>
  505. </FormItem>
  506. <FormItem
  507. labelCol={{ span: 4 }}
  508. wrapperCol={{ span: 18 }}
  509. label="成果简介" >
  510. <span>{theData.introduction}</span>
  511. </FormItem>
  512. <FormItem
  513. labelCol={{ span: 4 }}
  514. wrapperCol={{ span: 18 }}
  515. label="备注" >
  516. <span>{theData.remark}</span>
  517. </FormItem>
  518. <FormItem
  519. labelCol={{ span: 4 }}
  520. wrapperCol={{ span: 18 }}
  521. label="技术图片" >
  522. <div className="clearfix">
  523. <Upload className="demandDetailShow-upload"
  524. listType="picture-card"
  525. fileList={this.state.technicalPictureUrl}
  526. onPreview={(file) => {
  527. this.setState({
  528. previewImage: file.url || file.thumbUrl,
  529. previewVisible: true,
  530. });
  531. }} >
  532. </Upload>
  533. <Modal maskClosable={false} footer={null}
  534. visible={this.state.previewVisible}
  535. onCancel={() => { this.setState({ previewVisible: false }) }}>
  536. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  537. </Modal>
  538. </div>
  539. </FormItem>
  540. <FormItem
  541. labelCol={{ span: 4 }}
  542. wrapperCol={{ span: 18 }}
  543. label="应用领域" >
  544. <span>{getIndustryCategory(theData.fieldA, theData.fieldB)}</span>
  545. </FormItem>
  546. <div className="clearfix">
  547. <FormItem className="half-item"
  548. {...formItemLayout}
  549. label="成熟度" >
  550. <span>{getMaturity(theData.maturity)}</span>
  551. </FormItem>
  552. <FormItem className="half-item"
  553. {...formItemLayout}
  554. label="创新度" >
  555. <span>{getInnovation(theData.innovation)}</span>
  556. </FormItem>
  557. </div>
  558. <FormItem
  559. labelCol={{ span: 4 }}
  560. wrapperCol={{ span: 18 }}
  561. label="成熟度证明材料(图片)" >
  562. <Upload className="demandDetailShow-upload"
  563. listType="picture-card"
  564. fileList={this.state.maturityPictureUrl}
  565. onPreview={(file) => {
  566. this.setState({
  567. previewImage: file.url || file.thumbUrl,
  568. previewVisible: true,
  569. });
  570. }} >
  571. </Upload>
  572. </FormItem>
  573. <FormItem
  574. labelCol={{ span: 4 }}
  575. wrapperCol={{ span: 6 }}
  576. label="成熟度证明材料(文本)" >
  577. <p>{theData.maturityTextFileUrl ?
  578. <span className="download-file">
  579. <a onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/download?id=' + this.props.data.id + '&sign=achievement_maturity_text_file') }}>成熟度证明材料(文本文件)</a>
  580. </span>
  581. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  582. </FormItem>
  583. <FormItem
  584. labelCol={{ span: 4 }}
  585. wrapperCol={{ span: 18 }}
  586. label="成熟度证明材料(视频地址)" >
  587. <span>{theData.maturityVideoUrl}</span>
  588. </FormItem>
  589. {this.state.switchValue ?
  590. <div className="clearfix" >
  591. <FormItem className="half-item"
  592. {...formItemLayout}
  593. label="成果所有人名称" >
  594. <span>{theData.ownerName}</span>
  595. </FormItem>
  596. <FormItem className="half-item"
  597. {...formItemLayout}
  598. label="联系电话" >
  599. <span>{theData.ownerMobile}</span>
  600. </FormItem>
  601. <FormItem className="half-item"
  602. {...formItemLayout}
  603. label="证件号" >
  604. <span>{theData.ownerIdNumber}</span>
  605. </FormItem>
  606. <FormItem className="half-item"
  607. {...formItemLayout}
  608. label="电子邮箱" >
  609. <span>{theData.ownerEmail}</span>
  610. </FormItem>
  611. <FormItem className="half-item"
  612. {...formItemLayout}
  613. label="通讯地址" >
  614. <span>{theData.ownerPostalAddress}</span>
  615. </FormItem>
  616. </div> : <div className="clearfix" >
  617. <FormItem className="half-item"
  618. {...formItemLayout}
  619. label="成果所有人名称" >
  620. <span>{theData.iOwnerName}</span>
  621. </FormItem>
  622. <FormItem className="half-item"
  623. {...formItemLayout}
  624. label="联系电话" >
  625. {theData.ownerType == "1" ? <span>{this.state.contactsObj[theData.contacts]}</span> : <span>{theData.iOwnerMobile}</span>}
  626. </FormItem>
  627. <FormItem className="half-item"
  628. {...formItemLayout}
  629. label="证件号" >
  630. <span>{theData.iOwnerIdNumber}</span>
  631. </FormItem>
  632. <FormItem className="half-item"
  633. {...formItemLayout}
  634. label="电子邮箱" >
  635. <span>{theData.iOwnerEmail}</span>
  636. </FormItem>
  637. <FormItem className="half-item"
  638. {...formItemLayout}
  639. label="通讯地址" >
  640. <span>{theData.iOwnerPostalAddress}</span>
  641. </FormItem>
  642. </div>}
  643. <div className="clearfix">
  644. <FormItem className="half-item"
  645. {...formItemLayout}
  646. label="合作方式" >
  647. {(() => {
  648. switch (theData.cooperationMode) {
  649. case "0":
  650. return <span>技术转让</span>;
  651. case "1":
  652. return <span>授权生产</span>;
  653. }
  654. })()}
  655. </FormItem>
  656. <FormItem className="half-item"
  657. {...formItemLayout}
  658. label="转让方式" >
  659. <span>{getTransferMode(theData.transferMode)}</span>
  660. </FormItem>
  661. </div>
  662. <div className="clearfix">
  663. <FormItem className="half-item"
  664. {...formItemLayout}
  665. label="议价方式" >
  666. {(() => {
  667. switch (theData.bargainingMode) {
  668. case "0":
  669. return <span>面议</span>;
  670. case "1":
  671. return <span>定价</span>;
  672. }
  673. })()}
  674. </FormItem>
  675. {theData.bargainingMode == 0 ? <div></div> : <FormItem className="half-item"
  676. {...formItemLayout}
  677. label="转让价格" >
  678. <span>{theData.transferPrice} 万元</span>
  679. </FormItem>}
  680. </div>
  681. <FormItem
  682. labelCol={{ span: 4 }}
  683. wrapperCol={{ span: 18 }}
  684. label="技术场景" >
  685. <span>{theData.technicalScene}</span>
  686. </FormItem>
  687. <FormItem
  688. labelCol={{ span: 4 }}
  689. wrapperCol={{ span: 18 }}
  690. label="技术突破" >
  691. <span>{theData.breakthrough}</span>
  692. </FormItem>
  693. <FormItem
  694. labelCol={{ span: 4 }}
  695. wrapperCol={{ span: 18 }}
  696. label="专利情况" >
  697. <span>{theData.patentCase}</span>
  698. </FormItem>
  699. <FormItem
  700. labelCol={{ span: 4 }}
  701. wrapperCol={{ span: 18 }}
  702. label="获奖情况" >
  703. <span>{theData.awards}</span>
  704. </FormItem>
  705. <FormItem
  706. labelCol={{ span: 4 }}
  707. wrapperCol={{ span: 18 }}
  708. label="技术团队情况" >
  709. <span>{theData.teamDes}</span>
  710. </FormItem>
  711. <FormItem
  712. labelCol={{ span: 4 }}
  713. wrapperCol={{ span: 18 }}
  714. label="技术参数" >
  715. <span>{theData.parameter}</span>
  716. </FormItem>
  717. <FormItem
  718. labelCol={{ span: 4 }}
  719. wrapperCol={{ span: 6 }}
  720. label="技术方案" >
  721. <p>{theData.techPlanUrl ?
  722. <span className="download-file">
  723. <a onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/download?id=' + this.props.data.id + '&sign=achievement_tech_plan') }}>技术方案</a>
  724. </span>
  725. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  726. </FormItem>
  727. <FormItem
  728. labelCol={{ span: 4 }}
  729. wrapperCol={{ span: 6 }}
  730. label="商业计划书" >
  731. <p>{theData.businessPlanUrl ?
  732. <span className="download-file">
  733. <a onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/download?id=' + this.props.data.id + '&sign=achievement_business_plan') }}>商业计划书</a>
  734. </span>
  735. : <span><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传!</span>}</p>
  736. </FormItem>
  737. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  738. {window.showAuditStatus ? <Button className="set-submit" loading={this.state.buttonLoading} type="primary" onClick={this.buildMatchList} style={{"display":"none"}}>生成匹配列表</Button> : <span></span>}
  739. </FormItem>
  740. </Spin>
  741. </Form >
  742. )
  743. }
  744. }));
  745. const AchievementDetail = React.createClass({
  746. getInitialState() {
  747. return {
  748. visible: false,
  749. tabsKey: 1,
  750. loading: false,
  751. columns: [
  752. {
  753. title: '编号',
  754. dataIndex: 'serialNumber',
  755. key: 'serialNumber',
  756. }, {
  757. title: '数据类型',
  758. dataIndex: 'dataCategory',
  759. key: 'dataCategory',
  760. render: text => {
  761. switch (text) {
  762. case "0":
  763. return <span>成果</span>;
  764. case "1":
  765. return <span>技术</span>;
  766. case "2":
  767. return <span>项目</span>;
  768. }
  769. }
  770. }, {
  771. title: '名称',
  772. dataIndex: 'name',
  773. key: 'name',
  774. }, {
  775. title: '关键字',
  776. dataIndex: 'keyword',
  777. key: 'keyword',
  778. }, {
  779. title: '类型',
  780. dataIndex: 'demandType',
  781. key: 'demandType',
  782. render: text => { return getDemandType(text); }
  783. }, {
  784. title: '所有人名称',
  785. dataIndex: 'theName',
  786. key: 'theName',
  787. }, {
  788. title: '发布时间',
  789. dataIndex: 'releaseDateFormattedDate',
  790. key: 'releaseDateFormattedDate',
  791. }, {
  792. title: '有效期限',
  793. dataIndex: 'validityPeriodFormattedDate',
  794. key: 'validityPeriodFormattedDate',
  795. },
  796. ],
  797. dataSource: [],
  798. };
  799. },
  800. getTechBrodersList() {
  801. this.setState({
  802. loading: true
  803. });
  804. $.ajax({
  805. method: "get",
  806. dataType: "json",
  807. crossDomain: false,
  808. url: globalConfig.context + "/api/admin/audit/techBroders",
  809. success: function (data) {
  810. if (!data.data) {
  811. if (data.error && data.error.length) {
  812. message.warning(data.error[0].message);
  813. }
  814. return;
  815. };
  816. let _me = this, theArr = [];
  817. for (var item in data.data) {
  818. theArr.push(
  819. <Select.Option key={item}>{data.data[item]}</Select.Option>
  820. )
  821. };
  822. this.setState({
  823. techBrodersOption: theArr,
  824. techBrodersObj: data.data
  825. });
  826. }.bind(this),
  827. }).always(function () {
  828. this.setState({
  829. loading: false
  830. });
  831. }.bind(this));
  832. },
  833. getTableList() {
  834. this.setState({
  835. loading: true
  836. });
  837. $.ajax({
  838. method: "get",
  839. dataType: "json",
  840. crossDomain: false,
  841. url: globalConfig.context + "/api/admin/achievement/achievementDemand",
  842. data: { id: this.props.data.id },
  843. success: function (data) {
  844. let theArr = [];
  845. if (!data.data) {
  846. if (data.error && data.error.length) {
  847. message.warning(data.error[0].message);
  848. };
  849. } else if (data.data.length) {
  850. for (let i = 0; i < data.data.length; i++) {
  851. let thisdata = data.data[i];
  852. theArr.push({
  853. key: i,
  854. id: thisdata.id,
  855. serialNumber: thisdata.serialNumber,
  856. dataCategory: thisdata.dataCategory,
  857. name: thisdata.name,
  858. keyword: thisdata.keyword,
  859. demandType: thisdata.demandType,
  860. theName: thisdata.username || thisdata.unitName,
  861. releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
  862. validityPeriodFormattedDate: thisdata.validityPeriodFormattedDate,
  863. coverImg: thisdata.coverImg,
  864. hot: thisdata.hot,
  865. internationalFlag:thisdata.internationalFlag,
  866. });
  867. };
  868. };
  869. this.setState({
  870. dataSource: theArr,
  871. });
  872. }.bind(this),
  873. }).always(function () {
  874. this.setState({
  875. loading: false
  876. });
  877. }.bind(this));
  878. },
  879. tableRowClick(record, index) {
  880. window.open(globalConfig.context + '/portal/detail/demandDetail.html?id=' + record.id + '&type=' + record.dataCategory);
  881. },
  882. handleCancel(e) {
  883. this.setState({
  884. visible: false,
  885. });
  886. this.props.closeDesc(false);
  887. },
  888. handleOk(e) {
  889. this.setState({
  890. visible: false,
  891. });
  892. this.props.closeDesc(false, true);
  893. },
  894. componentWillMount() {
  895. this.getTechBrodersList();
  896. },
  897. componentWillReceiveProps(nextProps) {
  898. if (!this.state.visible && nextProps.showDesc) {
  899. this.state.tabsKey = "1";
  900. };
  901. this.state.visible = nextProps.showDesc;
  902. },
  903. render() {
  904. if (this.props.data) {
  905. return (
  906. <div className="patent-desc">
  907. <Modal maskClosable={false} visible={this.state.visible}
  908. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  909. width='1200px'
  910. footer=''
  911. className="admin-desc-content">
  912. <Spin spinning={this.state.loading}>
  913. <Tabs activeKey={this.state.tabsKey}
  914. onChange={(e) => {
  915. this.setState({ tabsKey: e });
  916. if (e == "2") {
  917. this.getTableList();
  918. };
  919. }} >
  920. <Tabs.TabPane tab="成果详情" key="1">
  921. <AchievementDetailShow
  922. data={this.props.data}
  923. detailApiUrl={this.props.detailApiUrl}
  924. techBrodersOption={this.state.techBrodersOption}
  925. techBrodersObj={this.state.techBrodersObj}
  926. closeDesc={this.handleCancel}
  927. visible={this.state.visible}
  928. handleOk={this.handleOk} />
  929. </Tabs.TabPane>
  930. <Tabs.TabPane tab="匹配列表" key="2" disabled={!this.props.data.id}>
  931. <Table size="middle" columns={this.state.columns}
  932. dataSource={this.state.dataSource}
  933. pagination={false}
  934. style={{
  935. cursor: 'pointer',
  936. }}
  937. onRowClick={this.tableRowClick} />
  938. </Tabs.TabPane>
  939. </Tabs>
  940. </Spin>
  941. </Modal>
  942. </div>
  943. );
  944. } else {
  945. return <div></div>
  946. }
  947. },
  948. });
  949. export default AchievementDetail;