Browse Source

物料上传和物料一键匹配,增加加载中动画

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@9416 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
dongbw 8 years ago
parent
commit
3cb69dc51a

+ 11 - 0
src/main/webapp/resources/js/index/app.js

@@ -10196,6 +10196,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         
      // 一键匹配
 		$scope.matchall = function() {
+            $scope.loading = true;
 			Products.matchall({}, function(data) {
 				toaster.pop('info', '提示', '匹配成功'+data.size+'个标准器件');
 				window.location.href = "#/sale/productmatches";
@@ -10262,6 +10263,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		})
 		// 通过excel批量上传物料
 		$scope.upload = function() {
+            $scope.loading = true;
 			if($scope.myFiles) {
 				var file = $scope.myFiles[0];
 				if(file.name) {
@@ -10270,6 +10272,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 						file: file,
 						method: 'POST'
 					}).success(function(data) {
+                        $scope.loading = false;
 						if(data.error) {
 							toaster.pop('error', '提示', data.error);
 						}
@@ -10282,9 +10285,11 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 						$scope.myFiles[0] = "";
 						$scope.fileName = "";
 					}).error(function(response) {
+                        $scope.loading = false;
 						toaster.pop('error', response.data || response);
 					});
 				} else {
+                    $scope.loading = false;
 					toaster.pop('info', '提示', '当前文件不存在,请重新选择');
 				}
 			}
@@ -16032,6 +16037,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		
 		// 一键匹配
 		$scope.matchall = function() {
+            $scope.loading = true;
 			Products.matchall({}, function(data) {
 				toaster.pop('info', '提示', '匹配成功'+data.size+'个标准器件');
 				window.location.href = "#/approvalFlow/productmatches";
@@ -16746,6 +16752,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         
      // 一键匹配
 		$scope.matchall = function() {
+            $scope.loading = true;
 			Products.matchall({}, function(data) {
 				toaster.pop('info', '提示', '匹配成功'+data.size+'个标准器件');
 				window.location.href = "#/purc/productmatches";
@@ -16769,6 +16776,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		})
 		// 通过excel批量上传物料
 		$scope.upload = function() {
+		    $scope.loading = true;
 			var file = $scope.myFiles[0];
 			if($scope.myFiles) {
 				var file = $scope.myFiles[0];
@@ -16778,6 +16786,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 						file: file,
 						method: 'POST'
 					}).success(function(data) {
+                        $scope.loading = false;
 						if(data.error) {
 							toaster.pop('error', '提示', data.error);
 						}
@@ -16790,9 +16799,11 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 						$scope.myFiles[0] = "";
 						$scope.fileName = "";
 					}).error(function(response) {
+                        $scope.loading = false;
 						toaster.pop('error', response.data || response);
 					});
 				} else {
+                    $scope.loading = false;
 					toaster.pop('info', '提示', '当前文件不存在,请重新选择');
 				}
 			}

+ 3 - 0
src/main/webapp/resources/tpl/index/baseInfo/uploadByBatch.html

@@ -295,6 +295,9 @@ table.table.table-striped  thead {
 </style>
 <!-- block start -->
 <div class="block">
+	<div class="loading" ng-class="{'in': loading}">
+		<i></i>
+	</div>
 	<div class="headerline">
 		<div class="index"></div>
 		<div class="content f16 text-bold">第一步、下载Excel模板</div>

+ 3 - 0
src/main/webapp/resources/tpl/index/purc/uploadByBatch.html

@@ -295,6 +295,9 @@ table.table.table-striped  thead {
 </style>
 <!-- block start -->
 <div class="block">
+	<div class="loading" ng-class="{'in': loading}">
+		<i></i>
+	</div>
 	<div class="headerline">
 		<div class="index"></div>
 		<div class="content f16 text-bold">第一步、下载Excel模板</div>