浏览代码

熏蒸校验

gaodd 2 年之前
父节点
当前提交
e7892aa46b

+ 5 - 0
src/main/resources/static/app/intelligent/fumigation/controller/fumHomeWorkCtrl.js

@@ -494,6 +494,11 @@ angular.module('app.intelligent')
494 494
         $.validator.addMethod("validInteger",function(value,element, params) {
495 495
             var checkNumber = /^[1-9]\d*$/g;
496 496
             return this.optional(element)||(checkNumber.test(value));
497
+        },"请输入正整数!");
498
+        
499
+        $.validator.addMethod("validIntegerZero",function(value,element, params) {
500
+            var checkNumber = /^[0-9]\d*$/g;
501
+            return this.optional(element)||(checkNumber.test(value));
497 502
         },"请输入正确的整数类型,不能有小数!");
498 503
 
499 504
         // 自定义验证

+ 4 - 4
src/main/resources/static/app/intelligent/fumigation/views/homework/fumHomeWorkAfter-edit.html

@@ -365,7 +365,7 @@
365 365
                                                     <section>
366 366
                                                         <label class="input">
367 367
                                                             <input class="form-control" type="text" ng-model="fumigationAfter.populationDensity"
368
-                                                                   ng-readonly="isNotEdit" validInteger="true" name="populationDensity">
368
+                                                                   ng-readonly="isNotEdit" validIntegerZero="true" name="populationDensity">
369 369
                                                         </label>
370 370
                                                     </section>
371 371
                                                 </th>
@@ -376,7 +376,7 @@
376 376
                                                     <section>
377 377
                                                         <label class="input">
378 378
                                                             <input class="form-control" type="text" ng-model="fumigationAfter.samplingCultureHalfMonths"
379
-                                                                   ng-readonly="isNotEdit" validInteger="true" name="samplingCultureHalfMonths">
379
+                                                                   ng-readonly="isNotEdit" validIntegerZero="true" name="samplingCultureHalfMonths">
380 380
                                                         </label>
381 381
                                                     </section>
382 382
                                                 </th>
@@ -391,7 +391,7 @@
391 391
                                                     <section>
392 392
                                                         <label class="input">
393 393
                                                             <input class="form-control" type="text" ng-model="fumigationAfter.samplingCultureMonthSurvival"
394
-                                                                   ng-readonly="isNotEdit" validInteger="true" name="samplingCultureMonthSurvival">
394
+                                                                   ng-readonly="isNotEdit" validIntegerZero="true" name="samplingCultureMonthSurvival">
395 395
                                                         </label>
396 396
                                                     </section>
397 397
                                                 </th>
@@ -402,7 +402,7 @@
402 402
                                                     <section>
403 403
                                                         <label class="input">
404 404
                                                             <input class="form-control" type="text" ng-model="fumigationAfter.samplingCultureMonthHalf"
405
-                                                                   ng-readonly="isNotEdit" validInteger="true" name="samplingCultureMonthHalf">
405
+                                                                   ng-readonly="isNotEdit" validIntegerZero="true" name="samplingCultureMonthHalf">
406 406
                                                         </label>
407 407
                                                     </section>
408 408
                                                 </th>