intentionDetail.jsx 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. import React from 'react';
  2. import {Modal,Tabs } from 'antd';
  3. const TabPane = Tabs.TabPane;
  4. import Basic from './detail/basic.jsx';
  5. import ajax from 'jquery/src/ajax/xhr.js';
  6. import $ from 'jquery/src/ajax';
  7. import ContactPerson from './detail/contactPerson.jsx'; //联系人
  8. import Account from './detail/account.jsx'; //账户信息
  9. import Visit from './detail/visit.jsx';
  10. import Business from './detail/business.jsx';
  11. import LockBusiness from './detail/lockBusiness.jsx';
  12. import BasicPerson from './detail/basicPerson.jsx';//基本信息
  13. const IntentionDetail = React.createClass({
  14. getInitialState(){
  15. return{
  16. modalVisible:false,
  17. switchState:false,
  18. contactData:[],
  19. contactState:true,
  20. IntentionState:false,
  21. businessState:false,
  22. visitState:false,
  23. accountState:false,
  24. basicState:false
  25. }
  26. },
  27. detailsModal(){
  28. this.setState({
  29. basicState:false,
  30. modalVisible:false,
  31. callnub:1,
  32. });
  33. this.props.closeDesc(false,false);
  34. },
  35. //详情tab切换数据处理
  36. callback(e) {
  37. if(e == '1') {
  38. this.setState({
  39. IntentionState:true,
  40. contactState:false,
  41. accountState:false,
  42. visitState:false,
  43. businessState:false,
  44. basicState:true
  45. })
  46. }
  47. if(e == '2') {
  48. this.setState({
  49. IntentionState:false,
  50. contactState:true,
  51. accountState:false,
  52. visitState:false,
  53. businessState:false,
  54. basicState:false
  55. })
  56. }
  57. // if(e == '3') {
  58. // this.setState({
  59. // IntentionState:false,
  60. // contactState:false,
  61. // accountState:true,
  62. // visitState:false,
  63. // businessState:false,
  64. // basicState:false
  65. // })
  66. // }
  67. if(e == '4') {
  68. this.setState({
  69. IntentionState:false,
  70. contactState:false,
  71. accountState:false,
  72. visitState:true,
  73. businessState:false,
  74. basicState:false
  75. })
  76. }
  77. if(e == '5') {
  78. this.setState({
  79. IntentionState:false,
  80. contactState:false,
  81. accountState:false,
  82. visitState:false,
  83. businessState:true,
  84. basicState:false
  85. })
  86. }
  87. this.setState({
  88. callnub: e,
  89. })
  90. },
  91. //取消函数
  92. closeDetail(e,s){
  93. this.setState({
  94. basicState:false,
  95. //contactState:true,
  96. modalVisible:e,
  97. })
  98. // if(s){
  99. // this.props.closeDesc(false,true)
  100. // }
  101. },
  102. componentWillReceiveProps(nextProps) {
  103. if(nextProps.modalVisible && nextProps.IntentionData.id) {
  104. this.setState({
  105. modalVisible:true,
  106. callnub:this.props.defaultActiveKey ? String(this.props.defaultActiveKey) : (this.props.detailApi.indexOf('Organization'))>0?"2":'1',
  107. })
  108. };
  109. this.setState({
  110. basicState:nextProps.basicState,
  111. contactState:nextProps.contactState,
  112. })
  113. },
  114. render(){
  115. return (
  116. <div>
  117. {this.state.modalVisible ? <Modal
  118. className="customeDetails"
  119. title="签单客户详情"
  120. width="1300px"
  121. visible={this.state.modalVisible}
  122. onOk={this.detailsModal}
  123. onCancel={this.detailsModal}
  124. footer=""
  125. >
  126. <Tabs onChange={this.callback} activeKey={this.state.callnub}>
  127. {this.props.detailApi.indexOf("Organization") > 0 ? (
  128. ""
  129. ) : (
  130. <TabPane tab="基本信息" key="1">
  131. <BasicPerson
  132. detailApi={this.props.detailApi}
  133. closeDetail={this.closeDetail}
  134. data={this.props.IntentionData}
  135. IntentionState={this.state.IntentionState}
  136. basicState={this.state.basicState}
  137. />
  138. </TabPane>
  139. )}
  140. <TabPane tab="联系人信息" key="2">
  141. <ContactPerson
  142. closeDetail={this.closeDetail}
  143. name={this.props.name}
  144. data={this.props.IntentionData}
  145. contactState={this.state.contactState}
  146. />
  147. </TabPane>
  148. {/*<TabPane tab="账户信息" key="3">*/}
  149. {/* <Account*/}
  150. {/* closeDetail={this.closeDetail}*/}
  151. {/* data={this.props.IntentionData}*/}
  152. {/* accountState={this.state.accountState}*/}
  153. {/* />*/}
  154. {/*</TabPane>*/}
  155. <TabPane tab="客户跟进" key="4">
  156. <Visit
  157. loadData={this.props.loadData}
  158. closeDetail={this.closeDetail}
  159. data={this.props.IntentionData}
  160. visitState={this.state.visitState}
  161. />
  162. </TabPane>
  163. <TabPane tab="业务意向" key="5">
  164. <Business
  165. closeDesc={this.props.closeDesc}
  166. closeDetail={this.closeDetail}
  167. data={this.props.IntentionData}
  168. businessState={this.state.businessState}
  169. />
  170. </TabPane>
  171. <TabPane tab="锁定业务" key="6">
  172. {
  173. this.state.callnub === '6' ?
  174. <LockBusiness uid={this.props.IntentionData && this.props.IntentionData.uid} id={this.props.IntentionData && this.props.IntentionData.id}/> :
  175. <div/>
  176. }
  177. </TabPane>
  178. {/*
  179. <TabPane tab="业务订单" key="6">
  180. </TabPane>
  181. <TabPane tab="技术需求" key="7">
  182. </TabPane>
  183. <TabPane tab="技术成果" key="8">
  184. </TabPane>
  185. <TabPane tab="技术专家" key="9">
  186. </TabPane>
  187. */}
  188. </Tabs>
  189. </Modal> : <div/>}
  190. </div>
  191. );
  192. }
  193. })
  194. export default IntentionDetail;