瀏覽代碼

跳转页面默认跳转到顶部

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@7624 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 年之前
父節點
當前提交
8048e07559
共有 2 個文件被更改,包括 126 次插入38 次删除
  1. 70 4
      src/main/webapp/resources/js/common/services.js
  2. 56 34
      src/main/webapp/resources/js/index/app.js

+ 70 - 4
src/main/webapp/resources/js/common/services.js

@@ -48,7 +48,7 @@ define(['angular', 'toaster'], function(angular) {
                 }
             }
         };
-    }).factory('BaseService', function() {
+    }).factory('BaseService', ['$rootScope', function($rootScope) {
         return {
             getRootPath: function() {
             	var pathName = window.location.pathname.substring(1);
@@ -88,9 +88,23 @@ define(['angular', 'toaster'], function(angular) {
                     }
                 }
                 return requestParams;
-            }
+            },
+            // 滚动到顶部
+            scrollBackToTop: function() {
+				var scrollToTop = function() {
+					if(angular.element(document).scrollTop() > 0) {
+						window.scrollBy(0, -50);
+						setTimeout(function() {
+							$rootScope.$apply(function() {
+								scrollToTop();
+							});
+						}, 10);
+					}	
+				}
+				scrollToTop();
+			},
         };
-    }).factory('AuthenticationService', ['$http', 'SessionService', 'BaseService', 'SerializerUtil', function($http, SessionService, BaseService, SerializerUtil) {
+    }]).factory('AuthenticationService', ['$http', 'SessionService', 'BaseService', 'SerializerUtil', function($http, SessionService, BaseService, SerializerUtil) {
         var cacheSession = function() {
             SessionService.set('authenticated', true);
         };
@@ -332,5 +346,57 @@ define(['angular', 'toaster'], function(angular) {
             else if (cur == null || cur == '') return '¥';
             else return cur;
         };
-    });
+    }).factory('SmoothScroll', function(){// 跳转到顶部
+		var currentYPosition = function (pID) {
+			var parent = pID ? document.getElementById(pID) : 
+				(self || document.documentElement || document.body);
+			return parent.pageYOffset || parent.scrollTop || 0;
+		}
+
+		var elmYPosition = function(pID, eID) {
+			var elm = document.getElementById(eID), parent = pID ? document.getElementById(pID) : document.body;
+			var y = elm.offsetTop;
+			var node = elm;
+			while (node.offsetParent && node.offsetParent != parent) {
+				node = node.offsetParent;
+				y += node.offsetTop;
+			}
+			return y;
+		}
+		return {
+			scrollTo: function(pID, eID, offset) {
+				var startY = currentYPosition(pID);
+				var stopY = elmYPosition(pID, eID) - (offset || 0);
+				var distance = stopY > startY ? stopY - startY : startY - stopY;
+				if (distance < 100) {
+					scrollTo(0, stopY);
+					return;
+				}
+				var speed = Math.round(distance / 100);
+				if (speed >= 20)
+					speed = 20;
+				var step = Math.round(distance / 25);
+				var leapY = stopY > startY ? startY + step : startY - step;
+				var timer = 0;
+				var parent = pID ? "#" + pID + "" : "document";
+				if (stopY > startY) {
+					for (var i = startY; i < stopY; i += step) {
+						setTimeout("$(" + parent + ").scrollTop(" + leapY + ")", timer * speed);
+						leapY += step;
+						if (leapY > stopY)
+							leapY = stopY;
+						timer++;
+					}
+					return;
+				}
+				for (var i = startY; i > stopY; i -= step) {
+					setTimeout("$(" + parent + ").scrollTop(" + leapY + ")", timer * speed);
+					leapY -= step;
+					if (leapY < stopY)
+						leapY = stopY;
+					timer++;
+				}
+			} 
+		};
+	});;
 });

+ 56 - 34
src/main/webapp/resources/js/index/app.js

@@ -573,6 +573,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
         $urlRouterProvider.otherwise('/index');
 	}]);
 	
+	
 	/**
 	 * 表示符号
 	 */
