dengzhiguo 6 年之前
父節點
當前提交
a9afe9b22d

+ 44 - 42
js/component/manageCenter/customer/customerManagement/adminCustomerStatistics.jsx

@@ -4,7 +4,7 @@ import ReactDom from 'react-dom';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
 import { Form, Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload, Popconfirm } from 'antd';
-import ManagementDetaile from "../../order/settlementOrder/settlementManage/managementDetaile.2.jsx";
+// import ManagementDetaile from "../../order/settlementOrder/settlementManage/managementDetaile.2.jsx";
 import moment from 'moment';
 import '../../order/userMangagement.less';
 import { orderState, orderChannel, orderType } from '../../../dataDic.js';
@@ -24,21 +24,11 @@ const AdminCustomerStatistics = Form.create()(React.createClass({
 			data: {
 				pageNo: pageNo || 1,
 				pageSize: this.state.pagination.pageSize,
-				buyerName: this.state.buyerNameSearch,
 				depId: this.state.departmenttSearch, //部门
-				salesmanName: this.state.salesmanNameSearch, //负责人
 				startTime: this.state.releaseDate[0],
 				endTime: this.state.releaseDate[1],
-				liquidationStatus: this.state.liquidationStatusSearch, //结算
-				orderStatus: this.state.orderStatusSearch,
-				orderChannel: this.state.orderChannelSearch,
-				financeName: this.state.financeNameSearchs,
-				orderType: this.state.orderTypeSearch,
-				orderNo: this.state.orderNoSearch,
-				isDistributionFinance: this.state.isDistributionFinance
 			},
 			success: function(data) {
-				console.log(data);
 				let theArr = [];
 				if(!data.data) {
 					if(data.error && data.error.length) {
@@ -141,11 +131,19 @@ const AdminCustomerStatistics = Form.create()(React.createClass({
 					return '共' + total + '条数据';
 				}
 			},
+			paginationX: {
+				defaultCurrent: 1,
+				defaultPageSize: 10,
+				showQuickJumper: true,
+				pageSize: 10,
+				onChange: function(page) {
+					this.xiangmu(page);
+				}.bind(this),
+				showTotal: function(total) {
+					return '共' + total + '条数据';
+				}
+			},
 			columns: [{
-				title: 'id',
-				dataIndex: 'aid',
-				key: 'aid'
-			},{
 				title: '编号',
 				dataIndex: 'key',
 				key: 'key'
@@ -167,6 +165,7 @@ const AdminCustomerStatistics = Form.create()(React.createClass({
 				key: 'timeCount'
  			}],
 			dataSource: [],
+			dataSourceX: [],
 			columnsX: [{
 				title: '客户ID',
 				dataIndex: 'id',
@@ -195,8 +194,8 @@ const AdminCustomerStatistics = Form.create()(React.createClass({
 				title: '跟进时间',
 				dataIndex: 'followTime',
 				key: 'followTime',
-			}],
-			dataSourceX: [],
+			}]
+			
 		};
 	},
 	//操作分配
@@ -295,13 +294,15 @@ const AdminCustomerStatistics = Form.create()(React.createClass({
 		this.loadData();
 	},
 	tableRowClick(record, index) {
-		 this.state.RowData = record;
 		this.setState({
 		    visible: true,
 		});
 		this.xiangmu(record.aid);
 	},
-	xiangmu(aids) {
+	xiangmu(pageNo,aids) {
+		this.setState({
+			loading:true
+		})
 		$.ajax({
 			method: "get",
 			dataType: "json",
@@ -311,31 +312,40 @@ const AdminCustomerStatistics = Form.create()(React.createClass({
 				aid:aids,
 			},
 			success: function(data) {
+				console.log(data);
 				let theArr = [];
-				
 				if(data.error.length || 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];
+					for (let i = 0; i < data.data.list.length; i++) {
+	                    let thisdata = data.data.list[i];
 	                    theArr.push({
 	                         key: i,
 	                         id:thisdata.id,
-	                         name:thisdata.name,//订单编号
-	                         sourceName:thisdata.sourceName,//项目ID
-	                         contacts:thisdata.contacts,//项目名称
-	                         contactMobile:thisdata.contactMobile,//项目类别
-	                         createTime:thisdata.createTime,//项目价格
-	                         followTime:thisdata.followTime,//项目数量
-							 source:thisdata.source
+	                         name:thisdata.name,
+	                         sourceName:thisdata.sourceName,
+	                         contacts:thisdata.contacts,
+	                         contactMobile:thisdata.contactMobile,
+	                         createTime:thisdata.createTime,
+	                         followTime:thisdata.followTime,
 	                    });
 	                };
+					this.state.paginationX.current = data.data.pageNo;
+					this.state.paginationX.total = data.data.totalCount;
 				};
+				if(!data.data.list.length) {
+					this.state.paginationX.current = 0
+					this.state.paginationX.total = 0
+				}
 				this.setState({
-	                dataSourceX: theArr,
-	            });
+					pageNo: pageNo,
+					dataSourceX: theArr,
+					paginationX: this.state.paginationX,
+					selectedRowKeys: [],
+					signBillVisible: false
+				});
 			}.bind(this),
 		}).always(function() {
 			this.setState({
@@ -380,19 +390,10 @@ const AdminCustomerStatistics = Form.create()(React.createClass({
 		})
 	},
 	reset() {
-		this.state.buyerNameSearch = '';
-		this.state.financeNameSearchs = '';
-		this.state.orderNoSearch = '';
 		this.state.releaseDate[0] = undefined;
 		this.state.releaseDate[1] = undefined;
-		this.state.orderChannelSearch = undefined;
-		this.state.liquidationStatusSearch = undefined;
-		this.state.orderStatusSearch = undefined;
-		this.state.salesmanNameSearch = undefined;
 		this.state.departmenttSearch = undefined;
 		this.state.approved = undefined;
-		this.state.orderChannelSearch = undefined;
-		this.state.orderTypeSearch = undefined;
 		this.state.isDistributionFinance = undefined;
 		this.loadData();
 	},
@@ -457,13 +458,14 @@ const AdminCustomerStatistics = Form.create()(React.createClass({
 						<Modal maskClosable={false} visible={this.state.visible}
                         onOk={this.visitOk} onCancel={this.visitCancel}
                         width='1000px'
-                        title='订单详情'                     
+                        title='订单详情'
                         footer=''
                         className="admin-desc-content">
 							<div className="patent-table">
 								<Spin spinning={this.state.loading}>
 									<Table columns={this.state.columnsX}
-									dataSource={this.state.dataSourceX} />
+									dataSource={this.state.dataSourceX} 
+									pagination={this.state.paginationX} />
 								</Spin>
 							</div>
 						</Modal>

+ 11 - 15
js/component/manageCenter/order/orderNew/examine.jsx

@@ -146,6 +146,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 			orgCodeUrl:[],
 			paginations:false,
 			confirmLoading: false,
+			aloading:false,
 			pagination: {
 				defaultCurrent: 1,
 				defaultPageSize: 10,
@@ -479,6 +480,9 @@ const IntentionCustomer = Form.create()(React.createClass({
 	},
 	//审核不通过
 	examOks(){
+		this.setState({
+			aloading:true,
+		});
 		$.ajax({
 			method: "post",
 			dataType: "json",
@@ -493,11 +497,15 @@ const IntentionCustomer = Form.create()(React.createClass({
 				if(data.error.length || data.data.list == "") {
 					if(data.error && data.error.length) {
 						message.warning(data.error[0].message);
+						this.setState({
+							aloading:true
+						})
 					};
 				} else {
 					message.success("该订单已被拒绝~");
 					this.setState({
 						visible:false,
+						aloading:true,
 						noVisible:false,
 						reason:'',
 					});
@@ -510,6 +518,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 				loading: false
 			});
 		}.bind(this));
+		
 	},
 	//点击拒绝
 	examNo(){
@@ -518,19 +527,6 @@ const IntentionCustomer = Form.create()(React.createClass({
 		})
 	},
 	
-	handleOk(){
-		this.setState({
-			reason:'',
-			confirmLoading: true,
-		});
-		setTimeout(() => {
-			this.setState({
-			noVisible: false,
-			confirmLoading: false,
-		});
-		}, 2000);
-    },
-	
 	//关闭输入理由框
 	noCancel(){
 		this.setState({
@@ -847,7 +843,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 			            </Form >
 			        </Modal>
 			         <Modal maskClosable={false} visible={this.state.noVisible}
-                        onOk={this.handleOk} onCancel={this.noCancel}
+                        onOk={this.noCancel} onCancel={this.noCancel}
                         width='400px'
                         title={'拒绝理由'}                       
                         footer=''
@@ -865,7 +861,7 @@ const IntentionCustomer = Form.create()(React.createClass({
 								        </FormItem>
 				                    </div>	
 				                     <div className='clearfix'>
-						                   <Button className="cancel" type="primary" onClick={this.examOks} style={{marginLeft:"50px"}} htmlType="submit">确定</Button>
+						                   <Button className="cancel" type="primary" onClick={this.examOks} style={{marginLeft:"50px"}} htmlType="submit" loading={this.state.aloading}>确定</Button>
 			                               <Button className="cancel" type="ghost" onClick={this.noCancel} style={{marginLeft:"50px"}}>取消</Button>
 	                            	</div>
 			                </Spin>

+ 7 - 5
js/component/manageCenter/order/settlementOrder/settlementManage/managementDetaile.2.jsx

@@ -44,6 +44,7 @@ const ManagementDetaile = Form.create()(React.createClass({
                         });
                     };
                    }
+				console.log(theArr)
                 this.setState({
                     dataSource: theArr,
                 });
@@ -62,6 +63,7 @@ const ManagementDetaile = Form.create()(React.createClass({
 			orgCodeUrl:[],
 			checkedKeys: [],
 			lookflowList:[],
+			dataSource:[],
 			columns: [
 							{
 			                    title: '客户名称',
@@ -279,7 +281,7 @@ const ManagementDetaile = Form.create()(React.createClass({
         });
     },
 	componentWillMount() {
-		
+		this.loadData();
 	},
 	componentWillReceiveProps(nextProps) { //props改变时触发
 		this.state.visible = nextProps.showDesc;
@@ -298,10 +300,10 @@ const ManagementDetaile = Form.create()(React.createClass({
 		const orderDetaiel=this.state.orderList || [];
 		return(
 			<div>
-            <Modal maskClosable={false} visible={this.state.visible}
+				<Modal maskClosable={false} visible={this.state.visible}
                         onOk={this.handleOk} onCancel={this.handleCancel}
                         width='1000px'
-                        title='订单详情'                     
+                        title='订单详情'
                         footer=''
                         className="admin-desc-content">
 			            <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}}  >
@@ -310,14 +312,14 @@ const ManagementDetaile = Form.create()(React.createClass({
 					                    <Spin spinning={this.state.loading}>
 					                        <Table columns={this.state.columns}
 					                            dataSource={this.state.dataSource}
-					                            pagination={false}
+					                            pagination={true}
 					                            onRowClick={this.tableRowClick} 
 					                            />
 					                    </Spin>
 						            </div>
 			                </Spin>
 			            </Form >
-			        </Modal> 
+				</Modal> 
     	    </div>
 		)
 	}

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "afanti",
-  "version": "1.0.50",
+  "version": "1.0.51",
   "description": "",
   "main": "index.js",
   "scripts": {