作者 蔺文领

增加运单号正则校验

@@ -15,16 +15,17 @@ @@ -15,16 +15,17 @@
15 <attributes> 15 <attributes>
16 <attribute name="optional" value="true"/> 16 <attribute name="optional" value="true"/>
17 <attribute name="maven.pomderived" value="true"/> 17 <attribute name="maven.pomderived" value="true"/>
  18 + <attribute name="test" value="true"/>
18 </attributes> 19 </attributes>
19 </classpathentry> 20 </classpathentry>
20 <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> 21 <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
21 <attributes> 22 <attributes>
22 <attribute name="maven.pomderived" value="true"/> 23 <attribute name="maven.pomderived" value="true"/>
  24 + <attribute name="test" value="true"/>
23 </attributes> 25 </attributes>
24 </classpathentry> 26 </classpathentry>
25 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> 27 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
26 <attributes> 28 <attributes>
27 - <attribute name="module" value="true"/>  
28 <attribute name="maven.pomderived" value="true"/> 29 <attribute name="maven.pomderived" value="true"/>
29 </attributes> 30 </attributes>
30 </classpathentry> 31 </classpathentry>
@@ -34,6 +35,5 @@ @@ -34,6 +35,5 @@
34 <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> 35 <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
35 </attributes> 36 </attributes>
36 </classpathentry> 37 </classpathentry>
37 - <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>  
38 <classpathentry kind="output" path="target/classes"/> 38 <classpathentry kind="output" path="target/classes"/>
39 </classpath> 39 </classpath>
@@ -5,4 +5,5 @@ org.eclipse.jdt.core.compiler.compliance=1.7 @@ -5,4 +5,5 @@ org.eclipse.jdt.core.compiler.compliance=1.7
5 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 5 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 6 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 7 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
  8 +org.eclipse.jdt.core.compiler.release=disabled
8 org.eclipse.jdt.core.compiler.source=1.7 9 org.eclipse.jdt.core.compiler.source=1.7
@@ -1013,6 +1013,17 @@ $(function(){ @@ -1013,6 +1013,17 @@ $(function(){
1013 1013
1014 function checkNo(content){ 1014 function checkNo(content){
1015 if (content) { 1015 if (content) {
  1016 + var reg = /^(\d{3})(-)(\d{8})$/;
  1017 + var flag = content.match(reg);
  1018 + if(flag==null){
  1019 + layui.use('layer', function(){
  1020 + var layer = layui.layer;
  1021 + parent.layer.alert('主单号格式错误,请检查运单号位数及格式,例如:172-30937185', {icon: 0});
  1022 + $("#waybill").focus();
  1023 + });
  1024 + return;
  1025 + }
  1026 +
1016 content = content.replace(/ /g,''); 1027 content = content.replace(/ /g,'');
1017 $("#waybill").val(content); 1028 $("#waybill").val(content);
1018 1029