@@ -686,7 +687,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	}]);
 
     app.controller('PagingReleaseCtrl', ['$scope', 'PagingRelease', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', function($scope, PagingRelease, BaseService, ngTableParams, toaster, $modalInstance){
-        $scope.active = "todo";
+    	BaseService.scrollBackToTop();
+    	$scope.active = "todo";
         $scope.setActive = function(state) {
             if($scope.active != state) {
                 $scope.active = state;
@@ -1331,6 +1333,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		});
 	}]);
 	app.controller('CustomerCtrl', ['$scope', 'VendorService', 'BaseService','AuthenticationService', 'ngTableParams', '$modal','toaster', function($scope, VendorService, BaseService, AuthenticationService,ngTableParams,$modal, toaster){
+		BaseService.scrollBackToTop();
 		$scope.userInfoResult = true;
 		AuthenticationService.getAuthentication().success(function(data) {
 			$scope.loading = false;
@@ -1557,7 +1560,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	
 	app.controller('PurcOrderCtrl', ['$scope', '$filter', 'PurcOrderItem', 'PurcOrder', 'ngTableParams', 'toaster', 'ReportService', 'BaseService',
   	   function($scope, $filter, PurcOrderItem, PurcOrder, ngTableParams, toaster, ReportService, BaseService){
-  		$scope.active = 'todo';
+		BaseService.scrollBackToTop();
+		$scope.active = 'todo';
   		$scope.dateZoneText = '不限';
   		$scope.deliveryZoneText = '不限';
   		$scope.condition = {dateZone: -1, deliveryZone: -1};
@@ -1788,6 +1792,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	
 	app.controller('SaleOrderCtrl', ['$scope', '$filter', 'PurcOrderItem', 'PurcOrder', 'ngTableParams', 'toaster', 'ReportService', 'BaseService', 'PurcOrderItemHis',
 	   function($scope, $filter, PurcOrderItem, PurcOrder, ngTableParams, toaster, ReportService, BaseService, PurcOrderItemHis){
+		BaseService.scrollBackToTop();
 		$scope.active = 'todo';
 		$scope.dateZoneText = '不限';
 		$scope.deliveryZoneText = '不限';
@@ -2089,6 +2094,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		};
 	}]);
 	app.controller('SaleChangeCtrl', ['$scope', '$filter', 'PurcChange', 'ngTableParams', 'toaster', 'BaseService', 'PurcChangeHis', function($scope, $filter, PurcChange, ngTableParams, toaster, BaseService, PurcChangeHis){
+		BaseService.scrollBackToTop();
 		$scope.active = 'todo';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -2197,6 +2203,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	
 	//采购询价
 	app.controller('SaleInquiryCtrl', ['$scope', '$filter', 'PurcInquiry', 'ngTableParams', 'toaster', 'BaseService', 'PurcInquiryHis', function($scope, $filter, PurcInquiry, ngTableParams, toaster, BaseService, PurcInquiryHis){
+		BaseService.scrollBackToTop();
 		$scope.active = 'todo';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -2457,6 +2464,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	
 	// 模具询价管理 
 	app.controller('SaleInquiryMouldCtrl',['$scope', '$filter', 'PurcInquiryMould', 'ngTableParams', 'toaster', 'BaseService', '$upload', function($scope, $filter, PurcInquiryMould, ngTableParams, toaster, BaseService, $upload){
+		BaseService.scrollBackToTop();
 		$scope.active = 'todo';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -2838,6 +2846,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	
 	// 主动报价 - 列表
 	app.controller('SaleQuotationListCtrl', ['$scope', '$filter', 'Quotation', 'PurcInquiry', 'ngTableParams', 'toaster', 'BaseService', function($scope, $filter, Quotation, PurcInquiry, ngTableParams, toaster, BaseService){
+		BaseService.scrollBackToTop();
 		$scope.active = 'todo';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -2913,6 +2922,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	
 	// Controller 主动报价 - 新增
 	app.controller('SaleQuotationNewCtrl', ['$scope', '$stateParams', '$filter', 'ngTableParams', 'toaster', 'BaseService', '$modal', 'Quotation', function($scope, $stateParams, $filter, ngTableParams, toaster, BaseService, $modal, Quotation){
+		BaseService.scrollBackToTop();
 		var staticItem = null;
 		
 		if( ! angular.isUndefined($stateParams.id)) {// 查看模式
@@ -3067,6 +3077,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	
 	// 查找客户
 	app.controller('DbfindCustCtrl', ['$scope', 'Customer', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', function($scope, Customer, BaseService, ngTableParams, toaster, $modalInstance){
+		BaseService.scrollBackToTop();
 		$scope.tableParams = new ngTableParams({
 			page : 1, 
 			count : 10
@@ -3100,6 +3111,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	
 	// 查找客户物料
 	app.controller('DbfindCustProdCtrl', ['$scope', 'Product', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', 'custUU', function($scope, Product, BaseService, ngTableParams, toaster, $modalInstance, custUU){
+		BaseService.scrollBackToTop();
 		$scope.tableParams = new ngTableParams({
 			page : 1, 
 			count : 10
@@ -3144,7 +3156,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 
     // 查找供应商
     app.controller('DbfindVendorCtrl', ['$scope', 'Vendor', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance','$rootScope', function($scope, Vendor, BaseService, ngTableParams, toaster, $modalInstance, $rootScope){
-
+    	BaseService.scrollBackToTop();
         // 搜索框回车
         $scope.onSearch = function(keyword) {
             $scope.keyword = keyword;
@@ -3223,6 +3235,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	
 	// 发货提醒
 	app.controller('SaleNoticeCtrl', ['$scope', '$rootScope', '$filter', 'PurcNotice', 'ngTableParams', 'toaster', 'BaseService', 'PurcNoticeHis', '$modal', 'SaleTruck', 'Symbol', '$state', function($scope, $rootScope, $filter, PurcNotice, ngTableParams, toaster, BaseService, PurcNoticeHis, $modal, SaleTruck, Symbol, $state){
+		BaseService.scrollBackToTop();
 		$scope.active = 'todo';
 		$scope.currency = Symbol.currency;
 		$scope.dateZoneText = '不限';
@@ -3505,7 +3518,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 发货单
 	 */
-app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function($scope, $filter, SaleSend, ngTableParams, toaster, BaseService, Symbol){
+	app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function($scope, $filter, SaleSend, ngTableParams, toaster, BaseService, Symbol){
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.currency = Symbol.currency;
 		$scope.dateZoneText = '不限';
@@ -4074,6 +4088,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 客户打样申请
 	 */
 	app.controller('SaleSampleCtrl', ['$scope', '$filter', 'PurcSample', 'ngTableParams', 'toaster', '$modal', 'BaseService','ReportService', 'Symbol', function($scope, $filter, PurcSample, ngTableParams, toaster, $modal, BaseService,ReportService, Symbol){
+		BaseService.scrollBackToTop();
 		$scope.active = 'todo';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -4216,6 +4231,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 客户认定单
 	 */
 	app.controller('SaleApprovalCtrl', ['$scope', '$filter', 'PurcApproval', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function($scope, $filter, PurcApproval, ngTableParams, toaster, BaseService, Symbol){
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -4301,6 +4317,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 客户采购预测
 	 */
 	app.controller('SaleForecastCtrl', ['$scope', '$filter', 'PurcForecast', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function($scope, $filter, PurcForecast, ngTableParams, toaster, BaseService, Symbol){
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -4375,6 +4392,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 客户采购验收
 	 */
 	app.controller('SaleAcceptCtrl', ['$scope', '$filter', 'PurcAccept', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function($scope, $filter, PurcAccept, ngTableParams, toaster, BaseService, Symbol){
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.dateZoneText = '不限';
   		$scope.deliveryZoneText = '不限';
@@ -4427,7 +4445,6 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 				getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function(page){
 					$scope.loading = false;
 					if(page) {
-						console.log(pageParams.searchFilter);
 						params.total(page.totalElement);
 						$defer.resolve(page.content);
 						$scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
@@ -4468,6 +4485,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 客户采购验退
 	 */
 	app.controller('SaleReturnsCtrl', ['$scope', '$filter', 'PurcReturn', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function($scope, $filter, PurcReturn, ngTableParams, toaster, BaseService, Symbol){
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -4548,6 +4566,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 客户不良品入库
 	 */
 	app.controller('SaleBadInCtrl', ['$scope', '$filter', 'PurcBadIn', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function($scope, $filter, PurcBadIn, ngTableParams, toaster, BaseService, Symbol){
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -4620,6 +4639,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 客户不良品出库
 	 */
 	app.controller('SaleBadOutCtrl', ['$scope', '$filter', 'PurcBadOut', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function($scope, $filter, PurcBadOut, ngTableParams, toaster, BaseService, Symbol){
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -4692,6 +4712,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 客户MRB
 	 */
 	app.controller('SaleMRBCtrl', ['$scope', '$filter', 'PurcMRB', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function($scope, $filter, PurcMRB, ngTableParams, toaster, BaseService, Symbol){
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -4764,6 +4785,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 客户应付发票
 	 */
 	app.controller('SaleApBillCtrl', ['$scope', '$filter', 'FaApBill', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function($scope, $filter, FaApBill, ngTableParams, toaster, BaseService, Symbol){
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.dateZoneText = '不限';
 		$scope.condition = {dateZone: -1};
@@ -4851,6 +4873,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 应付对账单
 	 */
 	app.controller('SaleArCheckCtrl', ['$scope', '$filter', 'FaArCheck', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function($scope, $filter, FaArCheck, ngTableParams, toaster, BaseService, Symbol){
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.dateZoneText = '不限';
 		$scope.condition = {dateZone: -1};
@@ -5655,6 +5678,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	}]);
 	
 	app.controller('UserCtrl', ['$scope', '$filter', 'AuthenticationService', 'AccountUser', 'BaseService', 'ngTableParams', 'toaster', '$modal', '$http', 'ngAlert', 'AccountEnterprise', function($scope, $filter, AuthenticationService, AccountUser, BaseService, ngTableParams, toaster, $modal, $http, ngAlert, AccountEnterprise){
+		BaseService.scrollBackToTop();
 		$scope.editing = false;
 		$scope.loading = true;
 		$scope.enterprise = null;
@@ -6518,6 +6542,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 */
 	app.controller('MakeOrderCtrl', ['$scope', '$filter', 'MakeOrder', 'ngTableParams', 'toaster','ReportService', 'BaseService',
 	   function($scope, $filter, MakeOrder, ngTableParams, toaster,ReportService, BaseService){
+		BaseService.scrollBackToTop();
 		$scope.active = 'todo';
 		$scope.dateZoneText = '不限';
 		$scope.condition = {dateZone: -1};
@@ -6742,6 +6767,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 客户委外验收
 	 */
 	app.controller('MakeAcceptCtrl', ['$scope', '$filter', 'MakeAccept', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function($scope, $filter, MakeAccept, ngTableParams, toaster, BaseService, Symbol){
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -6826,6 +6852,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 客户委外验退
 	 */
 	app.controller('MakeReturnCtrl', ['$scope', '$filter', 'MakeReturn', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function($scope, $filter, MakeReturn, ngTableParams, toaster, BaseService, Symbol){
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -6909,6 +6936,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 委外加工变更
 	 */
 	app.controller('MakeChangeCtrl', ['$scope', '$filter', 'MakeChange', 'ngTableParams', 'toaster', 'BaseService', function($scope, $filter, MakeChange ,ngTableParams, toaster, BaseService){
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -7043,6 +7071,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 */
 	app.controller('MakeOutOrderCtrl', ['$scope', '$filter', 'MakeOutOrder', 'ngTableParams', 'toaster','ReportService', 'BaseService',
 	        function($scope, $filter, MakeOutOrder, ngTableParams, toaster,ReportService, BaseService) {
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -7373,6 +7402,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 物料资料
 	 */
 	app.controller('ProductListCtrl', ['$scope', 'GetProductInfo', 'ngTableParams', '$filter', 'BaseService', 'toaster', '$timeout', function($scope, GetProductInfo, ngTableParams, $filter, BaseService, toaster, $timeout) {
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -7460,7 +7490,6 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 物料批量上传
 	 */
 	app.controller('UploadByBatchCtrl', ['$scope', '$upload', 'toaster', function($scope, $upload, toaster) {
-		
 		// 通过excel批量上传物料
 		$scope.upload = function() {
 			var file = $scope.myFiles[0];
@@ -7899,6 +7928,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 企业列表
 	 */
 	app.controller('EnterpriseListCtrl', ['$scope', 'getAccountUserSpace', 'ngTableParams', '$filter', 'BaseService', 'toaster', 'AddPartner', '$rootScope', function($scope, getAccountUserSpace, ngTableParams, $filter, BaseService, toaster, AddPartner, $rootScope) {
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -7983,7 +8013,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 新增采购单
 	 */
 	app.controller('PurcNewOrderCtrl',['$scope', '$modal', 'toaster', '$filter', 'addtoCart', '$rootScope', 'VendorInfo', 'ngTableParams', 'BaseService', 'Product', 'newPurcOrder', 'cartOperation', 'ShipAddress', 'Vendor', '$http', function($scope, $modal, toaster, $filter, addtoCart, $rootScope, VendorInfo, ngTableParams, BaseService, Product, newPurcOrder, cartOperation, ShipAddress, Vendor, $http) {
-		
+		BaseService.scrollBackToTop();
 		// 获取收货地址列表
 		ShipAddress.shipAddList({}, function(data) {
 			$scope.ships = data;
@@ -8264,6 +8294,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	
 	// 查找供应商
 	app.controller('DbfindVendorInfoCtrl', ['$scope', 'BaseService', 'ngTableParams', 'toaster', '$modalInstance', 'Vendor', function($scope, BaseService, ngTableParams, toaster, $modalInstance, Vendor){
+		BaseService.scrollBackToTop();
 		// 搜索框回车
 		$scope.onSearch = function(keyword) {
 			$scope.keyword = keyword;
@@ -8409,6 +8440,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 我的供应商
 	 */
 	app.controller('PurcVendorCtrl', ['$scope', 'Vendor', 'BaseService','AuthenticationService', 'ngTableParams', '$modal','toaster', '$rootScope', function($scope, Vendor, BaseService, AuthenticationService,ngTableParams,$modal, toaster, $rootScope){
+		BaseService.scrollBackToTop();
 		// 搜索框回车
 		$scope.onSearch = function(keyword) {
 			$scope.keyword = keyword;
@@ -8610,7 +8642,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 建立合作关系申请
 	 */
 	app.controller('AddPartnerRequestCtrl', ['$scope', 'AddPartnerMyRequest', 'toaster', 'BaseService', 'ngTableParams', 'AddPartner', '$timeout', function($scope, AddPartnerMyRequest, toaster, BaseService, ngTableParams, AddPartner, $timeout) {
-		
+		BaseService.scrollBackToTop();
 		$scope.active = 'todo';
 		
 		var getRequestStatus = function(active) {
@@ -8742,6 +8774,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 建立合作关系处理申请
 	 */
 	app.controller('AddPartnerMessageCtrl', ['$scope', 'AddPartnerMyMessage', 'toaster', 'BaseService', 'ngTableParams', 'AddPartner', function($scope, AddPartnerMyMessage, toaster, BaseService, ngTableParams, AddPartner) {
+		BaseService.scrollBackToTop();
 		$scope.active = 'todo';
 		var getMessagetStatus = function(active) {
   			var fn = 'getAllMessage';
@@ -8899,6 +8932,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 购物车
 	 */
 	app.controller('CartController', ['$scope', 'toaster', 'getCartList', 'ngTableParams', '$filter', 'BaseService', 'cartOperation', '$timeout', function($scope, toaster, getCartList, ngTableParams, $filter, BaseService, cartOperation, $timeout) {
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
@@ -9340,34 +9374,20 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 			};
 			item.useruu  = data.useruu;
 			item.username = data.username;
-//			if($scope.AppFlow.AppNodes.length != 0){
-//				angular.forEach($scope.AppFlow.AppNodes, function(node) {
-//					if(node) {
-//						if(node.useruu == item.useruu) {
-//							toaster.pop('info', '提示', '不能重复添加');
-//						} else {
-//							$scope.AppFlow.AppNodes.push(item);
-//						}
-//					} 
-//				});
-//			} else {
+			if($scope.AppFlow.appNodes.length != 0){
+				for(var i = 0;i < $scope.AppFlow.appNodes.length; i++) {
+					if($scope.AppFlow.appNodes[i] == item.useruu) {
+						toaster.pop('info', '提示', '不能重复添加');
+					} else {
+						$scope.AppFlow.appNodes.push(item);
+					}
+				}
+			} else {
 				$scope.AppFlow.appNodes.push(item);
-//			}
+			}
 			
 		}
 		
-		var flag = false;
-		$scope.isSelect = function(uu) {
-			angular.forEach($scope.AppFlow.AppNodes, function(node) {
-				if(node) {
-					if(node.useruu == uu) {
-						flag = true;
-					}
-				} 
-			});
-			return flag;
-		};
-		
 		$scope.SelectRole = function(data) {// 添加职位
 			var item = {
 					position: null,
@@ -9403,6 +9423,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 * 代采定单
 	 */
 	app.controller('DeputyOrderCtrl', ['$scope', 'toaster', 'getDeOrder', 'ngTableParams', 'BaseService', 'DeputyOrder', 'ReportService', function($scope, toaster, getDeOrder, ngTableParams, BaseService, DeputyOrder, ReportService) {
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.currency = Symbol.currency;//将币别转化为对应的符号
 		$scope.total = null;
@@ -9684,7 +9705,8 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
      */
 
     app.controller('PurcTenderCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope) {
-        $scope.active = 'done';
+    	BaseService.scrollBackToTop();
+    	$scope.active = 'done';
         $scope.setActive = function(state) {
             if($scope.active != state) {
                 $scope.active = state;
@@ -10131,7 +10153,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
      * 评标
      */
     app.controller('PurcEvaluationCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope) {
-
+    	BaseService.scrollBackToTop();
         $scope.tenderItems = [];
         // 采购方获取评标单
         var evaluation = function() {