gaodd %!s(int64=2) %!d(string=hai) anos
pai
achega
e7892aa46b

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

@@ -494,6 +494,11 @@ angular.module('app.intelligent')
494
         $.validator.addMethod("validInteger",function(value,element, params) {
494
         $.validator.addMethod("validInteger",function(value,element, params) {
495
             var checkNumber = /^[1-9]\d*$/g;
495
             var checkNumber = /^[1-9]\d*$/g;
496
             return this.optional(element)||(checkNumber.test(value));
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
                                                     <section>
365
                                                     <section>
366
                                                         <label class="input">
366
                                                         <label class="input">
367
                                                             <input class="form-control" type="text" ng-model="fumigationAfter.populationDensity"
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
                                                         </label>
369
                                                         </label>
370
                                                     </section>
370
                                                     </section>
371
                                                 </th>
371
                                                 </th>
@@ -376,7 +376,7 @@
376
                                                     <section>
376
                                                     <section>
377
                                                         <label class="input">
377
                                                         <label class="input">
378
                                                             <input class="form-control" type="text" ng-model="fumigationAfter.samplingCultureHalfMonths"
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
                                                         </label>
380
                                                         </label>
381
                                                     </section>
381
                                                     </section>
382
                                                 </th>
382
                                                 </th>
@@ -391,7 +391,7 @@
391
                                                     <section>
391
                                                     <section>
392
                                                         <label class="input">
392
                                                         <label class="input">
393
                                                             <input class="form-control" type="text" ng-model="fumigationAfter.samplingCultureMonthSurvival"
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
                                                         </label>
395
                                                         </label>
396
                                                     </section>
396
                                                     </section>
397
                                                 </th>
397
                                                 </th>
@@ -402,7 +402,7 @@
402
                                                     <section>
402
                                                     <section>
403
                                                         <label class="input">
403
                                                         <label class="input">
404
                                                             <input class="form-control" type="text" ng-model="fumigationAfter.samplingCultureMonthHalf"
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
                                                         </label>
406
                                                         </label>
407
                                                     </section>
407
                                                     </section>
408
                                                 </th>
408
                                                 </th>