techAchievementQueryDesc.jsx 85 KB

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