channeldetail.jsx 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. import React from "react";
  2. import { Modal, Tabs } from "antd";
  3. const TabPane = Tabs.TabPane;
  4. import ajax from "jquery/src/ajax/xhr.js";
  5. import $ from "jquery/src/ajax";
  6. import ContactPerson from "./detail/contactPerson"; //联系人
  7. import Visit from './detail/visit';
  8. const ChannelDetail = React.createClass({
  9. getInitialState() {
  10. return {
  11. modalVisible: false,
  12. switchState: false,
  13. contactData: [],
  14. contactState: true,
  15. IntentionState: false,
  16. businessState: false,
  17. visitState: false,
  18. accountState: false,
  19. basicState: false,
  20. };
  21. },
  22. detailsModal() {
  23. this.setState({
  24. basicState: false,
  25. modalVisible: false,
  26. });
  27. this.props.closeDesc(false, true);
  28. },
  29. //详情tab切换数据处理
  30. callback(e) {
  31. if (e == "1") {
  32. this.setState({
  33. IntentionState: true,
  34. contactState: false,
  35. accountState: false,
  36. visitState: false,
  37. businessState: false,
  38. basicState: true,
  39. });
  40. }
  41. if (e == "2") {
  42. this.setState({
  43. IntentionState: false,
  44. contactState: true,
  45. accountState: false,
  46. visitState: false,
  47. businessState: false,
  48. basicState: false,
  49. });
  50. }
  51. if (e == "4") {
  52. this.setState({
  53. IntentionState: false,
  54. contactState: false,
  55. accountState: false,
  56. visitState: true,
  57. businessState: false,
  58. basicState: false,
  59. });
  60. }
  61. if (e == "5") {
  62. this.setState({
  63. IntentionState: false,
  64. contactState: false,
  65. accountState: false,
  66. visitState: false,
  67. businessState: true,
  68. basicState: false,
  69. });
  70. }
  71. this.setState({
  72. callnub: e,
  73. });
  74. },
  75. //取消函数
  76. closeDetail(e, s) {
  77. this.setState({
  78. basicState: false,
  79. modalVisible: e,
  80. });
  81. if (s) {
  82. this.props.closeDesc(false, true);
  83. }
  84. },
  85. componentWillReceiveProps(nextProps) {
  86. },
  87. render() {
  88. return (
  89. <div>
  90. <Modal
  91. className="customeDetails"
  92. title="渠道详情"
  93. width="1800px"
  94. visible={this.props.visible == "detail"}
  95. onCancel={this.props.cancel}
  96. footer=""
  97. >
  98. <Tabs defaultActiveKey="1">
  99. <TabPane tab="联系人信息" key="1">
  100. <ContactPerson
  101. isCustomerAdmin={this.props.isCustomerAdmin}
  102. closeDetail={this.closeDetail}
  103. name={this.props.IntentionData.name}
  104. data={this.props.IntentionData}
  105. // contactState={this.state.contactState}
  106. />
  107. </TabPane>
  108. <TabPane tab="渠道跟进" key="2">
  109. <Visit
  110. categoryArr={this.props.categoryArr}
  111. closeDetail={this.closeDetail}
  112. data={this.props.IntentionData}
  113. // visitState={this.state.visitState}
  114. />
  115. </TabPane>
  116. </Tabs>
  117. </Modal>
  118. </div>
  119. );
  120. },
  121. });
  122. export default ChannelDetail;