Explorar o código

git-svn-id: https://192.168.57.71/svn/jsgkj@1904 931142cf-59ea-a443-aa0e-51397b428577

ld_jiangxf %!s(int64=8) %!d(string=hai) anos
pai
achega
434b922067

+ 6 - 3
gkjsjy/trunk/WebContent/WEB-INF/pages/gkyxtjyfx/hxhbtj/hxhbtjAdd.jsp

@@ -21,9 +21,12 @@
 		function percent(obj){
 			var reg = /^[+-]?\d*\.?\d{0,1}$/;
 			if(!reg.test(obj.value)){
-				obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
+				obj.value = obj.value.substring(0,obj.value.length-1);
+				obj.value = obj.value.replace(/[^\d.-]/g,""); //清除"数字"和"."以外的字符
 				obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
 				obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
+				obj.value = obj.value.replace(/\-{2,}/g,"-"); //只保留第一个, 清除多余的
+				obj.value = obj.value.replace("-","$#$").replace(/\-/g,"").replace("$#$","-");
 				obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d).*$/,'$1$2.$3'); //只能输入两个小数
 			}else{
 				obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
@@ -112,7 +115,7 @@
 							<td><input type="text" class="form-control" id="nwmjzxttl" name="nwmjzxttl" onkeyup="twoNumeber(this)"></td>
 							<th rowspan="2">其中:</th>
 							<th>外贸:&nbsp;</th>
-							<td><input type="text" class="form-control" id="wmtbzzs" name="wmtbzzs" onkeyup="twoNumeber(this)"></td>
+							<td><input type="text" class="form-control" id="wmtbzzs" name="wmtbzzs" onkeyup="percent(this)"></td>
 						</tr>
 						<tr>
 							<th>内贸:&nbsp;</th>
@@ -120,7 +123,7 @@
 							<th>内贸:&nbsp;</th>
 							<td><input type="text" class="form-control" id="nnmjzxttl" name="nnmjzxttl" onkeyup="twoNumeber(this)"></td>
 							<th>内贸:&nbsp;</th>
-							<td><input type="text" class="form-control" id="nmtbzzs" name="nmtbzzs" onkeyup="twoNumeber(this)"></td>
+							<td><input type="text" class="form-control" id="nmtbzzs" name="nmtbzzs" onkeyup="percent(this)"></td>
 						</tr>
 					</table>
 					<h2 align="center" style="margin-top:0px;"><font style="font-size:16px;color:#196794;font-family:微软雅黑;font-weight: bold;">集装箱航线航班开辟情况</font></h2>