techAchievementQueryDesc.jsx 85 KB

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