Browse Source

处理点击保存,数据正确但是提示框爆红的问题。

yujia 8 years ago
parent
commit
f6538a7db5

+ 93 - 75
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js

@@ -1653,21 +1653,21 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		 */
 		var getProductDetail = function (product) {
 			Material.getProductDetail({id : product.id}, function (data) {
-				$scope.goods.erpReserve = typeof data.reserve == 'undefined' ? 0 : data.reserve;
-				$scope.goods.b2cReserve = typeof data.b2cReserve == 'undefined' ? 0 : data.b2cReserve;
-				$scope.goods.packaging = data.packaging;
-				$scope.goods.produceDate = data.produceDate;
-				$scope.goods.minPackQty = data.minPackQty;
-				$scope.goods.breakUp = data.breakUp;
-				$scope.goods.minBuyQty = data.minBuyQty;
-				$scope.goods.minDelivery = data.minDelivery;
-				$scope.goods.maxDelivery = data.maxDelivery;
-				$scope.goods.prices = [];
-				product.selected = true;
-				if ('MAINLAND' == $scope.store.enType)
-					$scope.goods.prices.push({start : $scope.minReserve, end : $scope.maxReserve, rMBPrice: data.price});
-				if ('HK' == $scope.store.enType)
-					$scope.goods.prices.push({start : $scope.minReserve, end : $scope.maxReserve, uSDPrice: data.price});
+				// $scope.goods.erpReserve = typeof data.reserve == 'undefined' ? 0 : data.reserve;
+				// $scope.goods.b2cReserve = typeof data.b2cReserve == 'undefined' ? 0 : data.b2cReserve;
+				// $scope.goods.packaging = data.packaging;
+				// $scope.goods.produceDate = data.produceDate;
+				// $scope.goods.minPackQty = data.minPackQty;
+				// $scope.goods.breakUp = data.breakUp;
+				// $scope.goods.minBuyQty = data.minBuyQty;
+				// $scope.goods.minDelivery = data.minDelivery;
+				// $scope.goods.maxDelivery = data.maxDelivery;
+				// $scope.goods.prices = [];
+				// product.selected = true;
+				// if ('MAINLAND' == $scope.store.enType)
+				// 	$scope.goods.prices.push({start : $scope.minReserve, end : $scope.maxReserve, rMBPrice: data.price});
+				// if ('HK' == $scope.store.enType)
+				// 	$scope.goods.prices.push({start : $scope.minReserve, end : $scope.maxReserve, uSDPrice: data.price});
 
 			});
 		}
@@ -1763,9 +1763,6 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		 * @param goods		商品信息
 		 */
 		function setPriceMinAmount(goods, edit) {
-			if ($scope.$$nonProduct.enterSaveButton) {
-				return ;
-			}
             // goods.editMinBuyQtyInValid = false;
 			// if (typeof goods.editMinBuyQty == 'undefined') {
 			// 	goods.editMinBuyQtyInValid = true;
@@ -1782,7 +1779,9 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 						goods.editPrices[0].start = goods.editMinBuyQty;
 					}
 				}
-                toaster.pop('warning', '提示', '起订量必须是大于0的整数');
+				if (!$scope.$$nonProduct.enterSaveButton) {
+					toaster.pop('warning', '提示', '起订量必须是大于0的整数');
+				}
                 return false;
             }
             goods.editMinBuyQtyPre = goods.editMinBuyQty;
