Explorar o código

出入库输入为0时出错

wangcz %!s(int64=7) %!d(string=hai) anos
pai
achega
ac18d34cfd

+ 8 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_storageCtrl.js

@@ -375,10 +375,12 @@ define([ 'app/app' ], function(app) {
                         flag = 1
                     } else if((val.erpReserve < val.qty) && $scope.storage_tab === 'outBound') {
                         flag = 2
+                    } else if(val.qty && Number(val.qty) <= 0) {
+                        flag = 4
                     } else if(val.qty) {
                         val.price ?
-                        $scope.othenParam.detail.push({productId: val.id, qty: Number(val.qty), price: Number(val.price)}) :
-                        $scope.othenParam.detail.push({productId: val.id, qty: Number(val.qty)});
+                            $scope.othenParam.detail.push({productId: val.id, qty: Number(val.qty), price: Number(val.price)}) :
+                            $scope.othenParam.detail.push({productId: val.id, qty: Number(val.qty)});
                     } else {
                         flag = 3
                     }
@@ -396,6 +398,10 @@ define([ 'app/app' ], function(app) {
                 toaster.pop('info', '提示', '请填写数量!');
                 return;
             }
+            if(flag === 4) {
+                toaster.pop('info', '提示', '填写的数量不能小于0!');
+                return;
+            }
             if($scope.othenParam.detail.length <= 0) {
                 toaster.pop('info', '提示', '至少填写一条数据!');
                 return;