auditDesc.jsx 42 KB

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