zhuanjiaoDetail.jsx 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. import React from "react";
  2. import { Spin, Button, Tabs, Table, message, Modal } from "antd";
  3. import $ from "jquery/src/ajax";
  4. const ZhuanjiaoDetail = React.createClass({
  5. getInitialState() {
  6. return {
  7. newVisible: false,
  8. colunmn: [
  9. {
  10. title: "序号",
  11. dataIndex: "id",
  12. key: "id",
  13. },
  14. {
  15. title: "客户姓名",
  16. dataIndex: "userName",
  17. key: "userName",
  18. },
  19. {
  20. title: "原管理员",
  21. dataIndex: "usedAName",
  22. key: "usedAName",
  23. },
  24. {
  25. title: "现管理员",
  26. dataIndex: "newAName",
  27. key: "newAName",
  28. },
  29. {
  30. title: "转交类型",
  31. dataIndex: "type",
  32. key: "type",
  33. render: text => {
  34. if(text == 1) {
  35. return "项目转交"
  36. }else {
  37. return "客户转交"
  38. }
  39. }
  40. },
  41. {
  42. title: "项目名称",
  43. dataIndex: "pName",
  44. key: "pName",
  45. },
  46. {
  47. title: "创建时间",
  48. dataIndex: "createDate",
  49. key: "createDate",
  50. },
  51. ]
  52. };
  53. },
  54. loadData() {
  55. this.setState({
  56. loading: true
  57. });
  58. $.ajax({
  59. method: "get",
  60. dataType: "json",
  61. crossDomain: false,
  62. url: globalConfig.context + "/api/admin/customer/transferList",
  63. data: {
  64. uid: this.props.id,
  65. },
  66. success: function (data) {
  67. if (data.error.length || data.data.list == "") {
  68. if (data.error && data.error.length) {
  69. message.warning(data.error[0].message);
  70. }
  71. } else {
  72. this.setState({
  73. dataSource: data.data,
  74. });
  75. }
  76. }.bind(this),
  77. }).always(
  78. function () {
  79. this.setState({
  80. loading: false,
  81. });
  82. }.bind(this)
  83. );
  84. },
  85. componentWillMount() {
  86. this.loadData()
  87. },
  88. render() {
  89. return (
  90. <Modal
  91. style={{ position: "relative" }}
  92. title="转交记录"
  93. visible={this.props.visible}
  94. onCancel={this.props.cancel}
  95. footer={null}
  96. destroyOnClose={true}
  97. >
  98. <Table
  99. columns={this.state.colunmn}
  100. dataSource={this.state.dataSource}
  101. pagination={false}
  102. scroll={{ x: "max-content", y: 0 }}
  103. bordered
  104. size="small"
  105. />
  106. </Modal>
  107. );
  108. },
  109. });
  110. export default ZhuanjiaoDetail;