dengzhiguo il y a 7 ans
Parent
commit
57f282ef20

+ 24 - 1
js/component/dataDic.js

@@ -1050,7 +1050,30 @@ module.exports = {
             value: "5",
             key: "被拒绝客户"
         }
-    ],    
+    ],
+    //客户状态反
+    customerStatusOn:[
+        {
+            value: "新客户",
+            key: "0"
+        }, {
+            value: "意向客户",
+            key: "1"
+        },
+        {
+            value: "重点客户",
+            key: "2"
+        }, {
+            value: "面谈客户",
+            key: "3"
+        },{
+            value: "签单客户",
+            key: "4"
+        },{
+            value: "被拒绝客户",
+            key: "5"
+        }
+    ],        
     //意向服务
     intentionalService:[
         {

+ 2 - 1
js/component/manageCenter/achievement/techAchievementDesc.jsx

@@ -1026,7 +1026,8 @@ const AchievementDetailForm = Form.create()(React.createClass({
                         businessPlanUrl: this.state.businessPlanUrl,
                         auditStatus: this.state.auditStatus,                       
                         boutique: values.boutique, 
-                        hot: values.hot,                       
+                        hot: values.hot,      
+                        
                     }
                 }).done(function (data) {
                     this.state.auditStatus = 0;

+ 561 - 0
js/component/manageCenter/customer/companyCustomer.jsx

@@ -0,0 +1,561 @@
+import React from 'react';
+import { AutoComplete, Icon, Button, Input, InputNumber, Select, Spin, Table, message, Modal, Row, Col, DatePicker,Switch,Upload} from 'antd';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+import moment from 'moment';
+import './myClient.less';
+import { orderStatusList,cityArr,customerStatus,intentionalService,newFollow} from '../../dataDic.js';
+import { beforeUploadFile,getOrderStatus, getSearchUrl,getcustomerTyp,getcityArr,getcustomerStatue,getCompanyIntention,getfllowSituation,getsex} from '../../tools.js';
+
+
+
+
+//查询功能和初始列表
+const PublicCustomer = React.createClass({
+    loadData(pageNumber, detailApiUrl) {    	
+        this.state.data = [];
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,          
+            url:globalConfig.context +'/api/admin/customer/listCompanyCustomer',
+            data: {
+                pageNumber: pageNumber || 1,
+                pageSize: this.state.pagination.pageSize,               
+                companyName: this.state.companyName, //名称1                
+								customerType: this.state.customerType, //客户类型1
+              	locationProvince:this.state.locationProvince,//地区
+								customerStatus:this.state.customerStatus,//客户状态1
+								contactName:this.state.contactName,//联系人姓名1							
+								contactTel:this.state.contactTel,//联系人手机
+								companyIntention:this.state.companyIntention,//意向服务
+                followSituation:this.state.followSituation,//最新跟进进度
+				//releaseDateStartDate: this.state.releaseDate[0],
+                //releaseDateEndDate: this.state.releaseDate[1],			
+            },
+            success: function (data) {            	
+                let theArr = [];
+                if (!data.data || !data.data.list) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };                   
+                } else {                	
+                    for (let i = 0; i < data.data.list.length; i++) {
+                        let thisdata = data.data.list[i];                       
+                        theArr.push({
+                            key: i,
+                            id: thisdata.id,                                                  
+                            companyName:thisdata.companyName,//公司名称
+                            customerType:thisdata.customerType,
+                            _customerType:thisdata._customerType,//客户类型
+                            locationProvince:thisdata.locationProvince,//地区                        
+                            contactName:thisdata.contactName, //联系人姓名
+                            telNum:thisdata.telNum,//手机号
+                            _customerStatus:thisdata._customerStatus,//客户状态
+                            _companyIntention:thisdata._companyIntention,//意向服务
+                            _followSituation:thisdata._followSituation,//最新跟进
+                            customerStatus:thisdata.customerStatus,//客户状态
+                            companyIntention:thisdata.companyIntention,//意向服务
+                            followSituation:thisdata.followSituation,//最新跟进
+                            adminName:thisdata.adminName,     //跟进人          
+                            followDate:thisdata.followDate,
+                            customerStatus:thisdata.customerStatus,//客户状态
+                            companyIntention:thisdata.companyIntention,//意向服务                                                      
+                        });
+                    };
+                   
+                    this.state.pagination.current = data.data.pageNumber;
+                    this.state.pagination.total = data.data.totalCount;
+                };               
+                this.setState({
+                    dataSource: theArr,
+                    pagination: this.state.pagination
+                });             
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    }, 
+    //领取
+    handleSubmit (e) { 
+    	  let uids;   	  
+    	  let beforeCustomerStatus;
+    	  let beforeFollowSituation;
+    	  let beforeCustomerIntention;
+        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
+            let rowItem = this.state.selectedRows[idx];                          
+            if (rowItem.id) {
+                uids=rowItem.id;               
+                beforeCustomerStatus=rowItem.customerStatus;
+                beforeFollowSituation=rowItem.followSituation; 
+                beforeCustomerIntention=rowItem.companyIntention;
+            };            
+        };  
+        this.setState({
+            loading: true
+        });      
+        $.ajax({
+            method: "POST",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/admin/customer/receivePublicCustomer',
+            data: {
+                id: uids,                
+                beforeCustomerIntention:beforeCustomerIntention,
+                beforeCustomerStatus:beforeCustomerStatus,
+                beforeFollowSituation:beforeFollowSituation,
+            }
+        }).done(function (data) {
+            this.setState({
+                loading: false
+            });
+            if (!data.error.length) {
+                message.success('领取成功!');
+                this.setcancel();
+            } else {
+                message.warning(data.error[0].message);
+            };
+        }.bind(this));
+    },
+    //查看详情
+    Detailload(deletedIds){    	
+    	$.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + '/api/admin/customer/findCustomerDetails',
+            data: {
+                id: deletedIds
+            },
+            success: function (data) {
+                let thisData = data.data;                
+                if (!thisData) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                    thisData = {};
+                };
+                this.setState({
+                    data: thisData,
+                   	followSituation:thisData.followSituation,
+		            		customerStatus:thisData.customerStatus,		            		
+                });                            
+            }.bind(this),
+        }).always(function () {
+            this.setState({           	
+                loading: false
+            });
+        }.bind(this));  
+    },
+    getInitialState() {
+        return {
+            searchMore: true,
+            searchType: 0,
+            validityPeriodDate: [],
+            releaseDate: [],
+            selectedRowKeys: [],
+            selectedRows: [],
+            loading: false,
+            pagination: {
+                defaultCurrent: 1,
+                defaultPageSize: 10,
+                showQuickJumper: true,
+                pageSize: 10,
+                onChange: function (page) {
+                    this.loadData(page);
+                }.bind(this),
+                showTotal: function (total) {
+                    return '共' + total + '条数据';
+                }
+            },
+                contactInformation:[
+           			 {
+				  title: '姓名',
+				  dataIndex: 'contactName',
+				  key: 'contactName'
+						  
+					},{
+						  title: '性别',
+						  dataIndex: 'sex',
+						  key: 'sex',
+						  render: text => { return getsex(text); }
+					},
+					{
+						  title: '手机号码',
+						  dataIndex: 'telNum',
+						  key: 'telNum'	 
+					},{
+						  title: '座机号',
+						  dataIndex: 'mobile',
+						  key: 'mobile'	 
+					},{
+						  title: 'QQ号码',
+						  dataIndex: 'qq',
+						  key: 'qq'	 
+					},{
+						  title: '邮箱号',
+						  dataIndex: 'email',
+						  key: 'email'	 
+					},{
+						  title: '微信',
+						  dataIndex: 'wechat',
+						  key: 'wechat'	 
+					},{
+						  title: '部门',
+						  dataIndex: 'depatrment',
+						  key: 'depatrment'	 
+					},{
+						  title: '职位',
+						  dataIndex: 'customerPosition',
+						  key: 'customerPosition'	 
+					},
+                  ],
+            columns: [               
+                {
+                    title: '公司名称',
+                    dataIndex: 'companyName',
+                    key: 'companyName',
+                }, {
+                    title: '客户类型',
+                    dataIndex: '_customerType',
+                    key: '_customerType',
+                    //render: text => { return getcustomerTyp(text); }
+                }, {
+                    title: '地区',
+                    dataIndex: 'locationProvince',
+                    key: 'locationProvince',
+                    render: text => { return getcityArr(text); }
+                }, {
+                    title: '联系人姓名',
+                    dataIndex: 'contactName',
+                    key: 'contactName',                    
+                }, 
+                {
+                    title: '手机号',
+                    dataIndex: 'telNum',
+                    key:'telNum',                   
+                },
+                 {
+                    title: '客户状态',
+                    dataIndex: '_customerStatus',
+                    key: '_customerStatus',
+                  //render: text => { return getcustomerStatue(text) }
+                },
+                {
+                    title: '意向服务',
+                    dataIndex: '_companyIntention',
+                    key: '_companyIntention',
+                    //render: text => { return getCompanyIntention(text) }
+                },
+                 {
+                    title: '最新跟进',
+                    dataIndex: '_followSituation',
+                    key: '_followSituation',
+                    //render: text => { return getfllowSituation(text) }
+                },
+                 {
+                    title: '跟单人',
+                    dataIndex: 'adminName',
+                    key: 'adminName',
+                },
+                {
+                    title: '时间',
+                    dataIndex: 'followDate',
+                    key: 'followDate',
+                }
+            ],
+            dataSource: [],
+            searchTime: [],
+        };
+    },
+    componentWillMount() {
+        let theArr = [];
+        customerStatus.map(function (item) {
+            theArr.push(
+                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
+            )
+        });            
+               
+        let intentionalArr = [];
+        intentionalService.map(function (item) {
+            intentionalArr.push(
+                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
+            )
+        });   
+        let newArr = [];
+        newFollow.map(function (item) {
+            newArr.push(
+                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
+            )
+        });   
+				let auditArr = [];
+        cityArr.map(function (item) {
+            auditArr.push(
+                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
+            )
+        }); 
+        this.state.customerStatuarr = theArr;               
+        this.state.intentionalOption = intentionalArr;
+        this.state.newOption = newArr;
+        this.state.auditStatusOption = auditArr;
+        
+        if (window.location.search) {
+            let theObj = getSearchUrl(window.location.search);
+            if (theObj.rid) {
+                theObj.id = theObj.rid;
+                if (theObj.rid != 'null') {
+                    this.tableRowClick(theObj);
+                };
+            };
+        };       
+        this.loadData();        
+    },
+    tableRowClick(record) {
+        this.state.RowData = record;
+        this.setok(record.id);
+        this.handleSubmit(record.id) 
+        this.setState({
+        	hids:record.id
+        })
+    },
+    tableRow(record) {            
+        console.log(record)         
+    },
+    closeDesc(e, s) {
+        this.state.showDesc = e;
+        if (s) {
+            this.loadData();
+        };
+    },
+    search() {
+        this.loadData();
+    },
+    reset() {
+    	this.state.companyName='';  
+    	this.state.customerType=undefined;
+        this.state.id = undefined;
+        this.state.shareType = undefined;
+        this.state.companyIntention  = undefined;
+        this.state.followSituation  = undefined;
+        this.state.locationProvince  = undefined;
+        this.state.customerStatus  = undefined;
+        this.state.contactName   = undefined;
+        this.state.contactTel = undefined;
+        this.state.contactName = undefined;  
+        this.state.releaseDate = [];
+        this.loadData(); 
+    },
+    searchSwitch() {
+        this.setState({
+            searchMore: !this.state.searchMore
+        });
+    },
+    //点击消失函数
+    setok(e) {
+		    this.setState({ 
+		    	 visible:true
+		    });	
+		    this.Detailload(e)			   
+		},
+	setcancel(e) {
+	    this.setState({ 
+	    	 visible:false
+	    });	   	    
+	},
+	setoks(index) {
+		this.setState({ 
+		    visible1:true
+		});			
+        this.setState({
+            loading: true
+        });       
+        $.ajax({
+                method: "post",
+                dataType: "json",
+                crossDomain: false,
+                url: globalConfig.context + "/api/admin/customer/findCustomerUserList",
+                data:{
+                	cid:this.state.hids
+                },
+                 success: function (data) {                	  
+                		let theArr = [];
+					    let thedata=data.data;
+					    for (let i = 0; i < data.data.length; i++) {
+	                        let thisdata = data.data[i];                       
+	                        theArr.push({
+	                        		id:thisdata.id,//联系人ID
+	                        		contactName:thisdata.name,//联系人姓名
+	                        		sex:thisdata.sex,//联系人性别
+	                        		mobile:thisdata.mobile,//座机号
+	                        		telNum:thisdata.telNum,//手机号
+	                        		email:thisdata.email,//邮箱
+	                        		qq:thisdata.qq,//qq
+	                        		wechat:thisdata.wechat,//微信号
+	                        		depatrment:thisdata.depatrment,//部门
+	                        		customerPosition:thisdata.customerPosition,//职位
+	                        });
+	                    };         
+						this.setState({
+		                    information: theArr,                    
+	                    });
+					}.bind(this),
+				}).always(function () {
+	            this.setState({
+	                loading: false
+	            });
+	        }.bind(this));
+		    
+	},
+	setcancels(e) {
+	    this.setState({ 
+	    	 visible1:false
+	    });	   	    
+	},
+    render() {
+    	  const theData = this.state.data || {}; 
+        const rowSelection = {
+            selectedRowKeys: this.state.selectedRowKeys,
+            onChange: (selectedRowKeys, selectedRows) => {
+                this.setState({
+                    selectedRows: selectedRows.slice(-1),
+                    selectedRowKeys: selectedRowKeys.slice(-1)
+                });
+            }
+        };
+        const hasSelected = this.state.selectedRowKeys.length > 0;
+        const { RangePicker } = DatePicker;
+        return (
+            <div className="user-content" >
+                <div className="content-title">                  
+                    <span>公共客户管理</span>                  
+                </div>
+                <div className="user-search">                    
+                    <Input placeholder="公司名称"
+                        value={this.state.companyName}
+                        onChange={(e) => { this.setState({ companyName: e.target.value }); }} /> 
+                    <Select placeholder="客户类型" style={{ width: 120 }}
+                            value={this.state.customerType }
+                            onChange={(e) => { this.setState({ customerType : e }) }}>
+                            <Select.Option value="0" >个人客户</Select.Option>
+                            <Select.Option value="1" >公司客户</Select.Option>
+                    </Select>     
+                    <Select placeholder="意向服务"
+                            style={{ width: 160 }}
+                            value={this.state.companyIntention}
+                            onChange={(e) => { this.setState({ companyIntention: e }) }}>
+                            {this.state.intentionalOption}
+                    </Select>
+                    <Select placeholder="跟进进度"
+                            style={{ width: 160 }}
+                            value={this.state.followSituation}
+                            onChange={(e) => { this.setState({ followSituation: e }) }}>
+                            {this.state.newOption}
+                    </Select>
+                    <Select placeholder="地区"
+                            style={{ width: 160 }}
+                            value={this.state.locationProvince}
+                            onChange={(e) => { this.setState({ locationProvince: e }) }}>
+                            {this.state.auditStatusOption}
+                    </Select>
+                    <Select placeholder="客户状态" style={{ width: 120 }}
+                            value={this.state.customerStatus}
+                            onChange={(e) => { this.setState({customerStatus: e }) }}>                           
+                            {this.state.customerStatuarr}
+                    </Select>
+                    <Button type="primary" onClick={this.search}>搜索</Button>
+                    <Button onClick={this.reset}>重置</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.contactName}
+		                    onChange={(e) => { this.setState({ contactName: e.target.value }); }} /> 
+		                <Input placeholder="手机号码" style={{width:'140px',marginRight:'10px'}}
+		                    value={this.state.contactTel }
+		                    onChange={(e) => { this.setState({ contactTel: e.target.value }); }} />                          
+                    </div>
+                </div>
+                <div className="patent-table">
+                    <Spin spinning={this.state.loading}>
+                        <Table columns={this.state.columns}
+                            dataSource={this.state.dataSource}
+                            rowSelection={rowSelection}
+                            pagination={this.state.pagination}
+                            onRowClick={this.tableRowClick} />
+                    </Spin>
+                </div>
+                <Modal maskClosable={false} 
+                       visible={this.state.visible}
+                       onOk={this.setcancel} 
+                       onCancel={this.setcancel}
+                       width='800px'
+                       footer={null}
+                       title="客户详情"
+                       className="demand-order-content">
+                        <Spin spinning={this.state.loading}>                        	
+                            <Row style={{marginLeft:'100px'}}>
+                                <Col span={3}>客户类型:</Col>
+                                <Col span={6}>{theData._customerType}</Col>
+                                <Col span={3}>编号:</Col>
+                                <Col span={6}>{theData.cid}</Col>
+                            </Row>
+                            <Row style={{marginLeft:'100px'}}>
+                                <Col span={3}>录入时间:</Col>
+                                <Col span={6}>{theData.createTime}</Col>
+                                <Col span={3}>跟单人:</Col>
+                                <Col span={6}>{theData.adminName}</Col>
+                            </Row>
+                            <Row style={{marginLeft:'50px'}}>基本资料:</Row>
+                            <Row style={{marginLeft:'100px'}}>
+                                <Col span={3}>公司名称:</Col>
+                                <Col span={6}>{theData.companyName}</Col>
+                                <Col span={3}>公司行业:</Col>
+                                <Col span={6}>{theData.companyIndustry}</Col>
+                            </Row>
+                            <Row style={{marginLeft:'100px'}}>
+                                <Col span={3}>意向服务:</Col>
+                                <Col span={6}>{getCompanyIntention(theData.companyIntention)}</Col>
+                                <Col span={3}>地区:</Col>
+                                <Col span={6}>{getcityArr(theData.locationProvince)}</Col>
+                            </Row>
+                            <Row style={{marginLeft:'100px'}}>
+                                <Col span={3}>最新跟进:</Col>
+                                <Col span={6}>{theData._followSituation}</Col>
+                                <Col span={3}>客户状态:</Col>
+                                <Col span={6}>{theData._customerStatus}</Col>
+                            </Row>
+                            <Row style={{marginLeft:'100px'}}>
+                                <Col span={3}>详细地址:</Col>                                
+                                <Col span={6}>{theData.adress}</Col>
+                            </Row>
+                            <Row style={{marginLeft:'100px'}}>   
+                                <Col span={3}>备注:</Col>
+                                <Col span={6}>{theData.remarks}</Col>
+                            </Row>
+                            <Row style={{marginLeft:'50px'}}>联系资料:<a href='#' style={{marginLeft:'20px'}} onClick={this.setoks}>查看联系人列表</a></Row>                            
+                        </Spin>
+                </Modal> 
+                    <Modal maskClosable={false} 
+                        visible={this.state.visible1}
+                        onOk={this.setcancels} 
+                        onCancel={this.setcancels}
+                        width='800px'
+                        footer={null}
+                        title="联系人列表"
+                        className="demand-order-content">
+	                    <Spin spinning={this.state.loading}>
+	                        <Table columns={this.state.contactInformation}
+	                            dataSource={this.state.information}	                            
+	                            pagination={this.state.pagination}
+	                            />
+	                    </Spin>            
+                    </Modal>
+            </div >
+        );
+    }
+});
+export default PublicCustomer;

