viplogs.jsx 2.9 KB

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