Browse Source

模具询价出现先输入不合法价格,再在其他框输入合法价格,保存并报价可以点击的问题。修改价格验证。

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@7158 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
dongbw 9 năm trước cách đây
mục cha
commit
82a0f1da6d
1 tập tin đã thay đổi với 7 bổ sung5 xóa
  1. 7 5
      src/main/webapp/resources/js/index/app.js

+ 7 - 5
src/main/webapp/resources/js/index/app.js

@@ -2175,14 +2175,15 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 			}
 		}
 		
-		//有价格为0,则不能报价
+		//有价格为0或者不符合正则式,则不能报价
 		$scope.notZero = function (mould) {
+			var regex = /^(0|[1-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
 			angular.forEach(mould.inquiryMouldItems, function(item){
-				if (item.price == 0) {
+				if (item.price == 0 || !regex.test(item.price)) {
 					$scope.canSave = false;
 				}
 				angular.forEach(item.inquiryMouldDetails, function(detail){
-					if (detail.price == 0) {
+					if (detail.price == 0 || !regex.test(detail.price)) {
 						$scope.canSave = false;
 					}
 				})
@@ -2317,12 +2318,13 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		
 		//有价格为0,则不能报价
 		$scope.notZero = function (mould) {
+			var regex = /^(0|[1-9][0-9]{0,9})(\.[0-9]{1,6})?$/;
 			angular.forEach(mould.inquiryMouldItems, function(item){
-				if (item.price == 0) {
+				if (item.price == 0 || !regex.test(item.price)) {
 					$scope.canSave = false;
 				}
 				angular.forEach(item.inquiryMouldDetails, function(detail){
-					if (detail.price == 0) {
+					if (detail.price == 0 || !regex.test(detail.price)) {
 						$scope.canSave = false;
 					}
 				})