+ 24 - 5
js/component/manageCenter/customer/content.jsx

@@ -2,6 +2,9 @@ import React, { Component } from 'react';
 import '../content.less';
 import LeftTab from './leftTab';
 import TechAchievement from './myClient';
+import PublicCustomer from './publicCustomer';
+import CompanyCustomer from './companyCustomer';
+import Teamcustomer from './teamCustomer';
 
 
 class Content extends Component {
@@ -25,22 +28,38 @@ class Content extends Component {
                 require.ensure([], () => {
                     const TechAchievement = require('./myClient').default;
                     this.setState({
-                        component: TechAchievement ,  
-                        listApiUrl: '/api/admin/customer/orgList',
+                        component: TechAchievement ,                       
                         detailApiUrl: '/api/admin/customer/findCustomerUserDetails'
                     });
                 });
                 break;           
             case 'publicCustomer':
                 require.ensure([], () => {
-                    const AchievementOrder = require('./publicCustomer').default;
+                    const publicCustomer = require('./publicCustomer').default;
                     this.setState({
-                        component:AchievementOrder,
-                        listApiUrl: '/api/admin/customer/orgList',
+                        component:publicCustomer,                        
                         detailApiUrl: '/api/admin/customer/orgDetail'
                     });
                 });
                 break;
+            case 'companyCustomer':
+                require.ensure([], () => {
+	                const companyCustomer = require('./companyCustomer').default;
+	                this.setState({
+	                    component:companyCustomer,	                    
+	                    detailApiUrl: '/api/admin/customer/listCompanyCustomer'
+	                });
+          	    });
+          	    break;
+          	case 'teamCustomer':
+                require.ensure([], () => {
+	                const teamCustomer = require('./teamCustomer').default;
+	                this.setState({
+	                    component:teamCustomer,	                    
+	                    detailApiUrl: '/api/admin/customer/listTeamCustomer'
+	                });
+          	    });
+          	    break;
         };
         window.location.hash = key;
     }

