liting2017 7 years ago
parent
commit
09450a968f
1 changed files with 68 additions and 14 deletions
  1. 68 14
      js/component/manageCenter/customer/customerData/myClient.jsx

+ 68 - 14
js/component/manageCenter/customer/customerData/myClient.jsx

@@ -228,15 +228,17 @@ const MyClient = Form.create()(React.createClass({
             },
             //业务意向列表
             intentionList:[{
-					  title: '高新',
+					  title: '业务名称',
 					  dataIndex: 'id',
 					  key:'id',
 					  render: (text, record, index) => {
 	                  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>	    
+	                  {record.contacts?<Select value={record.id}  placeholder="选择业务" onChange={(e) => { record.id=e; this.setState({ data: this.state.data }); }}>
+                                    {
+                                        intentionalService.map(function (item) {
+                                            return <Select.Option  >{item.key}</Select.Option>
+                                        })
+                                    }    
                               </Select>:<span>{text}</span>}
                          }      
 				},{
@@ -270,7 +272,7 @@ const MyClient = Form.create()(React.createClass({
 					  dataIndex: 'remarks',
 					  key: 'remarks',
 					  render: (text, record, index) => {
-					  return <Input value={record.customerStatus} placeholder="跟进说明"
+					  return <Input value={record.customerStatus} placeholder="跟进说明" 
 	                             onChange={(e) => { record.customerStatus = e.target.value; this.setState({ data: this.state.data }); }}
 	                             style={{width:'120px'}}/>
 	                    }
@@ -605,7 +607,7 @@ const MyClient = Form.create()(React.createClass({
                 uid: e.id,
             },
             success: function (data) {                	  
-        		    let theArr = [];
+        		    let listArr=[];
 				    let thedata=data.data;
 				    if (!thedata) {
 	                    if (data.error && data.error.length) {
@@ -613,9 +615,21 @@ const MyClient = Form.create()(React.createClass({
 	                    };	
 	                    thedata = {}; 
 	                };   
+	                 for (let i = 0; i < data.data.userBusinessList.length; i++) {
+                        let thisdata = data.data.userBusinessList[i];                        
+                        listArr.push({
+                            key: i,                           
+                            id: thisdata.id,                                                  
+                            businessGlossoryId:thisdata.businessGlossoryId,
+                            followSituation:thisdata.followSituation,
+                            customerStatus:thisdata.customerStatus,
+                            remarks:thisdata.remarks,
+                            contacts:false
+                        });
+                   };
 			        this.setState({
 			        	 uid:thedata.uid,
-			        	 data:thedata.list || [],
+			        	 data:listArr,
 			        	 identityName:thedata.identityName,
 			        	 followTime:thedata.followTime,
 			        	 businessGlossoryId:thedata.businessGlossoryId,
@@ -680,8 +694,20 @@ const MyClient = Form.create()(React.createClass({
 	                    };	
 	                    thedata = {}; 
 	                };   
+	                for (let i = 0; i < data.data.userBusinessList.length; i++) {
+                        let thisdata = data.data.userBusinessList[i];                        
+                        theArr.push({
+                            key: i,                           
+                            id: thisdata.id,                                                  
+                            businessGlossoryId:thisdata.businessGlossoryId,
+                            followSituation:thisdata.followSituation,
+                            customerStatus:thisdata.customerStatus,
+                            remarks:thisdata.remarks,
+                            
+                        });
+                   };
 			        this.setState({
-			        	 data:thedata.userBusinessList || [],
+			        	 data:theArr,
 			        	 followId:thedata.followId,
 			        	 identityName:thedata.identityName,
 			        	 uid:thedata.uid,
@@ -1258,8 +1284,7 @@ const MyClient = Form.create()(React.createClass({
 	addNew() {
         this.state.data.push({
             id: null,
-            name: '',
-            url: ''
+            
         });
         this.setState({
             data: this.state.data
@@ -1392,7 +1417,7 @@ const MyClient = Form.create()(React.createClass({
 		                        <Select.Option value={item} key={theData.name}>{theData.name}</Select.Option>
 		                    );
 		                };
-						this.setState({	
+						this.setState({
 							contactsIdArr:thedata,
 				        	telNum:telNum,
 		                    orderStatusOption: theArr, 
@@ -1400,6 +1425,7 @@ const MyClient = Form.create()(React.createClass({
 					}.bind(this),
 				}).always(function () {
 	            this.setState({
+	            	deletId:ids,
 	                loading: false
 	            });
 	        }.bind(this));
@@ -1408,9 +1434,36 @@ const MyClient = Form.create()(React.createClass({
 	intentionModify(e){
 		console.log(e)
 	},
-	//意向服务列表单个删除
+	//拜访意向服务列表单个删除
 	intentionDelet(e){
-		console.log(e)
+		if(e.id==''){
+			this.setState({
+	       	  selectedRowKeys: [],
+	        });
+	        $.ajax({
+	            method: "get",
+	            dataType: "json",
+	            crossDomain: false,           
+	            url: globalConfig.context + "/api/admin/customer/transferToPublic",  
+	            data: {
+	                id: e.id
+	            }
+		        }).done(function (data) {
+		            if (!data.error.length) {
+		                message.success('删除成功');
+		                this.setState({
+		                    loading: false,
+		                });
+		            } else {
+		                message.warning(data.error[0].message);
+		            };
+		            //this.visitModify(this.state.deletId);
+		            this.visit(this.state.deletId)
+		        }.bind(this));
+		}else{
+			//this.visitModify(this.state.deletId);
+			this.visit(this.state.deletId)
+		}
 	},
 	
 	//tab5意向业务
@@ -2323,6 +2376,7 @@ const MyClient = Form.create()(React.createClass({
 					                 	<div className="clearfix" style={{paddingLeft:'50px',paddingRight:'50px'}}>
 		                    			    <Spin spinning={this.state.loading}>
 										      <Table 
+										         rowKey={record => record.id}
 								            	 pagination={false}
 								            	 columns={this.state.intentionList} 
 								            	 dataSource={this.state.data}