Bläddra i källkod

节前安全生产检查-输入字符效验

hanqingsong 1 år sedan
förälder
incheckning
798f0dd697

+ 17 - 2
src/main/resources/static/app/storage/controller/festivalbeforeCtrl.js

@@ -183,12 +183,27 @@ angular.module('app.storage')
183 183
             $scope.festivalbefore.houseId = storehouseId;
184 184
             $scope.loadData();
185 185
         });*/
186
+        // 效验-检查发现问题
187
+        $.validator.addMethod("checkProblem",function(value,element, params) {
188
+            // $scope.festivalbefore.problem = value;
189
+            if ((value.length*2) >= 200) { // Gbase 存储/2
190
+                return this.optional(element);
191
+            }
192
+            return true;
193
+        },"输入最大100字符");
194
+
195
+        // 效验-整改措施
196
+        $.validator.addMethod("checkOpinion",function(value,element, params) {
197
+            // $scope.festivalbefore.opinion = value;
198
+            if ((value.length*2) >= 200) { // Gbase 存储/2
199
+                return this.optional(element);
200
+            }
201
+            return true;
202
+        },"输入最大100字符");
186 203
 
187 204
         // 提交表单
188 205
         var validator = $("#festivalbefore-form").validate();
189 206
         $scope.saveData = function () {
190
-            console.log("$scope.festivalbefore.houseId", $scope.festivalbefore.houseIdList);
191
-            console.log("$scope.festivalbefore", $scope.festivalbefore);
192 207
             if (validator.form()) {
193 208
                 $scope.festivalbefore.orgId = $rootScope.userInfo.orgId;
194 209
                 $scope.festivalbefore.checkDate = $("input[name='checkDate']").val(); // 时间控件获取值

+ 2 - 2
src/main/resources/static/app/storage/views/safeproduce/safeproduce-festivalbefore-edit.html

@@ -281,7 +281,7 @@
281 281
 										<section class="col col-10" style="width:100%">
282 282
 											<label class="label">检查发现问题:</label>
283 283
 											<label class="textarea textarea-resizable">
284
-												<textarea rows="3" class="custom-scroll"  ng-model="festivalbefore.problem" name="problem" ng-disabled="isNotEdit"></textarea>
284
+												<textarea rows="3" class="custom-scroll" checkProblem="true" ng-model="festivalbefore.problem" name="problem" ng-disabled="isNotEdit"></textarea>
285 285
 											</label>
286 286
 										</section>
287 287
 									</div>
@@ -289,7 +289,7 @@
289 289
 										<section class="col col-10" style="width:100%">
290 290
 											<label class="label">整改措施:</label>
291 291
 											<label class="textarea textarea-resizable">
292
-												<textarea rows="3" class="custom-scroll"  ng-model="festivalbefore.opinion" name="opinion" ng-disabled="isNotEdit"></textarea>
292
+												<textarea rows="3" class="custom-scroll" checkOpinion="true" ng-model="festivalbefore.opinion" name="opinion" ng-disabled="isNotEdit"></textarea>
293 293
 											</label>
294 294
 										</section>
295 295
 									</div>