@@ -1801,27 +1800,32 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		 * @param goods		商品信息
 		 */
 		function setPriceMinPackAmount(goods) {
-			if ($scope.$$nonProduct.enterSaveButton) {
-				return ;
-			}
             goods.editMinPackQtyInValid = false;
 			if (typeof goods.editMinPackQty == 'undefined') {
-				toaster.pop('warning', '提示', '包装数量必须是大于0的整数');
+				if (!$scope.$$nonProduct.enterSaveButton) {
+					toaster.pop('warning', '提示', '包装数量必须是大于0的整数');
+				}
 				return false;
 			}
             if (!$scope.isInt.test(goods.editMinPackQty)) {
-				goods.editMinPackQtyInValid = true;
-                toaster.pop('warning', '提示', '包装数量必须是大于0的整数');
+				if (!$scope.$$nonProduct.enterSaveButton) {
+					goods.editMinPackQtyInValid = true;
+					toaster.pop('warning', '提示', '包装数量必须是大于0的整数');
+				}
                 return false;
             }
             if (parseInt(goods.editMinPackQty) < 1) {
-				goods.editMinPackQtyInValid = true;
-                toaster.pop('warning', '提示', '包装数量必须是大于0的整数');
+				if (!$scope.$$nonProduct.enterSaveButton) {
+					goods.editMinPackQtyInValid = true;
+					toaster.pop('warning', '提示', '包装数量必须是大于0的整数');
+				}
                 return false;
             }
             if (parseInt(goods.editMinPackQty) > $scope.maxPackQty) {
-                toaster.pop('warning', '提示', '包装数量必须小于' + $scope.maxPackQty);
-				goods.editMinPackQtyInValid = true;
+				if (!$scope.$$nonProduct.enterSaveButton) {
+					toaster.pop('warning', '提示', '包装数量必须小于' + $scope.maxPackQty);
+					goods.editMinPackQtyInValid = true;
+				}
                 return false;
             }
             if (goods.editMinBuyQty) {
@@ -1839,17 +1843,18 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		 * @param goods		商品信息
 		 */
 		function setPriceMaxAmount(goods, edit) {
-			if ($scope.$$nonProduct.enterSaveButton) {
-				return ;
-			}
 			if (!goods.editReserve) {
-				goods.editReserveInvalid = true;
-				toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+				if (!$scope.$$nonProduct.enterSaveButton) {
+					goods.editReserveInvalid = true;
+					toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+				}
 				return false;
 			}
 			if (!$scope.isInt.test(goods.editReserve)) {
-                goods.editReserveInvalid = true;
-                toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+				if (!$scope.$$nonProduct.enterSaveButton) {
+					goods.editReserveInvalid = true;
+					toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+				}
                 return false;
 			}
             // if(goods.editMinBuyQty) {
@@ -1860,8 +1865,10 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
             //     }
             // }
             if (parseInt(goods.editReserve) > $scope.maxReserve || goods.editReserve < $scope.minReserve) {
-                goods.editReserveInvalid = true;
-                toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+				if (!$scope.$$nonProduct.enterSaveButton) {
+					goods.editReserveInvalid = true;
+					toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+				}
                 return false;
             }
             goods.editReservePre = goods.editReserve;
@@ -1966,9 +1973,6 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
          * @param isEnd 是否是结束值
          */
         $scope.editQty = function (goods, index, isEnd, num) {
-			if ($scope.$$nonProduct.enterSaveButton) {
-				return ;
-			}
             goods.editPrices[index].endInValid = false;
             goods.editPrices[index].startInValid = false;
             if (goods.editPrices.length < index || index < 0) {
@@ -1978,26 +1982,32 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 				return ;
 			}
             if (!$scope.isInt.test(num)) {
-				if (isEnd) {
-					//goods.editPrices[index].endInValid = true;
-					delete goods.editPrices[index].end;
-				} else {
-					//goods.editPrices[index].startInValid = true;
-					delete goods.editPrices[index].start;
+				if (!$scope.$$nonProduct.enterSaveButton) {
+					if (isEnd) {
+						//goods.editPrices[index].endInValid = true;
+						delete goods.editPrices[index].end;
+					} else {
+						//goods.editPrices[index].startInValid = true;
+						delete goods.editPrices[index].start;
+					}
+					toaster.pop('warning', '提示', '输入值必须为正整数');
 				}
-                toaster.pop('warning', '提示', '输入值必须为正整数');
                 return ;
             }
             if (isEnd) {
                 if (index < goods.editPrices.length - 1) {
                     if (parseInt(goods.editPrices[index].end) < parseInt(goods.editPrices[index].start)) {
-                        toaster.pop('warning', '提示', '输入值必须大于' + goods.editPrices[index].start);
-						//goods.editPrices[index].endInValid = true;
-						delete goods.editPrices[index].end;
+						if (!$scope.$$nonProduct.enterSaveButton) {
+							toaster.pop('warning', '提示', '输入值必须大于' + goods.editPrices[index].start);
+							//goods.editPrices[index].endInValid = true;
+							delete goods.editPrices[index].end;
+						}
                     } else if ((goods.editPrices[index + 1].end) && (parseInt(goods.editPrices[index].end) + 1) >= parseInt(goods.editPrices[index + 1].end)) {
-                        toaster.pop('warning', '提示', '输入值必须小于'+(parseInt(goods.editPrices[index + 1].end) - 1));
-						//goods.editPrices[index].endInValid = true;
-						delete goods.editPrices[index].end;
+						if (!$scope.$$nonProduct.enterSaveButton) {
+							toaster.pop('warning', '提示', '输入值必须小于'+(parseInt(goods.editPrices[index + 1].end) - 1));
+							//goods.editPrices[index].endInValid = true;
+							delete goods.editPrices[index].end;
+						}
                     } else {
                         goods.editPrices[index + 1].start = parseInt(goods.editPrices[index].end) + 1;
 						goods.editPrices[index + 1].startInValid = false;
@@ -2025,13 +2035,17 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
                     if (parseInt(goods.editPrices[index].start) > parseInt(goods.editPrices[index].end)) {
                         // toaster.pop('warning', '提示', '修改本分段之后,会导致分段的起始值' + goods.editPrices[index ].start + '大于结束值' + parseInt(goods.editPrices[index].end));
 						//goods.editPrices[index].startInValid = true;
-						toaster.pop('warning', '提示', '输入值必须小于'+ + goods.editPrices[index].end);
-						delete goods.editPrices[index].start;
+						if (!$scope.$$nonProduct.enterSaveButton) {
+							toaster.pop('warning', '提示', '输入值必须小于'+ + goods.editPrices[index].end);
+							delete goods.editPrices[index].start;
+						}
                     } else if ((parseInt(goods.editPrices[index].start) - 1) < goods.editPrices[index - 1].start) {
                         // toaster.pop('warning', '提示', '修改本分段之后,会导致前一个分段的起始值' + goods.editPrices[index - 1].start + '大于结束值' + (parseInt(goods.editPrices[index].start) - 1));
 						//goods.editPrices[index].startInValid = true;
-						toaster.pop('warning', '提示', '输入值会导致梯度重叠,请重新修改');
-						delete goods.editPrices[index].start;
+						if (!$scope.$$nonProduct.enterSaveButton) {
+							toaster.pop('warning', '提示', '输入值会导致梯度重叠,请重新修改');
+							delete goods.editPrices[index].start;
+						}
                     } else {
                         goods.editPrices[index - 1].end = parseInt(goods.editPrices[index].start) - 1;
 						goods.editPrices[index - 1].endInValid = false;
@@ -2152,9 +2166,6 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
          * @param commodity 批次信息
          */
         $scope.changeDelivery = function(min, max, isMin, goods) {
-			if($scope.$$nonProduct.enterSaveButton) {
-				return ;
-			}
 			if(isMin) {
 				goods.editMinDeliveryinValid = false;
 			}else {
@@ -2169,9 +2180,11 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 						return ;
 					}
                     if(!$scope.isInt.test(min)) {
-                        toaster.pop('warning', '提示', '交期请输入1-31的整数');
+						if(!$scope.$$nonProduct.enterSaveButton) {
+							toaster.pop('warning', '提示', '交期请输入1-31的整数');
+							goods.editMinDeliveryinValid = true;
+						}
                     }
-                    goods.editMinDeliveryinValid = true;
                     return ;
                 }
 
@@ -2183,27 +2196,32 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 						return ;
 					}
                     if(!$scope.isInt.test(max)) {
-                        toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+						if(!$scope.$$nonProduct.enterSaveButton) {
+							toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+							goods.editMaxDeliveryinValid = true;
+						}
                     }
-                    goods.editMaxDeliveryinValid = true;
                     return ;
                 }
 
             }
             if(day > 31 || day < 1) {
-                if(isMin) {
-                    goods.editMinDeliveryinValid = true;
-                }else {
-                    goods.editMaxDeliveryinValid = true;
-                }
-                toaster.pop('warning', '提示', '交期的值必须在1-31天');
-
+				if(!$scope.$$nonProduct.enterSaveButton) {
+					if(isMin) {
+						goods.editMinDeliveryinValid = true;
+					}else {
+						goods.editMaxDeliveryinValid = true;
+					}
+					toaster.pop('warning', '提示', '交期的值必须在1-31天');
+				}
                 return ;
             }
             if(Number(min) > Number(max)) {
-                goods.editMinDeliveryinValid = true;
-                goods.editMaxDeliveryinValid = true;
-                toaster.pop('warning', '提示', '最短交期应小于等于最长交期');
+				if(!$scope.$$nonProduct.enterSaveButton) {
+					goods.editMinDeliveryinValid = true;
+					goods.editMaxDeliveryinValid = true;
+					toaster.pop('warning', '提示', '最短交期应小于等于最长交期');
+				}
                 return ;
             }
 			goods.editMinDeliveryinValid = false;

+ 89 - 65
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_onSaleCtrl.js

@@ -374,13 +374,16 @@ define([ 'app/app' ], function(app) {
          * @param edit
          */
         $scope.editPackaging = function(goods) {
-            goods.editPackagingInvalid = false;
             if (goods.editPackaging) {
                 if (!pattern.test(goods.editPackaging)) {
-                    toaster.pop('warning', '提示', '包装方式只能填写中英文');
-                    goods.editPackagingInvalid = true;
+                    if (!$scope.enterSaveButton) {
+                        goods.editPackagingInvalid = true;
+                        toaster.pop('warning', '提示', '包装方式只能填写中英文');
+                        return ;
+                    }
                 }
             }
+            goods.editPackagingInvalid = false;
         };
 
         $scope.changePackaging = function (goods) {
@@ -663,9 +666,6 @@ define([ 'app/app' ], function(app) {
          * @param isEnd 是否是结束值
          */
         $scope.editQty = function (commodity, index, isEnd, num) {
-            if($scope.enterSaveButton) {
-                return ;
-            }
             commodity.editPrices[index].endInValid = false;
             commodity.editPrices[index].startInValid = false;
             if(commodity.editPrices.length < index || index < 0) {
@@ -675,26 +675,32 @@ define([ 'app/app' ], function(app) {
                 return ;
             }
             if (!$scope.isInt.test(num)) {
-                if (isEnd) {
-                    delete commodity.editPrices[index].end;
-                    //commodity.editPrices[index].end = commodity.editPrices[index].endPre;
-                } else {
-                    delete commodity.editPrices[index].start;
-                    //commodity.editPrices[index].start = commodity.editPrices[index].startPre;
+                if(!$scope.enterSaveButton) {
+                    if (isEnd) {
+                        delete commodity.editPrices[index].end;
+                        //commodity.editPrices[index].end = commodity.editPrices[index].endPre;
+                    } else {
+                        delete commodity.editPrices[index].start;
+                        //commodity.editPrices[index].start = commodity.editPrices[index].startPre;
+                    }
+                    toaster.pop('warning', '提示', '分段数量必须为正整数');
                 }
-                toaster.pop('warning', '提示', '分段数量必须为正整数');
                 return ;
             }
             if (isEnd) {
                 if (index < commodity.editPrices.length - 1) {
                     if (parseInt(commodity.editPrices[index].end) < parseInt(commodity.editPrices[index].start)) {
-                        toaster.pop('warning', '提示', '输入值必须大于' +  commodity.editPrices[index].start);
+                        if(!$scope.enterSaveButton) {
+                            toaster.pop('warning', '提示', '输入值必须大于' +  commodity.editPrices[index].start);
+                            delete commodity.editPrices[index].end;
+                        }
                         //commodity.editPrices[index].end = commodity.editPrices[index].endPre;
-                        delete commodity.editPrices[index].end;
                     } else if ((commodity.editPrices[index + 1].end) && (parseInt(commodity.editPrices[index].end) + 1) >= parseInt(commodity.editPrices[index + 1].end)) {
-                        toaster.pop('warning', '提示', '输入的值必须小于'+(parseInt(commodity.editPrices[index].end) - 1));
+                        if(!$scope.enterSaveButton) {
+                            toaster.pop('warning', '提示', '输入的值必须小于'+(parseInt(commodity.editPrices[index].end) - 1));
+                            delete commodity.editPrices[index].end;
+                        }
                         //commodity.editPrices[index].end = commodity.editPrices[index].endPre;
-                        delete commodity.editPrices[index].end;
                     } else {
                         commodity.editPrices[index + 1].start = parseInt(commodity.editPrices[index].end) + 1;
                         commodity.editPrices[index].endPre = commodity.editPrices[index].end;
@@ -721,13 +727,17 @@ define([ 'app/app' ], function(app) {
                     if (parseInt(commodity.editPrices[index].start) > parseInt(commodity.editPrices[index].end)) {
                         // toaster.pop('warning', '提示', '修改本分段之后,会导致分段的起始值' + commodity.editPrices[index ].start + '大于结束值' + parseInt(commodity.editPrices[index].end));
                         //commodity.editPrices[index].start = commodity.editPrices[index].startPre;
-                        toaster.pop('warning', '提示', '输入值必须小于'+ + commodity.editPrices[index].end);
-                        delete commodity.editPrices[index].start;
+                        if(!$scope.enterSaveButton) {
+                            toaster.pop('warning', '提示', '输入值必须小于'+ + commodity.editPrices[index].end);
+                            delete commodity.editPrices[index].start;
+                        }
                     } else if ((parseInt(commodity.editPrices[index].start) - 1) < commodity.editPrices[index - 1].start) {
                         // toaster.pop('warning', '提示', '修改本分段之后,会导致前一个分段的起始值' + commodity.editPrices[index - 1].start + '大于结束值' + (parseInt(commodity.editPrices[index].start) - 1));
                         // commodity.editPrices[index].start = commodity.editPrices[index].startPre;
-                        toaster.pop('warning', '提示', '输入值会导致梯度重叠,请重新修改');
-                        delete commodity.editPrices[index].start;
+                        if(!$scope.enterSaveButton) {
+                            toaster.pop('warning', '提示', '输入值会导致梯度重叠,请重新修改');
+                            delete commodity.editPrices[index].start;
+                        }
                     } else {
                         commodity.editPrices[index - 1].end = parseInt(commodity.editPrices[index].start) - 1;
                         commodity.editPrices[index].startPre = commodity.editPrices[index].start;
@@ -795,23 +805,24 @@ define([ 'app/app' ], function(app) {
          * 验证库存量是否大于原有的库存量
          */
         $scope.changeReserve = function (commodity) {
-            if ($scope.enterSaveButton) {
-                return ;
-            }
             commodity.editReserveInvalid = true;
             if (typeof commodity.editReserve == 'undefined') {
                 return;
             }
             if (!commodity.editReserve) {
                 //commodity.editReserve = commodity.editReservePre;
-                commodity.editReserveInvalid = true;
-                toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+                if (!$scope.enterSaveButton) {
+                    commodity.editReserveInvalid = true;
+                    toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+                }
                 return false;
             }
             if (!$scope.isInt.test(commodity.editReserve)) {
                 //commodity.editReserve = commodity.editReservePre;
-                commodity.editReserveInvalid = true;
-                toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+                if (!$scope.enterSaveButton) {
+                    toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+                    commodity.editReserveInvalid = true;
+                }
                 return false;
             }
             // if (parseInt(commodity.editReserve) < parseInt(commodity.editMinBuyQty)) {
@@ -822,8 +833,10 @@ define([ 'app/app' ], function(app) {
             // }
             if (parseInt(commodity.editReserve) > $scope.maxReserve || commodity.editReserve < $scope.minReserve) {
                 //commodity.editReserve = commodity.editReservePre;
-                commodity.editReserveInvalid = true;
-                toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+                if (!$scope.enterSaveButton) {
+                    toaster.pop('warning', '提示', '库存须填写小于10亿的正整数');
+                    commodity.editReserveInvalid = true;
+                }
                 return false;
             }
             commodity.editReservePre = commodity.editReserve;
@@ -872,9 +885,6 @@ define([ 'app/app' ], function(app) {
          * 验证库存的最小起订量是否大于库存量
          */
         $scope.changeMinBuyQty = function (commodity) {
-            if ($scope.enterSaveButton) {
-                return ;
-            }
             // commodity.editMinBuyQtyInValid = false;
             // if (typeof commodity.editMinBuyQty == 'undefined') {
             //     commodity.editMinBuyQtyInValid = true;
@@ -891,7 +901,10 @@ define([ 'app/app' ], function(app) {
                         commodity.editPrices[0].start = commodity.editMinBuyQty;
                     }
                 }
-                toaster.pop('warning', '提示', '起订量必须是大于0的整数');
+                if (!$scope.enterSaveButton) {
+                    toaster.pop('warning', '提示', '起订量必须是大于0的整数');
+                    return false;
+                }
                 return false;
             }
             commodity.editMinBuyQtyPre = commodity.editMinBuyQty;
@@ -909,19 +922,21 @@ define([ 'app/app' ], function(app) {
          * @param commodity
          */
         $scope.changeMinPackQty = function(commodity) {
-            if($scope.enterSaveButton) {
-                return ;
-            }
-            commodity.editMinPackQtyInValid = true;
             if(typeof commodity.editMinPackQty == 'undefined') {
                 return;
             }
             if(!$scope.isInt.test(commodity.editMinPackQty)) {
-                toaster.pop('warning', '提示', '包装数必须是大于0的整数');
+                if(!$scope.enterSaveButton) {
+                    commodity.editMinPackQtyInValid = true;
+                    toaster.pop('warning', '提示', '包装数必须是大于0的整数');
+                }
                 return false;
             }
             if(commodity.editMinPackQty < 1) {
-                toaster.pop('warning', '提示', '包装数必须大于0');
+                if(!$scope.enterSaveButton) {
+                    commodity.editMinPackQtyInValid = true;
+                    toaster.pop('warning', '提示', '包装数必须是大于0的整数');
+                }
                 return false;
             }
             // if(commodity.editMinPackQty > commodity.editReserve) {
@@ -929,8 +944,11 @@ define([ 'app/app' ], function(app) {
             //     return false;
             // }
             if(parseInt(commodity.editMinPackQty) > $scope.maxPackQty) {
-                toaster.pop('warning', '提示', '包装数量必须小于等于' + $scope.maxPackQty);
-                return ;
+                if(!$scope.enterSaveButton) {
+                    commodity.editMinPackQtyInValid = true;
+                    toaster.pop('warning', '提示', '包装数量必须小于等于' + $scope.maxPackQty);
+                }
+                return false;
             }
             if(commodity.editMinBuyQty) {
                 if(!commodity.editBreakUp) {
@@ -996,9 +1014,6 @@ define([ 'app/app' ], function(app) {
          * @param commodity 批次信息
          */
         $scope.changeDelivery = function(min, max, isMin, isHk, commodity) {
-            if($scope.enterSaveButton) {
-                return ;
-            }
             if(isMin) {
                 commodity.editMinDeliveryinValid = false;
             }else {
@@ -1013,12 +1028,13 @@ define([ 'app/app' ], function(app) {
                         return ;
                     }
                     if(!$scope.isInt.test(min)) {
-                        toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+                        if(!$scope.enterSaveButton) {
+                            commodity.editMinDeliveryinValid = true;
+                            toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+                        }
                     }
-                    commodity.editMinDeliveryinValid = true;
                     return ;
                 }
-
             }else {
                 if(max && $scope.isInt.test(max)) {
                     day = max;
@@ -1027,28 +1043,32 @@ define([ 'app/app' ], function(app) {
                         return ;
                     }
                     if(!$scope.isInt.test(max)) {
-                        toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+                        if (!$scope.enterSaveButton) {
+                            commodity.editMaxDeliveryinValid = true;
+                            toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+                        }
                     }
-                    commodity.editMaxDeliveryinValid = true;
                     return ;
                 }
 
             }
             if(day > 31 || day < 1) {
-                if(isMin) {
-                    commodity.editMinDeliveryinValid = true;
-                }else {
-                    commodity.editMaxDeliveryinValid = true;
+                if(!$scope.enterSaveButton) {
+                    toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
+                    if(isMin) {
+                        commodity.editMinDeliveryinValid = true;
+                    }else {
+                        commodity.editMaxDeliveryinValid = true;
+                    }
                 }
-                toaster.pop('warning', '提示', '交期只能是1-31之间的值');
-
                 return ;
             }
             if(Number(min) > Number(max)) {
-                commodity.editMinDeliveryinValid = true;
-                commodity.editMaxDeliveryinValid = true;
-                toaster.pop('warning', '提示', '最短交期应小于等于最长交期');
-
+                if(!$scope.enterSaveButton) {
+                    toaster.pop('warning', '提示', '最短交期应小于等于最长交期');
+                    commodity.editMinDeliveryinValid = true;
+                    commodity.editMaxDeliveryinValid = true;
+                }
                 return ;
             }
 
@@ -1082,13 +1102,17 @@ define([ 'app/app' ], function(app) {
                 return ;
             }
             if(isNaN(price)) {
-                prices[index].priceInvalid = true;
-                toaster.pop('warning', '提示', '单价必须是大于0的数字');
-                return;
+                if (!$scope.enterSaveButton) {
+                    toaster.pop('warning', '提示', '单价必须是大于0的数字');
+                    prices[index].priceInvalid = true;
+                    return;
+                }
             }
             if(new Number(price) <= 0) {
-                prices[index].priceInvalid = true;
-                toaster.pop('warning', '提示', '单价必须是大于0的数字');
+                if (!$scope.enterSaveButton) {
+                    toaster.pop('warning', '提示', '单价必须是大于0的数字');
+                    prices[index].priceInvalid = true;
+                }
                 return;
             }
             if(price.indexOf('.') > -1) {