Browse Source

物料列表和产品列表增加一键匹配功能

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@9194 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 8 years ago
parent
commit
c82146b9fc

+ 32 - 1
src/main/webapp/resources/js/index/app.js

@@ -209,6 +209,10 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             url : "/prodList/:id",
             templateUrl : "static/tpl/index/purc/productDetail.html",
             controller : 'PurcProdDetailCtrl'
+        }).state('purc.productmatches', {
+            url : "/productmatches",
+            templateUrl : "static/tpl/index/approvalFlow/productmatches.html",
+            controller: 'ProductmatchesCtrl'
         }).state('purc.uploadProduct', {
             url : "/uploadProduct",
             templateUrl : "static/tpl/index/purc/uploadByBatch.html",
@@ -375,6 +379,10 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             url : "/prodList/:id",
             templateUrl : "static/tpl/index/baseInfo/productDetail.html",
             controller : 'ProductDetailCtrl'
+        }).state('sale.productmatches', {
+            url : "/productmatches",
+            templateUrl : "static/tpl/index/approvalFlow/productmatches.html",
+            controller: 'ProductmatchesCtrl'
         }).state('sale.maketodo', {
             url : "/maketodo",
             templateUrl : "static/tpl/index/make/todo.html"
@@ -9903,7 +9911,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 	/**
 	 * 物料资料
 	 */
-	app.controller('ProductListCtrl', ['$scope', 'GetProductInfo', 'ngTableParams', '$filter', 'BaseService', 'toaster', '$timeout', '$rootScope', '$modal', function($scope, GetProductInfo, ngTableParams, $filter, BaseService, toaster, $timeout, $rootScope, $modal) {
+	app.controller('ProductListCtrl', ['$scope', 'GetProductInfo', 'ngTableParams', '$filter', 'BaseService', 'toaster', '$timeout', '$rootScope', '$modal', 'Products', function($scope, GetProductInfo, ngTableParams, $filter, BaseService, toaster, $timeout, $rootScope, $modal, Products) {
 		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
@@ -10061,7 +10069,18 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			}, function(){
 				
 			});
+			
         }
+        
+     // 一键匹配
+		$scope.matchall = function() {
+			Products.matchall({}, function(data) {
+				toaster.pop('info', '提示', '匹配成功'+data.size+'标准器件');
+				window.location.href = "#/sale/productmatches";
+			}, function(response) {
+				toaster.pop('error', '提示', response.data);
+			});
+		}
 	}]);
 	
 	/**
@@ -15831,6 +15850,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 				Products.updateall( {}, ids, function(data) {
 					if(data.success) {
 						toaster.pop('success', '提示', data.success);
+						$scope.tableParams.page(1);
+						$scope.tableParams.reload();
 					}
 					ids = []; // 清空ids,防止重复点击出现多余的数据
 				}, function(response) {
@@ -15996,6 +16017,16 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 				
 			});
         }
+        
+     // 一键匹配
+		$scope.matchall = function() {
+			Products.matchall({}, function(data) {
+				toaster.pop('info', '提示', '匹配成功'+data.size+'标准器件');
+				window.location.href = "#/purc/productmatches";
+			}, function(response) {
+				toaster.pop('error', '提示', response.data);
+			});
+		}
 	}]);
 	
 	/**

+ 1 - 0
src/main/webapp/resources/tpl/index/baseInfo/prodList.html

@@ -194,6 +194,7 @@
             <a ui-sref="sale.uploadByBatch" title="批量导入">批量导入</a>
             <a ng-click="toggle('off')">一键关闭</a>
             <a ng-click="toggle('on')">一键开启</a>
+            <a ng-click="matchall()">一键匹配</a>
         </div>
     </div>
     <div class="condition block" style="padding: 10px 15px;">

+ 1 - 0
src/main/webapp/resources/tpl/index/purc/prodList.html

@@ -175,6 +175,7 @@
             <a ui-sref="purc.uploadProduct" title="批量导入">批量导入</a>
             <a ng-click="toggle('off')">一键关闭</a>
             <a ng-click="toggle('on')">一键开启</a>
+            <a ng-click="matchall()">一键匹配</a>
         </div>
     </div>
     <div class="condition block" style="padding: 10px 15px;">