Browse Source

跳转页面默认跳转到顶部

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@7636 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 years ago
parent
commit
59b1b4fb15
1 changed files with 37 additions and 18 deletions
  1. 37 18
      src/main/webapp/resources/js/index/app.js

+ 37 - 18
src/main/webapp/resources/js/index/app.js

@@ -795,6 +795,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
      * 顶部搜索
      */
 	app.controller('TopSearchCtrl', ['$scope', '$rootScope', 'getAccountUserSpace', 'ngTableParams', 'toaster', 'BaseService', 'AddPartner', '$filter', '$stateParams', 'SearchProd', '$sce', function($scope, $rootScope, getAccountUserSpace, ngTableParams, toaster, BaseService, AddPartner, $filter, $stateParams, SearchProd, $sce) {
+		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.tip = $rootScope.searchKeyword;
 		
@@ -4962,7 +4963,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	}]);
 	
 	// 应付对账单详情页
-	app.controller('SaleArCheckDetailCtrl', ['$scope', '$stateParams', 'FaArCheck', 'toaster', '$state', function($scope, $stateParams, FaArCheck, toaster, $state){
+	app.controller('SaleArCheckDetailCtrl', ['$scope', '$stateParams', 'FaArCheck', 'toaster', '$state', 'BaseService', function($scope, $stateParams, FaArCheck, toaster, $state, BaseService){
+		BaseService.scrollBackToTop();
 		var loadData = function() {
 			FaArCheck.get({id: $stateParams.id}, function(data){
 				$scope.order = data;
@@ -5003,6 +5005,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 
 	//应收对账单列表
 	app.controller('PurchaseApCheckCtrl',['$scope', 'FaApCheck', 'BaseService', 'ngTableParams', 'toaster','ReportService', 'Symbol', function($scope, FaApCheck, BaseService, ngTableParams, toaster, ReportService , Symbol){
+		BaseService.scrollBackToTop();
 		$scope.dateZoneText = '不限';
 		$scope.condition = {dateZone: -1};
 		$scope.currency = Symbol.currency;//将币别转化为对应的符号
@@ -5095,7 +5098,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	}]);
 	
 	//应收对账单详情
-	app.controller('PurchaseApCheckDetailCtrl',['$scope','toaster','FaApCheck','$stateParams',function($scope,toaster,FaApCheck,$stateParams){
+	app.controller('PurchaseApCheckDetailCtrl',['$scope','toaster','FaApCheck','$stateParams', 'BaseService', function($scope, toaster, FaApCheck, $stateParams, BaseService) {
+		BaseService.scrollBackToTop();
 		$scope.haveSelected = true;
 		$scope.data = {};
 		//控制提交和删除按钮的显示
@@ -5540,7 +5544,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	}]);
 
 	
-	app.controller('EnterpriseCtrl', ['$scope', 'AccountEnterprise', 'toaster', '$state', '$modal', function($scope, AccountEnterprise, toaster, $state, $modal){
+	app.controller('EnterpriseCtrl', ['$scope', 'AccountEnterprise', 'toaster', '$state', '$modal', 'BaseService', function($scope, AccountEnterprise, toaster, $state, $modal, BaseService){
+		BaseService.scrollBackToTop();
 		$scope.loading = true;
 		AccountEnterprise.get({}, function(data){
 			$scope.loading = false;
@@ -6434,7 +6439,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		};
 	}]);
 	
-	app.controller('RoleEditCtrl', ['$scope', '$modalInstance', '$timeout', 'AccountResource', 'AccountRole', 'toaster', 'role', 'ngAlert', function($scope, $modalInstance, $timeout, AccountResource, AccountRole, toaster, role, ngAlert){
+	app.controller('RoleEditCtrl', ['$scope', '$modalInstance', '$timeout', 'AccountResource', 'AccountRole', 'toaster', 'role', 'ngAlert', 'BaseService', function($scope, $modalInstance, $timeout, AccountResource, AccountRole, toaster, role, ngAlert, BaseService){
+		BaseService.scrollBackToTop();
 		$scope.role = role;
 		$scope.master = angular.copy($scope.role);
 		var isNew = role == null;
@@ -6689,7 +6695,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 委外加工单详细
 	 */
-	app.controller('MakeOrderDetailCtrl', ['$scope', '$stateParams', 'MakeOrder', 'toaster', 'ReportService', function($scope, $stateParams, MakeOrder, toaster, ReportService){
+	app.controller('MakeOrderDetailCtrl', ['$scope', '$stateParams', 'MakeOrder', 'toaster', 'ReportService', 'BaseService', function($scope, $stateParams, MakeOrder, toaster, ReportService, BaseService){
+		BaseService.scrollBackToTop();
 		var loadData = function() {
 			MakeOrder.get({id: $stateParams.id}, function(data){
 				$scope.order = data;
@@ -7040,7 +7047,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		};
 	}]);
 
-	app.controller('MakeChangeDetailCtrl', ['$scope', '$stateParams', 'MakeChange', 'toaster', function($scope, $stateParams, MakeChange, toaster){
+	app.controller('MakeChangeDetailCtrl', ['$scope', '$stateParams', 'MakeChange', 'toaster', 'BaseService', function($scope, $stateParams, MakeChange, toaster, BaseService){
+		BaseService.scrollBackToTop();
 		var loadData = function() {
 			MakeChange.get({id: $stateParams.id}, function(data){
 				$scope.change = data;
@@ -7178,7 +7186,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 委外加工详细
 	 */
-	app.controller('MakeOutOrderDetailCtrl', ['$scope', '$stateParams', 'MakeOutOrder', 'toaster', 'ReportService', function($scope, $stateParams, MakeOutOrder, toaster, ReportService) {
+	app.controller('MakeOutOrderDetailCtrl', ['$scope', '$stateParams', 'MakeOutOrder', 'toaster', 'ReportService', 'BaseService', function($scope, $stateParams, MakeOutOrder, toaster, ReportService, BaseService) {
+		BaseService.scrollBackToTop();
 		var loadData = function() {
 			MakeOutOrder.get({id: $stateParams.id}, function(data){
 				$scope.order = data;
@@ -7489,7 +7498,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 物料批量上传
 	 */
-	app.controller('UploadByBatchCtrl', ['$scope', '$upload', 'toaster', function($scope, $upload, toaster) {
+	app.controller('UploadByBatchCtrl', ['$scope', '$upload', 'toaster', 'BaseService', function($scope, $upload, toaster, BaseService) {
+		BaseService.scrollBackToTop();
 		// 通过excel批量上传物料
 		$scope.upload = function() {
 			var file = $scope.myFiles[0];
@@ -7530,7 +7540,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 物料详情
 	 */
-	app.controller('ProductDetailCtrl', ['$scope', 'GetProductInfo', '$upload', 'ngTableParams', '$stateParams', 'toaster', 'AuthenticationService', '$filter', function($scope, GetProductInfo, $upload, ngTableParams, $stateParams, toaster, AuthenticationService, $filter) {
+	app.controller('ProductDetailCtrl', ['$scope', 'GetProductInfo', '$upload', 'ngTableParams', '$stateParams', 'toaster', 'AuthenticationService', '$filter', 'BaseService', function($scope, GetProductInfo, $upload, ngTableParams, $stateParams, toaster, AuthenticationService, $filter, BaseService) {
+		BaseService.scrollBackToTop();
 		// 录入人
 		AuthenticationService.getAuthentication().success(function(data) {
 			$scope.loading = false;
@@ -7647,8 +7658,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 新增物料
 	 */
-	app.controller('NewProdInfoCtrl', ['$scope', 'GetProductInfo', '$upload', 'ngTableParams', '$stateParams', 'toaster', '$modal', 'ComponentActive', 'KindAPI', '$timeout', '$filter', 'AuthenticationService', function($scope, GetProductInfo, $upload, ngTableParams, $stateParams, toaster, $modal, ComponentActive, KindAPI, $timeout, $filter, AuthenticationService) {
-		
+	app.controller('NewProdInfoCtrl', ['$scope', 'GetProductInfo', '$upload', 'ngTableParams', '$stateParams', 'toaster', '$modal', 'ComponentActive', 'KindAPI', '$timeout', '$filter', 'AuthenticationService', 'BaseService', function($scope, GetProductInfo, $upload, ngTableParams, $stateParams, toaster, $modal, ComponentActive, KindAPI, $timeout, $filter, AuthenticationService, BaseService) {
+		BaseService.scrollBackToTop();
 		// 录入人
 		AuthenticationService.getAuthentication().success(function(data) {
 			$scope.loading = false;
@@ -8491,6 +8502,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	 * 供应商详情
 	 */
 	app.controller('PurcVendorDetailCtrl', ['$scope', 'toaster', '$stateParams', 'Vendor', '$modal', 'Product', 'ngTableParams', 'BaseService', '$rootScope', function($scope, toaster, $stateParams, Vendor, $modal, Product, ngTableParams, BaseService, $rootScope) {
+		BaseService.scrollBackToTop();
 		$scope.vendorContacts = [];
 		var loadData = function() {
 			Vendor.getVendorDetail({id: $stateParams.id}, {}, function(data) {
@@ -8857,7 +8869,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 我的合作伙伴
 	 */
-	app.controller('MyPartnersCtrl', ['$scope', 'toaster', 'GetProductInfo', function($scope, toaster, GetProductInfo) {
+	app.controller('MyPartnersCtrl', ['$scope', 'toaster', 'GetProductInfo', 'BaseService', function($scope, toaster, GetProductInfo, BaseService) {
+		BaseService.scrollBackToTop();
 		// 默认显示合作伙伴
 		$scope.status = 'news';
 		
@@ -9076,7 +9089,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 购物车详情
 	 */
-	app.controller('CartDetailController', ['$scope', 'cartOperation', '$stateParams', 'toaster', '$timeout', function($scope, cartOperation, $stateParams, toaster, $timeout) {
+	app.controller('CartDetailController', ['$scope', 'cartOperation', '$stateParams', 'toaster', '$timeout', 'BaseService', function($scope, cartOperation, $stateParams, toaster, $timeout, BaseService) {
+		BaseService.scrollBackToTop();
 		var loadData = function() {
 			cartOperation.getCartDetail({id: $stateParams.id}, function(data) {
 				if(data.code) {
@@ -9150,7 +9164,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 审批流
 	 */
-	app.controller('approvalFlowCtrl', ['$scope', 'toaster', '$modal', 'appFlow', function($scope, toaster, $modal, appFlow) {
+	app.controller('approvalFlowCtrl', ['$scope', 'toaster', '$modal', 'appFlow', 'BaseService', function($scope, toaster, $modal, appFlow, BaseService) {
+		BaseService.scrollBackToTop();
 		$scope.vacation = false;
 		$scope.workovertime = false;
 		$scope.workdaily = false;
@@ -9482,7 +9497,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 新增代采订单
 	 */
-	app.controller('NewDeputyOrderCtrl', ['$scope', 'toaster', '$modal', 'DeputyOrder', '$filter', 'ngTableParams',  function($scope, toaster, $modal, DeputyOrder, $filter, ngTableParams) {
+	app.controller('NewDeputyOrderCtrl', ['$scope', 'toaster', '$modal', 'DeputyOrder', '$filter', 'ngTableParams', 'BaseService', function($scope, toaster, $modal, DeputyOrder, $filter, ngTableParams, BaseService) {
+		BaseService.scrollBackToTop();
 		// 费率
 		DeputyOrder.vendorRate({}, function(data) {
 			$scope.rate = data;
@@ -9658,6 +9674,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	 * 代采详情
 	 */
 	app.controller('DeputyOrderDetailCtrl', ['$scope', 'toaster', 'DeputyOrder', '$stateParams', 'ngTableParams', 'BaseService', function($scope, toaster, DeputyOrder, $stateParams, ngTableParams, BaseService) {
+		BaseService.scrollBackToTop();
 		var loadData = function() {
 			DeputyOrder.getOrderDetail({id: $stateParams.id}, {}, function(data) {
 				$scope.deOrder = data;
@@ -10199,7 +10216,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
      *
      */
     app.controller('SaleTenderCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', 'AccountEnterprise', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, AccountEnterprise) {
-        $scope.active = 'todo';
+    	BaseService.scrollBackToTop();
+    	$scope.active = 'todo';
         $scope.condition = {dateZone: 1};
         $scope.setActive = function(state) {
             if($scope.active != state) {
@@ -10282,7 +10300,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
      *
      */
     app.controller('SaleOpenTenderCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', 'AccountEnterprise', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, AccountEnterprise) {
-        $scope.active = 'todo';
+    	BaseService.scrollBackToTop();
+    	$scope.active = 'todo';
         $scope.condition = {dateZone: 1};
         $scope.setActive = function(state) {
             if($scope.active != state) {
@@ -10408,7 +10427,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
      * 投标
      */
     app.controller('SaleTenderDetailCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', '$upload', 'AccountEnterprise', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, $upload, AccountEnterprise) {
-
+    	BaseService.scrollBackToTop();
         $scope.itemStatusTodo = true;
         $scope.attaches = []; // 存放上传了的附件
         // var staticItem = null;