index.jsx 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. // 开票历史记录--日志弹窗
  2. import React, { Component } from "react";
  3. import { Button, message, Modal, Spin, Table } from "antd";
  4. import { ShowModal } from "../../tools";
  5. import $ from "jquery/src/ajax";
  6. class LogPopup extends Component {
  7. constructor(props) {
  8. super(props);
  9. this.state = {
  10. visible: false,
  11. columnsDate: [
  12. {
  13. title: "编号",
  14. dataIndex: "id",
  15. key: "id",
  16. },
  17. {
  18. title: "操作人",
  19. dataIndex: "adminName",
  20. key: "adminName",
  21. },
  22. {
  23. title: "操作时间",
  24. dataIndex: "createTimes",
  25. key: "createTimes",
  26. },
  27. {
  28. title: "操作",
  29. dataIndex: "status",
  30. key: "status",
  31. render: (text, record) => {
  32. return (
  33. <div>
  34. {
  35. [
  36. "发起",
  37. "开票通过",
  38. "开票拒绝",
  39. "特批通过",
  40. "特批拒绝",
  41. "修改提交",
  42. ][text]
  43. }
  44. </div>
  45. );
  46. },
  47. },
  48. ],
  49. recordData: [],
  50. };
  51. }
  52. componentDidMount() {}
  53. getData() {
  54. $.ajax({
  55. method: "get",
  56. dataType: "json",
  57. crossDomain: false,
  58. url: globalConfig.context + "/api/admin/orderInvoice/invoice/log",
  59. data: {
  60. id: this.props.id,
  61. },
  62. success: function (data) {
  63. ShowModal(this);
  64. let theArr = [];
  65. if (!data.data) {
  66. if (data.error && data.error.length) {
  67. message.warning(data.error[0].message);
  68. }
  69. } else {
  70. this.setState({
  71. recordData: data.data,
  72. });
  73. }
  74. }.bind(this),
  75. }).always(
  76. function () {
  77. this.setState({
  78. loading: false,
  79. });
  80. }.bind(this)
  81. );
  82. }
  83. render() {
  84. return (
  85. <span>
  86. <Button
  87. type="primary"
  88. onClick={(e) => {
  89. e.stopPropagation();
  90. this.getData();
  91. this.setState({
  92. visible: true,
  93. })
  94. }}
  95. style={{ marginLeft: "10px" }}
  96. >
  97. 日志
  98. </Button>
  99. <Modal
  100. maskClosable={false}
  101. visible={this.state.visible}
  102. footer=""
  103. title="开票日志"
  104. className="admin-desc-content"
  105. width="600px"
  106. onCancel={(e) => {
  107. this.setState({
  108. visible: false,
  109. });
  110. }}
  111. style={{ zIndex: 10 }}
  112. >
  113. <Spin spinning={this.state.loading}>
  114. <div className="patent-table">
  115. <Table
  116. columns={this.state.columnsDate}
  117. dataSource={this.state.recordData || []}
  118. pagination={false}
  119. />
  120. </div>
  121. </Spin>
  122. </Modal>
  123. </span>
  124. );
  125. }
  126. }
  127. export default LogPopup;