fanxw před 2 roky
rodič
revize
3bc12bc5a1

+ 4 - 9
src/main/resources/static/app/storage/controller/qualitycheckAssayCtrl.js

@@ -1689,15 +1689,10 @@ angular.module('app.storage')
1689 1689
         },"检验时间不得早于入库日期!");
1690 1690
 
1691 1691
         // 自定义验证,验证散气时间不得早于熏蒸开始时间和熏蒸结束时间
1692
-        $.validator.addMethod("validTime",function(value,element, params) {
1693
-            var beginTime = $scope.fumigationProcess.firstUseDrugTime;
1694
-            var endTime = $scope.fumigationProcess.taskEndTime;
1695
-            if(value <= beginTime || value <= endTime){
1696
-                return this.optional(element)|| false;
1697
-            }else{
1698
-                return this.optional(element)|| true;
1699
-            }
1700
-        },"散气时间不得早于熏蒸开始时间和结束时间!");
1692
+        $.validator.addMethod("bhCheck",function(value,element, params) {
1693
+        	var checkNumber = /^$|^[A-Za-z0-9]{0,64}$/;
1694
+            return this.optional(element)||(checkNumber.test(value));
1695
+        },"只允许录入数字和字母!");
1701 1696
 
1702 1697
         // 自定义验证
1703 1698
         $.validator.addMethod("setState",function(value,element, params) {

+ 5 - 10
src/main/resources/static/app/storage/controller/qualitycheckCtrl.js

@@ -1674,16 +1674,11 @@ angular.module('app.storage')
1674 1674
             }
1675 1675
         },"检验时间不得早于入库日期!");
1676 1676
 
1677
-        // 自定义验证,验证散气时间不得早于熏蒸开始时间和熏蒸结束时间
1678
-        $.validator.addMethod("validTime",function(value,element, params) {
1679
-            var beginTime = $scope.fumigationProcess.firstUseDrugTime;
1680
-            var endTime = $scope.fumigationProcess.taskEndTime;
1681
-            if(value <= beginTime || value <= endTime){
1682
-                return this.optional(element)|| false;
1683
-            }else{
1684
-                return this.optional(element)|| true;
1685
-            }
1686
-        },"散气时间不得早于熏蒸开始时间和结束时间!");
1677
+        // 样表编号和扦样单编号校验
1678
+        $.validator.addMethod("bhCheck",function(value,element, params) {
1679
+        	var checkNumber = /^$|^[A-Za-z0-9]{0,64}$/;
1680
+            return this.optional(element)||(checkNumber.test(value));
1681
+        },"只允许录入数字和字母!");
1687 1682
 
1688 1683
         // 自定义验证
