|
|
@@ -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;
|
|
|
}
|
|
|
})
|