Browse Source

新增招标和询价物料调用物料库的数据

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

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

@@ -3273,12 +3273,13 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 	}]);
 	
 	// 平台新增的询价单
-	app.controller('PurcInquiryCtrl', ['$scope', 'PurchaseInquiry', 'toaster', 'BaseService', '$upload', '$filter', '$modal', '$rootScope', 'ngTableParams', 'GetProductInfo', '$timeout', '$http', 'ShipAddress', 'Search', 'ComponentActiveAPI', function($scope, PurchaseInquiry, toaster, BaseService, $upload, $filter, $modal, $rootScope, ngTableParams, GetProductInfo, $timeout, $http, ShipAddress, Search, ComponentActiveAPI) {
+	app.controller('PurcInquiryCtrl', ['$scope', 'PurchaseInquiry', 'toaster', 'BaseService', '$upload', '$filter', '$modal', '$rootScope', 'ngTableParams', 'PurcProduct', 'PurcProductNewest', '$timeout', '$http', 'ShipAddress', 'Search', 'ComponentActiveAPI', function($scope, PurchaseInquiry, toaster, BaseService, $upload, $filter, $modal, $rootScope, ngTableParams, PurcProduct, PurcProductNewest, $timeout, $http, ShipAddress, Search, ComponentActiveAPI) {
 		$scope.status = 'InquiryNew';
 		$scope.active = 'all';
 		$rootScope.tenderVendor = null;// 清除掉已选择的
+		$scope.searchMethod = false;
 		var getService = function() {
-			return GetProductInfo;
+			return $scope.searchMethod ? PurcProduct : PurcProductNewest;
 		};
 		$scope.inquiry = {
 				code: 'XJ' + $filter('date')(new Date(), 'yyMMddsss'),
@@ -3394,6 +3395,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			page : 1, 
 			count : 20,
 			sorting: {
+				id: 'desc'
             }
 		}, {
 			total : 0, 
@@ -3420,6 +3422,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
 		// 搜索框回车
 		$scope.onSearch = function(keyword) {
+			$scope.searchMethod = true;
 			$scope.tableParams.page(1);
 			$scope.tableParams.reload();
 		};
@@ -5493,6 +5496,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 					isSumbit = true;
 					 return true;
 				} else {
+					toaster.pop('error', '提示', '为防止重复发货,请刷新页面后重新填写');
 					 return false;
 				}
 			}
@@ -5699,6 +5703,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 					isSumbit = true;
 					return true;
 				} else {
+					toaster.pop('error', '提示', '为防止重复发货,请刷新页面后重新填写');
 					return false;
 				}
 			}
@@ -12702,7 +12707,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			if($scope.searchMethod) {
 				return cartList;
 			} else {
-				return getCartList;
+				return cartList;
 			}
 		};
 		var getTodoCartCount = function() {
@@ -14301,7 +14306,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
     /**
      * 新增招标单
      */
-    app.controller('PurcNewTenderCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', '$upload', 'ShipAddress', '$http', 'AuthenticationService', 'KindAPI', 'BrandActiveAPI', 'Search', 'ComponentActiveAPI', 'GetProductInfo', 'Vendor',function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, $upload, ShipAddress, $http, AuthenticationService, KindAPI, BrandActiveAPI, Search, ComponentActiveAPI, GetProductInfo, Vendor) {
+    app.controller('PurcNewTenderCtrl', ['$scope', '$filter', 'PurcTender', 'ngTableParams', 'toaster', 'BaseService', '$stateParams', '$modal', '$rootScope', '$upload', 'ShipAddress', '$http', 'AuthenticationService', 'KindAPI', 'BrandActiveAPI', 'Search', 'ComponentActiveAPI', 'GetProductInfo', 'Vendor', 'PurcProduct', 'PurcProductNewest', function($scope, $filter, PurcTender, ngTableParams, toaster, BaseService, $stateParams, $modal, $rootScope, $upload, ShipAddress, $http, AuthenticationService, KindAPI, BrandActiveAPI, Search, ComponentActiveAPI, GetProductInfo, Vendor, PurcProduct, PurcProductNewest) {
 
         // 录入人
         AuthenticationService.getAuthentication().success(function(data) {
@@ -14309,8 +14314,9 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         });
         $scope.time = $filter('date')(new Date, 'yyyy-MM-dd HH:mm');
 
+        $scope.searchMethod = false;
         var getService = function() {
-            return GetProductInfo;
+            return $scope.searchMethod ? PurcProduct : PurcProductNewest;
         };
 
         // 物料信息
@@ -14344,6 +14350,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         // 搜索框回车
         $scope.onSearch = function(keyword) {
+        	$scope.searchMethod = true;
             $scope.tableParams.page(1);
             $scope.tableParams.reload();
         };
@@ -17150,19 +17157,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 								product.checked = $scope.checks.checked;
 							}
 						});
-//						$scope.total = page.totalElement;
-//						Products.matchsize({type: 'sale'}, {}, function(data) {
-//							$scope.size = data.size;
-//							if($scope.total < $scope.size) {
-//								$timeout(function() {
-//									$scope.tableParams.reload();
-//								}, 500);
-//							} else {
-//								$scope.loading = false;
-//							}
-//						}, function(response) {
-//							toaster.pop('error', '提示', response.data);
-//						});
 					}
 				}, function(response) {
 					$scope.loading = false;

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

@@ -1177,7 +1177,7 @@ select.disabled {
 		<table class="block table table-default table-striped" ng-table="tableParams">
 			<thead>
 				<tr class="header">
-					<th width="160px">号</th>
+					<th width="160px">号</th>
 					<th width="120px">名称</th>
 					<th>规格</th>
 					<th width="120px">单位</th>

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

@@ -1045,7 +1045,7 @@ input[type="radio"], input[type="checkbox"] {
         <table class="block table table-default table-striped" ng-table="tableParams">
             <thead>
             <tr class="header">
-                <th width="160px">号</th>
+                <th width="160px">号</th>
                 <th width="120px">名称</th>
                 <th>规格</th>
                 <th width="120px">单位</th>