cognizance.jsx 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  1. import React from 'react';
  2. import { Icon, InputNumber, Form, Button, Input, Radio, Select, Spin, Table, message, Cascader, Modal } from 'antd';
  3. import { cognizanceStateList } from '../../dataDic.js';
  4. import { techFieldList } from '../../DicTechFieldList.js';
  5. import { getTime, getCognizanceState } from '../../tools.js';
  6. import ajax from 'jquery/src/ajax/xhr.js';
  7. import $ from 'jquery/src/ajax';
  8. import moment from 'moment';
  9. import './cognizance.less';
  10. const CognizanceDescFrom = Form.create()(React.createClass({
  11. loadData(theCid, theYear) {
  12. this.setState({
  13. loading: true
  14. });
  15. $.ajax({
  16. method: "post",
  17. dataType: "json",
  18. crossDomain: false,
  19. url: globalConfig.context + "/api/user/cognizance/cognizanceDetail",
  20. data: {
  21. cid: theCid || this.props.data.cid,
  22. year: theYear || this.props.data.year
  23. },
  24. success: function (data) {
  25. if (data.error.length || !data.data) {
  26. message.warning(data.error[0].message);
  27. return;
  28. };
  29. this.state.data = data.data;
  30. this.state.cid = this.props.data.cid;
  31. this.state.year = this.props.data.year;
  32. this.state.moneyTable = [{
  33. key: 1,
  34. year: '前一年',
  35. netAsset: data.data.netAsset1,
  36. salesRevenue: data.data.salesRevenue1,
  37. grossProfit: data.data.grossProfit1
  38. }, {
  39. key: 2,
  40. year: '前二年',
  41. netAsset: data.data.netAsset2,
  42. salesRevenue: data.data.salesRevenue2,
  43. grossProfit: data.data.grossProfit2
  44. }, {
  45. key: 3,
  46. year: '前三年',
  47. netAsset: data.data.netAsset3,
  48. salesRevenue: data.data.salesRevenue3,
  49. grossProfit: data.data.grossProfit3
  50. }];
  51. if (data.data.netAsset2 == 0) {
  52. this.state.netAssetRate = 0;
  53. } else if (data.data.netAsset3 == 0) {
  54. this.state.netAssetRate = (data.data.netAsset1 / data.data.netAsset2) - 1;
  55. } else {
  56. this.state.netAssetRate = 1 / 2 * (data.data.netAsset2 / data.data.netAsset3 + data.data.netAsset1 / data.data.netAsset2) - 1;
  57. };
  58. if (this.state.netAssetRate < 0 || isNaN(this.state.netAssetRate)) {
  59. this.state.netAssetRate = 0
  60. };
  61. if (data.data.salesRevenue2 == 0) {
  62. this.state.salesRevenueRate = 0;
  63. } else if (data.data.salesRevenue3 == 0) {
  64. this.state.salesRevenueRate = (data.data.salesRevenue1 / data.data.salesRevenue2) - 1;
  65. } else {
  66. this.state.salesRevenueRate = 1 / 2 * (data.data.salesRevenue2 / data.data.salesRevenue3 + data.data.salesRevenue1 / data.data.salesRevenue2) - 1;
  67. };
  68. if (this.state.salesRevenueRate < 0 || isNaN(this.state.salesRevenueRate)) {
  69. this.state.salesRevenueRate = 0
  70. };
  71. }.bind(this),
  72. }).always(function () {
  73. this.setState({
  74. loading: false
  75. });
  76. }.bind(this));
  77. },
  78. getStateData(theCid) {
  79. this.setState({
  80. loading: true
  81. });
  82. $.ajax({
  83. method: "post",
  84. dataType: "json",
  85. crossDomain: false,
  86. url: globalConfig.context + "/api/user/cognizance/cognizanceLog",
  87. data: {
  88. cid: theCid || this.props.data.cid
  89. },
  90. success: function (data) {
  91. if (data.error.length || !data.data) {
  92. message.warning(data.error[0].message);
  93. return;
  94. };
  95. this.state.stateTable = [];
  96. for (let i = 0; i < data.data.length; i++) {
  97. this.state.stateTable.push({
  98. key: i,
  99. recordTimeFormattedDate: data.data[i].recordTimeFormattedDate,
  100. state: String(data.data[i].state),
  101. principal: data.data[i].principal,
  102. operator: data.data[i].operator,
  103. comment: data.data[i].comment
  104. });
  105. };
  106. }.bind(this),
  107. }).always(function () {
  108. this.setState({
  109. loading: false
  110. });
  111. }.bind(this));
  112. },
  113. getInitialState() {
  114. return {
  115. loading: false,
  116. stateOption: [],
  117. moneyColumns: [{
  118. title: '',
  119. dataIndex: 'year',
  120. key: 'year',
  121. }, {
  122. title: '净资产',
  123. dataIndex: 'netAsset',
  124. key: 'netAsset',
  125. }, {
  126. title: '销售收入',
  127. dataIndex: 'salesRevenue',
  128. key: 'salesRevenue',
  129. }, {
  130. title: '利润总额',
  131. dataIndex: 'grossProfit',
  132. key: 'grossProfit',
  133. }],
  134. stateColumns: [{
  135. title: '状态',
  136. dataIndex: 'state',
  137. key: 'state',
  138. render: (text) => { return getCognizanceState(text) }
  139. }, {
  140. title: '处理时间',
  141. dataIndex: 'recordTimeFormattedDate',
  142. key: 'recordTimeFormattedDate',
  143. }, {
  144. title: '负责人',
  145. dataIndex: 'principal',
  146. key: 'principal',
  147. }, {
  148. title: '操作人',
  149. dataIndex: 'operator',
  150. key: 'operator',
  151. }, {
  152. title: '备注',
  153. dataIndex: 'comment',
  154. key: 'comment',
  155. }]
  156. };
  157. },
  158. componentWillMount() {
  159. let _me = this;
  160. cognizanceStateList.map(function (item) {
  161. _me.state.stateOption.push(
  162. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  163. )
  164. });
  165. this.loadData();
  166. this.getStateData();
  167. },
  168. handleSubmit(e) {
  169. e.preventDefault();
  170. this.props.form.validateFields((err, values) => {
  171. if (!err) {
  172. this.props.spinState(true);
  173. $.ajax({
  174. method: "POST",
  175. dataType: "json",
  176. crossDomain: false,
  177. url: globalConfig.context + "/api/user/cognizance/disposeCognizanceDetail",
  178. data: {
  179. id: this.props.data.cid,
  180. technicalField1: values.technicalField[0],
  181. technicalField2: values.technicalField[1],
  182. technicalField3: values.technicalField[2],
  183. basicResearchCost: values.basicResearchCost,
  184. accident: values.accident
  185. }
  186. }).done(function (data) {
  187. if (!data.error.length) {
  188. message.success('保存成功!');
  189. this.props.clickOk();
  190. this.props.form.resetFields();
  191. this.state.targetKeys = [];
  192. this.state.selectedKeys = [];
  193. this.props.spinState(false);
  194. } else {
  195. message.warning(data.error[0].message);
  196. this.props.spinState(false);
  197. }
  198. }.bind(this));
  199. }
  200. });
  201. },
  202. componentWillReceiveProps(nextProps) {
  203. if (!this.props.visible && nextProps.visible) {
  204. this.getStateData(nextProps.data.cid);
  205. this.loadData(nextProps.data.cid, nextProps.data.year);
  206. };
  207. },
  208. render() {
  209. const FormItem = Form.Item;
  210. const { getFieldDecorator } = this.props.form;
  211. const theData = this.state.data || {};
  212. const formItemLayout = {
  213. labelCol: { span: 6 },
  214. wrapperCol: { span: 12 },
  215. };
  216. const _me = this;
  217. return (
  218. <Form onSubmit={this.handleSubmit} id="highTechApply-form">
  219. <div className="clearfix">
  220. <div className="half-item">
  221. <span className="item-title">公司名称: </span>
  222. <span>{theData.unitName}</span>
  223. </div>
  224. <div className="half-item">
  225. <span className="item-title">公司组织机构代码: </span>
  226. <span>{theData.orgCode}</span>
  227. </div>
  228. <div className="half-item">
  229. <span className="item-title">公司地址: </span>
  230. <span>{theData.postalAddress}</span>
  231. </div>
  232. <div className="half-item">
  233. <span className="item-title">申请年份: </span>
  234. <span>{this.state.year}</span>
  235. </div>
  236. <FormItem className="half-item"
  237. labelCol={{ span: 6 }}
  238. wrapperCol={{ span: 14 }}
  239. >
  240. {getFieldDecorator('contacts', {
  241. rules: [{ required: true, message: '此项为必填项!' }],
  242. initialValue: theData.contacts
  243. })(
  244. <Select placeholder='选择一个联系人'>{this.props.contactsOption}</Select>
  245. )}
  246. </FormItem>
  247. </div>
  248. <FormItem style={{ width: '50%' }}
  249. labelCol={{ span: 0 }}
  250. wrapperCol={{ span: 24 }}
  251. label="技术领域"
  252. >
  253. <span className="item-title">技术领域: </span>
  254. {getFieldDecorator('technicalField', {
  255. rules: [{ type: 'array', required: true, message: '此项为必填项!' }],
  256. initialValue: [theData.technicalField1, theData.technicalField2, theData.technicalField3]
  257. })(
  258. <Cascader options={techFieldList} placeholder="请选择技术领域" />
  259. )}
  260. </FormItem>
  261. <div className="clearfix">
  262. <div>
  263. <span className="form-title">获得知识产权数量(件): </span>
  264. </div>
  265. <div className="half-item">
  266. <span className="item-title">一类: </span>
  267. <span>{theData.firstCatagory}</span>
  268. </div>
  269. <div className="half-item">
  270. <span className="item-title">二类: </span>
  271. <span>{theData.secondCatagory}</span>
  272. </div>
  273. </div>
  274. <div className="clearfix">
  275. <div>
  276. <span className="form-title">人力资源状况(人): </span>
  277. </div>
  278. <div className="half-item">
  279. <span className="item-title">职工总数: </span>
  280. <span>{theData.firmTotal}</span>
  281. </div>
  282. <div className="half-item">
  283. <span className="item-title">科技人员数: </span>
  284. <span>{theData.techTotal}</span>
  285. </div>
  286. </div>
  287. <div className="form-title">近三年经营状况(万元): </div>
  288. <Table pagination={false} dataSource={this.state.moneyTable} columns={this.state.moneyColumns} />
  289. <div className="clearfix">
  290. <div className="half-item">
  291. <span className="item-title">净资产增长率: </span>
  292. <span>{isNaN(this.state.netAssetRate) || this.state.netAssetRate == Infinity ? '数据错误无法计算' : (this.state.netAssetRate * 100).toFixed(2) + '%'}</span>
  293. </div>
  294. <div className="half-item">
  295. <span className="item-title">销售收入增长率: </span>
  296. <span>{isNaN(this.state.salesRevenueRate) || this.state.salesRevenueRate == Infinity ? '数据错误无法计算' : (this.state.salesRevenueRate * 100).toFixed(2) + '%'}</span>
  297. </div>
  298. </div>
  299. <div className="clearfix">
  300. <div><span className="form-title">近三年研究开发费用总额(万元): </span></div>
  301. <div className="third-item">
  302. <div className="item-title">近三年研究开发费用总额</div>
  303. <p>{theData.researchCost}</p>
  304. </div>
  305. <div className="third-item">
  306. <div className="item-title">其中: 在中国境内研发费用总和</div>
  307. <p>{theData.territory}</p>
  308. </div>
  309. <div className="third-item">
  310. <div className="item-title">其中: 基础研究投入费用总额</div>
  311. <div>
  312. <FormItem
  313. labelCol={{ span: 0 }}
  314. wrapperCol={{ span: 24 }}
  315. >
  316. {getFieldDecorator('basicResearchCost', {
  317. rules: [{ type: 'number', required: true, message: '此项为必填项!' }],
  318. initialValue: theData.basicResearchCost
  319. })(
  320. <InputNumber min={0} max={999999} step={0.01} />
  321. )}
  322. <span>万元</span>
  323. </FormItem>
  324. </div>
  325. </div>
  326. </div>
  327. <div>
  328. <span className="item-title">近一年企业总收入(万元): </span>
  329. <span>{theData.totalRevenue}</span>
  330. </div>
  331. <div>
  332. <span className="item-title">近一年高新技术产品收入(万元): </span>
  333. <span>{theData.lastYearRevenue}</span>
  334. </div>
  335. <div className="item-title">申请认定前一年内是否发生过重大安全、重大质量或严重环境违法行为</div>
  336. <FormItem
  337. labelCol={{ span: 0 }}
  338. wrapperCol={{ span: 24 }}
  339. >
  340. {getFieldDecorator('accident', {
  341. rules: [{ type: 'number', required: true, message: '此项为必填项!' }],
  342. initialValue: theData.accident
  343. })(
  344. <Radio.Group>
  345. <Radio value={0}>否</Radio>
  346. <Radio value={1}>是</Radio>
  347. </Radio.Group>
  348. )}
  349. </FormItem>
  350. <div className="form-title">状态流转记录: </div>
  351. <Table pagination={false} dataSource={this.state.stateTable} columns={this.state.stateColumns} />
  352. <FormItem style={{ marginTop: '20px' }}>
  353. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  354. <Button type="ghost" style={{ marginLeft: '20px' }} onClick={this.props.closeModal}>取消</Button>
  355. </FormItem>
  356. </Form >
  357. );
  358. },
  359. }));
  360. const CognizanceDesc = React.createClass({
  361. getInitialState() {
  362. return {
  363. visible: false,
  364. loading: false
  365. };
  366. },
  367. componentWillReceiveProps(nextProps) {
  368. this.state.visible = nextProps.showDesc
  369. },
  370. showModal() {
  371. this.setState({
  372. visible: true,
  373. });
  374. },
  375. handleOk() {
  376. this.setState({
  377. visible: false,
  378. });
  379. this.props.closeDesc(false, true);
  380. },
  381. handleCancel(e) {
  382. this.setState({
  383. visible: false,
  384. });
  385. this.props.closeDesc(false);
  386. },
  387. spinChange(e) {
  388. this.setState({
  389. loading: e
  390. });
  391. },
  392. render() {
  393. return (
  394. <div className="patent-addNew">
  395. <Modal maskClosable={false} title="高企管理" visible={this.state.visible}
  396. onOk={this.handleOk} onCancel={this.handleCancel}
  397. width='1000px'
  398. footer='' >
  399. <Spin spinning={this.state.loading} className='spin-box'>
  400. <CognizanceDescFrom
  401. visible={this.state.visible}
  402. contactsOption={this.props.contactsOption}
  403. data={this.props.data}
  404. spinState={this.spinChange}
  405. closeModal={this.handleCancel}
  406. clickOk={this.handleOk} />
  407. </Spin>
  408. </Modal>
  409. </div>
  410. );
  411. }
  412. });
  413. const CognizanceAdd = React.createClass({
  414. getInitialState() {
  415. return {
  416. visible: false,
  417. loading: false,
  418. yearOption: []
  419. };
  420. },
  421. componentWillReceiveProps(nextProps) {
  422. this.state.visible = nextProps.showAdd
  423. },
  424. componentWillMount() {
  425. let d = new Date();
  426. let _me = this;
  427. d = d.getFullYear() - 1;
  428. this.state.thisYear = d;
  429. for (let i = d; i < d + 20; i++) {
  430. _me.state.yearOption.push(
  431. <Select.Option key={i.toString()} >{i}</Select.Option>
  432. )
  433. };
  434. },
  435. showModal() {
  436. this.setState({
  437. visible: true,
  438. });
  439. },
  440. handleOk() {
  441. this.setState({
  442. loading: true
  443. });
  444. if (!this.state.year) {
  445. message.warning('请选择年份!');
  446. this.setState({
  447. loading: false
  448. });
  449. return;
  450. };
  451. if (!this.state.contacts) {
  452. message.warning('请选择一个联系人!');
  453. this.setState({
  454. loading: false
  455. });
  456. return;
  457. };
  458. $.ajax({
  459. method: "POST",
  460. dataType: "json",
  461. crossDomain: false,
  462. url: globalConfig.context + "/api/user/cognizance/applyCognizance",
  463. data: {
  464. year: this.state.year,
  465. contacts: this.state.contacts,
  466. comment: this.state.comment
  467. }
  468. }).done(function (data) {
  469. if (!data.error.length) {
  470. message.success('保存成功!');
  471. this.setState({
  472. visible: false
  473. });
  474. this.props.closeAdd(false, true);
  475. } else {
  476. message.warning(data.error[0].message);
  477. this.setState({
  478. loading: false
  479. });
  480. }
  481. }.bind(this));
  482. },
  483. handleCancel(e) {
  484. this.setState({
  485. visible: false,
  486. });
  487. this.props.closeAdd(false);
  488. },
  489. spinChange(e) {
  490. this.setState({
  491. loading: e
  492. });
  493. },
  494. render() {
  495. return (
  496. <div className="cognizance-add">
  497. <Modal maskClosable={false} title="高企申请" visible={this.state.visible}
  498. onOk={this.handleOk} onCancel={this.handleCancel}
  499. width='800px'
  500. footer={[
  501. <Button key="submit" type="primary" loading={this.state.loading} onClick={this.handleOk}>
  502. 提交
  503. </Button>,
  504. <Button key="back" onClick={this.handleCancel}>
  505. 返回
  506. </Button>,
  507. ]}
  508. >
  509. <Spin spinning={this.state.loading} className='spin-box'>
  510. <div className="clearfix">
  511. <div className="half-item">
  512. <span>选择申请年份: </span>
  513. <Select placeholder="请选择年份" style={{ width: 200 }}
  514. onSelect={(e, n) => { this.state.year = e }}>
  515. {this.state.yearOption}
  516. </Select>
  517. </div>
  518. <div className="half-item">
  519. <span>选择联系人: </span>
  520. <Select placeholder="请选择联系人" style={{ width: 200 }}
  521. onSelect={(e, n) => { this.state.contacts = e }}>
  522. {this.props.contactsOption}
  523. </Select>
  524. </div>
  525. </div>
  526. <div>
  527. <p>备注: </p>
  528. <p>
  529. <Input type="textarea" rows={6} onChange={(e) => { this.state.comment = e.target.value; }} />
  530. </p>
  531. </div>
  532. </Spin>
  533. </Modal>
  534. </div>
  535. );
  536. }
  537. });
  538. const Cognizance = React.createClass({
  539. loadData(pageNo) {
  540. this.state.data = [];
  541. this.setState({
  542. loading: true
  543. });
  544. $.when($.ajax({
  545. method: "get",
  546. dataType: "json",
  547. crossDomain: false,
  548. url: globalConfig.context + "/api/user/cognizance/getContacts"
  549. }), $.ajax({
  550. method: "post",
  551. dataType: "json",
  552. crossDomain: false,
  553. url: globalConfig.context + "/api/user/cognizance/listCognizance",
  554. data: {
  555. pageNo: pageNo || 1,
  556. pageSize: this.state.pagination.pageSize
  557. }
  558. })).done((data1, data2) => {
  559. this.state.data = [];
  560. if (data1[0].error || !data1[0].data) {
  561. if (data1[0].error.length) {
  562. message.warning(data1[0].error[0].message);
  563. return;
  564. };
  565. };
  566. if (data2[0].error || !data2[0].data || !data2[0].data.list) {
  567. if (data2[0].error.length) {
  568. message.warning(data2[0].error[0].message);
  569. this.state.ButtonDisabled = true;
  570. return;
  571. };
  572. };
  573. let _me = this;
  574. for (let item in data1[0].data) {
  575. let theData = data1[0].data[item];
  576. _me.state.contactsOption.push(
  577. <Select.Option value={item} key={theData}>{theData}</Select.Option>
  578. );
  579. };
  580. for (let i = 0; i < data2[0].data.list.length; i++) {
  581. let thisdata = data2[0].data.list[i];
  582. this.state.data.push({
  583. key: i,
  584. uid: thisdata.uid,
  585. cid: thisdata.cid,
  586. year: thisdata.year,
  587. serialNumber: thisdata.serialNumber,
  588. locationProvince: thisdata.locationProvince,
  589. unitName: thisdata.unitName,
  590. contacts: [thisdata.contacts, {
  591. '1': thisdata.firstContacts,
  592. '2': thisdata.secondContacts,
  593. '3': thisdata.thirdContacts
  594. }],
  595. createTime: thisdata.createTime,
  596. comment: thisdata.comment,
  597. state: thisdata.state,
  598. certificateNumber: thisdata.certificateNumber,
  599. issuingDate: thisdata.issuingDate,
  600. consultant: thisdata.consultant,
  601. createTimeFormattedDate: thisdata.createTimeFormattedDate,
  602. issuingDateFormattedDate: thisdata.issuingDateFormattedDate
  603. });
  604. };
  605. this.state.pagination.current = data2[0].data.pageNo;
  606. this.state.pagination.total = data2[0].data.totalCount;
  607. this.setState({
  608. dataSource: this.state.data,
  609. pagination: this.state.pagination
  610. });
  611. }).always(function () {
  612. this.setState({
  613. loading: false
  614. });
  615. }.bind(this));
  616. },
  617. getInitialState() {
  618. return {
  619. contactsOption: [],
  620. selectedRowKeys: [],
  621. selectedRows: [],
  622. loading: false,
  623. showAdd: false,
  624. showDesc: false,
  625. pagination: {
  626. defaultCurrent: 1,
  627. defaultPageSize: 10,
  628. showQuickJumper: true,
  629. pageSize: 10,
  630. onChange: function (page) {
  631. this.loadData(page);
  632. }.bind(this),
  633. showTotal: function (total) {
  634. return '共' + total + '条数据';
  635. }
  636. },
  637. columns: [
  638. {
  639. title: '编号',
  640. dataIndex: 'serialNumber',
  641. key: 'serialNumber'
  642. }, {
  643. title: '年份',
  644. dataIndex: 'year',
  645. key: 'year'
  646. }, {
  647. title: '联系人',
  648. dataIndex: 'contacts',
  649. key: 'contacts',
  650. render: (text) => {
  651. for (let item in text[1]) {
  652. if (text[0] == item) {
  653. return text[1][item];
  654. };
  655. };
  656. }
  657. }, {
  658. title: '派单日',
  659. dataIndex: 'createTimeFormattedDate',
  660. key: 'createTimeFormattedDate'
  661. }, {
  662. title: '状态',
  663. dataIndex: 'state',
  664. key: 'state',
  665. render: (text) => { return getCognizanceState(text) }
  666. }, {
  667. title: '证书编号',
  668. dataIndex: 'certificateNumber',
  669. key: 'certificateNumber'
  670. }, {
  671. title: '发证日',
  672. dataIndex: 'issuingDateFormattedDate',
  673. key: 'issuingDateFormattedDate'
  674. }, {
  675. title: '到期日',
  676. dataIndex: 'issuingDate',
  677. key: 'issuingDate',
  678. render: (text) => { return getTime(text, 36) }
  679. }, {
  680. title: '负责人',
  681. dataIndex: 'consultant',
  682. key: 'consultant'
  683. }
  684. ],
  685. dataSource: []
  686. };
  687. },
  688. componentWillMount() {
  689. this.loadData();
  690. },
  691. tableRowClick(record, index) {
  692. this.state.RowData = record;
  693. this.setState({
  694. showDesc: true
  695. });
  696. },
  697. addClick() {
  698. this.setState({
  699. showAdd: true
  700. });
  701. },
  702. // delectRow() {
  703. // let deletedIds = [];
  704. // for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  705. // let rowItem = this.state.selectedRows[idx];
  706. // if (rowItem.id) {
  707. // deletedIds.push(rowItem.id)
  708. // }
  709. // }
  710. // this.setState({
  711. // selectedRowKeys: [],
  712. // loading: deletedIds.length > 0
  713. // });
  714. // $.ajax({
  715. // method: "POST",
  716. // dataType: "json",
  717. // crossDomain: false,
  718. // url: globalConfig.context + "/api/user/cognizance/deleteTechProduct",
  719. // data: {
  720. // ids: deletedIds
  721. // }
  722. // }).done(function (data) {
  723. // if (!data.error.length) {
  724. // message.success('保存成功!');
  725. // this.setState({
  726. // loading: false,
  727. // });
  728. // } else {
  729. // message.warning(data.error[0].message);
  730. // };
  731. // this.loadData();
  732. // }.bind(this));
  733. // },
  734. closeDesc(e, s) {
  735. this.state.showDesc = e;
  736. if (s) {
  737. this.loadData();
  738. };
  739. },
  740. closeAdd(e, s) {
  741. this.state.showAdd = e;
  742. if (s) {
  743. this.loadData();
  744. };
  745. },
  746. // search() {
  747. // this.loadData();
  748. // },
  749. // reset() {
  750. // this.loadData();
  751. // },
  752. render() {
  753. const rowSelection = {
  754. selectedRowKeys: this.state.selectedRowKeys,
  755. onChange: (selectedRowKeys, selectedRows) => {
  756. this.setState({
  757. selectedRows: selectedRows,
  758. selectedRowKeys: selectedRowKeys
  759. });
  760. }
  761. };
  762. const hasSelected = this.state.selectedRowKeys.length > 0;
  763. return (
  764. <div className="user-content" >
  765. <div className="content-title">
  766. <span>高企申请管理</span>
  767. </div>
  768. <div className="user-search">
  769. <p>
  770. <Button style={{ background: "#3fcf9e", border: "none", color: "#fff", display: 'none' }}
  771. disabled={!hasSelected}
  772. onClick={this.delectRow}>删除<Icon type="minus" /></Button>
  773. </p>
  774. </div>
  775. <div className="patent-table">
  776. <Spin spinning={this.state.loading}>
  777. <Table columns={this.state.columns}
  778. dataSource={this.state.dataSource}
  779. pagination={this.state.pagination}
  780. //rowSelection={rowSelection}
  781. onRowClick={this.tableRowClick} />
  782. </Spin>
  783. </div>
  784. <CognizanceDesc
  785. data={this.state.RowData}
  786. contactsOption={this.state.contactsOption}
  787. showDesc={this.state.showDesc}
  788. closeDesc={this.closeDesc} />
  789. <CognizanceAdd
  790. contactsOption={this.state.contactsOption}
  791. showAdd={this.state.showAdd}
  792. closeAdd={this.closeAdd} />
  793. </div >
  794. );
  795. }
  796. });
  797. export default Cognizance;
  798. // <Button style={{ background: "#ea0862", border: "none", color: "#fff", float: "right" }}
  799. // disabled={this.state.ButtonDisabled}
  800. // onClick={this.addClick}>申请高企认定<Icon type="plus" /></Button>