transferRecords.jsx 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. import React from "react";
  2. import { Spin, Table, message, Modal } 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. };
  68. },
  69. loadData() {
  70. this.setState({
  71. loading: true
  72. });
  73. $.ajax({
  74. method: "get",
  75. dataType: "json",
  76. crossDomain: false,
  77. url: globalConfig.context + "/api/admin/customer/transferList",
  78. data: {
  79. uid: this.props.id,
  80. },
  81. success: function (data) {
  82. if (data.error.length || data.data.list == "") {
  83. if (data.error && data.error.length) {
  84. message.warning(data.error[0].message);
  85. }
  86. } else {
  87. this.setState({
  88. dataSource: data.data,
  89. });
  90. }
  91. }.bind(this),
  92. }).always(
  93. function () {
  94. this.setState({
  95. loading: false,
  96. });
  97. }.bind(this)
  98. );
  99. },
  100. componentWillMount() {
  101. this.loadData()
  102. },
  103. render() {
  104. return (
  105. <Modal
  106. style={{ position: "relative" }}
  107. title="转交记录"
  108. visible={this.props.visible}
  109. onCancel={this.props.cancel}
  110. footer={null}
  111. width={800}
  112. destroyOnClose={true}
  113. >
  114. <Spin spinning={this.state.loading} >
  115. <Table
  116. columns={this.state.colunmn}
  117. dataSource={this.state.dataSource}
  118. pagination={false}
  119. scroll={{ x: "max-content", y: 0 }}
  120. bordered
  121. size="small"
  122. />
  123. </Spin>
  124. </Modal>
  125. );
  126. },
  127. });
  128. export default TransferRecords;