1689 1684
         $.validator.addMethod("setState",function(value,element, params) {

+ 2 - 2
src/main/resources/static/app/storage/views/qualitycheck/qualitycheck-firstcheck-edit.html

@@ -194,7 +194,7 @@
194 194
 												<label class="select">
195 195
 													<label class="label">扦样单编号:</label>
196 196
 													<label class="input">
197
-														<input type="text" ng-model="qualitycheck.qydbh" ng-readonly="isNotEdit" name="qydbh"  placeholder="扦样单编号">
197
+														<input type="text" ng-model="qualitycheck.qydbh" ng-readonly="isNotEdit" name="qydbh" bhCheck=true maxlength="64" placeholder="扦样单编号">
198 198
 													</label>
199 199
 												</label>
200 200
 											</section>
@@ -205,7 +205,7 @@
205 205
 												<label class="select">
206 206
 													<label class="label">样品编号:</label>
207 207
 													<label class="input">
208
-														<input type="text" ng-model="qualitycheck.ypbh" ng-readonly="isNotEdit" name="ypbh"  placeholder="样品编号">
208
+														<input type="text" ng-model="qualitycheck.ypbh" ng-readonly="isNotEdit" name="ypbh" bhCheck=true maxlength="64" placeholder="样品编号">
209 209
 													</label>
210 210
 												</label>
211 211
 											</section>

+ 2 - 2
src/main/resources/static/app/storage/views/qualitycheck/qualitycheck-firstcheck-sample-edit.html

@@ -194,7 +194,7 @@
194 194
 												<label class="select">
195 195
 													<label class="label">扦样单编号:</label>
196 196
 													<label class="input">
197
-														<input type="text" ng-model="qualitycheck.qydbh" ng-readonly="isNotEdit" name="qydbh"  placeholder="扦样单编号">
197
+														<input type="text" ng-model="qualitycheck.qydbh" ng-readonly="isNotEdit" name="qydbh" maxlength="64" bhCheck=true placeholder="扦样单编号">
198 198
 													</label>
199 199
 												</label>
200 200
 											</section>
@@ -205,7 +205,7 @@
205 205
 												<label class="select">
206 206
 													<label class="label">样品编号:</label>
207 207
 													<label class="input">
208
-														<input type="text" ng-model="qualitycheck.ypbh" ng-readonly="isNotEdit" name="ypbh"  placeholder="样品编号">
208
+														<input type="text" ng-model="qualitycheck.ypbh" ng-readonly="isNotEdit" name="ypbh" maxlength="64" bhCheck=true  placeholder="样品编号">
209 209
 													</label>
210 210
 												</label>
211 211
 											</section>

+ 2 - 2
src/main/resources/static/app/storage/views/qualitycheck/qualitycheck-outcheck-edit.html

@@ -185,7 +185,7 @@
185 185
 												<label class="select">
186 186
 													<label class="label">扦样单编号:</label>
187 187
 													<label class="input">
188
-														<input type="text" ng-model="qualitycheck.qydbh" ng-readonly="isNotEdit" name="qydbh"  placeholder="扦样单编号">
188
+														<input type="text" ng-model="qualitycheck.qydbh" ng-readonly="isNotEdit" name="qydbh" bhCheck=true maxlength="64" placeholder="扦样单编号">
189 189
 													</label>
190 190
 												</label>
191 191
 											</section>
@@ -196,7 +196,7 @@
196 196
 												<label class="select">
197 197
 													<label class="label">样品编号:</label>
198 198
 													<label class="input">
199
-														<input type="text" ng-model="qualitycheck.ypbh" ng-readonly="isNotEdit" name="ypbh"  placeholder="样品编号">
199
+														<input type="text" ng-model="qualitycheck.ypbh" ng-readonly="isNotEdit" name="ypbh" bhCheck=true maxlength="64" placeholder="样品编号">
200 200
 													</label>
201 201
 												</label>
202 202
 											</section>

+ 2 - 2
src/main/resources/static/app/storage/views/qualitycheck/qualitycheck-outcheck-sample-edit.html

@@ -184,7 +184,7 @@
184 184
 												<label class="select">
185 185
 													<label class="label">扦样单编号:</label>
186 186
 													<label class="input">
187
-														<input type="text" ng-model="qualitycheck.qydbh" ng-readonly="isNotEdit" name="qydbh"  placeholder="扦样单编号">
187
+														<input type="text" ng-model="qualitycheck.qydbh" ng-readonly="isNotEdit" name="qydbh" maxlength="64" bhCheck=true placeholder="扦样单编号">
188 188
 													</label>
189 189
 												</label>
190 190
 											</section>
@@ -194,7 +194,7 @@
194 194
 												<label class="select">
195 195
 													<label class="label">样品编号:</label>
196 196
 													<label class="input">
197
-														<input type="text" ng-model="qualitycheck.ypbh" ng-readonly="isNotEdit" name="ypbh"  placeholder="样品编号" />
197
+														<input type="text" ng-model="qualitycheck.ypbh" ng-readonly="isNotEdit" name="ypbh" maxlength="64" bhCheck=true placeholder="样品编号" />
198 198
 													</label>
199 199
 												</label>
200 200
 											</section>