crmAchievement.jsx 81 KB

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