+ 7 - 1
js/component/manageCenter/customer/leftTab.jsx

@@ -33,7 +33,13 @@ const LeftTab = React.createClass({
                 </Menu.Item>               
                 <Menu.Item key="publicCustomer">
                     公共客户
-                </Menu.Item>            
+                </Menu.Item> 
+                <Menu.Item key="companyCustomer">
+                    公司客户
+                </Menu.Item>
+                <Menu.Item key="teamCustomer">
+                    团队客户
+                </Menu.Item>
             </Menu>
         );
     },

Fichier diff supprimé car celui-ci est trop grand
+ 842 - 523
js/component/manageCenter/customer/myClient.jsx


+ 7 - 7
js/component/manageCenter/customer/myClientDesc.jsx

@@ -1018,13 +1018,13 @@ const AchievementDetailForm = Form.create()(React.createClass({
 	                            {getFieldDecorator('tag', {	                            	
 	                                initialValue: theData.tag
 	                            })(
-	                               <Select placeholder="选择客户标签" >
-	                                    {
-	                                        tag.map(function (item) {
-	                                            return <Select.Option key={item.key} >{item.key}</Select.Option>
-	                                        })
-	                                    }
-	                                </Select>
+                               <Select placeholder="选择客户标签" >
+                                    {
+                                        tag.map(function (item) {
+                                            return <Select.Option key={item.key} >{item.key}</Select.Option>
+                                        })
+                                    }
+                                </Select>
 	                                )}
 	                        </FormItem>
 	                        <div  className="clearfix">		                        

+ 178 - 306
js/component/manageCenter/customer/publicCustomer.jsx

@@ -4,84 +4,108 @@ import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import moment from 'moment';
 import './myClient.less';
-import { orderStatusList,cityArr,customerStatus } from '../../dataDic.js';
+import { orderStatusList,cityArr,customerStatus,intentionalService,newFollow} from '../../dataDic.js';
 import { beforeUploadFile,getOrderStatus, getSearchUrl,getcustomerTyp,getcityArr,getcustomerStatue,getCompanyIntention,getfllowSituation,getsex} from '../../tools.js';
 
-const data = [{
-		  companyName   : '公司名称',
-		  _followSituation : 'John Brown',
-		  _companyIntention: 32,
-		  
-		}, {
-		  companyName: '跟单人',
-		  _followSituation: 'Jim Green',
-		  _companyIntention: 42,	 
-		}, {
-		  companyName: '时间',
-		  _followSituation: 'Joe Black',
-		  _companyIntention: 32,
-		 
-	}];
-const AchievementDetail = React.createClass({
-    getInitialState () {
-        return {
-            visible: false,
-            loading: false,
-            dataSource: [],
-        };
-    },
-    loadLogs (id) {   	
+//查询功能和初始列表
+const PublicCustomer = React.createClass({	
+    loadData(pageNumber, detailApiUrl) {    	
+        this.state.data = [];
         this.setState({
             loading: true
         });
         $.ajax({
-            method: "get",
+            method: "post",
             dataType: "json",
-            crossDomain: false,
-            url: globalConfig.context + "/api/admin/portal/order/achievementOrderLog",
+            crossDomain: false,          
+            url:globalConfig.context +'/api/admin/customer/listPublicCustomer',
             data: {
-                id:id
+                pageNumber: pageNumber || 1,
+                pageSize: this.state.pagination.pageSize,               
+                companyName: this.state.companyName, //名称1                
+				customerType: this.state.customerType, //客户类型1
+              	locationProvince:this.state.locationProvince,//地区
+				customerStatus:this.state.customerStatus,//客户状态1
+				contactName:this.state.contactName,//联系人姓名1							
+				contactTel:this.state.contactTel,//联系人手机
+				companyIntention:this.state.companyIntention,//意向服务
+                followSituation:this.state.followSituation,//最新跟进进度
+				//releaseDateStartDate: this.state.releaseDate[0],
+                //releaseDateEndDate: this.state.releaseDate[1],			
             },
-            success: function (data) {          	
+            success: function (data) {            	
                 let theArr = [];
-                if (!data.data) {
+                if (!data.data || !data.data.list) {
                     if (data.error && data.error.length) {
                         message.warning(data.error[0].message);
-                    };
-                } else {
-                    for (let i = 0; i < data.data.length; i++) {
-                        let thisdata = data.data[i];
+                    };                   
+                } else {                	
+                    for (let i = 0; i < data.data.list.length; i++) {
+                        let thisdata = data.data.list[i];                       
                         theArr.push({
                             key: i,
-                            recordTime: thisdata.recordTime,
-                            status: thisdata.status,
-                            comment: thisdata.comment,
-                            operator: thisdata.operator,
-                            recordTimeFormattedDate: thisdata.recordTimeFormattedDate                //传回来的值           可能要改
+                            id: thisdata.id,                                                  
+                            companyName:thisdata.companyName,//公司名称
+                            customerType:thisdata.customerType,
+                            _customerType:thisdata._customerType,//客户类型
+                            locationProvince:thisdata.locationProvince,//地区                        
+                            contactName:thisdata.contactName, //联系人姓名
+                            telNum:thisdata.telNum,//手机号
+                            _customerStatus:thisdata._customerStatus,//客户状态
+                            _companyIntention:thisdata._companyIntention,//意向服务
+                            _followSituation:thisdata._followSituation,//最新跟进
+                            customerStatus:thisdata.customerStatus,//客户状态
+                            companyIntention:thisdata.companyIntention,//意向服务
+                            followSituation:thisdata.followSituation,//最新跟进
+                            adminName:thisdata.adminName,     //跟进人          
+                            followDate:thisdata.followDate,
+                            customerStatus:thisdata.customerStatus,//客户状态
+                            companyIntention:thisdata.companyIntention,//意向服务                                                      
                         });
                     };
-                };
+                   
+                    this.state.pagination.current = data.data.pageNumber;
+                    this.state.pagination.total = data.data.totalCount;
+                };               
                 this.setState({
-                    dataSource: theArr
-                });
+                    dataSource: theArr,
+                    pagination: this.state.pagination
+                });             
             }.bind(this),
         }).always(function () {
             this.setState({
                 loading: false
             });
         }.bind(this));
-    },
-    handleSubmit (e) {
+    }, 
+    //领取
+    handleSubmit (e) { 
+    	  let uids;   	  
+    	  let beforeCustomerStatus;
+    	  let beforeFollowSituation;
+    	  let beforeCustomerIntention;
+        for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
+            let rowItem = this.state.selectedRows[idx];                          
+            if (rowItem.id) {
+                uids=rowItem.id;               
+                beforeCustomerStatus=rowItem.customerStatus;
+                beforeFollowSituation=rowItem.followSituation; 
+                beforeCustomerIntention=rowItem.companyIntention;
+            };            
+        };  
         this.setState({
             loading: true
-        });
+        });      
         $.ajax({
             method: "POST",
             dataType: "json",
             crossDomain: false,
-            url: globalConfig.context + '/api/admin/portal/order/updateAchievementOrder',
+            url: globalConfig.context + '/api/admin/customer/receivePublicCustomer',
             data: {
-                id: this.props.data.id,
+                id: uids,                
+                beforeCustomerIntention:beforeCustomerIntention,
+                beforeCustomerStatus:beforeCustomerStatus,
+                beforeFollowSituation:beforeFollowSituation,
             }
         }).done(function (data) {
             this.setState({
@@ -89,190 +113,11 @@ const AchievementDetail = React.createClass({
             });
             if (!data.error.length) {
                 message.success('领取成功!');
-                this.handleOk();
+                this.setcancel();
             } else {
                 message.warning(data.error[0].message);
             };
         }.bind(this));
-    },
-    handleCancel (e) {
-        this.setState({
-            visible: false,
-        });
-        this.props.closeDesc(false);
-    },
-    handleOk (e) {
-        this.setState({
-            visible: false,
-        });
-        this.props.closeDesc(false, true);
-    },
-    componentWillReceiveProps (nextProps) {
-        if (!this.state.visible && nextProps.showDesc && nextProps.data) {
-            this.loadLogs(nextProps.data.id);
-            this.state.paymentId = nextProps.data.paymentId;
-            this.state.paymentType = nextProps.data.paymentType;
-            this.state.paymentValue = nextProps.data.paymentValue;
-            this.state.transferPrice = nextProps.data.transferPrice;
-            this.state.orderStatus = undefined;
-            this.state.comment = undefined;
-            this.state.recordTime = undefined;
-        };
-        this.state.visible = nextProps.showDesc;
-    },
-    render () {       
-    	 const theData = this.props.data || {};    
-            return (
-                <div className="patent-desc">
-                    <Modal maskClosable={false} visible={this.state.visible}
-                        onOk={this.checkPatentProcess} onCancel={this.handleCancel}
-                        width='800px'
-                        footer={null}
-                        title="客户详情"
-                        className="demand-order-content">
-                        <Spin spinning={this.state.loading}>                        	
-                            <Row style={{marginLeft:'100px'}}>
-                                <Col span={3}>客户类型:</Col>
-                                <Col span={10}>{getcustomerTyp(theData.customerTyp)}</Col>
-                                <Col span={3}>编号:</Col>
-                                <Col span={10}>{theData.id}</Col>
-                            </Row>
-                            <Row style={{marginLeft:'100px'}}>
-                                <Col span={3}>录入时间:</Col>
-                                <Col span={10}>{theData.createTime}</Col>
-                                <Col span={3}>跟单人:</Col>
-                                <Col span={10}>{theData.ownerId}</Col>
-                            </Row>
-                            <Row style={{marginLeft:'50px'}}>基本资料:</Row>
-                            <Row style={{marginLeft:'100px'}}>
-                                <Col span={3}>公司名称:</Col>
-                                <Col span={10}>{theData.companyName}</Col>
-                                <Col span={3}>公司行业:</Col>
-                                <Col span={10}>{theData.companyIndustry}</Col>
-                            </Row>
-                            <Row style={{marginLeft:'100px'}}>
-                                <Col span={3}>意向服务:</Col>
-                                <Col span={10}>{getCompanyIntention(theData.companyIntention)}</Col>
-                                <Col span={3}>地区:</Col>
-                                <Col span={10}>{getcityArr(theData.province)}</Col>
-                            </Row>
-                            <Row style={{marginLeft:'100px'}}>
-                                <Col span={3}>最新跟进:</Col>
-                                <Col span={10}>{getfllowSituation(theData.followSituation)}</Col>
-                                <Col span={3}>客户状态:</Col>
-                                <Col span={10}>{getcustomerStatue(theData.customerStatus)}</Col>
-                            </Row>
-                            <Row style={{marginLeft:'100px'}}>
-                                <Col span={3}>详细地址:</Col>                                
-                                <Col span={10}>{theData.adress}</Col>
-                            </Row>
-                            <Row style={{marginLeft:'100px'}}>   
-                                <Col span={3}>备注:</Col>
-                                <Col span={10}>{theData.remark}</Col>
-                            </Row>
-                            <Row style={{marginLeft:'50px'}}>联系资料:</Row>
-                            <Row style={{marginLeft:'100px'}}> 
-                                <Col span={3}>姓名:</Col>
-                                <Col span={10}>{theData.contactName}</Col>
-                                <Col span={3}>性别:</Col>
-                                <Col span={10}>{getsex(theData.sex)}</Col>
-                            </Row>
-                            <Row style={{marginLeft:'100px'}}>
-                                <Col span={3}>手机号码:</Col>
-                                <Col span={10}>{theData.telNum}</Col>
-                                <Col span={3}>座机号:</Col>
-                                <Col span={10}>{theData.mobile}</Col>
-                            </Row>
-                            <Row style={{marginLeft:'100px'}}>
-                                <Col span={3}>QQ号码:</Col>
-                                <Col span={10}>{theData.qq}</Col>
-                                <Col span={3}>邮箱号:</Col>
-                                <Col span={10}>{theData.email}</Col>
-                            </Row>
-                            <Row style={{marginLeft:'100px'}}>
-                                <Col span={3}>微信:</Col>                                
-                                <Col span={10}>{theData.wechat}</Col>
-                                <Col span={3}>部门:</Col>
-                                <Col span={10}>{theData.department}</Col>
-                            </Row>
-                            <Row style={{marginLeft:'100px'}}> 
-                                <Col span={3}>职位:</Col>
-                                <Col span={10}>{theData.customerPosition}</Col>
-                            </Row>                               
-                            <Row style={{marginLeft:'100px'}}>
-                                <Col span={3}></Col>
-                                <Col span={20}>
-                                    <Button style={{ marginRight: '20px' }} type="primary" onClick={this.handleSubmit}>领取</Button>                                    
-                                    <Button className="set-submit" type="ghost" onClick={this.handleCancel}>取消</Button>
-                                </Col>
-                            </Row>
-                        </Spin>
-                    </Modal>
-                </div>
-            );
-    },
-});
-
-//查询功能和初始列表
-const AchievementOrderList = React.createClass({
-    loadData(pageNo, apiUrl) {
-        this.state.data = [];
-        this.setState({
-            loading: true
-        });
-        $.ajax({
-            method: "get",
-            dataType: "json",
-            crossDomain: false,          
-            url:globalConfig.context + '/api/admin/customer/searchCustomerList',
-            data: {
-                pageNo: pageNo || 1,
-                pageSize: this.state.pagination.pageSize,               
-                companyName: this.state.companyName, //名称
-				customerTyp: this.state.customerTyp, //客户类型
-              	province:this.state.province,//地区
-				customerStatus:this.state.customerStatus,//客户状态1
-				contactName:this.state.contactName,//联系人姓名1
-				adminName:this.state.adminName,//跟单人1
-				companyIntention:this.state.companyIntention,//意向服务1
-				followSituation:this.state.followSituation,//跟进进度1
-            },
-            success: function (data) {            	
-                let theArr = [];
-                if (!data.data || !data.data.list) {
-                    if (data.error && data.error.length) {
-                        message.warning(data.error[0].message);
-                    };                   
-                } else {                	
-                    for (let i = 0; i < data.data.list.length; i++) {
-                        let thisdata = data.data.list[i];                       
-                        theArr.push({
-                            key: i,
-                            id: thisdata.id,
-                            companyName:thisdata.companyName,
-                            customerTyp:thisdata.customerTyp,
-                            province:thisdata.province,
-                            contactName:thisdata.contactName,
-                            telNum:thisdata.telNum,
-                            customerStatus:thisdata.customerStatus,
-                            companyIntention:thisdata.companyIntention,
-                            followSituation:thisdata.followSituation,
-                            adminName:thisdata.adminName                                                                                       
-                        });
-                    };
-                    this.state.pagination.current = data.data.pageNo;
-                    this.state.pagination.total = data.data.totalCount;
-                };               
-                this.setState({
-                    dataSource: theArr,
-                    pagination: this.state.pagination
-                });
-            }.bind(this),
-        }).always(function () {
-            this.setState({
-                loading: false
-            });
-        }.bind(this));
     },   
     getInitialState() {
         return {
@@ -295,6 +140,48 @@ const AchievementOrderList = React.createClass({
                     return '共' + total + '条数据';
                 }
             },
+                contactInformation:[
+           			 {
+				  title: '姓名',
+				  dataIndex: 'contactName',
+				  key: 'contactName'
+						  
+					},{
+						  title: '性别',
+						  dataIndex: 'sex',
+						  key: 'sex',
+						  render: text => { return getsex(text); }
+					},
+					{
+						  title: '手机号码',
+						  dataIndex: 'telNum',
+						  key: 'telNum'	 
+					},{
+						  title: '座机号',
+						  dataIndex: 'mobile',
+						  key: 'mobile'	 
+					},{
+						  title: 'QQ号码',
+						  dataIndex: 'qq',
+						  key: 'qq'	 
+					},{
+						  title: '邮箱号',
+						  dataIndex: 'email',
+						  key: 'email'	 
+					},{
+						  title: '微信',
+						  dataIndex: 'wechat',
+						  key: 'wechat'	 
+					},{
+						  title: '部门',
+						  dataIndex: 'depatrment',
+						  key: 'depatrment'	 
+					},{
+						  title: '职位',
+						  dataIndex: 'customerPosition',
+						  key: 'customerPosition'	 
+					},
+                  ],
             columns: [               
                 {
                     title: '公司名称',
@@ -302,13 +189,13 @@ const AchievementOrderList = React.createClass({
                     key: 'companyName',
                 }, {
                     title: '客户类型',
-                    dataIndex: 'customerTyp',
-                    key: 'customerTyp',
-                    render: text => { return getcustomerTyp(text); }
+                    dataIndex: '_customerType',
+                    key: '_customerType',
+                    //render: text => { return getcustomerTyp(text); }
                 }, {
                     title: '地区',
-                    dataIndex: 'province',
-                    key: 'province',
+                    dataIndex: 'locationProvince',
+                    key: 'locationProvince',
                     render: text => { return getcityArr(text); }
                 }, {
                     title: '联系人姓名',
@@ -322,26 +209,31 @@ const AchievementOrderList = React.createClass({
                 },
                  {
                     title: '客户状态',
-                    dataIndex: 'customerStatus',
-                    key: 'customerStatus',
-                    render: text => { return getcustomerStatue(text) }
+                    dataIndex: '_customerStatus',
+                    key: '_customerStatus',
+                  //render: text => { return getcustomerStatue(text) }
                 },
                 {
                     title: '意向服务',
-                    dataIndex: 'companyIntention',
-                    key: 'companyIntention',
-                    render: text => { return getCompanyIntention(text) }
+                    dataIndex: '_companyIntention',
+                    key: '_companyIntention',
+                    //render: text => { return getCompanyIntention(text) }
                 },
                  {
                     title: '最新跟进',
-                    dataIndex: 'followSituation',
-                    key: 'followSituation',
-                    render: text => { return getfllowSituation(text) }
+                    dataIndex: '_followSituation',
+                    key: '_followSituation',
+                    //render: text => { return getfllowSituation(text) }
                 },
                  {
                     title: '跟单人',
                     dataIndex: 'adminName',
                     key: 'adminName',
+                },
+                {
+                    title: '时间',
+                    dataIndex: 'followDate',
+                    key: 'followDate',
                 }
             ],
             dataSource: [],
@@ -354,15 +246,31 @@ const AchievementOrderList = React.createClass({
             theArr.push(
                 <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
             )
-        });
-        let auditArr = [];
+        });            
+               
+        let intentionalArr = [];
+        intentionalService.map(function (item) {
+            intentionalArr.push(
+                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
+            )
+        });   
+        let newArr = [];
+        newFollow.map(function (item) {
+            newArr.push(
+                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
+            )
+        });   
+				let auditArr = [];
         cityArr.map(function (item) {
             auditArr.push(
                 <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
             )
-        });       
-        this.state.customerStatuarr = theArr;
+        }); 
+        this.state.customerStatuarr = theArr;               
+        this.state.intentionalOption = intentionalArr;
+        this.state.newOption = newArr;
         this.state.auditStatusOption = auditArr;
+        
         if (window.location.search) {
             let theObj = getSearchUrl(window.location.search);
             if (theObj.rid) {
@@ -374,12 +282,7 @@ const AchievementOrderList = React.createClass({
         };       
         this.loadData();        
     },
-    tableRowClick(record, index) {
-        this.state.RowData = record;
-        this.setState({
-            showDesc: true
-        });
-    },
+    
     closeDesc(e, s) {
         this.state.showDesc = e;
         if (s) {
@@ -390,14 +293,16 @@ const AchievementOrderList = React.createClass({
         this.loadData();
     },
     reset() {
+    	this.state.companyName='';  
+    	this.state.customerType = undefined;
         this.state.id = undefined;
-        this.state.companyName = undefined;
-        this.state.customerTyp = undefined;
-        this.state.province = undefined;
-        this.state.ownerType = undefined;
-        this.state.customerStatus = undefined;
-        this.state.auditStatus = undefined;
-        this.state.ownerId = undefined;
+        this.state.shareType = undefined;
+        this.state.companyIntention  = undefined;
+        this.state.followSituation  = undefined;
+        this.state.locationProvince  = undefined;
+        this.state.customerStatus  = undefined;
+        this.state.contactName   = undefined;
+        this.state.contactTel = undefined;
         this.state.contactName = undefined;  
         this.state.releaseDate = [];
         this.loadData(); 
@@ -408,6 +313,7 @@ const AchievementOrderList = React.createClass({
         });
     },
     render() {
+    	  const theData = this.state.data || {}; 
         const rowSelection = {
             selectedRowKeys: this.state.selectedRowKeys,
             onChange: (selectedRowKeys, selectedRows) => {
@@ -426,53 +332,23 @@ const AchievementOrderList = React.createClass({
                 </div>
                 <div className="user-search">                    
                     <Input placeholder="公司名称"
-                        value={this.state.customerName}
-                        onChange={(e) => { this.setState({ customerName: e.target.value }); }} /> 
+                        value={this.state.companyName}
+                        onChange={(e) => { this.setState({ companyName: e.target.value }); }} /> 
                     <Select placeholder="客户类型" style={{ width: 120 }}
-                            value={this.state.shareTyp }
-                            onChange={(e) => { this.setState({ shareTyp : e }) }}>
+                            value={this.state.customerType }
+                            onChange={(e) => { this.setState({ customerType : e }) }}>
                             <Select.Option value="0" >个人客户</Select.Option>
                             <Select.Option value="1" >公司客户</Select.Option>
-                    </Select>     
-                    <Select placeholder="意向服务"
-                            style={{ width: 160 }}
-                            value={this.state.companyIntention}
-                            onChange={(e) => { this.setState({ companyIntention: e }) }}>
-                            {this.state.intentionalOption}
-                    </Select>
-                    <Select placeholder="跟进进度"
-                            style={{ width: 160 }}
-                            value={this.state.followSituation}
-                            onChange={(e) => { this.setState({ followSituation: e }) }}>
-                            {this.state.newOption}
-                    </Select>
+                    </Select>                        
                     <Select placeholder="地区"
                             style={{ width: 160 }}
-                            value={this.state.province}
-                            onChange={(e) => { this.setState({ province: e }) }}>
+                            value={this.state.locationProvince}
+                            onChange={(e) => { this.setState({ locationProvince: e }) }}>
                             {this.state.auditStatusOption}
-                    </Select>
-                    <Select placeholder="客户状态" style={{ width: 120 }}
-                            value={this.state.customerStatus}
-                            onChange={(e) => { this.setState({ customerStatus: e }) }}>                           
-                            {this.state.customerStatuarr}
-                    </Select>
+                    </Select>                    
                     <Button type="primary" onClick={this.search}>搜索</Button>
-                    <Button onClick={this.reset}>重置</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.ownerId}
-		                    onChange={(e) => { this.setState({ ownerId: e.target.value }); }} />
-		                <Input placeholder="联系人姓名" style={{width:'140px',marginRight:'10px'}}
-		                    value={this.state.contactName}
-		                    onChange={(e) => { this.setState({ contactName: e.target.value }); }} />                                        	
-                        <span>发布时间 :</span>
-                        <RangePicker
-                            value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
-                            this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
-                            onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />                            
-                    </div>
+                    <Button onClick={this.reset}>重置</Button> 
+                    <Button type="primary" onClick={this.handleSubmit} disabled={!hasSelected}>领取</Button>                                                                                             
                 </div>
                 <div className="patent-table">
                     <Spin spinning={this.state.loading}>
@@ -480,16 +356,12 @@ const AchievementOrderList = React.createClass({
                             dataSource={this.state.dataSource}
                             rowSelection={rowSelection}
                             pagination={this.state.pagination}
-                            onRowClick={this.tableRowClick} />
+                            />
                     </Spin>
-                </div>
-                <AchievementDetail
-                    data={this.state.RowData}
-                    showDesc={this.state.showDesc}
-                    closeDesc={this.closeDesc} />
+                </div>                
             </div >
         );
     }
 });
 
-export default AchievementOrderList;
+export default PublicCustomer;

+ 283 - 0
js/component/manageCenter/customer/teamCustomer.jsx

@@ -0,0 +1,283 @@
+import React from 'react';
+import { AutoComplete, Icon, Button, Input, InputNumber, Select, Spin, Table, message, Modal, Row, Col, DatePicker,Switch,Upload} from 'antd';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+import moment from 'moment';
+import './myClient.less';
+import { orderStatusList,cityArr,customerStatus,intentionalService,newFollow} from '../../dataDic.js';
+import { beforeUploadFile,getOrderStatus, getSearchUrl,getcustomerTyp,getcityArr,getcustomerStatue,getCompanyIntention,getfllowSituation,getsex} from '../../tools.js';
+
+
+
+//查询功能和初始列表
+const Teamcustomer = React.createClass({
+     loadData(pageNumber, detailApiUrl) {    	
+        this.state.data = [];
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,          
+            url:globalConfig.context +'/api/admin/customer/listTeamCustomer',
+            data: {
+                pageNumber: pageNumber || 1,
+                pageSize: this.state.pagination.pageSize,               
+                companyName: this.state.companyName, //名称1                
+				        customerType: this.state.customerType, //客户类型1
+              	locationProvince:this.state.locationProvince,//地区
+								customerStatus:this.state.customerStatus,//客户状态1
+								contactName:this.state.contactName,//联系人姓名1							
+								contactTel:this.state.contactTel,//联系人手机
+								companyIntention:this.state.companyIntention,//意向服务
+                followSituation:this.state.followSituation,//最新跟进进度
+				//releaseDateStartDate: this.state.releaseDate[0],
+                //releaseDateEndDate: this.state.releaseDate[1],			
+            },
+            success: function (data) {            	
+                let theArr = [];
+                if (!data.data || !data.data.list) {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };                   
+                } else {                	
+                    for (let i = 0; i < data.data.list.length; i++) {
+                        let thisdata = data.data.list[i];                       
+                        theArr.push({
+                            key: i,
+                            id: thisdata.id,                                                  
+                            companyName:thisdata.companyName,//公司名称
+                            customerType:thisdata.customerType,
+                            _customerType:thisdata._customerType,//客户类型
+                            locationProvince:thisdata.locationProvince,//地区                        
+                            contactName:thisdata.contactName, //联系人姓名
+                            telNum:thisdata.telNum,//手机号
+                            _customerStatus:thisdata._customerStatus,//客户状态
+                            _companyIntention:thisdata._companyIntention,//意向服务
+                            _followSituation:thisdata._followSituation,//最新跟进
+                            customerStatus:thisdata.customerStatus,//客户状态
+                            companyIntention:thisdata.companyIntention,//意向服务
+                            followSituation:thisdata.followSituation,//最新跟进
+                            adminName:thisdata.adminName,     //跟进人          
+                            followDate:thisdata.followDate,
+                            customerStatus:thisdata.customerStatus,//客户状态
+                            companyIntention:thisdata.companyIntention,//意向服务                                                      
+                        });
+                    };
+                   
+                    this.state.pagination.current = data.data.pageNumber;
+                    this.state.pagination.total = data.data.totalCount;
+                };               
+                this.setState({
+                    dataSource: theArr,
+                    pagination: this.state.pagination
+                });             
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    },    
+    getInitialState() {
+        return {
+            searchMore: true,
+            searchType: 0,
+            validityPeriodDate: [],
+            releaseDate: [],
+            selectedRowKeys: [],
+            selectedRows: [],
+            loading: false,
+            pagination: {
+                defaultCurrent: 1,
+                defaultPageSize: 10,
+                showQuickJumper: true,
+                pageSize: 10,
+                onChange: function (page) {
+                    this.loadData(page);
+                }.bind(this),
+                showTotal: function (total) {
+                    return '共' + total + '条数据';
+                }
+            },              
+            columns: [               
+                {
+                    title: '公司名称',
+                    dataIndex: 'companyName',
+                    key: 'companyName',
+                }, {
+                    title: '客户类型',
+                    dataIndex: '_customerType',
+                    key: '_customerType',
+                    //render: text => { return getcustomerTyp(text); }
+                }, {
+                    title: '地区',
+                    dataIndex: 'locationProvince',
+                    key: 'locationProvince',
+                    render: text => { return getcityArr(text); }
+                }, {
+                    title: '联系人姓名',
+                    dataIndex: 'contactName',
+                    key: 'contactName',                    
+                }, 
+                {
+                    title: '手机号',
+                    dataIndex: 'telNum',
+                    key:'telNum',                   
+                },
+                 {
+                    title: '客户状态',
+                    dataIndex: '_customerStatus',
+                    key: '_customerStatus',
+                  //render: text => { return getcustomerStatue(text) }
+                },
+                {
+                    title: '意向服务',
+                    dataIndex: '_companyIntention',
+                    key: '_companyIntention',
+                    //render: text => { return getCompanyIntention(text) }
+                },
+                 {
+                    title: '最新跟进',
+                    dataIndex: '_followSituation',
+                    key: '_followSituation',
+                    //render: text => { return getfllowSituation(text) }
+                },
+                 {
+                    title: '跟单人',
+                    dataIndex: 'adminName',
+                    key: 'adminName',
+                },
+                {
+                    title: '时间',
+                    dataIndex: 'followDate',
+                    key: 'followDate',
+                }
+            ],
+            dataSource: [],
+            searchTime: [],
+        };
+    },
+    componentWillMount() {
+        let theArr = [];
+        customerStatus.map(function (item) {
+            theArr.push(
+                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
+            )
+        });            
+               
+        let intentionalArr = [];
+        intentionalService.map(function (item) {
+            intentionalArr.push(
+                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
+            )
+        });   
+        let newArr = [];
+        newFollow.map(function (item) {
+            newArr.push(
+                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
+            )
+        });   
+				let auditArr = [];
+        cityArr.map(function (item) {
+            auditArr.push(
+                <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
+            )
+        }); 
+        this.state.customerStatuarr = theArr;               
+        this.state.intentionalOption = intentionalArr;
+        this.state.newOption = newArr;
+        this.state.auditStatusOption = auditArr;
+        
+        if (window.location.search) {
+            let theObj = getSearchUrl(window.location.search);
+            if (theObj.rid) {
+                theObj.id = theObj.rid;
+                if (theObj.rid != 'null') {
+                    this.tableRowClick(theObj);
+                };
+            };
+        };       
+        this.loadData();        
+    },    
+    closeDesc(e, s) {
+        this.state.showDesc = e;
+        if (s) {
+            this.loadData();
+        };
+    },
+    search() {
+        this.loadData();
+    },
+    reset() {
+      	this.state.customerType=undefined;
+      	this.state.companyName='';   
+        this.state.id = undefined;
+        this.state.shareType = undefined;
+        this.state.companyIntention  = undefined;
+        this.state.followSituation  = undefined;
+        this.state.locationProvince  = undefined;
+        this.state.customerStatus  = undefined;
+        this.state.contactName   = undefined;
+        this.state.contactTel = undefined;
+        this.state.contactName = undefined;  
+        this.state.releaseDate = [];
+        this.loadData(); 
+    },
+    searchSwitch() {
+        this.setState({
+            searchMore: !this.state.searchMore
+        });
+    },
+    render() {
+    	  const theData = this.state.data || {}; 
+        const rowSelection = {
+            selectedRowKeys: this.state.selectedRowKeys,
+            onChange: (selectedRowKeys, selectedRows) => {
+                this.setState({
+                    selectedRows: selectedRows.slice(-1),
+                    selectedRowKeys: selectedRowKeys.slice(-1)
+                });
+            }
+        };
+        const hasSelected = this.state.selectedRowKeys.length > 0;
+        const { RangePicker } = DatePicker;
+        return (
+            <div className="user-content" >
+                <div className="content-title">                  
+                    <span>公共客户管理</span>                  
+                </div>
+                <div className="user-search">                    
+                    <Input placeholder="公司名称"
+                        value={this.state.companyName}
+                        onChange={(e) => { this.setState({ companyName: e.target.value }); }} /> 
+                    <Select placeholder="客户类型" style={{ width: 120 }}
+                            value={this.state.customerType }
+                            onChange={(e) => { this.setState({ customerType : e }) }}>
+                            <Select.Option value="0" >个人客户</Select.Option>
+                            <Select.Option value="1" >公司客户</Select.Option>
+                    </Select>                        
+                    <Select placeholder="地区"
+                            style={{ width: 160 }}
+                            value={this.state.locationProvince}
+                            onChange={(e) => { this.setState({ locationProvince: e }) }}>
+                            {this.state.auditStatusOption}
+                    </Select>                   
+                    <Button type="primary" onClick={this.search}>搜索</Button>
+                    <Button onClick={this.reset}>重置</Button>                     
+                </div>
+                <div className="patent-table">
+                    <Spin spinning={this.state.loading}>
+                        <Table columns={this.state.columns}
+                            dataSource={this.state.dataSource}
+                            rowSelection={rowSelection}
+                            pagination={this.state.pagination}
+                           />
+                    </Spin>
+                </div>                           
+            </div >
+        );
+    }
+});
+export default Teamcustomer;

+ 14 - 1
js/component/tools.js

@@ -40,7 +40,8 @@ import {
     tag,
     contact,
     intentionalServiceOn,
-    newFollowOn
+    newFollowOn,
+    customerStatusOn
 } from './dataDic.js';
 module.exports = {
     splitUrl: function (string, i, url) {
@@ -697,6 +698,18 @@ module.exports = {
             return theType;
         }
     },
+    //客户状态反
+	getcustomerStatueOn: function (e) {
+         if (e) {
+            let theType = '';
+            customerStatusOn.map(function (item) {
+                if (item.value == e) {
+                    theType = item.key;
+                };
+            });
+            return theType;
+        }
+    },
     //意向服务
 	getCompanyIntention: function (e) {
          if (e) {