Browse Source

Merge branch 'master' of ssh://git.jishutao.com:55555/jishutao/web

dengzhiguo 6 years ago
parent
commit
72c8690e82

+ 1 - 1
js/component/manageCenter/customer/NEW/intentionCustomer/followDetail.jsx

@@ -286,7 +286,7 @@ const FollowDetail = React.createClass({
 			message.warning('请选择联系人')
 			return false;
 		}
-		if(GlossoryId) {
+		if(this.state.data.length&&GlossoryId) {
 			message.warning("项目名称/最新进度/最新状态不能为空!")
 			return false;
 		};

+ 2 - 2
js/component/manageCenter/customer/NEW/intentionCustomer/intentionDetail/detail/basicPerson.jsx

@@ -264,8 +264,8 @@ const Basic = React.createClass({
 				postalAddress: this.state.postalAddress,
 				introduction: this.state.introduction,
 				positiveIdUrl: thecompanyLogoUrl.length != 0 ? thecompanyLogoUrl : '',
-				oppositeIdUrl: thecompanyLogoUrls != 0 ? thecompanyLogoUrls : '',
-				headPortraitUrl: theorgCodeUrl != 0 ? theorgCodeUrl : '',
+				oppositeIdUrl: thecompanyLogoUrls.length != 0 ? thecompanyLogoUrls : '',
+				headPortraitUrl: theorgCodeUrl.length != 0 ? theorgCodeUrl : '',
 				investment: this.state.investment,
 				professionalTitle: this.state.professionalTitle,
 				workUnit: this.state.workUnit,

+ 5 - 4
js/component/manageCenter/customer/NEW/intentionCustomer/intentionDetail/detail/visitDetail.jsx

@@ -171,8 +171,8 @@ const VisitDetail = React.createClass({
 							businessGlossoryId:i,
 							businessVarietiesName:thisdata.businessVarietiesName,
 							businessProjectName:thisdata.businessProjectName,
-							followSituation: String(thisdata.followSituation),
-							customerStatus: String(thisdata.customerStatus),
+							followSituation: thisdata.followSituation==null?undefined : String(thisdata.followSituation),
+						    customerStatus: thisdata.customerStatus==null?undefined : String(thisdata.customerStatus),
 							remarks: thisdata.remarks,
 						});
 					}
@@ -247,7 +247,7 @@ const VisitDetail = React.createClass({
 				GlossoryId = true
 			}
 		})
-		if(GlossoryId) {
+		if(this.state.data.length&&GlossoryId) {
 			message.warning("业务名称/项目名称/最新进度/最新状态不能为空!")
 			return false;
 		};
@@ -266,13 +266,14 @@ const VisitDetail = React.createClass({
 			loading: true
 		});
 		//新增
+		console.log(idsList)
 		$.ajax({
 			method: "post",
 			dataType: "json",
 			url: globalConfig.context + '/api/admin/customer/updateFollow',
 			data: {
-				followId: this.state.followIds,
 				userBusinessList: JSON.stringify(idsList),
+				followId: this.state.followIds,
 				uid: this.state.uid,
 				contactType: this.state.contactType,
 				result: this.state.result,

+ 44 - 32
js/component/manageCenter/customer/NEW/signCustomer/followDetail.jsx

@@ -33,7 +33,13 @@ const FollowDetail = React.createClass({
 					dataIndex: 'followSituation',
 					key: 'followSituation',
 					render: (text, record, index) => {
-						return  <span>{getfllowSituation(text)}</span>
+						return <Select  placeholder="选择最新进度" value={record.followSituation}  onChange={(e) => { record.followSituation = e; this.setState({ data: this.state.data }); }}>
+                                    {
+                                        newFollow.map(function (item) {
+                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
+                                        })
+                                    }
+                               </Select>
 					}
 				}, {
 					title: '最新状态',
@@ -41,7 +47,13 @@ const FollowDetail = React.createClass({
 					dataIndex: 'customerStatus',
 					key: 'customerStatus',
 					render: (text, record, index) => {
-						return <span>{getcustomerStatue(text)}</span>
+						return <Select value={record.customerStatus} placeholder="选择最新状态" onChange={(e) => { record.customerStatus = e; this.setState({ data: this.state.data }); }}>
+                                    {
+                                        customerStatus.map(function (item) {
+                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
+                                        })
+                                    }
+                               </Select>
 					}
 				}, {
 					title: '跟进说明',
@@ -49,23 +61,9 @@ const FollowDetail = React.createClass({
 					dataIndex: 'remarks',
 					key: 'remarks',
 					render: (text, record, index) => {
-						return(
-							<div>
-								<span title={text}>{text&&text.length>14?(text.substr(0,14)+'…'):text}</span>
-							</div>
-							)
-					}
-				}, {
-					title: '操作',
-					width:120,
-					dataIndex: 'rrr',
-					key: 'rrr',
-					render: (text, record, index) => {
-						return <div>
-                            <Popconfirm title="是否删除?" onConfirm={(e)=>{this.intentionDelet(record,index)}} okText="删除" cancelText="不删除">
-							    <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}}>删除</Button>
-							</Popconfirm>
-                        </div>
+						return <Input value={record.remarks} placeholder="跟进说明" 
+	                             onChange={(e) => { record.remarks = e.target.value; this.setState({ data: this.state.data }); }}
+	                             />
 					}
 				}
 			],
@@ -176,18 +174,23 @@ const FollowDetail = React.createClass({
 					};
 					thedata = {};
 				};
-				for(let i = 0; i < data.data.userBusinessList.length; i++) {
-					let thisdata = data.data.userBusinessList[i];
-					listArr.push({
-						id: thisdata.businessId,
-						businessName:thisdata.businessProjectId,
-						businessVarietiesName:thisdata.businessVarietiesName,
-						businessProjectName:thisdata.businessProjectName,
-						followSituation: String(thisdata.followSituation),
-						customerStatus: String(thisdata.customerStatus),
-						remarks: thisdata.remarks,
-					});
-				};
+				if(data.data.userBusinessList[0]!=null) {
+					for(let i = 0; i < data.data.userBusinessList.length; i++) {
+						let thisdata = data.data.userBusinessList[i];
+						if(thisdata!=null){
+							listArr.push({
+								key:i,
+								businessName:thisdata.businessProjectId,
+								businessVarietiesName:thisdata.businessVarietiesName,
+								businessProjectName:thisdata.businessProjectName,
+								followSituation: thisdata.followSituation==null?undefined : String(thisdata.followSituation),
+								customerStatus: thisdata.customerStatus==null?undefined : String(thisdata.customerStatus),
+								remarks: thisdata.remarks
+							});
+						}
+					};
+				}
+				
 				this.setState({
 					contacts: thedata.contacts,
 					uid: thedata.uid,
@@ -230,6 +233,12 @@ const FollowDetail = React.createClass({
 	//详情保存
 	visitSubmit(e){
 		e.preventDefault();
+		let GlossoryId=false;
+		this.state.data.map(function(item) {
+			if(!item.followSituation||!item.customerStatus||!item.businessName) {
+				GlossoryId = true
+			}
+		})
 		if(this.state.contactType == undefined) {
 			message.warning('请选择拜访方式')
 			return false;
@@ -238,6 +247,10 @@ const FollowDetail = React.createClass({
 			message.warning('请选择联系人')
 			return false;
 		}
+		if(this.state.data.length&&GlossoryId) {
+			message.warning("项目名称/最新进度/最新状态不能为空!")
+			return false;
+		};
 		this.setState({
 			loading: true
 		});
@@ -377,7 +390,6 @@ const FollowDetail = React.createClass({
 					                 	<div className="clearfix" >
 		                    			    <Spin spinning={this.state.loading}>
 										      <Table 
-										         rowKey={record => record.id}
 								            	 pagination={false}
 								            	 columns={this.state.intentionList} 
 								            	 dataSource={this.state.data}

+ 0 - 1
js/component/manageCenter/customer/NEW/signCustomer/intentionDetail/detail/basic.jsx

@@ -7,7 +7,6 @@ import { citySelect, provinceList, areaSelect ,getProvince} from '@/NewDicProvin
 import { socialAttribute, industry, newFollow, auditStatusL, lvl, currentMember, cityArr, statuslist, customerStatus, intentionalService, sex } from '@/dataDic.js';
 import { getCompanyIntention, splitUrl, getIndustry, getStatuslist, getAuditStatus, getContactType, getSocialAttribute, getfllowSituation, beforeUploadFile, getWhether, getcityArr, getcustomerStatue, getfllowSituationOn, getCertification, getcustomerTyp, getLvl, getCurrentMember, getprovince } from '@/tools.js';
 const FormItem = Form.Item;
-
 const Basic = React.createClass({
 	getInitialState() {
 		return {

+ 3 - 3
js/component/manageCenter/customer/NEW/signCustomer/intentionDetail/detail/basicPerson.jsx

@@ -40,9 +40,9 @@ const Basic = React.createClass({
 					};
 					thisData = {};
 				};
-				let ProvinceS = thisData.locationProvince, //getprovince
-				    citys = thisData.locationCity,
-				    Areas = thisData.locationArea,
+				let ProvinceS = thisData.province, //getprovince
+				    citys = thisData.city,
+				    Areas = thisData.area,
 				    ProvinceCity = getProvince(ProvinceS, citys, Areas),
 					month = thisData.dateOfBirthYear ? thisData.dateOfBirthYear + '/' + thisData.dateOfBirthMonth : '';
 				this.setState({

+ 1 - 1
js/component/manageCenter/customer/NEW/signCustomer/intentionDetail/detail/businFollow.jsx

@@ -19,7 +19,7 @@ const BusinFollow =React.createClass({
 		this.props.closeBusiness(false);
 	},
 	componentWillReceiveProps(nextProps) {
-		if(nextProps.data.ufbId&&nextProps.businessFollowModul){
+		if(nextProps.businessFollowModul){
 			this.setState({
 				businessFollowModul:true
 			})

+ 6 - 4
js/component/manageCenter/customer/NEW/signCustomer/intentionDetail/detail/visit.jsx

@@ -64,18 +64,20 @@ const Visit = React.createClass({
 				title: '拜访说明',
 				dataIndex: 'result',
 				key: 'result'
-			}, {
+			}
+			,{
 				title: '操作',
 				dataIndex: 'ttt',
 				key: 'ttt',
 				render: (text, record, index) => {
 					return <div>
-                            {record.readOnly&&<Popconfirm title="是否删除?" onConfirm={(e)=>{this.visitDelet(record)}} okText="删除" cancelText="不删除">
+                            {!record.readOnly?<Popconfirm title="是否删除?" onConfirm={(e)=>{this.visitDelet(record)}} okText="删除" cancelText="不删除">
 							    <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}} onClick={(e)=>{e.stopPropagation()}}>删除</Button>
-							</Popconfirm>}
+							</Popconfirm>:''}
                         </div>
 				}
-			}],
+			}
+		],
 		}
 	},
 	//拜访记录删除

+ 52 - 26
js/component/manageCenter/customer/NEW/signCustomer/intentionDetail/detail/visitDetail.jsx

@@ -32,7 +32,16 @@ const VisitDetail = React.createClass({
 					dataIndex: 'followSituation',
 					key: 'followSituation',
 					render: (text, record, index) => {
-						return  <span>{getfllowSituation(text)}</span>
+						return <div>
+									{!record.readOnly?<Select  placeholder="选择最新进度" value={record.followSituation}  onChange={(e) => { record.followSituation = e; this.setState({ data: this.state.data }); }}>
+	                                    {
+	                                        newFollow.map(function (item) {
+	                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
+	                                        })
+	                                    }
+	                               </Select>:
+	                               <span>{getfllowSituation(text)}</span>}
+                               </div>
 					}
 				}, {
 					title: '最新状态',
@@ -40,7 +49,16 @@ const VisitDetail = React.createClass({
 					dataIndex: 'customerStatus',
 					key: 'customerStatus',
 					render: (text, record, index) => {
-						return <span>{getcustomerStatue(text)}</span>
+						return <div>
+									{!record.readOnly?<Select value={record.customerStatus} placeholder="选择最新状态" onChange={(e) => { record.customerStatus = e; this.setState({ data: this.state.data }); }}>
+	                                    {
+	                                        customerStatus.map(function (item) {
+	                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
+	                                        })
+	                                    }
+	                                </Select>:
+	                                <span>{getcustomerStatue(text)}</span>}
+                               </div>
 					}
 				}, {
 					title: '跟进说明',
@@ -48,23 +66,9 @@ const VisitDetail = React.createClass({
 					dataIndex: 'remarks',
 					key: 'remarks',
 					render: (text, record, index) => {
-						return(
-							<div>
-								<span title={text}>{text&&text.length>14?(text.substr(0,14)+'…'):text}</span>
-							</div>
-							)
-					}
-				}, {
-					title: '操作',
-					width:120,
-					dataIndex: 'rrr',
-					key: 'rrr',
-					render: (text, record, index) => {
-						return <div>
-                            <Popconfirm title="是否删除?" onConfirm={(e)=>{this.intentionDelet(record,index)}} okText="删除" cancelText="不删除">
-							    <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}}>删除</Button>
-							</Popconfirm>
-                        </div>
+						return <Input value={record.remarks} placeholder="跟进说明" 
+	                             onChange={(e) => { record.remarks = e.target.value; this.setState({ data: this.state.data }); }}
+	                             />
 					}
 				}
 			],
@@ -96,12 +100,14 @@ const VisitDetail = React.createClass({
 				for(let i = 0; i < data.data.userBusinessList.length; i++) {
 					let thisdata = data.data.userBusinessList[i];
 					theArr.push({
-						id: thisdata.businessId,
+						key:i,
+						readOnly:this.props.followData.readOnly,
+						id: thisdata.ufbId,
 						businessName:thisdata.businessProjectId,
 						businessVarietiesName:thisdata.businessVarietiesName,
 						businessProjectName:thisdata.businessProjectName,
-						followSituation: String(thisdata.followSituation),
-						customerStatus: String(thisdata.customerStatus),
+						followSituation: thisdata.followSituation==null?undefined : String(thisdata.followSituation),
+						customerStatus: thisdata.customerStatus==null?undefined : String(thisdata.customerStatus),
 						remarks: thisdata.remarks,
 					});
 				};
@@ -109,7 +115,7 @@ const VisitDetail = React.createClass({
 					followIds: thedata.followId,
 					contacts: thedata.contacts,
 					uid: thedata.uid,
-					dataBus: theArr,
+					data: theArr,
 					result: thedata.result,
 					contactMobile:thedata.contactMobile,
 					contactType: parseInt(thedata.contactType),
@@ -179,6 +185,27 @@ const VisitDetail = React.createClass({
 			let conts = this.state.lastName;
 			contactsId = this.state.contactsIdArr[conts].id;
 		}
+		let GlossoryId=false;
+		this.state.data.map(function(item) {
+			if(!item.followSituation||!item.customerStatus||!item.businessName) {
+				GlossoryId = true
+			}
+		})
+		if(this.state.data.length&&GlossoryId) {
+			message.warning("项目名称/最新进度/最新状态不能为空!")
+			return false;
+		};
+		let dataList=this.state.data,
+			idsList=[];
+		dataList.map((item,index) => {
+			idsList.push({
+				ufbId:item.id||'',
+				businessProjectId:item.businessName,
+				customerStatus:item.customerStatus,
+				followSituation:item.followSituation,
+				remarks:item.remarks||''
+			})
+		});
 		//新增
 		$.ajax({
 			method: "post",
@@ -186,7 +213,7 @@ const VisitDetail = React.createClass({
 			url: globalConfig.context + '/api/admin/customer/updateFollow',
 			data: {
 				followId: this.state.followIds,
-				userBusinessList: JSON.stringify(this.state.data),
+				userBusinessList: JSON.stringify(idsList),
 				uid: this.state.uid,
 				contactType: this.state.contactType,
 				result: this.state.result,
@@ -288,10 +315,9 @@ const VisitDetail = React.createClass({
 					                 	<div className="clearfix">
 		                    			    <Spin spinning={this.state.loading}>
 										      <Table 
-										         rowKey={record => record.id}
 								            	 pagination={false}
 								            	 columns={this.state.intentionList} 
-								            	 dataSource={this.state.dataBus}
+								            	 dataSource={this.state.data}
 								            	 />
 										    </Spin> 
 										</div>	 

+ 3 - 37
js/component/manageCenter/customer/individualCustomer/myReject.jsx

@@ -451,9 +451,9 @@ const PublicCustomer = Form.create()(React.createClass({
 		                              </Select>
 		                   		 </FormItem>
 		                    </div>
-		                    <FormItem wrapperCol={{ span: 12, offset: 4 }}>
-		                        <Button className="set-submit" type="primary" htmlType="submit">提交审核</Button>  
-		                        <Button className="set-submit" type="ghost" onClick={this.detailsModal} style={{'marginLeft':'40px'}}>取消</Button>
+		                    <FormItem wrapperCol={{ span: 18, offset: 6 }}>
+		                        <Button  type="primary" htmlType="submit">提交审核</Button>  
+		                        <Button  type="ghost" onClick={this.detailsModal} style={{'marginLeft':'40px'}}>取消</Button>
 		                    </FormItem> 
 						</Spin>
 		            </Form >                          
@@ -463,40 +463,6 @@ const PublicCustomer = Form.create()(React.createClass({
 	}
 }));
 
-//const Tablees=Form.create()(React.createClass({
-//	//详情tab切换数据处理
-//	callbacks(e) {
-//		this.setState({
-//			callnubs: e,
-//		})
-//		if(e == '1') {
-//			
-//		}
-//		if(e == '2') {
-//			
-//		}
-//		
-//	},
-//	getInitialState() {
-//		return {
-//			callnubs: "1",
-//		}
-//	},
-//	render() {
-//		return(
-//			<div className="clearfix" style={{marginTop:'0px',marginLeft:'20px'}}>
-//			    <Tabs onChange={this.callbacks} type="card" activeKey={this.state.callnubs} style={{paddingLeft:'15px',paddingRight:'15px',marginRight:'20px'}}>
-//			         <TabPane tab="个人客户" key="1" >
-//			         	<QueryCustomer />
-//			         </TabPane>
-//					 <TabPane tab="单位客户" key="2">
-//					 	<PublicCustomer />
-//					 </TabPane>
-//			    </Tabs>
-//			</div>
-//		);
-//	}
-//}));
 export default PublicCustomer;