transferRecords.jsx 5.4 KB

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