|
@@ -1,5 +1,5 @@
|
|
|
import React from 'react';
|
|
|
-import {Modal,Tabs } from 'antd';
|
|
|
+import { Modal, Tabs } from 'antd';
|
|
|
const TabPane = Tabs.TabPane;
|
|
|
import Basic from './detail/basic.jsx';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
@@ -11,46 +11,46 @@ import Business from './detail/business.jsx';
|
|
|
import BasicPerson from './detail/basicPerson.jsx';
|
|
|
|
|
|
const IntentionDetail = React.createClass({
|
|
|
- getInitialState(){
|
|
|
- return{
|
|
|
- modalVisible:false,
|
|
|
- switchState:false,
|
|
|
- contactData:[],
|
|
|
- contactState:true,
|
|
|
- IntentionState:false,
|
|
|
- businessState:false,
|
|
|
- visitState:false,
|
|
|
- accountState:false,
|
|
|
- basicState:false
|
|
|
+ getInitialState() {
|
|
|
+ return {
|
|
|
+ modalVisible: false,
|
|
|
+ switchState: false,
|
|
|
+ contactData: [],
|
|
|
+ contactState: true,
|
|
|
+ IntentionState: false,
|
|
|
+ businessState: false,
|
|
|
+ visitState: false,
|
|
|
+ accountState: false,
|
|
|
+ basicState: false
|
|
|
}
|
|
|
},
|
|
|
- detailsModal(){
|
|
|
+ detailsModal() {
|
|
|
this.setState({
|
|
|
- basicState:false,
|
|
|
- modalVisible:false
|
|
|
+ basicState: false,
|
|
|
+ modalVisible: false
|
|
|
})
|
|
|
- this.props.closeDesc(false,true)
|
|
|
+ this.props.closeDesc(false, true)
|
|
|
},
|
|
|
//详情tab切换数据处理
|
|
|
callback(e) {
|
|
|
- if(e == '1') {
|
|
|
+ if (e == '1') {
|
|
|
this.setState({
|
|
|
- IntentionState:true,
|
|
|
- contactState:false,
|
|
|
- accountState:false,
|
|
|
- visitState:false,
|
|
|
- businessState:false,
|
|
|
- basicState:true
|
|
|
+ IntentionState: true,
|
|
|
+ contactState: false,
|
|
|
+ accountState: false,
|
|
|
+ visitState: false,
|
|
|
+ businessState: false,
|
|
|
+ basicState: true
|
|
|
})
|
|
|
}
|
|
|
- if(e == '2') {
|
|
|
+ if (e == '2') {
|
|
|
this.setState({
|
|
|
- IntentionState:false,
|
|
|
- contactState:true,
|
|
|
- accountState:false,
|
|
|
- visitState:false,
|
|
|
- businessState:false,
|
|
|
- basicState:false
|
|
|
+ IntentionState: false,
|
|
|
+ contactState: true,
|
|
|
+ accountState: false,
|
|
|
+ visitState: false,
|
|
|
+ businessState: false,
|
|
|
+ basicState: false
|
|
|
})
|
|
|
}
|
|
|
// if(e == '3') {
|
|
@@ -63,24 +63,24 @@ const IntentionDetail = React.createClass({
|
|
|
// basicState:false
|
|
|
// })
|
|
|
// }
|
|
|
- if(e == '4') {
|
|
|
+ if (e == '4') {
|
|
|
this.setState({
|
|
|
- IntentionState:false,
|
|
|
- contactState:false,
|
|
|
- accountState:false,
|
|
|
- visitState:true,
|
|
|
- businessState:false,
|
|
|
- basicState:false
|
|
|
+ IntentionState: false,
|
|
|
+ contactState: false,
|
|
|
+ accountState: false,
|
|
|
+ visitState: true,
|
|
|
+ businessState: false,
|
|
|
+ basicState: false
|
|
|
})
|
|
|
}
|
|
|
- if(e == '5') {
|
|
|
+ if (e == '5') {
|
|
|
this.setState({
|
|
|
- IntentionState:false,
|
|
|
- contactState:false,
|
|
|
- accountState:false,
|
|
|
- visitState:false,
|
|
|
- businessState:true,
|
|
|
- basicState:false
|
|
|
+ IntentionState: false,
|
|
|
+ contactState: false,
|
|
|
+ accountState: false,
|
|
|
+ visitState: false,
|
|
|
+ businessState: true,
|
|
|
+ basicState: false
|
|
|
})
|
|
|
}
|
|
|
this.setState({
|
|
@@ -88,87 +88,87 @@ const IntentionDetail = React.createClass({
|
|
|
})
|
|
|
},
|
|
|
//取消函数
|
|
|
- closeDetail(e,s){
|
|
|
+ closeDetail(e, s) {
|
|
|
this.setState({
|
|
|
- basicState:false,
|
|
|
- modalVisible:e,
|
|
|
+ basicState: false,
|
|
|
+ modalVisible: e,
|
|
|
})
|
|
|
- if(s){
|
|
|
- this.props.closeDesc(false,true)
|
|
|
+ if (s) {
|
|
|
+ this.props.closeDesc(false, true)
|
|
|
}
|
|
|
},
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
- if(nextProps.modalVisible && nextProps.IntentionData.id) {
|
|
|
+ if (nextProps.modalVisible && nextProps.IntentionData.id) {
|
|
|
this.setState({
|
|
|
- modalVisible:true,
|
|
|
- callnub:this.props.isCustomerAdmin ? '2' : (nextProps.isGuidanceLv ? (nextProps.tabsKey ? nextProps.tabsKey : "4") : (nextProps.tabsKey ? nextProps.tabsKey : (nextProps.detailApi.indexOf('Organization'))>0?"2":'1')),
|
|
|
+ modalVisible: true,
|
|
|
+ callnub: this.props.isCustomerAdmin ? '2' : (nextProps.isGuidanceLv ? (nextProps.tabsKey ? nextProps.tabsKey : "4") : (nextProps.tabsKey ? nextProps.tabsKey : (nextProps.detailApi.indexOf('Organization')) > 0 ? "2" : '1')),
|
|
|
})
|
|
|
};
|
|
|
this.setState({
|
|
|
- basicState:nextProps.basicState,
|
|
|
- contactState:nextProps.contactState,
|
|
|
+ basicState: nextProps.basicState,
|
|
|
+ contactState: nextProps.contactState,
|
|
|
})
|
|
|
},
|
|
|
- render(){
|
|
|
- return(
|
|
|
+ render() {
|
|
|
+ return (
|
|
|
<div>
|
|
|
{this.state.modalVisible ? <Modal
|
|
|
- className="customeDetails"
|
|
|
- title="意向客户详情"
|
|
|
- width='1800px'
|
|
|
- visible={this.state.modalVisible}
|
|
|
- onOk={this.detailsModal}
|
|
|
- onCancel={this.detailsModal}
|
|
|
- footer=''
|
|
|
- >
|
|
|
- <Tabs onChange={this.callback} activeKey={this.state.callnub}>
|
|
|
- {this.props.isGuidanceLv || this.props.detailApi.indexOf('Organization')>0?"":
|
|
|
- <TabPane tab="基本信息" key="1">
|
|
|
- <BasicPerson
|
|
|
- detailApi={this.props.detailApi}
|
|
|
- closeDetail={this.closeDetail}
|
|
|
- data={this.props.IntentionData}
|
|
|
- IntentionState={this.state.IntentionState}
|
|
|
- basicState={this.state.basicState}
|
|
|
- />
|
|
|
+ className="customeDetails"
|
|
|
+ title="意向客户详情"
|
|
|
+ width='1800px'
|
|
|
+ visible={this.state.modalVisible}
|
|
|
+ onOk={this.detailsModal}
|
|
|
+ onCancel={this.detailsModal}
|
|
|
+ footer=''
|
|
|
+ >
|
|
|
+ <Tabs onChange={this.callback} activeKey={this.state.callnub}>
|
|
|
+ {this.props.isGuidanceLv || this.props.detailApi.indexOf('Organization') > 0 ? "" :
|
|
|
+ <TabPane tab="基本信息" key="1">
|
|
|
+ <BasicPerson
|
|
|
+ detailApi={this.props.detailApi}
|
|
|
+ closeDetail={this.closeDetail}
|
|
|
+ data={this.props.IntentionData}
|
|
|
+ IntentionState={this.state.IntentionState}
|
|
|
+ basicState={this.state.basicState}
|
|
|
+ />
|
|
|
|
|
|
</TabPane>}
|
|
|
- {!this.props.isGuidanceLv || this.props.isCustomerAdmin ? <TabPane tab="联系人信息" key="2">
|
|
|
- <ContactPerson
|
|
|
- isCustomerAdmin={this.props.isCustomerAdmin}
|
|
|
- closeDetail={this.closeDetail}
|
|
|
- name={this.props.name}
|
|
|
- data={this.props.IntentionData}
|
|
|
- contactState={this.state.contactState}
|
|
|
- />
|
|
|
- </TabPane> : ""}
|
|
|
- {/* {!this.props.isGuidanceLv ? <TabPane tab="账户信息" key="3">*/}
|
|
|
- {/* <Account*/}
|
|
|
- {/* isGuidanceLv={this.props.isGuidanceLv} //用于判断是否为跟进管理页面*/}
|
|
|
- {/* closeDetail={this.closeDetail}*/}
|
|
|
- {/* data={this.props.IntentionData}*/}
|
|
|
- {/* accountState={this.state.accountState}*/}
|
|
|
- {/* />*/}
|
|
|
- {/*</TabPane>: ""}*/}
|
|
|
- <TabPane tab="客户跟进" key="4">
|
|
|
- <Visit
|
|
|
- isGuidanceLv={this.props.isGuidanceLv}
|
|
|
- isEditGuidanceLv={this.props.isEditGuidanceLv}
|
|
|
- categoryArr={this.props.categoryArr}
|
|
|
- closeDetail={this.closeDetail}
|
|
|
- data={this.props.IntentionData}
|
|
|
- visitState={this.state.visitState}
|
|
|
- />
|
|
|
- </TabPane>
|
|
|
- <TabPane tab="业务意向" key="5">
|
|
|
- <Business
|
|
|
- closeDetail={this.closeDetail}
|
|
|
- data={this.props.IntentionData}
|
|
|
- businessState={this.state.businessState}
|
|
|
- />
|
|
|
- </TabPane>
|
|
|
- </Tabs>
|
|
|
- </Modal> : <div/>}
|
|
|
+ {!this.props.isGuidanceLv || this.props.isCustomerAdmin ? <TabPane tab="联系人信息" key="2">
|
|
|
+ <ContactPerson
|
|
|
+ isCustomerAdmin={this.props.isCustomerAdmin}
|
|
|
+ closeDetail={this.closeDetail}
|
|
|
+ name={this.props.name}
|
|
|
+ data={this.props.IntentionData}
|
|
|
+ contactState={this.state.contactState}
|
|
|
+ />
|
|
|
+ </TabPane> : ""}
|
|
|
+ {/* {!this.props.isGuidanceLv ? <TabPane tab="账户信息" key="3">*/}
|
|
|
+ {/* <Account*/}
|
|
|
+ {/* isGuidanceLv={this.props.isGuidanceLv} //用于判断是否为跟进管理页面*/}
|
|
|
+ {/* closeDetail={this.closeDetail}*/}
|
|
|
+ {/* data={this.props.IntentionData}*/}
|
|
|
+ {/* accountState={this.state.accountState}*/}
|
|
|
+ {/* />*/}
|
|
|
+ {/*</TabPane>: ""}*/}
|
|
|
+ <TabPane tab="客户跟进" key="4">
|
|
|
+ <Visit
|
|
|
+ isGuidanceLv={this.props.isGuidanceLv}
|
|
|
+ isEditGuidanceLv={this.props.isEditGuidanceLv}
|
|
|
+ categoryArr={this.props.categoryArr}
|
|
|
+ closeDetail={this.closeDetail}
|
|
|
+ data={this.props.IntentionData}
|
|
|
+ visitState={this.state.visitState}
|
|
|
+ />
|
|
|
+ </TabPane>
|
|
|
+ <TabPane tab="业务意向" key="5">
|
|
|
+ <Business
|
|
|
+ closeDetail={this.closeDetail}
|
|
|
+ data={this.props.IntentionData}
|
|
|
+ businessState={this.state.businessState}
|
|
|
+ />
|
|
|
+ </TabPane>
|
|
|
+ </Tabs>
|
|
|
+ </Modal> : <div />}
|
|
|
</div>
|
|
|
)
|
|
|
}
|