liting2017 7 年之前
父節點
當前提交
57a48bd892

+ 15 - 1
js/component/dataDic.js

@@ -1223,5 +1223,19 @@ module.exports = {
             value: '10',
             key: "其他个人"
         }
-    ], 
+    ],
+    //账户状态
+    statuslist:[
+        {
+            value: '0',
+            key: "有效"
+        }, {
+            value: '1',
+            key: "失效"
+        },
+        {
+            value: '2',
+            key: "锁定"
+        }, 
+        ]
 };

+ 189 - 125
js/component/manageCenter/customer/customerData/myClient.jsx

@@ -8,7 +8,7 @@ import { citySelect,provinceList,areaSelect} from '../../../NewDicProvinceList';
 const { Column, ColumnGroup } = Table;
 const TabPane = Tabs.TabPane;
 import  CustomerDetail from './myClientDesc.jsx';
-import {socialAttribute,newFollow,lvl,currentMember,cityArr, customerStatus,intentionalService,sex} from '../../../dataDic.js';
+import {socialAttribute,newFollow,lvl,currentMember,cityArr, statuslist,customerStatus,intentionalService,sex} from '../../../dataDic.js';
 import {getCompanyIntention,beforeUploadFile,getWhether,getcityArr,getcustomerStatue,getfllowSituationOn,getCertification,getcustomerTyp,getLvl,getCurrentMember,getprovince} from '../../../tools.js';
 
 const data = [{
@@ -232,17 +232,19 @@ const MyClient = Form.create()(React.createClass({
 					  dataIndex: 'id',
 					  key:'id',
 					  render: (text, record, index) => {
-	                  return  <Select value={record.id}  onChange={(e) => { record.id=e; this.setState({ data: this.state.data }); }}>
+	                  return  
+	                  	let contacts=record.contacts||'';
+	                  {contacts==''?<Select value={record.id} placeholder="选择高新" onChange={(e) => { record.id=e; this.setState({ data: this.state.data }); }}>
                                     <Select.Option value="0" >否</Select.Option>
 		                            <Select.Option value="1" >是</Select.Option>	    
-                              </Select>
+                              </Select>:<span>{text}</span>}
                          }      
 				},{
 					  title: '最新进度',
 					  dataIndex: 'businessGlossoryId',
 					  key: 'businessGlossoryId',
 					  render: (text, record, index) => {
-	                  return  <Select  value={record.businessGlossoryId}  onChange={(e) => { record.businessGlossoryId = e; this.setState({ data: this.state.data }); }}>
+	                  return  <Select  placeholder="选择最新进度" value={record.businessGlossoryId}  onChange={(e) => { record.businessGlossoryId = e; this.setState({ data: this.state.data }); }}>
                                     {
                                         newFollow.map(function (item) {
                                             return <Select.Option key={item.value} >{item.key}</Select.Option>
@@ -255,7 +257,7 @@ const MyClient = Form.create()(React.createClass({
 					  dataIndex: 'followSituation',
 					  key: 'followSituation',
 					  render: (text, record, index) => {
-	                  return  <Select value={record.followSituation}  onChange={(e) => { record.followSituation = e; this.setState({ data: this.state.data }); }}>
+	                  return  <Select value={record.followSituation} placeholder="选择最新状态" onChange={(e) => { record.followSituation = e; this.setState({ data: this.state.data }); }}>
                                     {
                                         customerStatus.map(function (item) {
                                             return <Select.Option key={item.value} >{item.key}</Select.Option>
@@ -268,7 +270,7 @@ const MyClient = Form.create()(React.createClass({
 					  dataIndex: 'remarks',
 					  key: 'remarks',
 					  render: (text, record, index) => {
-					  return <Input value={record.customerStatus} 
+					  return <Input value={record.customerStatus} placeholder="跟进说明"
 	                             onChange={(e) => { record.customerStatus = e.target.value; this.setState({ data: this.state.data }); }}
 	                             style={{width:'120px'}}/>
 	                    }
@@ -287,29 +289,29 @@ const MyClient = Form.create()(React.createClass({
 			],
 			businessIntentionList:[{
 					  title: '意向时间',
-					  dataIndex: 'name',
-					  key: 'name'	 
+					  dataIndex: 'createTime',
+					  key: 'createTime'	 
 				},{
 					  title: '客户名称',
-					  dataIndex: 'mobile2',
-					  key: 'mobile2'	 
+					  dataIndex: 'identifyName',
+					  key: 'identifyName'	 
 				},{
 					  title: '业务名',
-					  dataIndex: 'mobile3',
-					  key: 'mobile3'	 
+					  dataIndex: 'businessName',
+					  key: 'businessName'	 
 				}
 				,{
 					  title: '营销员',
-					  dataIndex: 'mobile4',
-					  key: 'mobile4'	 
+					  dataIndex: 'adminName',
+					  key: 'adminName'	 
 				},{
 					  title: '业务意向进度',
-					  dataIndex: 'mobile5',
-					  key: 'mobile5'	 
+					  dataIndex: 'followSituation',
+					  key: 'followSituation'	 
 				},{
 					  title: '客户状态',
-					  dataIndex: 'mobile6',
-					  key: 'mobile6'	 
+					  dataIndex: 'customerStatus',
+					  key: 'customerStatus'	 
 				},{
 					  title: '操作',
 					  dataIndex: 'ooo',
@@ -568,7 +570,7 @@ const MyClient = Form.create()(React.createClass({
                     key: 'abc',
                     render: (text, record, index) => {                    	
                         return <div>
-                            <Button onClick={(e) =>{ e.stopPropagation(), this.visit(record) }} type="primary">拜访</Button>                            							    
+                            <Button onClick={(e) =>{ e.stopPropagation(), this.visit(record)}} type="primary">拜访</Button>                            							    
                         </div>
                     }
                 } 
@@ -589,7 +591,8 @@ const MyClient = Form.create()(React.createClass({
     },      
     //进入新增拜访记录
     visit(e){ 
-    	this.getNewWoman(e.uid);
+    	this.state.keys=true;
+    	this.getNewWoman(e.id);
     	this.setState({
     		visitModul:true,
             loading: true
@@ -599,7 +602,7 @@ const MyClient = Form.create()(React.createClass({
             dataType: "json",
             url:globalConfig.context + '/api/admin/customer/toAddFollow',
             data: {         	
-                uid: e.uid,
+                uid: e.id,
             },
             success: function (data) {                	  
         		    let theArr = [];
@@ -984,7 +987,8 @@ const MyClient = Form.create()(React.createClass({
         })    
     },
     VisitRowClick(record, index) { 
-        this.state.RowData = record; 
+    	this.state.keys=false;
+        this.state.RowData = record;
         this.visitModify(record.id);
         this.setState({
         	selectedRowKeys:[],
@@ -1087,9 +1091,9 @@ const MyClient = Form.create()(React.createClass({
                     thisData = {};
                 }; 
                 let ProvinceCityArr=[];
-                let ProvinceS=getprovince(thisData.locationProvince);
-                let citys=getprovince(thisData.locationCity);
-                let Areas=getprovince(thisData.locationArea);
+                let ProvinceS=thisData.locationProvince;  //getprovince
+                let citys=thisData.locationCity;
+                let Areas=thisData.locationArea;
                  ProvinceCityArr.push(ProvinceS,citys,Areas);
                 this.setState({
                 	InformationId:thisData.id,
@@ -1101,9 +1105,8 @@ const MyClient = Form.create()(React.createClass({
                 	companyLogoUrl: thisData.companyLogoUrl ? splitUrl(thisData.companyLogoUrl, ',', globalConfig.avatarHost + '/upload') : [],
                 	dataInformation:thisData,
                 	ProvinceCity:ProvinceCityArr,
-                	industry:thisData.industry,
-                });  
-                
+                	industry:thisData.industry?(thisData.industry).toString():undefined,
+                });    
             }.bind(this),
         }).always(function () {
             this.setState({            	
@@ -1178,71 +1181,79 @@ const MyClient = Form.create()(React.createClass({
 	    	visitModul:false
 	    });	 	   
 	},
-	visitCancel(e) {		
-	    this.setState({ 
+	visitCancel(e) {	
+	    this.setState({
+	    	
 	    	visitModul:false
 	    });	 	   
 	},
 	//拜访保存函数
     visitSubmit(e){
-    	e.preventDefault(); 
-    	this.state.data=[];
-        this.setState({        	
-            selectedRowKeys: [],           
-        });
-        this.setState({
-          loading: true
-    	}); 
-    	let conName=this.state.lastname;
-    	let ocbIds='';
-    	this.state.orderStatusOption.map(function(item){
-    		if(item.name==conName){
-    			ocbIds=item.ocbId
-    		}
-    		return ocbIds;
-    	})
-    	//新增
-        $.ajax({
-            method: "get",
-            dataType: "json",
-            url:this.state.contacts?globalConfig.context + '/api/admin/customer/addFollow':globalConfig.context + '/api/admin/customer/updateFollow',
-            data: this.state.contacts?{
-            	userBusinessList:JSON.stringify(this.state.data),
-                uid: this.state.Accountuid,
-                ocbId: ocbIds,
-                result: this.state.result,
-                followTime: this.state.followTime,
-            }:{
-            	userBusinessList:JSON.stringify(this.state.data),
-                uid: this.state.Accountuid,
-                ocbId: ocbIds,
-                result: this.state.result,
-                followTime: this.state.followTime,
-                userBusinessList: this.state.userBusinessList,
-                contactType:this.state.contactType
-            }
-        }).done(function (data) {                	
-            this.setState({
-                loading: false
-            });
-            if (!data.error.length) {
-                message.success('保存成功!');
-                this.loadVisit(); //
-                this.loadData();
-                this.visitCancel()
-            } else {
-                message.warning(data.error[0].message);
-            }            
-        }.bind(this)); 
+    	e.preventDefault();
+    	if(this.state.contactType==undefined){
+    		message.warning('请选择拜访方式')
+    		return false;
+    	};
+    	if(this.state.keys){
+    		
+    	};
+		if(this.state.lastName==undefined){
+		  		message.warning('请选择联系人')
+		  		return false;
+		  	}
+	        this.setState({        	
+	            selectedRowKeys: [],           
+	        });
+	        this.setState({
+	          loading: true
+	    	}); 
+            let conts=this.state.lastName;
+            let contactsId= this.state.contactsIdArr[conts].id;
+	    	//新增
+	        $.ajax({
+	            method: "post",
+	            dataType: "json",
+	            url:this.state.keys?globalConfig.context + '/api/admin/customer/addFollow':globalConfig.context + '/api/admin/customer/updateFollow',
+	            data: this.state.keys?{
+	            	userBusinessList:JSON.stringify(this.state.data),
+	                uid: this.state.uid,
+	                ocbId:contactsId ,
+	                contactType:this.state.contactType,
+	                result: this.state.result,
+	                followTime: this.state.followTime,
+	            }:{
+	            	userBusinessList:JSON.stringify(this.state.data),
+	                uid: this.state.uid,
+	                ocbId: contactsId,
+	                contactType:this.state.contactType,
+	                result: this.state.result,
+	                followTime: this.state.followTime,
+	            } 
+	        }).done(function (data) {                	
+	            this.setState({
+	                loading: false
+	            });
+	            if (!data.error.length) {
+	                message.success('保存成功!');
+	                this.loadVisit(); //
+	                this.loadData();
+	                this.visitCancel()
+	            } else {
+	                message.warning(data.error[0].message);
+	            }            
+	        }.bind(this)); 
+	    
     },
-    //根据获取的联系人获取到电话号码函数
-	hundleName(e){
-		let changNub=this.state.telNumArr[e];
-		this.setState({
-			lastname:e,
-			nub:changNub.mobile
-		})
-	},
+
+	
+    //当选择联系人的列表变化时,则执行
+    hundleName(e){		    	
+       let changNub=this.state.telNum[e];     
+       this.setState({       		
+       	  nub:this.state.telNum[e],
+	      lastName: e,
+	   });
+	},			
 	//添加新业务及单位客户详情新增
 	addNew() {
         this.state.data.push({
@@ -1269,7 +1280,8 @@ const MyClient = Form.create()(React.createClass({
             data: {
             	pageNo: pageNo || 1,
                 pageSize: this.state.pagination.pageSize,
-                uid: this.state.rowId, //名称1                   
+                uid: this.state.rowId, //名称1
+                businessGlossoryId:'',
             },
             success: function (data) {            	
                 let theArr = []; 
@@ -1350,7 +1362,6 @@ const MyClient = Form.create()(React.createClass({
 	},
 	//获取联系人下拉框
 	getNewWoman(ids) {  
-		console.log(ids);
     	this.state.data = []
          $.ajax({
                 method: "get",
@@ -1361,23 +1372,31 @@ const MyClient = Form.create()(React.createClass({
                    uid:ids,
                 },
                 success: function (data) {                	  
-            		let theArr = [];
-							    let thedata=data.data;
-							    if (!thedata) {
-				                    if (data.error && data.error.length) {
-				                        message.warning(data.error[0].message);
-				                    };	
-				                    thedata = {}; 
-				               };   
-						      thedata.map(function (item,index) {	
-						          	theArr.push(<Select.Option value={index}>{item.name}</Select.Option>)						          
-			            });
-			            let telNum=thedata.telNum;
-			           
-					       this.setState({   
-					       		 telNumArr:thedata,
-	                             orderStatusOption: theArr, 
-                 		});
+                		let theArr = [];
+					    let thedata=data.data;
+					    if (!thedata) {
+		                    if (data.error && data.error.length) {
+		                        message.warning(data.error[0].message);
+		                    };	
+		                    thedata = {}; 
+		               };   
+					    var telNum=[];
+					    var contactIds=[];
+				        thedata.map(function (item,index) {	
+				        	contactIds.push(thedata[index].id);
+			            	telNum.push(thedata[index].mobile);
+				        });	
+				        for (let item in data.data) {
+		                    let theData = data.data[item];
+		                    theArr.push(
+		                        <Select.Option value={item} key={theData.name}>{theData.name}</Select.Option>
+		                    );
+		                };
+						this.setState({	
+							contactsIdArr:thedata,
+				        	telNum:telNum,
+		                    orderStatusOption: theArr, 
+	                    });
 					}.bind(this),
 				}).always(function () {
 	            this.setState({
@@ -1433,16 +1452,16 @@ const MyClient = Form.create()(React.createClass({
     		this.loadInformation(this.state.rowId)
     	}
     	if(e==2){    		
-
+			
     	}
     	if(e==3){    		
 			this.httpAccount(this.state.rowId)
     	}
     	if(e==4){    		
-  		    this.loadVisit()
+  		    this.loadVisit();
     	}
     	if(e==5){    		
-
+			this.BusinessList();
     	}
     	if(e==6){    		
 
@@ -1515,7 +1534,56 @@ const MyClient = Form.create()(React.createClass({
     ContactsListSave(e){
     	console.log(e)
     },
-    //
+    //tab5业务意向
+    BusinessList(pageNo) {
+        this.setState({
+            loading: true
+        });      
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,          
+            url:globalConfig.context + '/api/admin/customer/listBusiness',
+            data: { 				
+                pageNo: pageNo || 1,
+                pageSize: this.state.pagination.pageSize,               
+                uid:this.state.rowId               
+            },
+            success: function (data) {            	
+                let theArr = []; 
+                if (data.error.length || data.data.list=="") {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };                   
+                } else {  
+                    for (let i = 0; i < data.data.list.length; i++) {
+                        let thisdata = data.data.list[i];                        
+                        theArr.push({
+                            key: i,                           
+                            id: thisdata.id,                                                  
+                            businessId:thisdata.businessId,
+                            businessName:thisdata.businessName,
+                            identifyName:thisdata.identifyName,
+                            followSituation:thisdata.followSituation,
+                            customerStatus:thisdata.customerStatus,
+                            adminName:thisdata.adminName,
+                   			createTime:thisdata.createTime			                
+                        });
+                    };
+                    this.state.pagination.current = data.data.pageNo;
+                    this.state.pagination.total = data.data.totalCount;
+                };               
+                this.setState({
+                    dataBusiness: theArr,
+                    pagination: this.state.pagination
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },    
     componentWillReceiveProps(nextProps) {
         if (!this.props.visible && nextProps.visible) {
             if (nextProps.data && nextProps.data.id) {
@@ -2054,11 +2122,11 @@ const MyClient = Form.create()(React.createClass({
 							                    </FormItem>
 							                    <FormItem className="half-item" 
 						                           {...formItemLayout}
-						                           label="户状态"
+						                           label="户状态"
 						                         > 
-												    <Select placeholder="户状态" value={this.state.status}  onChange={(e) => { this.setState({ status: e }); }} >
+												    <Select placeholder="户状态" value={this.state.status}  onChange={(e) => { this.setState({ status: e }); }} >
 				                                    {
-				                                        customerStatus.map(function (item) {
+				                                        statuslist.map(function (item) {
 				                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
 				                                        })
 				                                    }
@@ -2137,20 +2205,19 @@ const MyClient = Form.create()(React.createClass({
 								      <Table 
 						            	 pagination={this.state.paginations}
 						            	 columns={this.state.visitsList} 
-						            	 dataSource={this.state.data}
+						            	 dataSource={this.state.visitArrList}
 						            	 onRowClick={this.VisitRowClick}
 						            	 />
 								    </Spin> 
 								</div>								
-							</TabPane>
-							{/*this.state.visitArrList*/}
+							</TabPane>						
 							<TabPane tab="业务意向" key="5">
 							    <div className="clearfix">
                     			    <Spin spinning={this.state.loading}>
 								      <Table 
 						            	 pagination={this.state.paginations}
 						            	 columns={this.state.businessIntentionList} 
-						            	 dataSource={data}
+						            	 dataSource={this.state.dataBusiness}
 						            	 />
 								    </Spin> 
 								</div>							
@@ -2222,11 +2289,11 @@ const MyClient = Form.create()(React.createClass({
 				                            {...formItemLayout}
 				                             label="联系人"
 				                             >
-						                	 <Select placeholder="选择联系人" style={{ width: 140 }}
+						                	<Select placeholder="选择联系人" style={{ width: 140 }}
 						                        value={this.state.lastName}
-						                       onChange={this.hundleName}>
+						                        onChange={this.hundleName}>
 						                        {this.state.orderStatusOption}
-				                    		 </Select>
+			                    			</Select>
 						                </FormItem>
 						                
 						                <FormItem className="half-item"
@@ -2247,11 +2314,8 @@ const MyClient = Form.create()(React.createClass({
 					                        labelCol={{ span: 4 }}
 							                wrapperCol={{ span: 16 }}
 					                        label="拜访备注" >
-					                        {getFieldDecorator('result', {
-					                            initialValue: this.state.result
-					                        })(
-					                            <Input type="textarea" rows={4} />
-					                            )}
+					                            <Input type="textarea" rows={4} value={this.state.result} 
+					                              onChange={(e)=>{this.setState({result:e.target.value})}}/>
 					                    </FormItem>
 					                </div>
 					                <div className="clearfix">

+ 170 - 135
js/component/manageCenter/customer/customerService/myBusiness.jsx

@@ -272,7 +272,7 @@ const MyBusiness = Form.create()(React.createClass({
                     key:'ccc',  
  									  render: (text, record, index) => {                    	
                         return <div>
-                            <Popconfirm title="是否删除?" onConfirm={(e)=>{this.intentionDelet(record)}} okText="删除" cancelText="不删除">
+                            <Popconfirm title="是否删除?" onConfirm={(e)=>{e.stopPropagation(),this.intentionDelet(record)}} okText="删除" cancelText="不删除">
 							                 <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}}>删除</Button>
 							              </Popconfirm>
                         </div>
@@ -409,19 +409,13 @@ const MyBusiness = Form.create()(React.createClass({
         this.state.contactType=undefined;
         this.state.remarks='';
         this.state.result='';
+        this.state.keys=false;
         this.addTime(); 
         this.setState({
             showDesc: true,           
         });       
     },
-    //跟进
-    addModify(e) {
-        this.addTime(); 
-        this.HttpFollowUp(e.businessId)
-        this.setState({
-            showDesc: true,           
-        });       
-    }, 
+    
     addClickOk(){
     	this.setState({
     		businessId:'',
@@ -472,45 +466,37 @@ const MyBusiness = Form.create()(React.createClass({
                 $.ajax({
                     method: "get",
                     dataType: "json",
-                    url:globalConfig.context + '/api/admin/customer/toUpdateBusiness',
+                    url:globalConfig.context + '/api/admin/customer/updateBusiness',
                     data: {         	
-                    	businessId:this.state.rowId   
+                    	businessId:this.state.rowId, 
+                    	followSituation:this.state.followSituation, 
+                    	customerStatus:this.state.customerStatus, 
+                    	result:this.state.result, 
+                    	
                     }
                 }).done(function (data) { 
-                	let thisData=data.data;
-                	if (!thisData) {
-                   		 if (data.error && data.error.length) {
+                	 this.setState({
+                        loading: false
+                    });
+                    if (!data.error.length) {
+                        message.success('保存成功!');
+                        this.detailsModal() ;
+                        this.loadData();
+                    } else {
                         message.warning(data.error[0].message);
-                   		 };
-                    	thisData = {};
-                   	 }; 
-	                	this.setState({
-		                	businessId:thisData.businessId,
-		                	identifyName:thisData.identifyName,
-		                	businessGlossoryId:thisData.businessGlossoryId,
-		                	followSituation:thisData.followSituation,
-		                	customerStatus:thisData.customerStatus,
-		                	createTime:thisData.createTime,
-		                	adminName:thisData.adminName,
-		                	remarks:thisData.remarks,  	
-               		});                  
-		        }.bind(this),
-		        ).always(function () {
-		            this.setState({            	
-		                loading: false
-		            });
-		        }.bind(this));
+                    }
+        			;
+                }.bind(this));
 			}
     	})
     },
     //查看基本详情基本信息
     loadInformation(record){
-    	console.log(record)
     	$.ajax({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + '/api/admin/customer/findOrganizationCustomerDetail',
+            url: globalConfig.context + '/api/admin/customer/toUpdateBusiness',
             data: {
                 uid: record
             },
@@ -522,24 +508,8 @@ const MyBusiness = Form.create()(React.createClass({
                     };
                     thisData = {};
                 }; 
-                let ProvinceCityArr=[];
-                let ProvinceS=getprovince(thisData.locationProvince);
-                let citys=getprovince(thisData.locationCity);
-                let Areas=getprovince(thisData.locationArea);
-                ProvinceCityArr.push(ProvinceS,citys,Areas)
-                
-               console.log(ProvinceCityArr)
                 this.setState({
-                	InformationId:thisData.id,
-                	InformationUid:thisData.uid,
-                	unitName:thisData.unitName,
-                	listed:thisData.listed,
-                	highTechZone:thisData.highTechZone,
-                	orgCodeUrl: thisData.orgCodeUrl ? splitUrl(thisData.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],
-                	companyLogoUrl: thisData.companyLogoUrl ? splitUrl(thisData.companyLogoUrl, ',', globalConfig.avatarHost + '/upload') : [],
-                	dataInformation:thisData,
-                	ProvinceCity:ProvinceCityArr,
-                	industry:thisData.industry,
+                	dataInformation:thisData,	
                 });                  
             }.bind(this),
         }).always(function () {
@@ -550,7 +520,7 @@ const MyBusiness = Form.create()(React.createClass({
     },
    	detailsModalOk(e) {
   	  this.setState({ modal5Visible:true });//需要一个请求数据
-  	  this.loadInformation(e.id)
+  	  this.loadInformation(e.businessId)
     },
     //点击消失函数
 	  detailsModal(e) {		
@@ -634,85 +604,55 @@ const MyBusiness = Form.create()(React.createClass({
             }
         }); 
 	},
-	//获取联系人下拉框
-	getNewWoman(ids) { 
-		  console.log(ids);
-         $.ajax({
-                method: "get",
-                dataType: "json",
-                crossDomain: false,
-                url: globalConfig.context + "/api/admin/customer/findCustomerContacts",
-                data:{
-                	uid:ids,
-                },
-                success: function (data) {                	  
-            		let theArr = [];
-							    let thedata=data.data;
-							    if (!thedata) {
-				                    if (data.error && data.error.length) {
-				                        message.warning(data.error[0].message);
-				                    };	
-				                    thedata = {}; 
-				               };   
-						      thedata.map(function (item,index) {	
-						          	theArr.push(<Select.Option value={index}>{item.name}</Select.Option>)						          
-			            });
-			            let telNum=thedata.telNum;
-			           
-					       this.setState({
-					       	     lastname:thedata[0].name||'',
-					       		 telNumArr:thedata,
-					       		 nub:thedata[0].mobile,
-	                             orderStatusOption: theArr, 
-                 		});
-					}.bind(this),
-				}).always(function () {
-	            this.setState({
-	                loading: false
-	            });
-	        }.bind(this));
-	},
-	//根据获取的联系人获取到电话号码函数
-	hundleName(e){
-		let changNub=this.state.telNumArr[e];
-		this.setState({
-			lastname:e,
-			nub:changNub.mobile
-		})
-	},
+	//跟进
+    addModify(e) {
+        this.addTime(); 
+        this.HttpFollowUp(e.businessId);
+        this.state.keys=true;
+        this.setState({
+            showDesc: true,           
+        }); 
+    }, 
+	
+	//当选择联系人的列表变化时,则执行
+    hundleName(e){		    	
+       let changNub=this.state.telNum[e];    
+       this.setState({       		
+       	  nub:this.state.telNum[e],
+	      lastName: e,
+	   });
+	},	
 	//新建保存
 	addSubmit(e){
 		e.preventDefault();
+		if(this.state.contactType==undefined){
+    		message.warning('请选择联系方式')
+    		return false;
+    	}
+    	if(this.state.lastName==undefined){
+		  		message.warning('请选择联系人')
+		  		return false;
+		}	
 		this.props.form.validateFields((err, values) => {                                 
             if (!err) {
                 this.setState({
                     loading: true
                 }); 
-                let thed='';
-                let conts=this.state.lastname;
-                if(this.state.orderStatusOption){
-                	this.state.orderStatusOption.map(function(itam){
-                	if(itam.name==conts){
-                		thed=itam.ocbId
-                	}
-                	return thed;
-                })
-                }
-               
+                let conts=this.state.lastName;
+           		let contactsId= this.state.contactsIdArr[conts].id;
                 $.ajax({
                     method: "post",
                     dataType: "json",
                     crossDomain: false,
-                    url: globalConfig.context + '/api/admin/customer/addBusinessAndFollow',
-                    data: {
-                    	uid:this.state.khId,
+                    url:!this.state.keys?globalConfig.context + '/api/admin/customer/addBusinessAndFollow':globalConfig.context + '/api/admin/customer/addFollowOneBusiness ',
+                    data:{
+                    	businessId:this.state.businessId,
                         businessGlossoryId: this.state.businessGlossoryId, 
                         followSituation:this.state.followSituation,
                         customerStatus: this.state.customerStatus,
-                        createTime:this.state.createYear+''+this.state.creatMent,
                         contactType: this.state.contactType,
-                        ocbId: thed,
-                        followTime:this.state.followTime,
+                        ocbId: this.state.kid,
+                        createTime:this.state.createTime,
                         remarks: this.state.remarks,
                         result: this.state.result,
                     }
@@ -731,6 +671,7 @@ const MyBusiness = Form.create()(React.createClass({
                 }.bind(this));
             }
         });
+       
 	},
 	//新建HTTP获取数据
 	addTime(){
@@ -750,10 +691,7 @@ const MyBusiness = Form.create()(React.createClass({
 	                        message.warning(data.error[0].message);
 	                    };	
 	                    thedata = {}; 
-	               };   
-//			        thedata.adminName.map(function (item,index) {	
-//			          	theArr.push(<Select.Option value={index}>{item.name}</Select.Option>)						          
-//			        });	
+	              };   	
 					let creatMent=thedata.createTime.substr(10,9);
  				    let createYear=thedata.createTime.substr(0,10);
 					this.setState({	
@@ -825,7 +763,6 @@ const MyBusiness = Form.create()(React.createClass({
 		blurChange(e){
 			let theType='';
 			let contactLists=this.state.customerArr||[];
-			//let contactLists=dataSource;
 				if (e) {
 	            contactLists.map(function (item) {
 	                if (item.name == e.toString()) {
@@ -843,7 +780,7 @@ const MyBusiness = Form.create()(React.createClass({
              method: "get",
              dataType: "json",
              crossDomain: false,
-             url: globalConfig.context + "/api/admin/customer/toFollowOneBusiness",
+             url: globalConfig.context + "/api/admin/customer/toAddFollowOneBusiness",
              data:{
             	businessId:e
              },
@@ -854,8 +791,9 @@ const MyBusiness = Form.create()(React.createClass({
                         message.warning(data.error[0].message);
                     };	
                     thedata = {}; 
-             }; 
+            }; 
 					this.setState({
+						uids:thedata.uid,
 						businessId:thedata.businessId,
 						businessGlossoryId:thedata.businessGlossoryId,
 						followSituation:thedata.followSituation,
@@ -866,11 +804,108 @@ const MyBusiness = Form.create()(React.createClass({
                     });
 				}.bind(this),
 			}).always(function () {
+			this.getNewWoman(this.state.uids)
             this.setState({
                 loading: false
             });
-        }.bind(this));  
+        }.bind(this));
+        
+        
+	},
+	//获取联系人下拉框
+	getNewWoman(ids) {  
+    	this.state.data = []
+         $.ajax({
+                method: "get",
+                dataType: "json",
+                crossDomain: false,
+                url: globalConfig.context + "/api/admin/customer/findCustomerContacts",
+                data:{
+                   uid:ids,
+                },
+                success: function (data) {                	  
+                		let theArr = [];
+					    let thedata=data.data;
+					    if (!thedata) {
+		                    if (data.error && data.error.length) {
+		                        message.warning(data.error[0].message);
+		                    };	
+		                    thedata = {}; 
+		               };   
+					    var telNum=[];
+					    var contactIds=[];
+				        thedata.map(function (item,index) {	
+			            	telNum.push(thedata[index].mobile);					          
+				        });	
+				        for (let item in data.data) {
+		                    let theData = data.data[item];
+		                    theArr.push(
+		                        <Select.Option value={item} key={theData.name}>{theData.name}</Select.Option>
+		                    );
+		                };
+						this.setState({	
+						    contactsIdArr:thedata,						   						  	        	    	
+				        	telNum:telNum,
+		                    orderStatusOption: theArr, 
+	                    });
+					}.bind(this),
+				}).always(function () {
+	            this.setState({
+	                loading: false
+	            });
+	        }.bind(this));
 	},
+	//获取拜访详情ajax
+	loadVisit(pageNo) {
+        this.state.data = [];
+        this.setState({
+            loading: true
+        });      
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,          
+            url:globalConfig.context + '/api/admin/customer/listFollowHistory',
+            data: {
+            	pageNo: pageNo || 1,
+                pageSize: this.state.pagination.pageSize,
+                uid: this.state.rowId, //名称1
+                businessGlossoryId:'',
+            },
+            success: function (data) {            	
+                let theArr = []; 
+                if (data.error.length || data.data.list=="") {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };                   
+                } else {  
+                    for (let i = 0; i < data.data.list.length; i++) {
+                        let thisdata = data.data.list[i];                        
+                        theArr.push({
+                            followId:thisdata.followId,
+                            followTime:thisdata.followTime,
+                            identityName:thisdata.identityName, 
+                            contacts:thisdata.contacts,
+                            contactMobile:thisdata.contactMobile,
+                            result:thisdata.result, 
+                            adminName:thisdata.adminName,
+                            contactType:thisdata.contactType
+                        });
+                    };
+                    this.state.pagination.current = data.data.pageNo;
+                    this.state.pagination.total = data.data.totalCount;
+                };               
+                this.setState({
+                    visitArrList: theArr,
+                    pagination: this.state.pagination
+                });
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },
     componentWillReceiveProps(nextProps) {
         if (!this.props.visible && nextProps.visible) {
             if (nextProps.data && nextProps.data.id) {
@@ -882,23 +917,24 @@ const MyBusiness = Form.create()(React.createClass({
         };
     },
     tableRowClick(record, index) { 
-    	console.log(record)
         this.state.RowData = record; 
-        console.log(record)
         this.detailsModalOk(record);
+        this.loadVisit();
         this.setState({
         	selectedRowKeys:[],
-        	rowId:record.id,
+        	rowId:record.businessId,
         })    
     },
     followRowClick(record, index) { 
+    	console.log(record)
         this.state.RowData = record; 
-        this.addTime(); 
+        this.addTime();
+        this.getNewWoman(record.khId)
         this.customerList();
         this.setState({
             businessFollowModul: true, 
             selectedRowKeys:[],
-        	rowId:record.id,
+        	rowId:record.businessId,
         });    
     },
     render() {
@@ -940,8 +976,7 @@ const MyBusiness = Form.create()(React.createClass({
     	  const formItemLayout = {
             labelCol: { span: 8 },
             wrapperCol: { span: 14 },
-        };
-        //const theDatak = this.state.datak || {};
+       };
         const theInformation=this.state.dataInformation || {}
       	const contactsOption="";    	        	
         const formItemLayput = {
@@ -1044,7 +1079,7 @@ const MyBusiness = Form.create()(React.createClass({
 				                            {...formItemLayout}
 				                             label="客户名称"
 				                             >
-			    			     		<span>{this.state.businessGlossoryId}</span>
+			    			     		<span>{this.state.identifyName}</span>
 			    			    	</FormItem></div>
 										:<div><FormItem className="half-item"
 			                           {...formItemLayout}
@@ -1158,7 +1193,7 @@ const MyBusiness = Form.create()(React.createClass({
 			                           label="联系人"
 		                               > 
 				                        <Select placeholder="联系人姓名"  style={{ width: 140 }}
-						                        value={this.state.lastname}
+						                        value={this.state.lastName}
 						                        onChange={this.hundleName}>
 						                        {this.state.orderStatusOption}
 				                    	</Select>
@@ -1201,7 +1236,7 @@ const MyBusiness = Form.create()(React.createClass({
     			</Modal> 
     			<Modal	
 				      className="customeDetails"				      
-			          title="我的业务详情"
+			          title="我的业务意向详情"
 			          width='1000px'
 			          visible={this.state.modal5Visible}
 			          onOk={this.detailsModal}
@@ -1280,7 +1315,7 @@ const MyBusiness = Form.create()(React.createClass({
 								      <Table 
 						            	 pagination={this.state.paginations}
 						            	 columns={this.state.businessFollowList} 
-						            	 dataSource={data}
+						            	 dataSource={this.state.visitArrList}
 						            	 onRowClick={this.followRowClick}
 						            	 />
 								    </Spin> 

+ 54 - 62
js/component/manageCenter/servicesManage/contract/contractAdd.jsx

@@ -11,7 +11,7 @@ const ContractAddFrom = Form.create()(React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/api/admin/getContacts",
+            url: globalConfig.context + "/api/admin/customer/findAllContacts",
             data: {
                 uid: theUid
             },
@@ -26,11 +26,12 @@ const ContractAddFrom = Form.create()(React.createClass({
                 for (let item in data.data) {
                     let theData = data.data[item];
                     theOption.push(
-                        <Select.Option value={item} key={theData}>{theData}</Select.Option>
+                        <Select.Option value={item} key={theData.name}>{theData.name}</Select.Option>
                     );
                 };
                 this.setState({
-                    contactsOption: theOption
+                	//orderStatusOption:data.data,
+                    //contactsOption: theOption
                 });
             }.bind(this),
         });
@@ -87,7 +88,7 @@ const ContractAddFrom = Form.create()(React.createClass({
         };
         this.state.yearOption = theArr;
         if (this.props.data && this.props.data.uid && this.props.data.id) {
-            this.getContactsList(this.props.data.uid);
+            this.getNewWoman(this.props.data.uid);
             this.loadData(this.props.data.id);
         } else {
             this.state.data = {};
@@ -100,7 +101,7 @@ const ContractAddFrom = Form.create()(React.createClass({
     componentWillReceiveProps(nextProps) {
         if (!this.props.visible && nextProps.visible) {
             if (nextProps.data && nextProps.data.uid && nextProps.data.id) {
-                this.getContactsList(nextProps.data.uid);
+                this.getNewWoman(nextProps.data.uid);
                 this.loadData(nextProps.data.id);
             } else {
                 this.state.data = {};
@@ -112,6 +113,44 @@ const ContractAddFrom = Form.create()(React.createClass({
             this.props.form.resetFields();
         };
     },
+    //获取联系人下拉框
+	getNewWoman(ids) {  
+    	this.state.data = []
+         $.ajax({
+                method: "get",
+                dataType: "json",
+                crossDomain: false,
+                url: globalConfig.context + "/api/admin/customer/findAllContacts",
+                data:{
+                   uid:ids,
+                },
+                success: function (data) {                	  
+                		let theArr = [];
+					    let thedata=data.data;
+					    if (!thedata) {
+		                    if (data.error && data.error.length) {
+		                        message.warning(data.error[0].message);
+		                    };	
+		                    thedata = {}; 
+		              };   
+					    var contactIds=[];
+				        for (let item in data.data) {
+		                    let theData = data.data[item];
+		                    theArr.push(
+		                        <Select.Option value={item} key={theData.name}>{theData.name}</Select.Option>
+		                    );
+		                };
+						this.setState({												   						  	        	    	
+		                    contactsOption: theArr, 
+		                    orderStatusOptions:data.data,
+	                    });
+					}.bind(this),
+				}).always(function () {
+	            this.setState({
+	                loading: false
+	            });
+	        }.bind(this));
+	},
     handleSave(e) {
         e.preventDefault();
         this.props.form.validateFields((err, values) => {
@@ -124,14 +163,7 @@ const ContractAddFrom = Form.create()(React.createClass({
                     message.warning('请至少选择一个申报项目!');
                     return;
                 };
- 				let thed='';
-                let conts=this.state.contacts;
-                this.state.orderStatusOption.map(function(itam){
-                	if(itam.name==conts){
-                		thed=itam.ocbId
-                	}
-                	return thed;
-                })
+ 				
                 this.props.spinState(true);
                 $.ajax({
                     method: "POST",
@@ -141,7 +173,7 @@ const ContractAddFrom = Form.create()(React.createClass({
                     data: {
                         "uid": this.state.data.uid || this.state.khId,
                         "id": this.state.data.id,
-                        "contacts": thed, //联系人
+                        "contacts": this.state.contacts, //联系人
                         "type": values.type, //合同类型
                         "depict": values.depict, // "合同描述",
                         "patentNum": this.state.patentCheck ? values.patentNum : 0,
@@ -173,14 +205,10 @@ const ContractAddFrom = Form.create()(React.createClass({
                     message.warning('请填写审核信息!');
                     return;
                 };
-                let thed='';
-                let conts=this.state.contacts;
-                this.state.orderStatusOption.map(function(itam){
-                	if(itam.name==conts){
-                		thed=itam.ocbId
-                	}
-                	return thed;
-                })
+                if(this.state.contacts==undefined){
+		  		 message.warning('请选择联系人')
+		  		return false;
+		  	    }
                 this.props.spinState(true);
                 $.ajax({
                     method: "POST",
@@ -190,7 +218,7 @@ const ContractAddFrom = Form.create()(React.createClass({
                     data: {
                         "uid": this.state.data.uid || this.state.khId,
                         "id": this.state.data.id,
-                        "contacts": thed, //联系人
+                        "contacts": this.state.contacts, //联系人
                         "type": values.type, //合同类型
                         "depict": values.depict, // "合同描述",
                         "patentNum": this.state.patentCheck ? values.patentNum : 0,
@@ -271,42 +299,6 @@ const ContractAddFrom = Form.create()(React.createClass({
 			khId:theType
 		})
 	},
-	//获取联系人下拉框
-	getNewWoman(ids) { 
-         $.ajax({
-                method: "get",
-                dataType: "json",
-                crossDomain: false,
-                url: globalConfig.context + "/api/admin/customer/findCustomerContacts",
-                data:{
-                	uid:ids,
-                },
-                success: function (data) {  
-                	console.log(data)
-            		let theArr = [];
-							    let thedata=data.data;
-							    if (!thedata) {
-				                    if (data.error && data.error.length) {
-				                        message.warning(data.error[0].message);
-				                    };	
-				                    thedata = {}; 
-				               };   
-						      thedata.map(function (item) {	
-						          	theArr.push(<Select.Option value={item.id}>{item.name}</Select.Option>)
-						          	
-			           });
-			          
-				       this.setState({
-				       	  contacts:thedata[0].name||'',
-                          orderStatusOption: theArr, 
-	                 });
-					}.bind(this),
-				}).always(function () {
-	            this.setState({
-	                loading: false
-	            });
-	        }.bind(this));
-	},
 	//选择值时值匹配及联系人函数加载
 	autoChange(e){
 		let theType='';
@@ -317,8 +309,8 @@ const ContractAddFrom = Form.create()(React.createClass({
                     theType = item.id;
                 }
            });     
-       }			
-	   this.getNewWoman(theType) 	 
+       }	
+       this.getNewWoman(theType)
 	},
     render() {
         const FormItem = Form.Item;
@@ -368,7 +360,7 @@ const ContractAddFrom = Form.create()(React.createClass({
                             <Select placeholder="请选择联系人" value={this.state.contacts} onChange={(e)=>{this.setState({contacts:e})}}
                                 style={{ width: 260 }}
                                 notFoundContent="未获取到联系人列表">
-                                {this.state.orderStatusOption}
+                                {this.state.contactsOption}
                             </Select>           
                     </FormItem>
                     <FormItem className="half-item"

+ 2 - 2
js/component/manageCenter/servicesManage/copyright/comPatentAdd.jsx

@@ -11,7 +11,7 @@ const PatentAddFrom = Form.create()(React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/api/admin/getContacts",
+            url: globalConfig.context + "/api/admin/customer/findAllContacts",
             data: {
                 uid: theUid || this.state.uid
             },
@@ -26,7 +26,7 @@ const PatentAddFrom = Form.create()(React.createClass({
                 for (let item in data.data) {
                     let theData = data.data[item];
                     theOption.push(
-                        <Select.Option value={item} key={theData}>{theData}</Select.Option>
+                        <Select.Option value={item} key={theData.name}>{theData.name}</Select.Option>
                     );
                 };
                 this.setState({

+ 2 - 2
js/component/manageCenter/servicesManage/highTech/highTechApply.jsx

@@ -156,7 +156,7 @@ const CognizanceDescFrom = Form.create()(React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/api/admin/getContacts",
+            url: globalConfig.context + "/api/admin/customer/findAllContacts",
             data: {
                 uid: uid || this.props.data.uid
             },
@@ -168,7 +168,7 @@ const CognizanceDescFrom = Form.create()(React.createClass({
                 for (let item in data.data) {
                     let theData = data.data[item];
                     theOption.push(
-                        <Select.Option value={item} key={theData}>{theData}</Select.Option>
+                        <Select.Option value={item} key={theData.name}>{theData.name}</Select.Option>
                     );
                 };
                 this.setState({

+ 2 - 2
js/component/manageCenter/servicesManage/patent/comPatentAdd.jsx

@@ -117,7 +117,7 @@ const PatentAddFrom = Form.create()(React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/api/admin/getContacts",
+            url: globalConfig.context + "/api/admin/customer/findAllContacts",
             data: {
                 uid: theUid || this.state.uid
             },
@@ -129,7 +129,7 @@ const PatentAddFrom = Form.create()(React.createClass({
                 for (let item in data.data) {
                     let theData = data.data[item];
                     theOption.push(
-                        <Select.Option value={item} key={theData}>{theData}</Select.Option>
+                        <Select.Option value={item} key={theData.name}>{theData.name}</Select.Option>
                     );
                 };
                 this.setState({

+ 2 - 2
js/component/manageCenter/servicesManage/patent/comPatentDesc.jsx

@@ -188,7 +188,7 @@ const PatentDesc = React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/api/admin/getContacts",
+            url: globalConfig.context + "/api/admin/customer/findAllContacts",
             data: {
                 uid: theUid || this.state.uid
             },
@@ -200,7 +200,7 @@ const PatentDesc = React.createClass({
                 for (let item in data.data) {
                     let theData = data.data[item];
                     theOption.push(
-                        <Select.Option value={item} key={theData}>{theData}</Select.Option>
+                        <Select.Option value={item} key={theData.name}>{theData.name}</Select.Option>
                     );
                 };
                 this.setState({

+ 2 - 2
js/component/manageCenter/servicesManage/technology/applyAdd.jsx

@@ -16,7 +16,7 @@ const ApplyAdd = React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/api/admin/getContacts",
+            url: globalConfig.context + "/api/admin/customer/findAllContacts",
             data: { "uid": theUid },
             success: function (data) {
                 let theOption = [];
@@ -26,7 +26,7 @@ const ApplyAdd = React.createClass({
                 for (let item in data.data) {
                     let theData = data.data[item];
                     theOption.push(
-                        <Select.Option value={item} key={item}>{theData}</Select.Option>
+                        <Select.Option value={item} key={item.name}>{theData.name}</Select.Option>
                     );
                 };
                 this.setState({

+ 2 - 2
js/component/manageCenter/servicesManage/technology/applyChange.jsx

@@ -87,7 +87,7 @@ const ApplyChangeFrom = Form.create()(React.createClass({
             method: "get",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + "/api/admin/getContacts",
+            url: globalConfig.context + "/api/admin/customer/findAllContacts",
             data: { "uid": id || this.props.data.uid },
             success: function (data) {
                 let theOption = [];
@@ -100,7 +100,7 @@ const ApplyChangeFrom = Form.create()(React.createClass({
                 for (let item in data.data) {
                     let theData = data.data[item];
                     theOption.push(
-                        <Select.Option value={item} key={item}>{theData}</Select.Option>
+                        <Select.Option value={item} key={item.name}>{theData.name}</Select.Option>
                     );
                 };
                 this.setState({