Bläddra i källkod

企业圈bug修改

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@9409 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
dongbw 8 år sedan
förälder
incheckning
2cd612ba06

+ 10 - 12
src/main/java/com/uas/platform/b2b/service/impl/CustomerServiceImpl.java

@@ -1,17 +1,5 @@
 package com.uas.platform.b2b.service.impl;
 
-import java.util.List;
-
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.stereotype.Service;
-
 import com.uas.platform.b2b.dao.CustomerDao;
 import com.uas.platform.b2b.model.Customer;
 import com.uas.platform.b2b.model.User;
@@ -19,6 +7,16 @@ import com.uas.platform.b2b.service.CustomerService;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.persistence.criteria.PredicateFactory;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Service;
+
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import java.util.List;
 
 @Service
 public class CustomerServiceImpl implements CustomerService {

+ 27 - 12
src/main/webapp/resources/js/index/app.js

@@ -996,6 +996,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			AddPartner.addPartner({name: name, businessCode: businessCode}, {}, function(data) {
 				if(data.success) {
 					toaster.pop("success", '添加成功', data.success);
+                    $scope.tableParams.reload();
 				}
 				if(data.error) {
 					toaster.pop("error", '添加失败', data.error);
@@ -10859,6 +10860,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			AddPartner.addPartner({name: name, businessCode: businessCode}, {}, function(data) {
 				if(data.success) {
 					toaster.pop("success", '添加成功', data.success);
+                    $scope.tableParams.reload();
 				}
 				if(data.error) {
 					toaster.pop("error", '添加失败', data.error);
@@ -11735,6 +11737,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			AddPartner.addSupplier({businessCode: vendUID}, {}, function(data) {
 				if(data.success) {
 					toaster.pop('success', '提示', data.success);
+                    $scope.tableParams.reload();
 				}
 				if(data.error) {
 					toaster.pop('error','提示', data.error);
@@ -11749,6 +11752,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			AddPartner.addCust({businessCode: vendUID}, {}, function(data) {
 				if(data.success) {
 					toaster.pop('success', '提示', data.success);
+                    $scope.tableParams.reload();
 				}
 				if(data.error) {
 					toaster.pop('error','提示', data.error);
@@ -11772,7 +11776,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
 			});
-		}
+		};
 		
 		// 拒绝申请
 		$scope.refuse = function(id, reason) {
@@ -11782,7 +11786,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
 			});
-		}
+		};
 		
 		// 取消供应商关系
 		$scope.relieve = function(id) {
@@ -11795,7 +11799,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
 			});
-		}
+		};
 		
 		// 建立供应商关系
 		$scope.activeVend = function(id) {
@@ -11925,6 +11929,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             AddPartner.addSupplier({businessCode: vendUID}, {}, function(data) {
                 if(data.success) {
                     toaster.pop('success', '提示', data.success);
+                    $scope.tableParams.reload();
                 }
                 if(data.error) {
                     toaster.pop('error','提示', data.error);
@@ -11939,6 +11944,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             AddPartner.addCust({businessCode: vendUID}, {}, function(data) {
                 if(data.success) {
                     toaster.pop('success', '提示', data.success);
+                    $scope.tableParams.reload();
                 }
                 if(data.error) {
                     toaster.pop('error','提示', data.error);
@@ -11962,7 +11968,11 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }, function(response) {
                 toaster.pop('error', '提示', response.data);
             });
-        }
+        };
+
+        AddPartnerMyRequest.requestAmount({}, function(data) {
+            $scope.requestTodo = data;
+        });
 
         // 拒绝申请
         $scope.refuse = function(id, reason) {
@@ -11972,7 +11982,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }, function(response) {
                 toaster.pop('error', '提示', response.data);
             });
-        }
+        };
 
         // 取消供应商关系
         $scope.relieve = function(id) {
@@ -12030,7 +12040,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 	/**
 	 * 建立合作关系处理申请
 	 */
-	app.controller('AddPartnerMessageCtrl', ['$scope', 'AddPartnerMyMessage', 'toaster', 'BaseService', 'ngTableParams', 'AddPartner', function($scope, AddPartnerMyMessage, toaster, BaseService, ngTableParams, AddPartner) {
+	app.controller('AddPartnerMessageCtrl', ['$scope', 'AddPartnerMyMessage', 'toaster', 'BaseService', 'ngTableParams', 'AddPartner', 'AddPartnerMyRequest', function($scope, AddPartnerMyMessage, toaster, BaseService, ngTableParams, AddPartner, AddPartnerMyRequest) {
 		BaseService.scrollBackToTop();
 		$scope.active = 'todo';
 		var getMessagetStatus = function(active) {
@@ -12093,19 +12103,21 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		$scope.agree = function(id) {
 			AddPartner.agreeRequest({id: id}, {}, function(data) {
 				toaster.pop('success', '提示', '操作成功');
+                $scope.tableParams.reload();
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
 			});
-		}
+		};
 		
 		// 拒绝申请
 		$scope.refuse = function(id, reason) {
 			AddPartner.refuseRequest({id: id, reason: reason}, {}, function(data) {
 				toaster.pop('success', '提示', '操作成功');
+                $scope.tableParams.reload();
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
 			});
-		}
+		};
 		
 		$scope.status = 'get';
 	}]);
@@ -12129,6 +12141,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		$scope.addCust = function(partner) {
 			GetProductInfo.addCust({}, partner, function(data) {
 				toaster.pop('success', '提示', '添加客户成功');
+                $scope.tableParams.reload();
 			}, function(response) {
 				toaster.pop('error', '添加客户失败', response.data);
 			});
@@ -12138,6 +12151,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		$scope.addSupplier = function(partner) {
 			GetProductInfo.addSupplier({}, partner, function(data) {
 				toaster.pop('success', '提示', '添加供应商成功');
+                $scope.tableParams.reload();
 			}, function(response) {
 				toaster.pop('error', '添加供应商失败', response.data);
 			});
@@ -15328,7 +15342,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 				if(data.success) {
 					toaster.pop('success', '提示', data.success);
 				}
-				$scope.customerParams.page(1);
+				// $scope.customerParams.page(1);
 	  			$scope.customerParams.reload();
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
@@ -15341,7 +15355,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 				if(data.success) {
 					toaster.pop('success', '提示', data.success);
 				}
-				$scope.customerParams.page(1);
+				// $scope.customerParams.page(1);
 	  			$scope.customerParams.reload();
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
@@ -15404,7 +15418,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 				if(data.success) {
 					toaster.pop('success', '提示', data.success);
 				}
-				$scope.customerParams.page(1);
+				// $scope.customerParams.page(1);
 				$scope.customerParams.reload();
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
@@ -15417,7 +15431,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 				if(data.success) {
 					toaster.pop('success', '提示', data.success);
 				}
-				$scope.customerParams.page(1);
+				// $scope.customerParams.page(1);
 				$scope.customerParams.reload();
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
@@ -15510,6 +15524,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			AddPartner.addPartner({name: name, businessCode: businessCode}, {}, function(data) {
 				if(data.success) {
 					toaster.pop("success", '添加成功', data.success);
+                    $scope.tableParams.reload();
 				}
 				if(data.error) {
 					toaster.pop("error", '添加失败', data.error);

+ 1 - 1
src/main/webapp/resources/js/index/services/BaseInfo.js

@@ -295,7 +295,7 @@ define(['ngResource'], function() {
 	}]).factory('AddPartnerMyRequest', ['$resource', function($resource) {
 		return $resource('addpartner/request', {}, {
 			getAllRequest: {
-				url: 'addpartner/request',
+				url: 'addpartner/request'
 			},
 			getRequestTodo: {
 				url: 'addpartner/request',