|
|
@@ -416,51 +416,56 @@ define(['app/app'], function(app) {
|
|
|
|
|
|
// 输入购买量限制
|
|
|
$scope.blurNum = function (detail) {
|
|
|
- detail.inputError = 0;
|
|
|
- detail.noInputError = 0;
|
|
|
+ // detail.inputError = 0;
|
|
|
+ // detail.noInputError = 0;
|
|
|
detail.number = Number(detail.number);
|
|
|
if (detail.number < detail.goodsHistory.minBuyQty || !detail.number) {
|
|
|
// toaster.pop("info", "提示", "该商品最少购买" + detail.goodsHistory.minBuyQty + "件");
|
|
|
if(detail.goodsHistory.breakUp) {
|
|
|
- detail.noInputError = 1;
|
|
|
+ // detail.noInputError = 1;
|
|
|
+ toaster.pop('info','提示','最小起订量为' + detail.goodsHistory.minBuyQty);
|
|
|
detail.number = detail.goodsHistory.minBuyQty;
|
|
|
- $timeout(function () {
|
|
|
- c.noInputError = 0;
|
|
|
- }, 3000);
|
|
|
+ // $timeout(function () {
|
|
|
+ // c.noInputError = 0;
|
|
|
+ // }, 3000);
|
|
|
}else{
|
|
|
- detail.inputError = 1;
|
|
|
+ // detail.inputError = 1;
|
|
|
+ toaster.pop('info','提示','最小起订量为' + detail.goodsHistory.minBuyQty);
|
|
|
detail.number = detail.goodsHistory.minBuyQty;
|
|
|
- $timeout(function () {
|
|
|
- detail.inputError = 0;
|
|
|
- },3000);
|
|
|
+ // $timeout(function () {
|
|
|
+ // detail.inputError = 0;
|
|
|
+ // },3000);
|
|
|
}
|
|
|
}else if(detail.number > detail.goodsHistory.reserve){
|
|
|
if(detail.goodsHistory.breakUp) {
|
|
|
- detail.noInputError = 2;
|
|
|
+ // detail.noInputError = 2;
|
|
|
+ toaster.pop('info','提示','库存不足');
|
|
|
detail.number = detail.goodsHistory.reserve;
|
|
|
- $timeout(function () {
|
|
|
- c.noInputError = 0;
|
|
|
- }, 3000);
|
|
|
+ // $timeout(function () {
|
|
|
+ // c.noInputError = 0;
|
|
|
+ // }, 3000);
|
|
|
}else{
|
|
|
- detail.inputError = 2;
|
|
|
+ // detail.inputError = 2;
|
|
|
+ toaster.pop('info','提示','库存不足');
|
|
|
detail.number = Number(NumberService.sub(detail.goodsHistory.reserve, detail.goodsHistory.reserve % detail.goodsHistory.minPackQty));
|
|
|
- $timeout(function () {
|
|
|
- detail.inputError = 0;
|
|
|
- },3000);
|
|
|
+ // $timeout(function () {
|
|
|
+ // detail.inputError = 0;
|
|
|
+ // },3000);
|
|
|
}
|
|
|
// toaster.pop('info', '提示','库存不足');
|
|
|
}else {
|
|
|
if(!detail.goodsHistory.breakUp) {
|
|
|
var remandar = detail.number % detail.goodsHistory.minPackQty;
|
|
|
if(remandar != 0) {
|
|
|
- detail.inputError = 3;
|
|
|
+ // detail.inputError = 3;
|
|
|
+ toaster.pop("info", "提示", "不支持拆包且包装量为" + detail.goodsHistory.minPackQty);
|
|
|
detail.number = Number(NumberService.add(NumberService.sub(detail.number, detail.number % detail.goodsHistory.minPackQty), detail.goodsHistory.minPackQty));
|
|
|
if(detail.number > detail.goodsHistory.reserve) {
|
|
|
detail.number = NumberService.sub(detail.goodsHistory.reserve, detail.goodsHistory.reserve % detail.goodsHistory.minPackQty);
|
|
|
}
|
|
|
- $timeout(function () {
|
|
|
- detail.inputError = 0;
|
|
|
- },3000);
|
|
|
+ // $timeout(function () {
|
|
|
+ // detail.inputError = 0;
|
|
|
+ // },3000);
|
|
|
}
|
|
|
}
|
|
|
}
|