transferRecords.jsx 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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渠道释放 12 回收 13离职转交
  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. text === 13 ? '离职转交' :""
  52. }
  53. </span>
  54. )
  55. }
  56. },
  57. {
  58. title: "项目名称",
  59. dataIndex: "pName",
  60. key: "pName",
  61. },
  62. {
  63. title: "创建时间",
  64. dataIndex: "createDate",
  65. key: "createDate",
  66. },
  67. {
  68. title: "备注",
  69. dataIndex: "remarks",
  70. key: "remarks",
  71. render: (text) => {
  72. return (
  73. <Tooltip placement="topLeft" title={text}>
  74. <div style={{
  75. maxWidth:'150px',
  76. overflow:'hidden',
  77. textOverflow: "ellipsis",
  78. whiteSpace:'nowrap',
  79. }}>{text}</div>
  80. </Tooltip>
  81. )
  82. }
  83. },
  84. ]
  85. };
  86. },
  87. loadData() {
  88. this.setState({
  89. loading: true
  90. });
  91. $.ajax({
  92. method: "get",
  93. dataType: "json",
  94. crossDomain: false,
  95. url: globalConfig.context + "/api/admin/customer/transferList",
  96. data: {
  97. uid: this.props.id,
  98. },
  99. success: function (data) {
  100. if (data.error.length || data.data.list == "") {
  101. if (data.error && data.error.length) {
  102. message.warning(data.error[0].message);
  103. }
  104. } else {
  105. this.setState({
  106. dataSource: data.data,
  107. });
  108. }
  109. }.bind(this),
  110. }).always(
  111. function () {
  112. this.setState({
  113. loading: false,
  114. });
  115. }.bind(this)
  116. );
  117. },
  118. componentWillMount() {
  119. this.loadData()
  120. },
  121. render() {
  122. return (
  123. <Modal
  124. style={{ position: "relative" }}
  125. // title={this.props.type === 1 ? '转交记录' : this.props.type === 2 ? '回收记录' : '分配记录'}
  126. title='日志'
  127. visible={this.props.visible}
  128. onCancel={this.props.cancel}
  129. footer={null}
  130. width={800}
  131. destroyOnClose={true}
  132. >
  133. <Spin spinning={this.state.loading} >
  134. <Table
  135. columns={this.state.colunmn}
  136. dataSource={this.state.dataSource}
  137. pagination={false}
  138. scroll={{ x: "max-content", y: 0 }}
  139. bordered
  140. size="small"
  141. />
  142. </Spin>
  143. </Modal>
  144. );
  145. },
  146. });
  147. export default TransferRecords;