zhuanjiaoDetail.jsx 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. loading: 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. width={600}
  97. destroyOnClose={true}
  98. >
  99. <Spin spinning={this.state.loading} >
  100. <Table
  101. columns={this.state.colunmn}
  102. dataSource={this.state.dataSource}
  103. pagination={false}
  104. scroll={{ x: "max-content", y: 0 }}
  105. bordered
  106. size="small"
  107. />
  108. </Spin>
  109. </Modal>
  110. );
  111. },
  112. });
  113. export default ZhuanjiaoDetail;