liting2017 il y a 6 ans
Parent
commit
63b0ad8775

+ 3 - 2
js/component/manageCenter/customer/NEW/intentionCustomer/intentionCustomer.jsx

@@ -390,12 +390,12 @@ const IntentionCustomer = Form.create()(React.createClass({
 			this.setState({
 				selectedRowKeys: [],
 			});
-			let changeIds;
+			let changeIds,oldAid;
 			for(let idx = 0; idx < this.state.selectedRows.length; idx++) {
 				let rowItem = this.state.selectedRows[idx];
 				if(rowItem.id) {
+					oldAid=rowItem.aid;
 					changeIds = rowItem.id;
-					
 				};
 			};
 			$.ajax({
@@ -406,6 +406,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 				data: {
 					uid: changeIds, //这一行数据的ID
 					aid: this.state.theTypes, //指定转交人的ID 
+					oldAid:oldAid
 				}
 			}).done(function(data) {
 				if(!data.error.length) {

+ 21 - 57
js/component/manageCenter/customer/NEW/publicCustomer/publicCustomer.jsx

@@ -3,7 +3,6 @@ import { Button,Cascader,Input, Select, Spin, Table, message, Form } from 'antd'
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import { citySelect, provinceList } from '@/NewDicProvinceList';
-import './publicCustomer.less';
 
 const QueryCustomer = React.createClass({
 	loadData(pageNo, apiUrl) {
@@ -39,12 +38,8 @@ const QueryCustomer = React.createClass({
 							name: thisdata.name,
 							contacts: thisdata.contacts,
 							contactMobile: thisdata.contactMobile,
-							industry: thisdata.industry,
-							societyTag: thisdata.societyTag,
-							lastFollowTime:thisdata.lastFollowTime&&thisdata.lastFollowTime.split(' ')[0],
+							createTime:thisdata.createTime&&thisdata.createTime.split(' ')[0],
 							transferTime:thisdata.transferTime&&thisdata.transferTime.split(' ')[0],
-							surplusFollowTime:thisdata.surplusFollowTime&&thisdata.surplusFollowTime.split(' ')[0],
-							surplusSignTime:thisdata.surplusSignTime&&thisdata.surplusSignTime.split(' ')[0],
 							locationProvince: thisdata.province ? thisdata.province + '-' + thisdata.city + '-' + thisdata.area : '--'
 						});
 					};
@@ -127,60 +122,31 @@ const QueryCustomer = React.createClass({
 			],
 		}
 	},
-	/*领取所有*/
-	receiveAll(){
-		this.setState({
-			laodingt:true
-		});
-		let selectIds=[];
-		this.state.selectedRows.map((item)=>{
-			selectIds.push(`${item.id}`)
-		});
-		$.ajax({
-			type:"get",
-			url:"http://abc",
-			crossDomain: false,
-			data:{
-				id:`${selectIds}`
-			},
-			success:function(data){
-				if(data.error && data.error.length) {
-					message.warning(data.error[0].message);
-				}else{
-					message.success('领取成功!')
-					this.loadData(this.state.ispage);
-				};
-			}.bind(this),
-		}).always(function(){
-			this.setState({
-				loading:false
-			});
-		}.bind(this));
-	},
 	/*单个领取*/
-	receive(record){
+	receive(e) {
 		this.setState({
-			laodingt:true
+			loading: true,
+			selectedRowKeys: [],
 		});
 		$.ajax({
-			type:"get",
-			url:"http://abcttt",
+			method: "get",
+			dataType: "json",
 			crossDomain: false,
-			data:{
-				id:record.id
-			},
-			success:function(data){
-				if(data.error && data.error.length) {
-					message.warning(data.error[0].message);
-				}else{
-					message.success('领取成功!')
-					this.loadData(this.state.ispage);
-				};
-			}.bind(this),
-		}).always(function(){
-			this.setState({
-				loading:false
-			});
+			url: globalConfig.context + "/api/admin/customer/receiveCustomer",
+			data: {
+				uid: e.id,
+				oldAid:e.aid
+			}
+		}).done(function(data) {
+			if(!data.error.length) {
+				message.success('领取成功!');
+				this.setState({
+					loading: false,
+				});
+			} else {
+				message.warning(data.error[0].message);
+			};
+			this.loadData(this.state.ispage);
 		}.bind(this));
 	},
 	closeDesc(e) {
@@ -231,7 +197,6 @@ const QueryCustomer = React.createClass({
 			},
 			
 		};
-		const hasSelected = this.state.selectedRowKeys.length > 0;
 		return(
 			<div className="user-content" >
                 <div className="content-title">                  
@@ -253,7 +218,6 @@ const QueryCustomer = React.createClass({
                     </span>
                     <Button type="primary" onClick={this.search}>搜索</Button>
                     <Button onClick={this.reset}>重置</Button> 
-                    <Button disabled={!hasSelected} onClick={this.receiveAll}>一键领取</Button> 
                 </div>  
                 <div className="patent-table">
                     <Spin spinning={this.state.loading}>

+ 28 - 40
js/component/manageCenter/customer/NEW/query/detail.jsx

@@ -1,11 +1,10 @@
 import React from 'react';
-import { Table,Spin, message,Modal } from 'antd';
+import { Table, Spin, message, Modal } from 'antd';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 
-const Detail =React.createClass({
-	loadData(data,apiUrl) {
-		console.log(data)
+const Detail = React.createClass({
+	loadData(data, apiUrl) {
 		this.setState({
 			loading: true,
 		});
@@ -13,8 +12,7 @@ const Detail =React.createClass({
 			method: "get",
 			dataType: "json",
 			crossDomain: false,
-			//url: globalConfig.context + apiUrl,
-			url: globalConfig.context + '/api/admin/customer/toAddFollow',
+			url: globalConfig.context + apiUrl,
 			data: {
 				uid: data.id,
 			},
@@ -26,16 +24,15 @@ const Detail =React.createClass({
 						message.warning(data.error[0].message);
 					};
 					thedata = {};
+					return;
 				};
-				for(let i = 0; i < data.data.userBusinessList.length; i++) {
-					let thisdata = data.data.userBusinessList[i];
+				for(let i = 0; i < data.data.length; i++) {
+					let thisdata = data.data[i];
 					listArr.push({
 						id: thisdata.id,
-						businessName:thisdata.businessName,
-						businessGlossoryId: String(thisdata.businessGlossoryId),
-						followSituation: String(thisdata.followSituation),
-						customerStatus: String(thisdata.customerStatus),
-						remarks: thisdata.remarks,
+						businessProjectName: thisdata.businessProjectName,
+						salesmanName: thisdata.salesmanName,
+						lockTime: thisdata.lockTime && thisdata.lockTime.split(' ')[0],
 					});
 				};
 				this.setState({
@@ -48,51 +45,42 @@ const Detail =React.createClass({
 			});
 		}.bind(this));
 	},
-	getInitialState(){
-		return{
-			loading:false,
-			dataSource:[],
+	getInitialState() {
+		return {
+			loading: false,
+			dataSource: [],
 			columns: [{
 					title: '业务名称',
-					dataIndex: 'businessName',
-					key: 'businessName',
+					dataIndex: 'businessProjectName',
+					key: 'businessProjectName',
 				}, {
-					title: '项目名称',
-					dataIndex: 'locationProvince',
-					key: 'locationProvince',
-				},{
 					title: '签单时间',
-					dataIndex: 'createTime',
-					key: 'createTime',
-				}, 
-				{
-					title: '客户名称',
-					dataIndex: 'contacts',
-					key: 'contacts',
+					dataIndex: 'lockTime',
+					key: 'lockTime',
 				},
 				{
 					title: '营销员',
-					dataIndex: 'contactst',
-					key: 'contactst',
+					dataIndex: 'salesmanName',
+					key: 'salesmanName',
 				}
 			],
 		}
 	},
-	visitCancel(){
+	visitCancel() {
 		this.setState({
-			visitModul:false
+			visitModul: false
 		})
-		this.props.closeDesc(false)
+		this.props.closeDesc(false);
 	},
 	componentWillReceiveProps(nextProps) {
-		if(nextProps.visitModul){
+		if(nextProps.visitModul) {
 			this.setState({
-				visitModul:true
+				visitModul: true
 			})
-			this.loadData(nextProps.data,nextProps.detailApi)
+			this.loadData(nextProps.data, nextProps.detailApi);
 		}
 	},
-	render(){
+	render() {
 		return(
 			<Modal	
 			      className="customeDetails"
@@ -113,4 +101,4 @@ const Detail =React.createClass({
 		)
 	}
 })
-export default Detail;
+export default Detail;

+ 5 - 10
js/component/manageCenter/customer/NEW/query/queryCutomer.jsx

@@ -39,15 +39,10 @@ const QueryCustomer = React.createClass({
 						theArr.push({
 							key: i,
 							id: thisdata.uid,
-							type: thisdata.type,
 							name: thisdata.name,
-							status: thisdata.status,
-							contacts: thisdata.contacts,
-							contactMobile: thisdata.contactMobile,
-							industry: thisdata.industry,
-							createTime: thisdata.createTime,
-							businessAudit: thisdata.businessAudit,
-							auditStatus: thisdata.auditStatus,
+							adminName: thisdata.adminName,
+							createTime: thisdata.createTime&&thisdata.createTime.split(' ')[0],
+							locationProvince: thisdata.province ? thisdata.province + '-' + thisdata.city + '-' + thisdata.area : '--'
 						});
 					};
 					this.state.pagination.current = data.data.pageNo;
@@ -104,8 +99,8 @@ const QueryCustomer = React.createClass({
 				}, 
 				{
 					title: '所属人',
-					dataIndex: 'contacts',
-					key: 'contacts',
+					dataIndex: 'adminName',
+					key: 'adminName',
 				},
 				{
 					title: '操作',

+ 2 - 2
js/component/manageCenter/customer/content.jsx

@@ -311,7 +311,7 @@ class Content extends Component {
                         component: <PersonalQuery 
                 			intentionState={1}
                 		    ApiUrl={'/api/admin/customer/listAllPersonalCustomer'}	
-                		    detailApi={'/api/admin/customer/findPersonalCustomerDetail'}
+                		    detailApi={'/api/admin/customer/getLockedProject'}
                         />
                     });
                 });
@@ -324,7 +324,7 @@ class Content extends Component {
                         component: <CompanyQuery 
                 			intentionState={0}
                     		ApiUrl={'/api/admin/customer/listAllOrganizationCustomer'}
-                    		detailApi={'/api/admin/customer/findOrganizationCustomerDetail'}
+                    		detailApi={'/api/admin/customer/getLockedProject'}
                     	/>	
                     });
                 });

+ 1 - 1
js/component/manageCenter/customer/individualCustomer/expertQuery.jsx

@@ -75,7 +75,7 @@ const QueryCustomer = Form.create()(React.createClass({
 			method: "post",
 			dataType: "json",
 			crossDomain: false,
-			url: globalConfig.context + '/api/admin/customer/listPersonalCustomer',
+			url: globalConfig.context + '/api/admin/customer/listExpertCustomer',
 			data: {
 				pageNo: pageNo || 1,
 				pageSize: this.state.pagination.pageSize,

+ 1 - 1
js/component/manageCenter/customer/reviewed/expertReview.jsx

@@ -142,7 +142,7 @@ const QueryCustomer = Form.create()(React.createClass({
 					this.state.pagination.current = data.data.pageNo ;
 					this.state.pagination.total = data.data.totalCount ;
 				};
-				if(!data.data.list.length){
+				if(data.data&&data.data.list&&!data.data.list.length){
 					this.state.pagination.current=0
 					this.state.pagination.total=0
 				}

+ 1 - 1
js/component/manageCenter/customer/reviewed/identityAuditsOne.jsx

@@ -143,7 +143,7 @@ const QueryCustomer = Form.create()(React.createClass({
 					this.state.pagination.current = data.data.pageNo ;
 					this.state.pagination.total = data.data.totalCount ;
 				};
-				if(!data.data.list.length){
+				if(data.data&&data.data.list&&!data.data.list.length){
 					this.state.pagination.current=0
 					this.state.pagination.total=0
 				}