viplogs.jsx 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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 VipLogs extends Component {
  7. constructor(props) {
  8. super(props);
  9. this.state = {
  10. visible: false,
  11. columnsDate: [
  12. {
  13. title: "操作人",
  14. dataIndex: "aname",
  15. key: "aname",
  16. width: 150,
  17. },
  18. {
  19. title: "操作",
  20. dataIndex: "status",
  21. key: "status",
  22. width: 110,
  23. render: (text, record) => {
  24. return (
  25. <div>
  26. {["发起", "通过", "拒绝", "完成",][text]}
  27. </div>
  28. );
  29. },
  30. },
  31. {
  32. title: "操作时间",
  33. dataIndex: "createTimes",
  34. key: "createTimes",
  35. width: 150,
  36. },
  37. {
  38. title: "备注",
  39. dataIndex: "remarks",
  40. key: "remarks",
  41. },
  42. ],
  43. recordData: [],
  44. };
  45. }
  46. componentDidMount() { }
  47. getData() {
  48. $.ajax({
  49. method: "get",
  50. dataType: "json",
  51. crossDomain: false,
  52. url: globalConfig.context + "/api/admin/orderProject/memberLog",
  53. data: {
  54. id: this.props.id,
  55. },
  56. success: function (data) {
  57. ShowModal(this);
  58. let theArr = [];
  59. if (!data.data) {
  60. if (data.error && data.error.length) {
  61. message.warning(data.error[0].message);
  62. }
  63. } else {
  64. this.setState({
  65. recordData: data.data,
  66. });
  67. }
  68. }.bind(this),
  69. }).always(
  70. function () {
  71. this.setState({
  72. loading: false,
  73. });
  74. }.bind(this)
  75. );
  76. }
  77. render() {
  78. return (
  79. <span>
  80. <Button
  81. type="primary"
  82. onClick={(e) => {
  83. e.stopPropagation();
  84. this.getData();
  85. this.setState({
  86. visible: true,
  87. })
  88. }}
  89. style={{ marginLeft: "10px" }}
  90. >
  91. 日志
  92. </Button>
  93. <Modal
  94. maskClosable={false}
  95. visible={this.state.visible}
  96. footer=""
  97. title="会员审批日志"
  98. className="admin-desc-content"
  99. width="800px"
  100. onCancel={(e) => {
  101. this.setState({
  102. visible: false,
  103. });
  104. }}
  105. style={{ zIndex: 10 }}
  106. >
  107. <Spin spinning={this.state.loading}>
  108. <div className="patent-table">
  109. <Table
  110. columns={this.state.columnsDate}
  111. dataSource={this.state.recordData || []}
  112. pagination={false}
  113. />
  114. </div>
  115. </Spin>
  116. </Modal>
  117. </span>
  118. );
  119. }
  120. }
  121. export default VipLogs;