liting2017 7 jaren geleden
bovenliggende
commit
0de13b9abf

+ 152 - 139
js/component/manageCenter/customer/customerData/companyCustomer.jsx

@@ -291,7 +291,7 @@ const PublicCustomer = Form.create()(React.createClass({
 					  key: 'rrr',
 					   render: (text, record, index) => {                    	
                         return <div style={{display:adminData.isSuperAdmin?'inline-block':'none'}}>
-                            <Popconfirm title="是否删除?" onConfirm={(e)=>{this.intentionDelet(record)}} okText="删除" cancelText="不删除">
+                            <Popconfirm title="是否删除?" onConfirm={(e)=>{this.intentionDelet(record,index)}} okText="删除" cancelText="不删除">
 							    <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}}>删除</Button>
 							</Popconfirm>
                         </div>
@@ -580,7 +580,7 @@ const PublicCustomer = Form.create()(React.createClass({
                     render: (text, record, index) => {                    	
                         return record.shareType=='1'?<div>
                                <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
-                                onClick={(e)=>{this.changeRow(record)}}>领取<Icon /></Button>  
+                                onClick={(e)=>{ e.stopPropagation(),this.changeRow(record)}}>领取<Icon /></Button>  
                         </div>:<span>无权限</span>
                     }
                 } 
@@ -707,13 +707,16 @@ const PublicCustomer = Form.create()(React.createClass({
     	
 	//拜访记录删除
 	visitDelet(e){
+			this.setState({
+				loading:true
+			});
 			$.ajax({
 	            method: "get",
 	            dataType: "json",
 	            crossDomain: false,           
-	            url: globalConfig.context + "/api/admin/customer/deleteCustomer",
+	            url: globalConfig.context + "/api/admin/customer/deleteFollow",
 	            data: {
-	                id: e.followId,//删除的ID    
+	                followId: e.followId,//删除的ID    
 	            }
 	        }).done(function (data) {
 	            if (!data.error.length) {
@@ -934,19 +937,19 @@ const PublicCustomer = Form.create()(React.createClass({
             crossDomain: false,           
             url: globalConfig.context + "/api/admin/customer/receiveCustomer",  
             data: {
-                uid: uids.uid,
+                uid: uids.id,
             }
-		        }).done(function (data) {
-		            if (!data.error.length) {
-		                message.success('领取成功!');
-		                this.setState({
-		                    loading: false,
-		                });
-		            } else {
-		                message.warning(data.error[0].message);
-		            };
-		            this.loadData();
-		        }.bind(this));
+	        }).done(function (data) {
+	            if (!data.error.length) {
+	                message.success('领取成功!');
+	                this.setState({
+	                    loading: false,
+	                });
+	            } else {
+	                message.warning(data.error[0].message);
+	            };
+	            this.loadData();
+	        }.bind(this));
     },
     getOrgCodeUrl(e) {
         this.setState({ orgCodeUrl: e });
@@ -1047,7 +1050,15 @@ const PublicCustomer = Form.create()(React.createClass({
     },
     //基本信息提交
     newSubmit(e){
-    	e.preventDefault(); 
+    	e.preventDefault();
+    	if(!this.state.industry){
+    		message.warning('请选择行业');
+    		return false;
+    	};
+    	if(!this.state.societyTag){
+    		message.warning('请选择社会性质');
+    		return false;
+    	};
     	if(!this.state.ProvinceCity[1]){
     		message.warning('请选择地区');
     		return false;
@@ -1084,29 +1095,29 @@ const PublicCustomer = Form.create()(React.createClass({
                     data: {         	
                     	id:this.state.InformationId,
                         uid: this.state.InformationUid,
-                        societyTag:values.societyTag,
-                        introduction:values.introduction,
-                        identifyName:this.state.identifyName,
+                        societyTag:this.state.societyTag,
+                        introduction:this.state.introduction,
+                        unitName:this.state.unitName,
                         industry:this.state.industry,
                         locationProvince:(this.state.ProvinceCity)[0],//省-
                         locationCity:(this.state.ProvinceCity)[1],//市
                         locationArea:(this.state.ProvinceCity)[2],//区
-                        postalAddress:values.postalAddress,
-                        contactsFixedTel:values.contactsFixedTel,
-                        contactsFax:values.contactsFax,
-                        registeredCapital:values.registeredCapital,
-                        enterpriseScale:values.enterpriseScale,
-                        legalPerson:values.legalPerson,
-                        legalPersonIdCard:values.legalPersonIdCard,
-                        legalPersonTel:values.legalPersonTel,
-                        legalPersonEmail:values.legalPersonEmail,
+                        postalAddress:this.state.postalAddress,
+                        contactsFixedTel:this.state.contactsFixedTel,
+                        contactsFax:this.state.contactsFax,
+                        registeredCapital:this.state.registeredCapital,
+                        enterpriseScale:this.state.enterpriseScale,
+                        legalPerson:this.state.legalPerson,
+                        legalPersonIdCard:this.state.legalPersonIdCard,
+                        legalPersonTel:this.state.legalPersonTel,
+                        legalPersonEmail:this.state.legalPersonEmail,
                         highTechZone:this.state.highTechZone,
                         listed:this.state.listed,
-                        orgCode:values.orgCode,
-                        businessScope:values.businessScope,
-                        introduction:values.introduction,
+                        orgCode:this.state.orgCode,
+                        businessScope:this.state.businessScope,
+                        introduction:this.state.introduction,
                         companyLogoUrl:thecompanyLogoUrl,
-                        orgCodeUrl:theorgCodeUrl,    
+                        orgCodeUrl:theorgCodeUrl, 
                     }
                 }).done(function (data) {                	
                     this.setState({
@@ -1162,6 +1173,20 @@ const PublicCustomer = Form.create()(React.createClass({
                 	ProvinceCity:ProvinceCityArr,
                 	proviceCityArea:ProvinceS?cityArea:'',
                 	industry:String(thisData.industry)=='null'?undefined:String(thisData.industry),
+                	
+                	societyTag:thisData.societyTag,
+                	introduction:thisData.introduction,
+                	postalAddress:thisData.postalAddress,
+                	contactsFixedTel:thisData.contactsFixedTel,
+                	contactsFax:thisData.contactsFax,
+                	registeredCapital:thisData.registeredCapital,
+                	enterpriseScale:thisData.enterpriseScale,
+                	legalPerson:thisData.legalPerson,
+                	legalPersonIdCard:thisData.legalPersonIdCard,
+                	legalPersonTel:thisData.legalPersonTel,
+                	legalPersonEmail:thisData.legalPersonEmail,
+                	businessScope:thisData.businessScope,
+                	orgCode:thisData.orgCode,
                 });    
             }.bind(this),
         }).always(function () {
@@ -1203,7 +1228,7 @@ const PublicCustomer = Form.create()(React.createClass({
                 	mobile:thisData.mobile,
                 	nickname:thisData.nickname,
                 	email:thisData.email,
-                	type:getcustomerTyp(thisData.type),
+                	type:getcustomerTyp(String(thisData.type)),
                 	source:sourcecustomer,
                 	isMember:thisData.isMember,
                 	currentMemberStatus:String(thisData.currentMemberStatus),
@@ -1458,6 +1483,8 @@ const PublicCustomer = Form.create()(React.createClass({
                 },
                 success: function (data) {                	  
                 		if (!data.error.length) {
+                			this.addcontactModulOK()
+                			this.getNewWoman(this.state.uids)
 			                this.setState({
 			                    loading: false,
 			                })
@@ -1517,34 +1544,40 @@ const PublicCustomer = Form.create()(React.createClass({
 		console.log(e)
 	},
 	//拜访意向服务列表单个删除
-	intentionDelet(e){
-		
-		let detId=!this.state.keys?this.state.followIds:this.state.uid;
-		if(e.id||e.followId){
+	intentionDelet(e,index){
+		if(!this.state.keys){
+			let detId=this.state.followIds;
+			if(e.id){
+				this.setState({
+		       	  selectedRowKeys: [],
+		        });
+		        $.ajax({
+		            method: "get",
+		            dataType: "json",
+		            crossDomain: false,           
+		            url: globalConfig.context + "/api/admin/customer/deleteFollowOneBusiness",  
+		            data: {
+		                ufbId:e.id
+		            }
+			        }).done(function (data) {
+			            if (!data.error.length) {
+			                message.success('删除成功');
+			                this.setState({
+			                    loading: false,
+			                });
+			            } else {
+			                message.warning(data.error[0].message);
+			            };
+			          this.visitModify(detId);
+			        }.bind(this));
+		    }else{
+		        this.visitModify(detId);
+		        }
+		}else{
+			let deteluserBusinessList=(this.state.data).splice(index,1)
 			this.setState({
 	       	  selectedRowKeys: [],
 	        });
-	        $.ajax({
-	            method: "get",
-	            dataType: "json",
-	            crossDomain: false,           
-	            url: globalConfig.context + "/api/admin/customer/transferToPublic",  
-	            data: {
-	                id: e.id||e.followId
-	            }
-		        }).done(function (data) {
-		            if (!data.error.length) {
-		                message.success('删除成功');
-		                this.setState({
-		                    loading: false,
-		                });
-		            } else {
-		                message.warning(data.error[0].message);
-		            };
-		          !this.state.keys?this.visitModify(detId):this.deletelist(detId);
-		        }.bind(this));
-		}else{
-			!this.state.keys?this.visitModify(detId):this.deletelist(detId);
 		}
 	},
 	
@@ -1828,8 +1861,33 @@ const PublicCustomer = Form.create()(React.createClass({
 
 
     //tab2删除
-    confirmDelet(e){
-    	console.log(e)
+   confirmDelet(e){
+    	this.setState({
+				loading:true
+		});
+		if(e.id){
+			$.ajax({
+	            method: "get",
+	            dataType: "json",
+	            crossDomain: false,           
+	            url: globalConfig.context + "/api/admin/customer/deleteOneContact",
+	            data: {
+	                ocbId: e.id,//删除的ID    
+	            }
+	        }).done(function (data) {
+	            if (!data.error.length) {
+	                message.success('删除成功!');
+	                this.setState({
+	                    loading: false,
+	                });
+	            } else {
+	                message.warning(data.error[0].message);
+	            };
+	            this.contactLists(this.state.rowId);
+	        }.bind(this));
+        }else{
+        	this.contactLists(this.state.rowId);
+        }
     },
 
     //tab5业务意向
@@ -2094,43 +2152,34 @@ const PublicCustomer = Form.create()(React.createClass({
 					                    	<FormItem className="half-item" 
 					                         labelCol={{ span: 4 }}
 					                         wrapperCol={{ span: 18 }}
-					                        label="行业"
-					                         > 
-					                         {getFieldDecorator('industry', {
-						                        	    rules: [{ required: true, message: '此项为必填项!' }],
-						                            	initialValue: this.state.industry
-				                                 })(
-												    <Select placeholder="选择行业" >
+					                         label="行业">
+											    <Select placeholder="选择行业" value={this.state.industry} 
+											    				onChange={(e)=>{this.setState({industry:e})}}>
 				                                      {
 				                                        industry.map(function (item) {
 				                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
 				                                        })
 				                                      }
-				                                    </Select>
-				                                  )}
+				                                </Select>
 					                   		 </FormItem>
 					                   		 <FormItem className="half-item" 
 					                           labelCol={{ span: 4 }}
 					                            wrapperCol={{ span: 18 }}
 					                           label="社会属性"
 					                         > 
-						                        {getFieldDecorator('societyTag', {
-						                        	    rules: [{ required: true, message: '此项为必填项!' }],
-						                            	initialValue: theInformation.societyTag
-				                                 })(
-												    <Select placeholder="客户社会属性(必填项)" >
+												    <Select placeholder="客户社会属性(必填项)" value={this.state.societyTag} 
+											    				onChange={(e)=>{this.setState({societyTag:e})}}>
 				                                    {
 				                                        socialAttribute.map(function (item) {
 				                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
 				                                        })
 				                                    }
 				                                </Select>
-				                                )}
 					                   		 </FormItem>
 					                         <FormItem className="half-item" 
 					                           labelCol={{ span: 4 }}
 					                           wrapperCol={{ span: 18 }}
-					                           label="省-市-区"
+					                           label="*省-市-区"
 					                          > 
 					                            <Cascader options={areaSelect()}  value={this.state.ProvinceCity} placeholder="选择城市(必填项)"
     												onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />                
@@ -2140,99 +2189,72 @@ const PublicCustomer = Form.create()(React.createClass({
 							                        wrapperCol={{ span: 18 }}
 							                         label="通信地址"
 						                            >
-						                            {getFieldDecorator('postalAddress', {
-						                                initialValue: theInformation.postalAddress
-						                            })(
-						                                <Input placeholder="客户通信地址"/>
-						                                )}
+						                                <Input placeholder="客户通信地址" value={this.state.postalAddress} 
+											    				onChange={(e)=>{this.setState({postalAddress:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                         label="固定电话"
 						                            >
-						                            {getFieldDecorator('contactsFixedTel', {
-						                                initialValue: theInformation.contactsFixedTel
-						                            })(
-						                                <Input placeholder="客户固定电话"/>
-						                                )}
+						                                <Input placeholder="客户固定电话" value={this.state.contactsFixedTel} 
+											    				onChange={(e)=>{this.setState({contactsFixedTel:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="客户传真"
 						                            >
-						                            {getFieldDecorator('contactsFax', {
-						                                initialValue: theInformation.contactsFax
-						                            })(
-						                                <Input placeholder="客户传真"/>
-						                                )}
+						                                <Input placeholder="客户传真" value={this.state.contactsFax} 
+											    				onChange={(e)=>{this.setState({contactsFax:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="注册资本"
 						                            >
-						                            {getFieldDecorator('registeredCapital', {
-						                                initialValue: theInformation.registeredCapital
-						                            })(
-						                                <Input placeholder="注册资本"/>
-						                                )}
+						                                <Input placeholder="注册资本" value={this.state.registeredCapital} 
+											    				onChange={(e)=>{this.setState({registeredCapital:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="单位规模"
 						                            >
-						                            {getFieldDecorator('enterpriseScale', {
-						                                initialValue: theInformation.enterpriseScale
-						                            })(
-						                                <Input placeholder="单位规模"/>
-						                                )}
+						                                <Input placeholder="单位规模" value={this.state.enterpriseScale} 
+											    				onChange={(e)=>{this.setState({enterpriseScale:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="法人名称"
 						                            >
-						                            {getFieldDecorator('legalPerson', {
-						                                initialValue: theInformation.legalPerson
-						                            })(
-						                                <Input placeholder="法人名称"/>
-						                                )}
+						                                <Input placeholder="法人名称" value={this.state.legalPerson} 
+											    				onChange={(e)=>{this.setState({legalPerson:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="身份证号码"
 						                            >
-						                            {getFieldDecorator('legalPersonIdCard', {
-						                                initialValue: theInformation.legalPersonIdCard
-						                            })(
-						                                <Input placeholder="法人身份证号码"/>
-						                                )}
+						                                <Input placeholder="法人身份证号码" value={this.state.legalPersonIdCard} 
+											    				onChange={(e)=>{this.setState({legalPersonIdCard:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="法人电话"
-						                            >
-						                            {getFieldDecorator('legalPersonTel', {
-						                                initialValue: theInformation.legalPersonTel
-						                            })(
-						                                <Input placeholder="法人电话"/>
-						                                )}
+						                            > 
+						                                <Input placeholder="法人电话" value={this.state.legalPersonTel} 
+											    				onChange={(e)=>{this.setState({legalPersonTel:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="电子邮箱"
 						                            >
-						                            {getFieldDecorator('legalPersonEmail', {
-						                                initialValue: theInformation.legalPersonEmail
-						                            })(
-						                                <Input placeholder="法人电子邮箱"/>
-						                                )}
+						                                <Input placeholder="法人电子邮箱" value={this.state.legalPersonEmail} 
+											    				onChange={(e)=>{this.setState({legalPersonEmail:e.target.value})}}/>
 						                    </FormItem>
 					                   		<FormItem className="half-item"
 				                   		   		labelCol={{ span: 4 }}
@@ -2263,11 +2285,8 @@ const PublicCustomer = Form.create()(React.createClass({
 							                        wrapperCol={{ span: 18 }}
 							                        label="机构代码"
 						                            >
-						                            {getFieldDecorator('orgCode', {
-						                                initialValue: theInformation.orgCode
-						                            })(
-						                                <Input placeholder="社会同意机构代码"/>
-						                                )}
+						                                <Input placeholder="社会同意机构代码" value={this.state.orgCode} 
+											    				onChange={(e)=>{this.setState({orgCode:e.target.value})}}/>
 						                    </FormItem>
 						                    <div className="clearfix pictures">
 						                        <FormItem
@@ -2296,21 +2315,15 @@ const PublicCustomer = Form.create()(React.createClass({
 						                        labelCol={{ span: 2 }}
 						                        wrapperCol={{ span: 18 }}
 						                        label="业务范围" >
-						                        {getFieldDecorator('businessScope', {
-						                            initialValue: theInformation.businessScope
-						                        })(
-						                            <Input type="textarea" rows={4} />
-						                            )}
+						                            <Input type="textarea" rows={4} value={this.state.businessScope} 
+											    				onChange={(e)=>{this.setState({businessScope:e.target.value})}}/>
 							                    </FormItem>
 							                    <FormItem
 							                        labelCol={{ span: 2 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="单位简介" >
-							                        {getFieldDecorator('introduction', {
-							                            initialValue: theInformation.introduction
-							                        })(
-							                            <Input type="textarea" rows={4} />
-							                            )}
+							                            <Input type="textarea" rows={4}  value={this.state.introduction} 
+											    				onChange={(e)=>{this.setState({introduction:e.target.value})}}/>			                      
 							                    </FormItem>
 						                    </div>
 						                    <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'90px',marginBottom:'30px'}}>保存</Button>  
@@ -2701,7 +2714,7 @@ const PublicCustomer = Form.create()(React.createClass({
 					                <FormItem className="half-item"
 			                           {...formItemLayout}
 			                             >
-					                	<Button type="primary" onClick={this.newContacts} style={{marginLeft:'100px'}}>添加新联系人</Button>
+					                	<Button type="primary" onClick={this.newContacts} style={{marginLeft:'100px',display:this.state.keys?'inline-block':'none'}}>添加新联系人</Button>
 					                </FormItem>
 					                <div className="clearfix">
 						                <FormItem className="half-item"

+ 83 - 118
js/component/manageCenter/customer/customerData/myClient.jsx

@@ -66,13 +66,10 @@ const PicturesWall = React.createClass({
 
 const MyClient = Form.create()(React.createClass({	
     loadData(pageNo, apiUrl) {
-        this.state.data = [];
         this.setState({
             loading: true
         }); 
-        
-        console.log(this.state.addressSearch)
-        console.log(this.state.provinceSearch)
+       
         $.ajax({
             method: "post",
             dataType: "json",
@@ -802,12 +799,10 @@ const MyClient = Form.create()(React.createClass({
    	//转为公共客户
    	 changeRow() {
         let deletedIds;
-        let adminName;
         for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
             let rowItem = this.state.selectedRows[idx];
             if (rowItem.id) {
-                deletedIds=rowItem.id;
-                adminName=rowItem.adminName;               
+                deletedIds=rowItem.id;             
             };            
         };       
         this.setState({
@@ -819,8 +814,7 @@ const MyClient = Form.create()(React.createClass({
             crossDomain: false,           
             url: globalConfig.context + "/api/admin/customer/transferToPublic",  
             data: {
-                id: deletedIds,
-				beforeAdminName:adminName,
+                uid: deletedIds,
             }
         }).done(function (data) {
             if (!data.error.length) {
@@ -992,11 +986,18 @@ const MyClient = Form.create()(React.createClass({
     //基本信息提交
     newSubmit(e){
     	e.preventDefault();
+    	if(!this.state.industry){
+    		message.warning('请选择行业');
+    		return false;
+    	};
+    	if(!this.state.societyTag){
+    		message.warning('请选择社会性质');
+    		return false;
+    	};
     	if(!this.state.ProvinceCity[1]){
     		message.warning('请选择地区');
     		return false;
     	};
-    	this.state.data=[];
         this.setState({        	
             selectedRowKeys: [],           
         });
@@ -1028,27 +1029,27 @@ const MyClient = Form.create()(React.createClass({
                     data: {         	
                     	id:this.state.InformationId,
                         uid: this.state.InformationUid,
-                        societyTag:values.societyTag,
-                        introduction:values.introduction,
+                        societyTag:this.state.societyTag,
+                        introduction:this.state.introduction,
                         unitName:this.state.unitName,
-                        industry:values.industry,
+                        industry:this.state.industry,
                         locationProvince:(this.state.ProvinceCity)[0],//省-
                         locationCity:(this.state.ProvinceCity)[1],//市
                         locationArea:(this.state.ProvinceCity)[2],//区
-                        postalAddress:values.postalAddress,
-                        contactsFixedTel:values.contactsFixedTel,
-                        contactsFax:values.contactsFax,
-                        registeredCapital:values.registeredCapital,
-                        enterpriseScale:values.enterpriseScale,
-                        legalPerson:values.legalPerson,
-                        legalPersonIdCard:values.legalPersonIdCard,
-                        legalPersonTel:values.legalPersonTel,
-                        legalPersonEmail:values.legalPersonEmail,
+                        postalAddress:this.state.postalAddress,
+                        contactsFixedTel:this.state.contactsFixedTel,
+                        contactsFax:this.state.contactsFax,
+                        registeredCapital:this.state.registeredCapital,
+                        enterpriseScale:this.state.enterpriseScale,
+                        legalPerson:this.state.legalPerson,
+                        legalPersonIdCard:this.state.legalPersonIdCard,
+                        legalPersonTel:this.state.legalPersonTel,
+                        legalPersonEmail:this.state.legalPersonEmail,
                         highTechZone:this.state.highTechZone,
                         listed:this.state.listed,
-                        orgCode:values.orgCode,
-                        businessScope:values.businessScope,
-                        introduction:values.introduction,
+                        orgCode:this.state.orgCode,
+                        businessScope:this.state.businessScope,
+                        introduction:this.state.introduction,
                         companyLogoUrl:thecompanyLogoUrl,
                         orgCodeUrl:theorgCodeUrl,    
                     }
@@ -1070,14 +1071,9 @@ const MyClient = Form.create()(React.createClass({
     //点击整行查看详情
     //查看基本详情基本信息
     loadInformation(record){    	
-    	this.RowClick; 
-    	this.setState({
-    		dataInformation:[]
-    	})
     	$.ajax({
             method: "get",
             dataType: "json",
-            crossDomain: false,
             url: globalConfig.context + '/api/admin/customer/findOrganizationCustomerDetail',
             data: {
                 uid: record
@@ -1105,7 +1101,21 @@ const MyClient = Form.create()(React.createClass({
                 	companyLogoUrl: thisData.companyLogoUrl ? splitUrl(thisData.companyLogoUrl, ',', globalConfig.avatarHost + '/upload') : [],
                 	dataInformation:thisData,
                 	ProvinceCity:ProvinceCityArr,
-                	industry:thisData.industry?thisData.industry.toString():'',
+                	industry:String(thisData.industry)=='null'?undefined:String(thisData.industry),
+                	
+                	societyTag:thisData.societyTag,
+                	introduction:thisData.introduction,
+                	postalAddress:thisData.postalAddress,
+                	contactsFixedTel:thisData.contactsFixedTel,
+                	contactsFax:thisData.contactsFax,
+                	registeredCapital:thisData.registeredCapital,
+                	enterpriseScale:thisData.enterpriseScale,
+                	legalPerson:thisData.legalPerson,
+                	legalPersonIdCard:thisData.legalPersonIdCard,
+                	legalPersonTel:thisData.legalPersonTel,
+                	legalPersonEmail:thisData.legalPersonEmail,
+                	businessScope:thisData.businessScope,
+                	orgCode:thisData.orgCode,
                 });    
             }.bind(this),
         }).always(function () {
@@ -1147,7 +1157,7 @@ const MyClient = Form.create()(React.createClass({
                 	mobile:thisData.mobile,
                 	nickname:thisData.nickname,
                 	email:thisData.email,
-                	type:getcustomerTyp(thisData.type),
+                	type:getcustomerTyp(String(thisData.type)),
                 	source:sourcecustomer,
                 	isMember:thisData.isMember,
                 	currentMemberStatus:String(thisData.currentMemberStatus),
@@ -1451,10 +1461,7 @@ const MyClient = Form.create()(React.createClass({
 	            });
 	        }.bind(this));
 	},
-	//意向服务列表修改保存
-	intentionModify(e){
-		console.log(e)
-	},
+	
 	//拜访意向服务列表单个删除
 	intentionDelet(e,index){
 		if(!this.state.keys){
@@ -1926,7 +1933,7 @@ const MyClient = Form.create()(React.createClass({
                     </span>
                     <Button type="primary" onClick={this.search}>搜索</Button>
                     <Button onClick={this.reset}>重置</Button>                      
-                    <Button disabled onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/downloadTemplate?sign=achievement_template') }}>下载批量导入模板</Button>
+                    <Button onClick={() => { window.open(globalConfig.context + '/api/admin/customer/downloadTemplate?type=1') }}>下载批量导入模板</Button>
                		<Upload 
                		    name="file"
                         action={globalConfig.context + "/api/admin/customer/uploadExcel"}                            
@@ -1948,7 +1955,7 @@ const MyClient = Form.create()(React.createClass({
                                 message.error(`${info.file.name} 文件上传失败。`);
                             };
                         }} >
-                        <Button disabled>上传批量内容</Button>
+                        <Button>上传批量内容</Button>
                     </Upload>                        
 	                <Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
 							     <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
@@ -2094,145 +2101,112 @@ const MyClient = Form.create()(React.createClass({
 					                    	<FormItem className="half-item" 
 					                         labelCol={{ span: 4 }}
 					                         wrapperCol={{ span: 18 }}
-					                        label="行业"
-					                         > 
-					                         {getFieldDecorator('industry', {
-						                        	    rules: [{ required: true, message: '此项为必填项!' }],
-						                            	initialValue: this.state.industry
-				                                 })(
-												    <Select placeholder="选择行业" >
+					                         label="行业">
+											    <Select placeholder="选择行业" value={this.state.industry}  style={{width:'300px'}}
+											    				onChange={(e)=>{this.setState({industry:e})}}>
 				                                      {
 				                                        industry.map(function (item) {
 				                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
 				                                        })
 				                                      }
-				                                    </Select>
-				                                  )}
+				                                </Select>
+				                                <span style={{color:'red',marginLeft:'15px'}}>*</span>
 					                   		 </FormItem>
 					                   		 <FormItem className="half-item" 
 					                           labelCol={{ span: 4 }}
 					                            wrapperCol={{ span: 18 }}
 					                           label="社会属性"
 					                         > 
-						                        {getFieldDecorator('societyTag', {
-						                        	    rules: [{ required: true, message: '此项为必填项!' }],
-						                            	initialValue: theInformation.societyTag
-				                                 })(
-												    <Select placeholder="客户社会属性(必填项)" >
+												    <Select placeholder="客户社会属性(必填项)" value={this.state.societyTag}  style={{width:'300px'}}
+											    				onChange={(e)=>{this.setState({societyTag:e})}}>
 				                                    {
 				                                        socialAttribute.map(function (item) {
 				                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
 				                                        })
 				                                    }
 				                                </Select>
-				                                )}
+				                                <span style={{color:'red',marginLeft:'15px'}}>*</span>
 					                   		 </FormItem>
 					                         <FormItem className="half-item" 
 					                           labelCol={{ span: 4 }}
 					                           wrapperCol={{ span: 18 }}
-					                           label="*省-市-区"
+					                           label="省-市-区"
 					                          > 
-					                            <Cascader options={areaSelect()}  value={this.state.ProvinceCity} placeholder="选择城市(必填项)"
-    												onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />                
+					                            <Cascader options={areaSelect()}  value={this.state.ProvinceCity} placeholder="选择城市" style={{width:'300px'}}
+    												onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
+    												<span style={{color:'red',marginLeft:'15px'}}>*</span>
 						                   </FormItem>
 						                   <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                         label="通信地址"
 						                            >
-						                            {getFieldDecorator('postalAddress', {
-						                                initialValue: theInformation.postalAddress
-						                            })(
-						                                <Input placeholder="客户通信地址"/>
-						                                )}
+						                                <Input placeholder="客户通信地址" value={this.state.postalAddress} 
+											    				onChange={(e)=>{this.setState({postalAddress:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                         label="固定电话"
 						                            >
-						                            {getFieldDecorator('contactsFixedTel', {
-						                                initialValue: theInformation.contactsFixedTel
-						                            })(
-						                                <Input placeholder="客户固定电话"/>
-						                                )}
+						                                <Input placeholder="客户固定电话" value={this.state.contactsFixedTel} 
+											    				onChange={(e)=>{this.setState({contactsFixedTel:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="客户传真"
 						                            >
-						                            {getFieldDecorator('contactsFax', {
-						                                initialValue: theInformation.contactsFax
-						                            })(
-						                                <Input placeholder="客户传真"/>
-						                                )}
+						                                <Input placeholder="客户传真" value={this.state.contactsFax} 
+											    				onChange={(e)=>{this.setState({contactsFax:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="注册资本"
 						                            >
-						                            {getFieldDecorator('registeredCapital', {
-						                                initialValue: theInformation.registeredCapital
-						                            })(
-						                                <Input placeholder="注册资本"/>
-						                                )}
+						                                <Input placeholder="注册资本" value={this.state.registeredCapital} 
+											    				onChange={(e)=>{this.setState({registeredCapital:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="单位规模"
 						                            >
-						                            {getFieldDecorator('enterpriseScale', {
-						                                initialValue: theInformation.enterpriseScale
-						                            })(
-						                                <Input placeholder="单位规模"/>
-						                                )}
+						                                <Input placeholder="单位规模" value={this.state.enterpriseScale} 
+											    				onChange={(e)=>{this.setState({enterpriseScale:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="法人名称"
 						                            >
-						                            {getFieldDecorator('legalPerson', {
-						                                initialValue: theInformation.legalPerson
-						                            })(
-						                                <Input placeholder="法人名称"/>
-						                                )}
+						                                <Input placeholder="法人名称" value={this.state.legalPerson} 
+											    				onChange={(e)=>{this.setState({legalPerson:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="身份证号码"
 						                            >
-						                            {getFieldDecorator('legalPersonIdCard', {
-						                                initialValue: theInformation.legalPersonIdCard
-						                            })(
-						                                <Input placeholder="法人身份证号码"/>
-						                                )}
+						                                <Input placeholder="法人身份证号码" value={this.state.legalPersonIdCard} 
+											    				onChange={(e)=>{this.setState({legalPersonIdCard:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="法人电话"
-						                            >
-						                            {getFieldDecorator('legalPersonTel', {
-						                                initialValue: theInformation.legalPersonTel
-						                            })(
-						                                <Input placeholder="法人电话"/>
-						                                )}
+						                            > 
+						                                <Input placeholder="法人电话" value={this.state.legalPersonTel} 
+											    				onChange={(e)=>{this.setState({legalPersonTel:e.target.value})}}/>
 						                    </FormItem>
 						                    <FormItem className="half-item"
 							                    	labelCol={{ span: 4 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="电子邮箱"
 						                            >
-						                            {getFieldDecorator('legalPersonEmail', {
-						                                initialValue: theInformation.legalPersonEmail
-						                            })(
-						                                <Input placeholder="法人电子邮箱"/>
-						                                )}
+						                                <Input placeholder="法人电子邮箱" value={this.state.legalPersonEmail} 
+											    				onChange={(e)=>{this.setState({legalPersonEmail:e.target.value})}}/>
 						                    </FormItem>
 					                   		<FormItem className="half-item"
 				                   		   		labelCol={{ span: 4 }}
@@ -2263,11 +2237,8 @@ const MyClient = Form.create()(React.createClass({
 							                        wrapperCol={{ span: 18 }}
 							                        label="机构代码"
 						                            >
-						                            {getFieldDecorator('orgCode', {
-						                                initialValue: theInformation.orgCode
-						                            })(
-						                                <Input placeholder="社会同意机构代码"/>
-						                                )}
+						                                <Input placeholder="社会同意机构代码" value={this.state.orgCode} 
+											    				onChange={(e)=>{this.setState({orgCode:e.target.value})}}/>
 						                    </FormItem>
 						                    <div className="clearfix pictures">
 						                        <FormItem
@@ -2296,21 +2267,15 @@ const MyClient = Form.create()(React.createClass({
 						                        labelCol={{ span: 2 }}
 						                        wrapperCol={{ span: 18 }}
 						                        label="业务范围" >
-						                        {getFieldDecorator('businessScope', {
-						                            initialValue: theInformation.businessScope
-						                        })(
-						                            <Input type="textarea" rows={4} />
-						                            )}
+						                            <Input type="textarea" rows={4} value={this.state.businessScope} 
+											    				onChange={(e)=>{this.setState({businessScope:e.target.value})}}/>
 							                    </FormItem>
 							                    <FormItem
 							                        labelCol={{ span: 2 }}
 							                        wrapperCol={{ span: 18 }}
 							                        label="单位简介" >
-							                        {getFieldDecorator('introduction', {
-							                            initialValue: theInformation.introduction
-							                        })(
-							                            <Input type="textarea" rows={4} />
-							                            )}
+							                            <Input type="textarea" rows={4}  value={this.state.introduction} 
+											    				onChange={(e)=>{this.setState({introduction:e.target.value})}}/>			                      
 							                    </FormItem>
 						                    </div>
 						                    <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'90px',marginBottom:'30px'}}>保存</Button>  
@@ -2520,7 +2485,7 @@ const MyClient = Form.create()(React.createClass({
 					                <FormItem className="half-item"
 			                           {...formItemLayout}
 			                             >
-					                	<Button type="primary" onClick={this.newContacts} style={{marginLeft:'100px'}}>添加新联系人</Button>
+					                	<Button type="primary" onClick={this.newContacts} style={{marginLeft:'100px',display:this.state.keys?'inline-block':'none'}}>添加新联系人</Button>
 					                </FormItem>
 					                <div className="clearfix">
 						                <FormItem className="half-item"

File diff suppressed because it is too large
+ 397 - 387
js/component/manageCenter/customer/individualCustomer/individualCustomer.jsx


+ 28 - 40
js/component/manageCenter/customer/individualCustomer/myClientDesc.jsx

@@ -18,7 +18,7 @@ const AchievementDetailForm = Form.create()(React.createClass({
     		message.warning('联系人字数不超过64个')
     		return false;
 	    	};
-	    	if(values.telnum.length>13){
+	    	if(values.telnums.length>13){
 	    		message.warning('电话号码字数不超过13个')
 	    		return false;
 	    	};
@@ -30,15 +30,12 @@ const AchievementDetailForm = Form.create()(React.createClass({
                     method: "POST",
                     dataType: "json",
                     crossDomain: false,
-                    url: globalConfig.context + '/api/admin/customer/addCu',
+                    url: globalConfig.context + '/api/admin/customer/addCustomer',
                     data: {
+                        contacts:values.companyNamet,
+                        societyTag:values.societyTagt,
                         name: values.companyNamet, 
-                        contactMobile: values.telnum,
-                        depatrment:this.state.depatrments,
-                        position:this.state.positions,
-                        wechat:this.state.wechats,
-                        qq:this.state.qqs,
-                        email:this.state.emails,
+                        contactMobile: values.telnums,
                         type:'0'
                     }
                 }).done(function (data) { 
@@ -110,46 +107,37 @@ const AchievementDetailForm = Form.create()(React.createClass({
                                     <Input placeholder="客户姓名" />
                                 )} 
 	                    </FormItem>
+	                    </div>
+	                    <div className="clearfix">
                     	<FormItem className="half-item"
 	                            {...formItemLayout}
 	                            label="联系电话" >
-	                    		{getFieldDecorator('telnum', {
+	                    		{getFieldDecorator('telnums', {
 	                                rules: [{ required: true, message: '此项为必填项!' }],
-	                                initialValue: this.state.telnum
+	                                initialValue: this.state.telnums
                                 })(
                                     <Input placeholder="联系电话" />
                                 )} 
 	                    </FormItem>
-	                    <FormItem className="half-item"
-	                            {...formItemLayout}
-	                            label="联系人部门" >
-	                              <Input value={this.state.depatrments} placeholder="联系人部门"  
-	                                    onChange={(e) => { this.setState({ depatrments: e.target.value }); }} />
-	                    </FormItem>
-	                    <FormItem className="half-item"
-	                            {...formItemLayout}
-	                            label="联系人职务" >
-	                              <Input value={this.state.positions} placeholder="联系人职务"  
-	                                    onChange={(e) => { this.setState({ positions: e.target.value }); }} />
-	                    </FormItem>
-	                    <FormItem className="half-item"
-	                            {...formItemLayout}
-	                            label="微信" >
-	                              <Input value={this.state.wechats} placeholder="微信"  
-	                                    onChange={(e) => { this.setState({ wechats: e.target.value }); }} />
-	                    </FormItem>
-	                    <FormItem className="half-item"
-	                            {...formItemLayout}
-	                            label="联系人QQ" >
-	                              <Input value={this.state.qqs} placeholder="联系人QQ"  
-	                                    onChange={(e) => { this.setState({ qqs: e.target.value }); }} />
-	                    </FormItem>
-	                    <FormItem className="half-item"
-	                            {...formItemLayout}
-	                            label="电子邮箱" >
-	                              <Input value={this.state.emails} placeholder="电子邮箱"  
-	                                    onChange={(e) => { this.setState({ emails: e.target.value }); }} />
-	                    </FormItem>
+                    </div>
+                    <div className="clearfix">
+                    	<FormItem className="half-item" 
+                          {...formItemLayout}
+                           label="社会属性"
+                         > 
+                         {getFieldDecorator('societyTagt', {
+	                                rules: [{ required: true, message: '此项为必填项!' }],
+	                                initialValue: this.state.societyTagt
+                                })(
+							  <Select placeholder="客户社会属性"> 
+                                {
+                                    socialAttribute.map(function (item) {
+                                        return <Select.Option key={item.value} >{item.key}</Select.Option>
+                                    })
+                                }
+                              </Select>
+                            )}
+                   		 </FormItem>
                     </div>
                     <FormItem wrapperCol={{ span: 12, offset: 4 }}>
                         <Button className="set-submit" type="primary" htmlType="submit">保存</Button>  

File diff suppressed because it is too large
+ 500 - 423
js/component/manageCenter/customer/individualCustomer/queryCustomer.jsx