zhuanjiaoDetail.jsx 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. // 0录入 1 领取 2 转交客户 3转交业务 4 未跟进丢失(30) 5未签单丢失(270天) 6移除
  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. }
  46. </span>
  47. )
  48. }
  49. },
  50. {
  51. title: "项目名称",
  52. dataIndex: "pName",
  53. key: "pName",
  54. },
  55. {
  56. title: "创建时间",
  57. dataIndex: "createDate",
  58. key: "createDate",
  59. },
  60. ]
  61. };
  62. },
  63. loadData() {
  64. this.setState({
  65. loading: true
  66. });
  67. $.ajax({
  68. method: "get",
  69. dataType: "json",
  70. crossDomain: false,
  71. url: globalConfig.context + "/api/admin/customer/transferList",
  72. data: {
  73. uid: this.props.id,
  74. },
  75. success: function (data) {
  76. if (data.error.length || data.data.list == "") {
  77. if (data.error && data.error.length) {
  78. message.warning(data.error[0].message);
  79. }
  80. } else {
  81. this.setState({
  82. dataSource: data.data,
  83. });
  84. }
  85. }.bind(this),
  86. }).always(
  87. function () {
  88. this.setState({
  89. loading: false,
  90. });
  91. }.bind(this)
  92. );
  93. },
  94. componentWillMount() {
  95. this.loadData()
  96. },
  97. render() {
  98. return (
  99. <Modal
  100. style={{ position: "relative" }}
  101. title="转交记录"
  102. visible={this.props.visible}
  103. onCancel={this.props.cancel}
  104. footer={null}
  105. width={800}
  106. destroyOnClose={true}
  107. >
  108. <Spin spinning={this.state.loading} >
  109. <Table
  110. columns={this.state.colunmn}
  111. dataSource={this.state.dataSource}
  112. pagination={false}
  113. scroll={{ x: "max-content", y: 0 }}
  114. bordered
  115. size="small"
  116. />
  117. </Spin>
  118. </Modal>
  119. );
  120. },
  121. });
  122. export default ZhuanjiaoDetail;