channellog.jsx 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. import React from "react";
  2. import { Spin, Button, Tabs, Table, message, Modal, Tooltip } from "antd";
  3. import $ from "jquery/src/ajax";
  4. import { getTransferType } from "@/tools.js";
  5. const ChannelLog = React.createClass({
  6. getInitialState() {
  7. return {
  8. loading: false,
  9. colunmn: [
  10. {
  11. title: "序号",
  12. dataIndex: "id",
  13. key: "id",
  14. },
  15. {
  16. title: "渠道名称",
  17. dataIndex: "userName",
  18. key: "userName",
  19. },
  20. {
  21. title: "管理员",
  22. dataIndex: "usedAName",
  23. key: "usedAName",
  24. },
  25. {
  26. title: "现管理员",
  27. dataIndex: "newAName",
  28. key: "newAName",
  29. },
  30. // 0录入 1 领取 2 转交私有客户 3转交业务 4 未跟进丢失(30) 5未签单丢失(270天)6移除 7转交签单客户 8外联录入 9外联客户分配 10 外联客户转交 11外联释放 12 回收 13离职转交 14 离职签单业务转交
  31. {
  32. title: "转交类型",
  33. dataIndex: "type",
  34. key: "type",
  35. render: (text) => {
  36. return <span>{getTransferType(text)}</span>;
  37. },
  38. },
  39. {
  40. title: "项目名称",
  41. dataIndex: "pName",
  42. key: "pName",
  43. },
  44. {
  45. title: "创建时间",
  46. dataIndex: "createDate",
  47. key: "createDate",
  48. },
  49. {
  50. title: "备注",
  51. dataIndex: "remarks",
  52. key: "remarks",
  53. render: (text) => {
  54. return (
  55. <Tooltip placement="topLeft" title={text}>
  56. <div
  57. style={{
  58. maxWidth: "150px",
  59. overflow: "hidden",
  60. textOverflow: "ellipsis",
  61. whiteSpace: "nowrap",
  62. }}
  63. >
  64. {text}
  65. </div>
  66. </Tooltip>
  67. );
  68. },
  69. },
  70. ],
  71. };
  72. },
  73. loadData() {
  74. this.setState({
  75. loading: true,
  76. });
  77. $.ajax({
  78. method: "get",
  79. dataType: "json",
  80. crossDomain: false,
  81. url: globalConfig.context + "/api/admin/customer/transferList",
  82. data: {
  83. uid: this.props.id,
  84. },
  85. success: function (data) {
  86. if (data.error.length || data.data.list == "") {
  87. if (data.error && data.error.length) {
  88. message.warning(data.error[0].message);
  89. }
  90. } else {
  91. this.setState({
  92. dataSource: data.data,
  93. });
  94. }
  95. }.bind(this),
  96. }).always(
  97. function () {
  98. this.setState({
  99. loading: false,
  100. });
  101. }.bind(this)
  102. );
  103. },
  104. componentWillMount() {
  105. this.loadData();
  106. },
  107. render() {
  108. return (
  109. <Modal
  110. style={{ position: "relative" }}
  111. title="转交记录"
  112. visible={this.props.visible == "channellog"}
  113. onCancel={this.props.cancel}
  114. footer={null}
  115. width={800}
  116. destroyOnClose={true}
  117. >
  118. <Spin spinning={this.state.loading}>
  119. <Table
  120. columns={this.state.colunmn}
  121. dataSource={this.state.dataSource}
  122. pagination={false}
  123. scroll={{ x: "max-content", y: 0 }}
  124. bordered
  125. size="small"
  126. />
  127. </Spin>
  128. </Modal>
  129. );
  130. },
  131. });
  132. export default ChannelLog;