contractDetail.jsx 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. import React from 'react';
  2. import { Icon, Modal, message, Spin, Input, Select, DatePicker, Button, Table, Form, Upload } from 'antd';
  3. import './contract.less';
  4. import ajax from 'jquery/src/ajax/xhr.js';
  5. import $ from 'jquery/src/ajax';
  6. import moment from 'moment';
  7. import { copyrightStateList } from '../../../dataDic.js';
  8. import { companySearch, getContractState, getCopyrightState, getPatentType, getPatentState, getCognizanceState, getTechnologyState } from '../../../tools.js';
  9. const ContractDetailForm = Form.create()(React.createClass({
  10. getInitialState() {
  11. return {
  12. visible: false,
  13. loading: false,
  14. stateOption: [],
  15. stateTable: [],
  16. contactsOption: [],
  17. stateColumns: [
  18. {
  19. title: '申请状态',
  20. dataIndex: 'status',
  21. key: 'status',
  22. render: (text) => { return getContractState(text) }
  23. }, {
  24. title: '处理时间',
  25. dataIndex: 'recordTimeFormattedDate',
  26. key: 'recordTimeFormattedDate',
  27. }, {
  28. title: '负责人',
  29. dataIndex: 'principal',
  30. key: 'principal',
  31. }, {
  32. title: '操作人',
  33. dataIndex: 'operator',
  34. key: 'operator',
  35. }, {
  36. title: '备注',
  37. dataIndex: 'comment',
  38. key: 'comment',
  39. }
  40. ],
  41. patentColumns: [
  42. {
  43. title: '专利名称',
  44. dataIndex: 'patentName',
  45. key: 'patentName',
  46. width: 200
  47. }, {
  48. title: '专利编号',
  49. dataIndex: 'patentNumber',
  50. key: 'patentNumber',
  51. width: 200
  52. }, {
  53. title: '专利状态',
  54. dataIndex: 'patentState',
  55. key: 'patentState',
  56. render: text => { return getPatentState(text) },
  57. width: 120
  58. }, {
  59. title: '专利类型',
  60. dataIndex: 'patentCatagory',
  61. key: 'patentCatagory',
  62. render: text => { return getPatentType(text) },
  63. width: 160
  64. }, {
  65. title: '当前操作人',
  66. dataIndex: 'principal',
  67. key: 'principal',
  68. width: 200
  69. }
  70. ],
  71. copyrightColumns: [
  72. {
  73. title: '软著名称',
  74. dataIndex: 'copyrightName',
  75. key: 'copyrightName',
  76. width: 200
  77. }, {
  78. title: '软著编号',
  79. dataIndex: 'serialNumber',
  80. key: 'serialNumber',
  81. width: 200
  82. }, {
  83. title: '软著状态',
  84. dataIndex: 'status',
  85. key: 'status',
  86. render: (text) => { return getCopyrightState(text) },
  87. width: 120
  88. }, {
  89. title: '加急天数',
  90. dataIndex: 'inUrgent',
  91. key: 'inUrgent',
  92. render: (text) => {
  93. switch (text) {
  94. case 0:
  95. return '不加急(45个工作日)';
  96. case 3:
  97. return '3个工作日';
  98. case 5:
  99. return '5个工作日';
  100. case 10:
  101. return '6-10个工作日';
  102. case 15:
  103. return '11-15个工作日';
  104. case 20:
  105. return '16-20个工作日';
  106. case 25:
  107. return '21-25个工作日';
  108. case 30:
  109. return '26-30个工作日';
  110. case 35:
  111. return '31-35个工作日';
  112. default:
  113. return '不加急(45个工作日)';
  114. }
  115. },
  116. width: 220
  117. }, {
  118. title: '当前操作人',
  119. dataIndex: 'principal',
  120. key: 'principal'
  121. }
  122. ],
  123. highTechColumns: [
  124. {
  125. title: '申请年份',
  126. dataIndex: 'year',
  127. key: 'year',
  128. width: 200
  129. }, {
  130. title: '申请状态',
  131. dataIndex: 'state',
  132. key: 'state',
  133. render: (text) => { return getCognizanceState(text) },
  134. width: 200
  135. }, {
  136. title: '证书编号',
  137. dataIndex: 'certificateNumber',
  138. key: 'certificateNumber',
  139. width: 260
  140. }, {
  141. title: '当前操作人',
  142. dataIndex: 'techPrincipal',
  143. key: 'techPrincipal',
  144. width: 200
  145. }
  146. ],
  147. techProjectColumns: [
  148. {
  149. title: '项目名称',
  150. dataIndex: 'projectName',
  151. key: 'projectName',
  152. width: 260
  153. }, {
  154. title: '项目类型',
  155. dataIndex: 'projectCatagory',
  156. key: 'projectCatagory',
  157. width: 200
  158. }, {
  159. title: '项目状态',
  160. dataIndex: 'state',
  161. key: 'state',
  162. render: text => { return getTechnologyState(text) },
  163. width: 120
  164. }, {
  165. title: '技术领域',
  166. dataIndex: 'techField',
  167. key: 'techField',
  168. width: 200
  169. }, {
  170. title: '当前操作人',
  171. dataIndex: 'principle',
  172. key: 'principle',
  173. width: 200
  174. }
  175. ]
  176. };
  177. },
  178. componentWillMount() {
  179. this.loadData();
  180. this.getContactsList();
  181. this.loadColumnsData();
  182. },
  183. getContactsList(uid) {
  184. $.ajax({
  185. method: "get",
  186. dataType: "json",
  187. crossDomain: false,
  188. url: globalConfig.context + "/api/admin/getContacts",
  189. data: {
  190. uid: uid || this.props.data.uid
  191. },
  192. success: function (data) {
  193. if (!data.data) {
  194. if (data.error && data.error.length) {
  195. message.warning(data.error[0].message);
  196. return;
  197. };
  198. };
  199. this.setState({
  200. contactsList: data.data
  201. });
  202. }.bind(this),
  203. });
  204. },
  205. loadData(id) {
  206. this.setState({
  207. loading: true
  208. });
  209. $.when($.ajax({
  210. method: "get",
  211. dataType: "json",
  212. crossDomain: false,
  213. cache: false,
  214. url: globalConfig.context + "/api/admin/contract/log",
  215. data: {
  216. cid: id || this.props.data.id
  217. }
  218. }), $.ajax({
  219. method: "get",
  220. dataType: "json",
  221. crossDomain: false,
  222. cache: false,
  223. url: globalConfig.context + "/api/admin/contract/detail",
  224. data: {
  225. id: id || this.props.data.id
  226. }
  227. })).done((data1, data2) => {
  228. let _me = this;
  229. //状态流转table
  230. this.state.stateTable = [];
  231. if (data1[0].error && data1[0].error.length) {
  232. message.warning(data1[0].error[0].message);
  233. } else {
  234. data1[0].data.map(function (item, i) {
  235. _me.state.stateTable.push({
  236. key: i,
  237. recordTimeFormattedDate: item.recordTimeFormattedDate,
  238. status: item.status,
  239. principal: item.principal,
  240. operator: item.operator,
  241. comment: item.comment
  242. });
  243. });
  244. };
  245. //获取详细数据
  246. if (!data2[0].data) {
  247. if (data2[0].error && data2[0].error.length) {
  248. message.warning(data2[0].error[0].message);
  249. };
  250. } else {
  251. let detailData = data2[0].data;
  252. this.setState({
  253. data: detailData
  254. });
  255. };
  256. }).always(function () {
  257. this.setState({
  258. loading: false
  259. });
  260. }.bind(this));
  261. },
  262. loadColumnsData(id) {
  263. this.setState({
  264. loading: true
  265. });
  266. $.when($.ajax({
  267. method: "get",
  268. dataType: "json",
  269. crossDomain: false,
  270. cache: false,
  271. url: globalConfig.context + "/api/admin/contract/techProject",
  272. data: {
  273. contractId: id || this.props.data.id
  274. }
  275. }), $.ajax({
  276. method: "get",
  277. dataType: "json",
  278. crossDomain: false,
  279. cache: false,
  280. url: globalConfig.context + "/api/admin/contract/cognizance",
  281. data: {
  282. contractId: id || this.props.data.id
  283. }
  284. }), $.ajax({
  285. method: "get",
  286. dataType: "json",
  287. crossDomain: false,
  288. cache: false,
  289. url: globalConfig.context + "/api/admin/contract/copyright",
  290. data: {
  291. contractId: id || this.props.data.id
  292. }
  293. }), $.ajax({
  294. method: "get",
  295. dataType: "json",
  296. crossDomain: false,
  297. cache: false,
  298. url: globalConfig.context + "/api/admin/contract/patent",
  299. data: {
  300. contractId: id || this.props.data.id
  301. }
  302. })).done((data1, data2, data3, data4) => {
  303. let patentArr = [], techProjectArr = [], cognizanceArr = [], copyrightArr = [];
  304. if (!data1[0].data) {
  305. if (data1[0].error && data1[0].error.length) {
  306. message.warning(data1[0].error[0].message)
  307. };
  308. } else {
  309. data1[0].data.map(function (item, i) {
  310. techProjectArr.push({
  311. "key": i,
  312. "id": item.id, //科技项目ID
  313. "uid": item.uid, //用户ID
  314. "contractId": item.contractId, //合同ID
  315. "projectName": item.projectName, //项目名称
  316. "projectCatagory": item.projectCatagory, //项目类型
  317. "state": item.state, //状态
  318. "techField": item.techField, //领域
  319. "principle": item.principle, //当前负责人(技术员)
  320. "tableType": "techProject"
  321. });
  322. });
  323. };
  324. if (!data2[0].data) {
  325. if (data2[0].error && data2[0].error.length) {
  326. message.warning(data2[0].error[0].message)
  327. };
  328. } else {
  329. data2[0].data.map(function (item, i) {
  330. cognizanceArr.push({
  331. "key": i,
  332. "id": item.id, //科技项目ID
  333. "uid": item.uid, //用户ID
  334. "contractId": item.contractId, //合同ID
  335. "year": item.year,
  336. "serialNumber": item.serialNumber,
  337. "state": item.state, //状态
  338. "certificateNumber": item.certificateNumber,
  339. "techPrincipal": item.techPrincipal, //当前负责人(技术员)
  340. "tableType": "cognizance"
  341. });
  342. });
  343. };
  344. if (!data3[0].data) {
  345. if (data3[0].error && data3[0].error.length) {
  346. message.warning(data3[0].error[0].message)
  347. };
  348. } else {
  349. data3[0].data.map(function (item, i) {
  350. copyrightArr.push({
  351. "key": i,
  352. "id": item.id, //科技项目ID
  353. "uid": item.uid, //用户ID
  354. "contractId": item.contractId, //合同ID
  355. "copyrightName": item.copyrightName, //项目名称
  356. "serialNumber": item.serialNumber,
  357. "status": item.status, //状态
  358. "inUrgent": item.inUrgent ? Number(item.inUrgent) : null, //加急天数
  359. "principal": item.principal, //当前负责人(技术员)
  360. "tableType": "copyright"
  361. });
  362. });
  363. };
  364. if (!data4[0].data) {
  365. if (data4[0].error && data4[0].error.length) {
  366. message.warning(data4[0].error[0].message)
  367. };
  368. } else {
  369. data4[0].data.map(function (item, i) {
  370. patentArr.push({
  371. "key": i,
  372. "id": item.id, //科技项目ID
  373. "uid": item.uid, //用户ID
  374. "contractId": item.contractId, //合同ID
  375. "patentName": item.patentName, //项目名称
  376. "patentNumber": item.patentNumber, //专利号
  377. "serialNumber": item.serialNumber, //编号
  378. "patentState": item.patentState, //状态
  379. "patentCatagory": item.patentCatagory, //专利类别
  380. "principal": item.principal, //当前负责人(技术员)
  381. "tableType": "patent"
  382. });
  383. });
  384. };
  385. this.setState({
  386. patentTableData: patentArr,
  387. copyrightTableData: copyrightArr,
  388. highTechTableData: cognizanceArr,
  389. techProjectTableData: techProjectArr
  390. });
  391. }).always(function () {
  392. this.setState({
  393. loading: false
  394. });
  395. }.bind(this));
  396. },
  397. foundHighTech() {
  398. $.ajax({
  399. method: "post",
  400. dataType: "json",
  401. crossDomain: false,
  402. url: globalConfig.context + "/api/admin/contract/createCognizance",
  403. data: {
  404. id: this.props.data.id
  405. },
  406. success: function (data) {
  407. if (!data.data) {
  408. if (data.error && data.error.length) {
  409. message.warning(data.error[0].message);
  410. return;
  411. };
  412. };
  413. this.loadData();
  414. this.loadColumnsData();
  415. }.bind(this),
  416. });
  417. },
  418. foundPatent() {
  419. $.ajax({
  420. method: "post",
  421. dataType: "json",
  422. crossDomain: false,
  423. url: globalConfig.context + "/api/admin/contract/createPatent",
  424. data: {
  425. id: this.props.data.id
  426. },
  427. success: function (data) {
  428. if (!data.data) {
  429. if (data.error && data.error.length) {
  430. message.warning(data.error[0].message);
  431. return;
  432. };
  433. };
  434. this.loadData();
  435. this.loadColumnsData();
  436. }.bind(this),
  437. });
  438. },
  439. foundCopyright() {
  440. $.ajax({
  441. method: "post",
  442. dataType: "json",
  443. crossDomain: false,
  444. url: globalConfig.context + "/api/admin/contract/createCopyright",
  445. data: {
  446. id: this.props.data.id
  447. },
  448. success: function (data) {
  449. if (!data.data) {
  450. if (data.error && data.error.length) {
  451. message.warning(data.error[0].message);
  452. return;
  453. };
  454. };
  455. this.loadData();
  456. this.loadColumnsData();
  457. }.bind(this),
  458. });
  459. },
  460. foundTechProject() {
  461. $.ajax({
  462. method: "post",
  463. dataType: "json",
  464. crossDomain: false,
  465. url: globalConfig.context + "/api/admin/contract/createTechProject",
  466. data: {
  467. id: this.props.data.id
  468. },
  469. success: function (data) {
  470. if (!data.data) {
  471. if (data.error && data.error.length) {
  472. message.warning(data.error[0].message);
  473. return;
  474. };
  475. };
  476. this.loadData();
  477. this.loadColumnsData();
  478. }.bind(this),
  479. });
  480. },
  481. componentWillReceiveProps(nextProps) {
  482. if (!this.props.visible && nextProps.visible) {
  483. this.loadData(nextProps.data.id);
  484. this.props.form.resetFields();
  485. this.loadColumnsData(nextProps.data.id);
  486. this.getContactsList(nextProps.data.uid);
  487. };
  488. },
  489. handleSubmit(e) {
  490. e.preventDefault();
  491. this.props.form.validateFields((err, values) => {
  492. if (values.status || values.principals || values.recordTime || values.comment) {
  493. if (!values.status || !values.principals || !values.recordTime) {
  494. message.warning("请填写完整的状态流转信息!");
  495. return;
  496. };
  497. };
  498. if (!err) {
  499. this.props.spinState(true);
  500. $.ajax({
  501. method: "POST",
  502. dataType: "json",
  503. crossDomain: false,
  504. url: globalConfig.context + "/api/admin/contract/circulation",
  505. data: {
  506. "cid": this.props.data.id,
  507. "comment": values.comment,
  508. "status": values.status,
  509. "recordTimeFormattedDate": values.recordTime ? values.recordTime.format("YYYY-MM-DD HH:mm:ss") : null,
  510. "principals": values.principals //流转分发人
  511. }
  512. }).done(function (data) {
  513. if (!data.error.length) {
  514. message.success('保存成功!');
  515. this.props.clickOk();
  516. this.props.form.resetFields();
  517. } else {
  518. message.warning(data.error[0].message);
  519. };
  520. this.props.spinState(false);
  521. }.bind(this));
  522. }
  523. });
  524. },
  525. tableRowClick(record, index) {
  526. switch (record.tableType) {
  527. case 'patent':
  528. window.open(globalConfig.context + "/admin/servicesManage/patent.html?contractId=" + record.contractId + "#comprehensive");
  529. break;
  530. case 'copyright':
  531. window.open(globalConfig.context + "/admin/servicesManage/copyright.html?contractId=" + record.contractId + "#copyright");
  532. break;
  533. case 'cognizance':
  534. window.open(globalConfig.context + "/admin/servicesManage/highTech.html?contractId=" + record.contractId + "#highTechApply");
  535. break;
  536. case 'techProject':
  537. window.open(globalConfig.context + "/admin/servicesManage/technology.html?contractId=" + record.contractId + "#applyManage");
  538. break;
  539. };
  540. },
  541. render() {
  542. const FormItem = Form.Item;
  543. const { getFieldDecorator } = this.props.form;
  544. const theData = this.state.data || {};
  545. const formItemLayout = {
  546. labelCol: { span: 6 },
  547. wrapperCol: { span: 18 },
  548. };
  549. const _me = this;
  550. return (
  551. <Form onSubmit={this.handleSubmit} id="CopyrightDesc-form">
  552. <div className="clearfix">
  553. <FormItem className="half-item"
  554. {...formItemLayout}
  555. label="合同编号" >
  556. {getFieldDecorator('serialNumber')(
  557. <span>{theData.serialNumber}</span>
  558. )}
  559. </FormItem>
  560. <FormItem className="half-item"
  561. {...formItemLayout}
  562. label="公司名称" >
  563. {getFieldDecorator('unitName')(
  564. <span>{theData.unitName}</span>
  565. )}
  566. </FormItem>
  567. <FormItem className="half-item"
  568. {...formItemLayout}
  569. label="组织机构代码" >
  570. {getFieldDecorator('orgCode')(
  571. <span>{theData.orgCode}</span>
  572. )}
  573. </FormItem>
  574. <FormItem className="half-item"
  575. {...formItemLayout}
  576. label="公司地址" >
  577. {getFieldDecorator('address')(
  578. <span>{theData.address}</span>
  579. )}
  580. </FormItem>
  581. <FormItem className="half-item"
  582. {...formItemLayout}
  583. label="联系人" >
  584. <span>{this.state.contactsList ? this.state.contactsList[theData.contacts] : ''}</span>
  585. </FormItem>
  586. <FormItem className="half-item"
  587. {...formItemLayout}
  588. label="前期费用" >
  589. <span>{theData.previousFee}</span>
  590. </FormItem>
  591. </div>
  592. <p style={{ fontSize: '14px', color: '#333' }}>状态流转记录: </p>
  593. <Table size="middle" style={{ margin: '10px 0', background: "#eee" }}
  594. pagination={false}
  595. dataSource={this.state.stateTable}
  596. columns={this.state.stateColumns} />
  597. <div className="clearfix" style={{ padding: '0 4px', paddingTop: '20px', marginBottom: '10px', background: '#eee' }}>
  598. <FormItem className="half-item"
  599. {...formItemLayout}
  600. label="状态流转"
  601. >
  602. {getFieldDecorator('status')(
  603. <Select
  604. style={{ width: 200 }}
  605. placeholder="选择一个状态">
  606. {this.props.statusOption}
  607. </Select>
  608. )}
  609. </FormItem>
  610. <FormItem className="half-item"
  611. {...formItemLayout}
  612. label="处理时间"
  613. >
  614. {getFieldDecorator('recordTime')(
  615. <DatePicker />
  616. )}
  617. </FormItem>
  618. <FormItem className="half-item"
  619. {...formItemLayout}
  620. label="负责人"
  621. >
  622. {getFieldDecorator('principals')(
  623. <Select
  624. placeholder="请选择审核人"
  625. notFoundContent="未找到"
  626. style={{ width: 260 }}
  627. showSearch
  628. multiple
  629. filterOption={companySearch} >
  630. {this.props.authorOption}
  631. </Select>
  632. )}
  633. </FormItem>
  634. <FormItem className="half-item"
  635. {...formItemLayout}
  636. label="备注">
  637. {getFieldDecorator('comment')(
  638. <Input />
  639. )}
  640. </FormItem>
  641. </div>
  642. {theData.cognizanceYear ? <div>
  643. <div className="clearfix">
  644. <FormItem className="half-item"
  645. {...formItemLayout}
  646. label="高企申请">
  647. {getFieldDecorator('cognizanceYear', {
  648. initialValue: theData.cognizanceYear
  649. })(
  650. <span>{theData.cognizanceYear} 年</span>
  651. )}
  652. </FormItem>
  653. {theData.cognizanceStatus == 0 ? <Button onClick={this.foundHighTech}>创建申请</Button> : <span></span>}
  654. </div>
  655. <Table className="contract-Table" size="small" scroll={{ y: 240 }}
  656. columns={this.state.highTechColumns}
  657. dataSource={this.state.highTechTableData}
  658. pagination={false}
  659. style={{
  660. cursor: 'pointer',
  661. }}
  662. onRowClick={this.tableRowClick} />
  663. </div> : <div></div>}
  664. {theData.patentNum ? <div>
  665. <div className="clearfix">
  666. <FormItem className="half-item"
  667. {...formItemLayout}
  668. label="专利申请">
  669. {getFieldDecorator('patentNum', {
  670. initialValue: theData.patentNum
  671. })(
  672. <span>{theData.patentNum} 条</span>
  673. )}
  674. </FormItem>
  675. {theData.patentStatus == 0 ? <Button onClick={this.foundPatent}>创建申请</Button> : <span></span>}
  676. </div>
  677. <Table className="contract-Table" size="small" scroll={{ y: 240 }}
  678. columns={this.state.patentColumns}
  679. dataSource={this.state.patentTableData}
  680. pagination={false}
  681. style={{
  682. cursor: 'pointer',
  683. }}
  684. onRowClick={this.tableRowClick} />
  685. </div> : <div></div>}
  686. {theData.copyrightNum ? <div>
  687. <div className="clearfix">
  688. <FormItem className="half-item"
  689. {...formItemLayout}
  690. label="软著申请">
  691. {getFieldDecorator('copyrightNum', {
  692. initialValue: theData.copyrightNum
  693. })(
  694. <span>{theData.copyrightNum} 条</span>
  695. )}
  696. </FormItem>
  697. {theData.copyrightStatus == 0 ? <Button onClick={this.foundCopyright}>创建申请</Button> : <span></span>}
  698. </div>
  699. <Table className="contract-Table" size="small" scroll={{ y: 240 }}
  700. columns={this.state.copyrightColumns}
  701. dataSource={this.state.copyrightTableData}
  702. pagination={false}
  703. style={{
  704. cursor: 'pointer',
  705. }}
  706. onRowClick={this.tableRowClick} />
  707. </div> : <div></div>}
  708. {theData.techProjectNum ? <div>
  709. <div className="clearfix">
  710. <FormItem className="half-item"
  711. {...formItemLayout}
  712. label=" 科技项目申请">
  713. {getFieldDecorator('techProjectNum', {
  714. initialValue: theData.techProjectNum
  715. })(
  716. <span>{theData.techProjectNum} 条</span>
  717. )}
  718. </FormItem>
  719. {theData.techProjectStatus == 0 ? <Button onClick={this.foundTechProject}>创建申请</Button> : <span></span>}
  720. </div>
  721. <Table className="contract-Table" size="small" scroll={{ y: 240 }}
  722. columns={this.state.techProjectColumns}
  723. dataSource={this.state.techProjectTableData}
  724. pagination={false}
  725. style={{
  726. cursor: 'pointer',
  727. }}
  728. onRowClick={this.tableRowClick} />
  729. </div> : <div></div>}
  730. <FormItem style={{ marginTop: '20px' }}>
  731. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  732. <Button type="ghost" style={{ marginLeft: '20px' }} onClick={this.props.closeModal}>取消</Button>
  733. </FormItem>
  734. </Form>
  735. );
  736. }
  737. }));
  738. const ContractDetail = React.createClass({
  739. getInitialState() {
  740. return {
  741. visible: false,
  742. loading: false
  743. };
  744. },
  745. componentWillReceiveProps(nextProps) {
  746. this.state.visible = nextProps.showDesc
  747. },
  748. showModal() {
  749. this.setState({
  750. visible: true,
  751. });
  752. },
  753. handleOk() {
  754. this.setState({
  755. visible: false,
  756. });
  757. this.props.closeDesc(false, true);
  758. },
  759. handleCancel(e) {
  760. this.setState({
  761. visible: false,
  762. });
  763. this.props.closeDesc(false);
  764. },
  765. spinChange(e) {
  766. this.setState({
  767. loading: e
  768. });
  769. },
  770. render() {
  771. return (
  772. <div className="patent-addNew">
  773. <Modal maskClosable={false} title="合同详情" visible={this.state.visible}
  774. onOk={this.handleOk} onCancel={this.handleCancel}
  775. width='1200px'
  776. footer='' >
  777. <Spin spinning={this.state.loading} className='spin-box'>
  778. <ContractDetailForm
  779. visible={this.state.visible}
  780. authorOption={this.props.authorOption}
  781. statusOption={this.props.statusOption}
  782. data={this.props.data}
  783. spinState={this.spinChange}
  784. closeModal={this.handleCancel}
  785. clickOk={this.handleOk} />
  786. </Spin>
  787. </Modal>
  788. </div>
  789. );
  790. }
  791. });
  792. export default ContractDetail;