liting2017 7 years ago
parent
commit
d20c740d5b

+ 1 - 2
js/component/manageCenter/customer/companyCustomer.jsx

@@ -94,8 +94,7 @@ const PublicCustomer = React.createClass({
                 let companyArr=[]; 	
                 let companyText=[];
    				let companyString=thisData.companyIntention;				
-   				companyArr=companyString.split(",") 
-   				console.log(companyArr)
+   				companyArr=companyString.split(",")    				
    				for(var i=0;i<companyArr.length;i++){
    					companyText+=getCompanyIntention(companyArr[i])+"-"
    				}

+ 76 - 72
js/component/manageCenter/customer/myClient.jsx

@@ -4,15 +4,14 @@ import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import moment from 'moment';
 import './myClient.less';
+import { areaSelect } from '../../NewDicProvinceList';
 const { Column, ColumnGroup } = Table;
 const TabPane = Tabs.TabPane;
-import  TechAchievementDesc from './myClientDesc.jsx';
+import  CustomerDetail from './myClientDesc.jsx';
 import { achievementCategoryList, techAuditStatusList,cityArr,tag,customerStatus,intentionalService,newFollow ,contact,sex} from '../../dataDic.js';
-import { beforeUploadFile, companySearch, getAchievementCategory,getsex,getSearchUrl,getTechAuditStatus,getcustomerTyp,getcityArr,getCompanyIntentionOn,getcustomerStatue,getCompanyIntention,getfllowSituation,getcontact,getfllowSituationOn,getcustomerStatueOn} from '../../tools.js';
+import { beforeUploadFile, companySearch, getAchievementCategory,getsex,getSearchUrl,getTag,getTechAuditStatus,getcustomerTyp,getcityArr,getCompanyIntentionOn,getcustomerStatue,getCompanyIntention,getfllowSituation,getcontact,getfllowSituationOn,getcustomerStatueOn} from '../../tools.js';
 import BatchImport from './batchImport';
-
 //图片组件
-
 const PicturesWall = React.createClass({
     getInitialState() {
         return {
@@ -691,7 +690,6 @@ const AchievementList = Form.create()(React.createClass({
         }.bind(this));
 			
 		},
-
     componentWillReceiveProps(nextProps) {
         if (!this.props.visible && nextProps.visible) {
             if (nextProps.data && nextProps.data.id) {
@@ -717,28 +715,28 @@ const AchievementList = Form.create()(React.createClass({
             let customerTypechange="";
             switch(custype){
             	case "个人客户":customerTypechange=0;break;
-            	case "公司客户":customerTypechange=1;break;
+            	case "机构单位":customerTypechange=1;break;
+            	case "团体单位":customerTypechange=2;break;
             }              
             let customerStatus= getcustomerStatueOn(this.state.customerStatus);
             let followSituation= getfllowSituationOn(this.state.followSituation);
-            //图片转换
-            
-            let thetechnicalPictureUrl = [];
-            if (this.state.technicalPictureUrl.length) {
+            //图片转换      
+            let thetechnicalPictureUrl = [];            
+            if (this.state.technicalPictureUrl.length) {            	
                 let picArr = [];
                 this.state.technicalPictureUrl.map(function (item) {
                     picArr.push(item.response.data);
                 });
                 thetechnicalPictureUrl = picArr.join(",");
-            };  
+            };
             let yearMonth = new Date(this.state.createYear).toLocaleDateString();
            
             let yearString = yearMonth.split('/').join('-');            
             let pjstringY='';                    	           
         	let days = new Date(this.state.creatMent); 
-            let hours = days.getHours().length==1 ? "0"+days.getHours():days.getHours();            
-            let minutes = days.getMinutes().length==1 ? "0"+days.getMinutes():days.getMinutes();            
-            let seconds = days.getSeconds().length==1 ? "0"+days.getSeconds():days.getSeconds();
+            let hours = parseInt(days.getHours())<10 ? "0"+days.getHours():days.getHours();            
+            let minutes =parseInt(days.getMinutes())<10 ? "0"+days.getMinutes():days.getMinutes();            
+            let seconds =parseInt(days.getSeconds())<10 ? "0"+days.getSeconds():days.getSeconds(); 
             if(this.state.creatMent.length==9){
             	pjstringY=this.state.creatMent
             }else{
@@ -754,11 +752,10 @@ const AchievementList = Form.create()(React.createClass({
                         cuid:this.state.idt,//联系人ID
                         followDates:yearString+' '+pjstringY,
                         followResult:this.state.remarkst,//跟进结果
-                        attachment:"",//附件地址
+                        attachment:thetechnicalPictureUrl,//附件地址
                         customerStatus:this.state.customerStatus,//跟进客户状态
                         followSituation:this.state.followSituation.length==1?this.state.followSituation:followSituation,//跟进进度
-                        contactInfo:(this.state.conts?this.state.conts:"电话")+"-"+(this.state.nub?this.state.nub:""),
-                        sign:thetechnicalPictureUrl
+                        contactInfo:(this.state.conts?this.state.conts:"电话")+"-"+(this.state.nub?this.state.nub:""),                                           	
                     }
                 }).done(function (data) {                	
                     this.setState({
@@ -773,8 +770,7 @@ const AchievementList = Form.create()(React.createClass({
                     this.rescordlist(this.state.rowId);                    
                 }.bind(this));  	
             }
-    	})
-        
+    	})        
     },
     //当选择联系人的列表变化时,则执行
     hundleName(e){		    	
@@ -793,10 +789,7 @@ const AchievementList = Form.create()(React.createClass({
 	      changWatch:changWatch,
 	      changQq:changQq
 	   });
-	},
-
-
-		
+	},		
     //所有资料修改保存提交,点击保存按钮进行更新
     handleSubmit(e) {    		
         e.preventDefault(); 
@@ -858,9 +851,7 @@ const AchievementList = Form.create()(React.createClass({
                         remarks: values.remarks,//备注1
                         companyIntention:this.state.companyIntention,//公司意向
                         followSituation:theDatak.followSituation,//最新跟进1
-                        customerStatus:this.state.customerStatus,//客户状态1
-                		beforeAdminName:this.state.adminName,
-               		
+                        customerStatus:this.state.customerStatus,//客户状态1                	              		
                     }
                 }).done(function (data) {                	
                     this.setState({
@@ -876,8 +867,7 @@ const AchievementList = Form.create()(React.createClass({
                     this.loadData()
                 }.bind(this));  	
             }
-    	})
-        
+    	})       
     },    
     submitcontactman(e){    
     	let deletedIds; 
@@ -952,6 +942,9 @@ const AchievementList = Form.create()(React.createClass({
 	    this.setState({
 	      visible: true,
 	    });
+	    this.setState({
+            selectedRowKeys:[],            
+        });
 	    let changeIds;
         let adminName;
         let customerStatus;       
@@ -964,8 +957,7 @@ const AchievementList = Form.create()(React.createClass({
                 adminName=rowItem.adminName; 
                 customerStatus=rowItem.customerStatus;
                 companyIntention=rowItem.companyIntention;
-                followSituation=rowItem.followSituation;   
-               
+                followSituation=rowItem.followSituation;                  
             };            
         };  
 	     $.ajax({
@@ -997,7 +989,7 @@ const AchievementList = Form.create()(React.createClass({
                         let thisdata = data.data[i];  
                         //处理数据 进行循环
                         theAssigne.push({
-                            key: thisdata.name,
+                            name: thisdata.name,
                             id: thisdata.id,
                             ids: thisdata.cid,
                             mobile:thisdata.mobile,
@@ -1010,8 +1002,9 @@ const AchievementList = Form.create()(React.createClass({
                    
                 };               
                 this.setState({
-                    dataman: theAssigne,                   
-                });              
+                    dataman: theAssigne,                      
+                    paginations:false
+                });            
             }
         }.bind(this));
     },	   
@@ -1020,6 +1013,9 @@ const AchievementList = Form.create()(React.createClass({
           this.setState({
 	      visible: false,
 	    });
+	    this.setState({
+            selectedRowKeys:[],            
+        });
 	    let changeId;
 	    let changeIds;
         let adminName;
@@ -1048,11 +1044,11 @@ const AchievementList = Form.create()(React.createClass({
 	        data: {
 	            id: changeIds,//这一行数据的ID
 	            aid:changeId,//指定转交人的ID 
-	            beforeCompanyIntention:companyIntention,//意向服务
-							beforeCustomerStatus:customerStatus,//客户状态
-							beforeFollowSituation:followSituation,//最新跟进状态
-							beforeAdminName:beforeAdminName,//之前的跟进人
-							adminName:adminName,//转交的跟进人
+//	            beforeCompanyIntention:companyIntention,//意向服务
+//				beforeCustomerStatus:customerStatus,//客户状态
+//				beforeFollowSituation:followSituation,//最新跟进状态
+				beforeAdminName:beforeAdminName,//之前的跟进人
+				adminName:adminName,//转交的跟进人
 	        }
         }).done(function (data) {
             if (!data.error.length) {
@@ -1315,8 +1311,8 @@ const AchievementList = Form.create()(React.createClass({
         ],                     
             columnsman:[{
 				  title: '姓名',
-				  dataIndex: 'key',
-				  key: 'key'	 
+				  dataIndex: 'name',
+				  key: 'name'	 
 			},{
 				  title: '手机号码',
 				  dataIndex: 'mobile',
@@ -1447,20 +1443,19 @@ const AchievementList = Form.create()(React.createClass({
         };  
         this.state.data = []
         this.setState({        	
-            selectedRowKeys: [],
-            
+            selectedRowKeys: [],            
         });
         $.ajax({
-            method: "post",
+            method: "get",
             dataType: "json",
             crossDomain: false,           
             url: globalConfig.context + "/api/admin/customer/deleteCustomer",
             data: {
                 id: deletedIds,//删除的ID                
-                beforeCustomerStatus:customerStatus,
-                beforeCompanyIntention:companyIntention,
-                beforeFollowSituation:followSituation,
-                beforeAdminName:adminName
+//              beforeCustomerStatus:customerStatus,
+//              beforeCompanyIntention:companyIntention,
+//              beforeFollowSituation:followSituation,
+//              beforeAdminName:adminName
             }
         }).done(function (data) {
             if (!data.error.length) {
@@ -1610,7 +1605,8 @@ const AchievementList = Form.create()(React.createClass({
         let deletedIds;
         let customerStatus;       
         let companyIntention;
-        let followSituation;   
+        let followSituation; 
+        let adminName;
         for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
             let rowItem = this.state.selectedRows[idx];
             if (rowItem.id) {
@@ -1618,6 +1614,7 @@ const AchievementList = Form.create()(React.createClass({
                 customerStatus=rowItem.customerStatus;
                 companyIntention=rowItem.companyIntention;
                 followSituation=rowItem.followSituation;
+                adminName=rowItem.adminName;               
             };            
         };       
         this.setState({
@@ -1625,16 +1622,17 @@ const AchievementList = Form.create()(React.createClass({
             
         });
         $.ajax({
-            method: "post",
+            method: "get",
             dataType: "json",
             crossDomain: false,           
             url: globalConfig.context + "/api/admin/customer/transferToPublic",  
             data: {
-            	aid:this.state.aid,
+            	//aid:this.state.aid,
                 id: deletedIds,
-                beforeCompanyIntention:companyIntention,//意向服务
-				beforeCustomerStatus:customerStatus,//客户状态
-				beforeFollowSituation:followSituation,//最新跟进状态
+//              beforeCompanyIntention:companyIntention,//意向服务
+//				beforeCustomerStatus:customerStatus,//客户状态
+//				beforeFollowSituation:followSituation,//最新跟进状态
+				beforeAdminName:adminName,
             }
         }).done(function (data) {
             if (!data.error.length) {
@@ -1813,32 +1811,36 @@ const AchievementList = Form.create()(React.createClass({
 						        >
 					            <Spin spinning={this.state.loading}>
 					            	 <Table 
+					            	 scroll={{y:'350px'}}
+					            	 pagination={this.state.paginations}
 					            	 columns={this.state.columnsman} 
 					            	 rowSelection={rowSelection} 
 					            	 dataSource={this.state.dataman}
 					            	 />
 					           				            				        
-				                <FormItem wrapperCol={{ span: 12, offset: 12 }}>
-                       		<Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:"50px"}} onClick={this.changeAssigner }>保存</Button>
-                       		<Button className="set-submit" type="ghost" onClick={this.handleCancel } style={{marginLeft:"30px"}} id='change_rem'>取消</Button>
+				            <FormItem wrapperCol={{ span: 12, offset: 12 }} style={{marginTop:'15px'}}>
+	                       		<Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:"50px"}} onClick={this.changeAssigner }>保存</Button>
+	                       		<Button className="set-submit" type="ghost" onClick={this.handleCancel } style={{marginLeft:"30px"}} id='change_rem'>取消</Button>
                     	  </FormItem>  
                     	</Spin>
 					</Modal>
                     <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
                         disabled={!hasSelected}
                         onClick={this.changeRow}>转为公共客户<Icon /></Button>
-                    <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
-                        disabled={!hasSelected}
-                        onClick={this.delectRow}>删除<Icon type="minus" /></Button>
-                    <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
-                    <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>                    			                  
-		                <Input placeholder="联系人姓名" style={{width:'140px',marginRight:'10px'}}
-		                    value={this.state.contactNamet}
-		                    onChange={(e) => { this.setState({ contactNamet: e.target.value }); }} /> 
-		                <Input placeholder="手机号码" style={{width:'140px',marginRight:'10px'}}
-		                    value={this.state.contactTelt }
-		                    onChange={(e) => { this.setState({ contactTelt: e.target.value }); }} />
-		            </div>        
+                    <div className='clearfix' style={{marginTop:'10px'}}>
+	                    <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'15px' }}
+	                        disabled={!hasSelected} 
+	                        onClick={this.delectRow}>删除<Icon type="minus" /></Button>
+	                    <span >更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
+	                    <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>                    			                  
+			                <Input placeholder="联系人姓名" style={{width:'140px',marginRight:'10px'}}
+			                    value={this.state.contactNamet}
+			                    onChange={(e) => { this.setState({ contactNamet: e.target.value }); }} /> 
+			                <Input placeholder="手机号码" style={{width:'140px',marginRight:'10px'}}
+			                    value={this.state.contactTelt }
+			                    onChange={(e) => { this.setState({ contactTelt: e.target.value }); }} />
+			            </div>  
+		            </div>
                 </div>                                               
                 <div className="patent-table">
                     <Spin spinning={this.state.loading}>
@@ -2144,14 +2146,16 @@ const AchievementList = Form.create()(React.createClass({
 										<FormItem className="half-item" style={{marginLeft:'96px'}}
 				                         	labelCol={{ span: 4 }}
 				                        	wrapperCol={{ span: 18 }}
-				                       		 label="意向服务" > 				                       									   	
-					                             <Select placeholder="选择意向服务" style={{width:'200px'}} value={this.state.companyIntention}  onChange={(e) => { this.setState({companyIntention: e}); }}>
+				                       		 label="意向服务" >
+										    <span>{getCompanyIntention(this.state.companyIntention)}</span>
+					                            {/* <Select placeholder="选择意向服务" style={{width:'200px'}} value={this.state.companyIntention}  onChange={(e) => { this.setState({companyIntention: e}); }}>
 				                                    {
 				                                        intentionalService.map(function (item) {
 				                                            return <Select.Option key={item.value} >{item.key}</Select.Option>
 				                                        })
 				                                    }
 	                               				 </Select>
+	                               				 */}
 					                    </FormItem>
 										<FormItem className="half-item"
 				                            {...formItemLayout}
@@ -2161,7 +2165,7 @@ const AchievementList = Form.create()(React.createClass({
 										<FormItem className="half-item"
 				                            {...formItemLayout}
 				                            label="标签" >
-				                            <span>{theDatak.tag}</span>
+				                            <span>{getTag(theDatak.tag)}</span>
 										</FormItem>										
 										<FormItem className="half-item"
 				                            {...formItemLayout}
@@ -2534,7 +2538,7 @@ const AchievementList = Form.create()(React.createClass({
 										    </FormItem>	
 										</Spin>
 								    </Modal>
-                <TechAchievementDesc
+                <CustomerDetail
                     data={this.state.RowData}
                     detailApiUrl={this.props['data-detailApiUrl']}
                     achievementCategoryOption={this.state.achievementCategoryOption}

File diff suppressed because it is too large
+ 82 - 974
js/component/manageCenter/customer/myClientDesc.jsx


+ 1 - 1
js/component/tools.js

@@ -735,7 +735,7 @@ module.exports = {
         }
     },
     //客户标签
-    tag: function (e) {
+    getTag: function (e) {
          if (e) {
             let theType = '';
             tag.map(function (item) {