reminderLog.jsx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import React,{Component} from "react";
  2. import {message, Modal, Table} from "antd";
  3. import $ from "jquery/src/ajax";
  4. class ReminderLog extends Component{
  5. constructor(props) {
  6. super(props);
  7. this.state={
  8. dataSource:[],
  9. columns:[],
  10. }
  11. this.loadData = this.loadData.bind(this);
  12. }
  13. componentDidMount() {
  14. this.loadData();
  15. }
  16. loadData() {
  17. this.setState({
  18. loading: true,
  19. });
  20. $.ajax({
  21. method: "get",
  22. dataType: "json",
  23. crossDomain: false,
  24. url: globalConfig.context + "/api/admin/company/selectPaymentList",
  25. data: {},
  26. success: function (data) {
  27. if(data.error.length === 0){
  28. this.setState({
  29. columns: [],
  30. });
  31. }else{
  32. message.warning(data.error[0].message);
  33. }
  34. }.bind(this),
  35. }).always(
  36. function () {
  37. this.setState({
  38. loading: false,
  39. });
  40. }.bind(this)
  41. );
  42. }
  43. render() {
  44. return (
  45. this.props.visible ? <Modal
  46. title='提醒日志'
  47. className='payRecordComponent'
  48. width={800}
  49. maskClosable={false}
  50. footer={null}
  51. visible={this.props.visible}
  52. onCancel={this.props.onCancel}
  53. >
  54. <Table
  55. columns={this.state.columns}
  56. dataSource={this.state.dataSource}
  57. pagination={false}
  58. bordered
  59. size="small"
  60. />
  61. </Modal> : null
  62. );
  63. }
  64. }
  65. export default ReminderLog;