crmAchievement.jsx 81 KB

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