liting2017 6 years ago
parent
commit
1bc16ebf4e

+ 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;
 		};

+ 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,

+ 10 - 0
js/component/manageCenter/customer/NEW/signCustomer/followDetail.jsx

@@ -228,6 +228,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;
@@ -236,6 +242,10 @@ const FollowDetail = React.createClass({
 			message.warning('请选择联系人')
 			return false;
 		}
+		if(this.state.data.length&&GlossoryId) {
+			message.warning("项目名称/最新进度/最新状态不能为空!")
+			return false;
+		};
 		this.setState({
 			loading: true
 		});

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

@@ -94,7 +94,7 @@ 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,
+						id: thisdata.ufbId,
 						businessName:thisdata.businessProjectId,
 						businessVarietiesName:thisdata.businessVarietiesName,
 						businessProjectName:thisdata.businessProjectName,
@@ -103,11 +103,12 @@ const VisitDetail = React.createClass({
 						remarks: thisdata.remarks,
 					});
 				};
+				console.log(theArr)
 				this.setState({
 					followIds: thedata.followId,
 					contacts: thedata.contacts,
 					uid: thedata.uid,
-					dataBus: theArr,
+					data: theArr,
 					result: thedata.result,
 					contactMobile:thedata.contactMobile,
 					contactType: parseInt(thedata.contactType),
@@ -177,6 +178,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",
@@ -184,7 +206,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,
@@ -289,7 +311,7 @@ const VisitDetail = React.createClass({
 										         rowKey={record => record.id}
 								            	 pagination={false}
 								            	 columns={this.state.intentionList} 
-								            	 dataSource={this.state.dataBus}
+								            	 dataSource={this.state.data}
 								            	 />
 										    </Spin> 
 										</div>