yangc 8 лет назад
Родитель
Сommit
400fbc6107

+ 4 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -53,7 +53,7 @@ define(['app/app'], function (app) {
           * */
           $scope.onUnitPriceBlur = function () {
             if (angular.isNumber($scope.offer.unitPrice)) {
-              if ($scope.offer.unitPrice < 0) {
+              if ($scope.offer.unitPrice <= 0) {
                 toaster.pop('warning', '提示', '单价必须是大于0的数字');
                 $scope.validOffer.unitPrice = false;
               } else {
@@ -82,6 +82,7 @@ define(['app/app'], function (app) {
           }
 
           $scope.onMinDayInput = function () {
+            // $scope.offer.minDay = Number($scope.offer.minDay.toString());
             if ($scope.offer.minDay < 1 || $scope.offer.minDay > 31 || $scope.offer.minDay.toString().indexOf('.') !== -1) {
               $scope.validOffer.minDay = false;
               toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
@@ -100,6 +101,7 @@ define(['app/app'], function (app) {
           }
 
           $scope.onMaxDayInput = function () {
+            // $scope.offer.maxDay = Number($scope.offer.maxDay.toString());
             if ($scope.offer.maxDay < 1 || $scope.offer.maxDay > 31 || $scope.offer.maxDay.toString().indexOf('.') !== -1) {
               $scope.validOffer.maxDay = false;
               toaster.pop('warning', '提示', '交期只能填写1-31之间的整数值');
@@ -155,7 +157,7 @@ define(['app/app'], function (app) {
               });
             } else {
               if (!$scope.validOffer.unitPrice) {
-                if (!$scope.offer.unitPrice) {
+                if (!$scope.offer.unitPrice || $scope.offer.unitPrice == 0) {
                   toaster.pop('warning', '提示', '单价不能为空');
                 } else {
                   toaster.pop('warning', '提示', '单价必须是大于0的数字');