软件世界网 购物 网址 三丰软件 | 小说 美女秀 图库大全 游戏 笑话 | 下载 开发知识库 新闻 开发 图片素材
多播视频美女直播
↓电视,电影,美女直播,迅雷资源↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
移动开发 架构设计 编程语言 Web前端 互联网
开发杂谈 系统运维 研发管理 数据库 云计算 Android开发资料
  软件世界网 -> Web前端 -> 限制文本框只能输入数字及小数点 -> 正文阅读
Web前端 最新文章
10分钟
SSM框架SSM项目源码SSM源码下载java框架整合
javascript入门
JavaScript常用对象Array(2)
8.Smarty3:模版中的内置函数
表单脚本
iTextSharp5.0页眉页脚及Asp.net预览的实现
MVC基础学习—理论篇
JavaScript
http协议中get与post区别详解

[Web前端]限制文本框只能输入数字及小数点

  2016-03-29 22:59:56
<#--限制文本框只能输入数字及小数点 -->    
		<script type="text/javascript">    
	        $(function(){       
		        <#--
		           	 限制文本框只能输入数字
		            $("#iddd").keyup(function(){      
		                    $(this).val($(this).val().replace(/\D|^0/g,''));    
		                }).bind("paste",function(){  //CTR+V事件处理      
		                    $(this).val($(this).val().replace(/\D|^0/g,''));       
		                }).css("ime-mode", "disabled"); //CSS设置输入法不可用      
		          -->
		         <#--限制文本框只能输入数字和小数点   -->    
		            $(".dig_point").keyup(function(){      
		                    $(this).val($(this).val().replace(/[^0-9.]/g,''));      
		                }).bind("paste",function(){  //CTR+V事件处理      
		                    $(this).val($(this).val().replace(/[^0-9.]/g,''));       
		                }).css("ime-mode","disabled"); //CSS设置输入法不可用      
		        });    
		</script>    
或者:onkeyup="value=value.replace(/\D/g,'')"

完整文件引用:
<#include "/WEB-INF/template/htmledit.ftl">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title><#if model.id??>修改<#else>新增</#if>XXXX管理平台</title>
		<#--限制文本框只能输入数字及小数点 -->    
		<script type="text/javascript">    
	        $(function(){       
		        <#--
		           	 限制文本框只能输入数字
		            $("#iddd").keyup(function(){      
		                    $(this).val($(this).val().replace(/\D|^0/g,''));    
		                }).bind("paste",function(){  //CTR+V事件处理      
		                    $(this).val($(this).val().replace(/\D|^0/g,''));       
		                }).css("ime-mode", "disabled"); //CSS设置输入法不可用      
		          -->
		         <#--限制文本框只能输入数字和小数点   -->    
		            $(".dig_point").keyup(function(){      
		                    $(this).val($(this).val().replace(/[^0-9.]/g,''));      
		                }).bind("paste",function(){  //CTR+V事件处理      
		                    $(this).val($(this).val().replace(/[^0-9.]/g,''));       
		                }).css("ime-mode","disabled"); //CSS设置输入法不可用      
		        });    
		</script>    
		 <#--检查动态追加tr表格-->
		<script type="text/javascript">
			function myfilter(e) {
			
			 var obj=e.srcElement || e.target;
			
			 var dot=obj.value.indexOf(".");//alert(e.which);
			
			 var  key=e.keyCode|| e.which;
			
			 if(key==8 || key==9 || key==46 || (key>=37  && key<=40))//这里为了兼容Firefox的backspace,tab,del,方向键
			
			  return true;
			
			 if (key<=57 && key>=48) { //数字
			
			  if(dot==-1)//没有小数点
			
			     return true;
			
			    else if(obj.value.length<=dot+8)//两位小数
			
			  return true;
			
			 } else if((key==46) && dot==-1){//小数点
			
			  return true;
			
			 }        
			
			    return false;
			
			}
		</script>
		<script type="text/javascript">
			<#--在此添加鼠标离开触发事件   ajax 异步获取-->
			function load_data(obj)	{
			debugger;
				var isLoad = true;
				var isAlert_ = true;
				<#--存在记录判断
				debugger;
				$('.mat_code').each(function(index,ele){
					//alert(ele.value);
					if(ele.value==obj.value&&isAlert_)
					{
						isLoad	= false;
						isAlert_ = false;
						var sele_obj = $(obj).parent().parent().next();
						$(sele_obj).detach();
						 $(obj).parent().parent().detach();
						alert("物料编号:【"+ele.value+"】,列表已存在此记录!");
					}			
				});
				debugger;
				-->
				var tr = $(obj).parents("tr");
				var m_code = tr.find(".mat_code").val();
				var m_name = tr.find(".mc_name").val();
				if(isLoad) {
				debugger;
					var url_ = "${ctx}/biz/material/materDataForm!doLoadData.action";
					htmlobj = $.ajax({
						url:url_,
						async:false,
						data:{code:m_code,name:m_name},    
						dataType:'json',
						success:function(obj){}
					});
					var obj_  =htmlobj.responseText;
					var to_json = eval("("+obj_+")");
					
					var tr_and_tr = $(obj).parent().parent().next();
				
					for(var i=0;i<to_json.length;i++)
					{
						var k = to_json.key[i];
						$("#addTr").append("<tr><td class='tdLabel'><label class='label'>新值</label><input type='hidden' name='types_' value='新值'/></td>"+
										"<td><input type='hidden' name='maId' value='"+k.id+"'/><input type='hidden' name='materialCodes' value='"+k.materialCode+"'/><input type='text' disabled='disabled' class='inp mat_code' value='"+k.materialCode+"'  onchange='load_data(this)'/></td>"+
										"<td><input type='text' name='materialNames' class='inp' value='"+k.materialName+"'/></td>"+
										"<td><input type='text' name='basicUnits' class='inp' value='"+k.basicUnit+"'/></td>"+
										"<td><input type='text' name='procurementUnits' class='inp' value='"+k.procurementUnit+"'/></td>"+
										"<td><input type='text' name='conversionFactors' style='ime-mode:disabled'  onkeypress='return myfilter(event)' class='inp dig_point' value='"+k.conversionFactor+"'/></td>"+
										"<td><input type='text' name='minPackings' style='ime-mode:disabled'  onkeypress='return myfilter(event)' class='inp dig_point' value='"+k.minPacking+"'/></td>"+
										"<td><input type='text' name='moqs' style='ime-mode:disabled'  onkeypress='return myfilter(event)' class='inp dig_point' value='"+k.moq+"'/></td>"+
										"<td><input type='text' name='procurementCycles' style='ime-mode:disabled'  onkeypress='return myfilter(event)' class='inp dig_point' value='"+k.procurementCycle+"'/></td>"+
										"<td><input type='text' name='mateClasses' value='"+k.materialClass+"' id='mateClasses' class='materialTypeName' onclick='openTreeDialog(this)' readonly='true' style=';width:152px;float:left;'><ul class='opt_bt'><li><input type='button' onclick='openTreeDialog(this)' value='选择' class='select' id='mateClasses_select_bt'></li></ul></td>"+
										"<td><input type='text' name='maFactory' class='inp mat_factory' value='"+k.factory+"' readonly='readonly'/></td>"+
										"<td><input type='text' name='remarks' class='inp' value='"+k.remark+"'/></td>"+
										"<td  rowspan='2'><a href='javascript:;'><i style='margin-left:9px;' class='glyphicon glyphicon-trash' onclick='remove2Tr(this)'></i></a></td></tr>"+
										"<tr><td class='tdLabel'><label class='label'>原值</label><input type='hidden' name='types_' value='原值'/></td>"+
										"<td>"+k.materialCode+"<input type='hidden' name='materialCodes' value='"+k.materialCode+"'/></td>"+
										"<td>"+k.materialName+"<input type='hidden' name='materialNames' value='"+k.materialName+"'/></td>"+
										"<td>"+k.basicUnit+"<input type='hidden' name='basicUnits' value='"+k.basicUnit+"'/></td>"+
										"<td>"+k.procurementUnit+"<input type='hidden' name='procurementUnits' value='"+k.procurementUnit+"'/></td>"+
										"<td>"+k.conversionFactor+"<input type='hidden' name='conversionFactors' value='"+k.conversionFactor+"'/></td>"+
										"<td>"+k.minPacking+"<input type='hidden' name='minPackings' value='"+k.minPacking+"'/></td>"+
										"<td>"+k.moq+"<input type='hidden' name='moqs' value='"+k.moq+"'/></td>"+
										"<td>"+k.procurementCycle+"<input type='hidden' name='procurementCycles' value='"+k.procurementCycle+"'/></td>"+
										"<td>"+k.materialClass+"<input type='hidden' name='mateClasses' value='"+k.materialClass+"'/></td>"+
										"<td>"+k.factory+"<input type='hidden' name='maFactory' value='"+k.factory+"'/></td>"+
										"<td>"+k.remark+"<input type='hidden' name='remarks' value='"+k.remark+"'/></td></tr>");
					
					}
					tr_and_tr.detach();
					$(obj).parent().parent().detach();
					
					<#--供应商数据ajax加载-->
						for(var i=0;i<to_json.length_sup;i++)
						{
							var supp = to_json.sup[i];
							$("#addTab").append("<tr><td class='tdLabel'><label class='label'>新值</label><input type='hidden' name='types_' value='新值'/></td><input type='hidden' name='sid' value='"+supp.id+"'/>"+
											"<td><input type='hidden' name='materialSupplierCodes' value='"+supp.materialCode+"'/><input type='text' name='materialSupplierCodes' class='inp sup_code' onchange='load_data(this)' value='"+supp.materialCode+"' disabled='disabled' /></td>"+
											"<td><input type='text' name='materialSupplierNames' class='inp'  value='"+supp.materialName+"' readonly='readonly'/></td>"+
											"<td><input type='text' name='vendorCodes' class='inp' value='"+supp.vendorCodes+"'readonly='readonly'/></td>"+
											"<td><input type='text' name='abbreviations' class='inp' value='"+supp.supplierAbbr+"'readonly='readonly'/></td>"+
											"<td colspan='2'><input type='text' name='brands' class='inp' value='"+supp.brand+"'/></td>"+
											"<td colspan='2'><input type='text' name='maxTransports' class='inp dig_point' value='"+supp.maxTransport+"'/></td>"+
											"<td><input type='text' name='mateClasses' value='"+supp.materialClass+"' id='mateClasses' class='materialTypeName' style=';width:152px;float:left;' onclick='openTreeDialog(this)' readonly='true'><ul class='opt_bt'><li><input type='button' onclick='openTreeDialog(this)' value='选择' class='select' id='mateClasses_select_bt'></li></ul></td>"+
											"<td><input type='text' name='supFactory' class='inp sup_factory' value='"+supp.factory+"' readonly='readonly'/></td>"+
											"<td><input type='text' name='supplierRemarks' class='inp' value='"+supp.remark+"'/></td>"+
											"<td rowspan='2'><a href='javascript:;'><i style='margin-left:9px;' class='glyphicon glyphicon-trash' onclick='remove2Tr(this)'></i></a></td></tr>"+
											"<tr><td class='tdLabel'><label class='label'>原值</label><input type='hidden' name='types_' value='原值'/></td>"+
											"<td>"+supp.materialCode+"<input type='hidden' name='materialSupplierCodes' value='"+supp.materialCode+"'/></td>"+
											"<td>"+supp.materialName+"<input type='hidden' name='materialSupplierNames' value='"+supp.materialName+"'/></td>"+
											"<td>"+supp.vendorCodes+"<input type='hidden' name='vendorCodes' value='"+supp.vendorCodes+"'/></td>"+
											"<td>"+supp.supplierAbbr+"<input type='hidden' name='abbreviations' value='"+supp.supplierAbbr+"'/></td>"+
											"<td colspan='2'>"+supp.brand+"<input type='hidden' name='brands' value='"+supp.brand+"'/></td>"+
											"<td colspan='2'>"+supp.maxTransport+"<input type='hidden' name='maxTransports' value='"+supp.maxTransport+"'/></td>"+
											"<td>"+supp.materialClass+"<input type='hidden' name='mateClasses' value='"+supp.materialClass+"'/></td>"+
											"<td>"+supp.factory+"<input type='hidden' name='supFactory' value='"+supp.supFactory+"'/></td>"+
											"<td>"+supp.remark+"<input type='hidden' name='supplierRemarks' value='"+supp.remark+"'/></td></tr>");
					}
				}
			}
			
			function goBack(){
				disabledButtons();
				loadHTML("#content", "<@lc.url uri="/biz/material/materDataForm!doList.action"/>", {"pageModel.query":"${pageModel.query!}","pageModel.currentPage":${(pageModel.currentPage?string('0'))!0},"pageModel.pageSize":${(pageModel.pageSize?string('0'))!20},"isInitList":true});
				return false;
			}
			jQuery(document).ready(function(){
				initEditMethod();
			});
			
			<#--进行 field校验-->
			function checkSameRecord(){
				var sup_code = $('.sup_code');
				var sup_factory = $('.sup_factory');
				var mat_factory = $('.mat_factory');
				var mat_code = $('.mat_code');
				var not_same_ = true;
				if(mat_code.length==0||sup_code.length==0) 
				{
					alert("物料主数据表或物料供应商表不能为空!");
					not_same_ = false; 
					return;
				}
				for(var code_i = 0;code_i<mat_code.length;code_i++)
				{ 
					if(mat_factory[code_i].value=="")
					{
						not_same_ = false; 
						alert("工厂列数据不能为空!!");
						return;
					}
					for(var code_j = code_i+1;code_j<mat_code.length;code_j++)
					{ 
						if(mat_code[code_i].value == mat_code[code_j].value&&mat_factory[code_i].value == mat_factory[code_j].value)
						{ 
							not_same_ = false; 
							alert("物料主数据表中,有相同的物料编码和工厂的记录!!");
							return;
						} 
				
					} 
				
				}
				for(var code_i = 0;code_i<sup_code.length;code_i++)
				{ 
					if(sup_factory[code_i].value=="")
					{
						not_same_ = false; 
						alert("工厂列数据不能为空!!");
						return;
					}
					for(var code_j = code_i+1;code_j<sup_code.length;code_j++)
					{ 
				
						if(sup_code[code_i].value == sup_code[code_j].value&&sup_factory[code_i].value == sup_factory[code_j].value)
						{ 
							not_same_ = false; 
							alert("物料供应商表中,有相同的物料编码和工厂的记录!!");
							return;
						} 
				
					} 
				
				}
				if(not_same_)
				submitForm();
			}
			
			function removeTr(obj){
				$(obj).parent().parent().parent().detach();	
			}
			function remove2Tr(obj){
				var delObj=$(obj).parent().parent().parent();
				var delNextObj=$(obj).parent().parent().parent().next();
				delObj.detach();	
				delNextObj.detach();
			}
			
		</script>
		<script type="text/javascript">
			var currentObj = null;
			function openTreeDialog(obj){
				currentObj = obj;
				jQuery.colorbox({
					href:"<@lc.url uri="/biz/material/type!doTreeSelect.action"/>",
					innerWidth:360,
					innerHeight:500,
					scrolling:false
				});
			}
			function typeCallBack(id,name){
				$(currentObj).parents("td").find(".materialTypeName").val(name);
			}
			function openDialog(){
				jQuery.colorbox({
					href:"<@lc.url uri="/biz/material/materDataForm!doBatchCodes.action"/>",
					innerWidth:400,
					innerHeight:600,
					scrolling:false,
					onComplete:function(rs){
						jQuery("#cboxLoadedContent").find(".box-icon").detach();
						jQuery("#cboxLoadedContent").find("#model_id").detach();
					}
				});
			}
		</script>
	<#--物料主数据-->	
		<script type="text/javascript">
			$(function(){ 
				$("#add").click(function(){
					$("#addTr").append("<#if model.id??><tr><td class='tdLabel'><label class='label'>新值</label><input type='hidden' name='types_' value='新值'/></td>"+
									"<td><input type='hidden' name='maId' /><input type='text' name='materialCodes' class='inp mat_code' onchange='load_data(this)'/></td>"+
									"<td><input type='text' name='materialNames' class='inp mc_name' onchange='load_data(this)'/></td>"+
									"<td><input type='text' name='basicUnits' class='inp' /></td>"+
									"<td><input type='text' name='procurementUnits' class='inp' /></td>"+
									"<td><input type='text' name='conversionFactors' style='ime-mode:disabled'  onkeypress='return myfilter(event)' class='inp dig_point' /></td>"+
									"<td><input type='text' name='minPackings' style='ime-mode:disabled'  onkeypress='return myfilter(event)' class='inp dig_point' /></td>"+
									"<td><input type='text' name='moqs' style='ime-mode:disabled'  onkeypress='return myfilter(event)' class='inp dig_point' /></td>"+
									"<td><input type='text' name='procurementCycles' style='ime-mode:disabled'  onkeypress='return myfilter(event)' class='inp dig_point' /></td>"+
									"<td><input type='text' name='mateClasses' style=';width:152px;float:left;' id='mateClasses' class='materialTypeName' onclick='openTreeDialog(this)' readonly='true'><ul class='opt_bt'><li><input type='button' onclick='openTreeDialog(this)' value='选择' class='select' id='mateClasses_select_bt'></li></ul></td>"+
									"<td><input type='text' name='maFactory' class='inp mat_factory' /></td>"+
									"<td><input type='text' name='remarks' class='inp' /></td>"+
									"<td rowspan='2'><a href='javascript:;'><i style='margin-left:9px;' class='glyphicon glyphicon-trash' onclick='remove2Tr(this)'></i></a></td></tr>"+
									"<tr><td class='tdLabel'><label class='label'>原值</label><input type='hidden' name='types_' value='原值'/></td>"+
									"<td></td>"+
									"<td></td>"+
									"<td></td>"+
									"<td></td>"+
									"<td></td>"+
									"<td></td>"+
									"<td></td>"+
									"<td></td>"+
									"<td></td>"+
									"<td></td>"+
									"<td></td></tr><#else>"+
									"<tr><td class='tdLabel'><label class='label'>新值</label><input type='hidden' name='types_' value='新值'/></td>"+
									"<td><input type='text' name='materialCodes' class='inp' /></td>"+
									"<td><input type='text' name='materialNames' class='inp' /></td>"+
									"<td><input type='text' name='basicUnits' class='inp' /></td>"+
									"<td><input type='text' name='procurementUnits' class='inp' /></td>"+
									"<td><input type='text' name='conversionFactors' style='ime-mode:disabled'  onkeypress='return myfilter(event)' class='inp dig_point' /></td>"+
									"<td><input type='text' name='minPackings' style='ime-mode:disabled'  onkeypress='return myfilter(event)' class='inp dig_point' /></td>"+
									"<td><input type='text' name='moqs' style='ime-mode:disabled'  onkeypress='return myfilter(event)' class='inp dig_point' /></td>"+
									"<td><input type='text' name='procurementCycles' style='ime-mode:disabled'  onkeypress='return myfilter(event)' class='inp dig_point' /></td>"+
									"<td><input type='text' name='mateClasses' style=';width:152px;float:left;'  id='mateClasses' class='materialTypeName' onclick='openTreeDialog(this)' readonly='true'><ul class='opt_bt'><li><input type='button' onclick='openTreeDialog(this)' value='选择' class='select' id='mateClasses_select_bt'></li></ul></td>"+
									"<td><input type='text' name='maFactory' class='inp mat_factory' /></td>"+
									"<td><input type='text' name='remarks' class='inp' /></td>"+
									"<td><a href='javascript:;'><i style='margin-left:9px;' class='glyphicon glyphicon-trash' onclick='removeTr(this)'></i></a></td></tr></#if>");
				});
				
				<#--供应商列-->
				
				$("#addMaterial").click(function(){
					$("#addTab").append("<#if model.id??><tr><td class='tdLabel'><label class='label'>新值</label><input type='hidden' name='types_' value='新值'/></td><input type='hidden' name='sid' />"+
									"<td><input type='text' name='materialSupplierCodes' class='inp sup_code' onchange='load_data(this)'/></td>"+
									"<td><input type='text' name='materialSupplierNames' class='inp'/></td>"+
									"<td><input type='text' name='vendorCodes' class='inp' /></td>"+
									"<td><input type='text' name='abbreviations' class='inp' /></td>"+
									"<td colspan='2'><input type='text' name='brands' class='inp' /></td>"+
									"<td colspan='2'><input type='text' name='maxTransports' style='ime-mode:disabled'  onkeypress='return myfilter(event)' class='inp dig_point' /></td>"+
									"<td><input type='text' name='mateClasses' style=';width:152px;float:left;'  id='mateClasses' class='materialTypeName' onclick='openTreeDialog(this)' readonly='true'><ul class='opt_bt'><li><input type='button' onclick='openTreeDialog(this)' value='选择' class='select' id='mateClasses_select_bt'></li></ul></td>"+
									"<td><input type='text' name='supFactory' class='inp sup_factory' /></td>"+
									"<td><input type='text' name='supplierRemarks' class='inp' /></td>"+
									"<td rowspan='2'><a href='javascript:;'><i style='margin-left:9px;' class='glyphicon glyphicon-trash' onclick='remove2Tr(this)'></i></a></td></tr>"+
									"<tr><td class='tdLabel'><label class='label'>原值</label><input type='hidden' name='types_' value='原值'/></td>"+
									"<td></td>"+
									"<td></td>"+
									"<td></td>"+
									"<td></td>"+
									"<td colspan='2'></td>"+
									"<td colspan='2'></td>"+
									"<td></td>"+
									"<td></td>"+
									"<td></td></tr>"+
									"<#else><tr><td class='tdLabel'><label class='label'>新值</label><input type='hidden' name='types_' value='新值'/></td>"+
									"<td><input type='text' name='materialSupplierCodes' class='inp'/></td>"+
									"<td><input type='text' name='materialSupplierNames' class='inp'/></td>"+
									"<td><input type='text' name='vendorCodes' class='inp' /></td>"+
									"<td><input type='text' name='abbreviations' class='inp' /></td>"+
									"<td colspan='2'><input type='text' name='brands' class='inp' /></td>"+
									"<td colspan='2'><input type='text' name='maxTransports' class='inp ' /></td>"+
									"<td><input type='text' name='mateClasses' style=';width:152px;float:left;'  id='mateClasses' class='materialTypeName' onclick='openTreeDialog(this)' readonly='true'><ul class='opt_bt'><li><input type='button' onclick='openTreeDialog(this)' value='选择' class='select' id='mateClasses_select_bt'></li></ul></td>"+
									"<td><input type='text' name='supFactory' class='inp sup_factory' /></td>"+
									"<td><input type='text' name='supplierRemarks' class='inp' /></td>"+
									"<td><a href='javascript:;'><i style='margin-left:9px;' class='glyphicon glyphicon-trash' onclick='removeTr(this)'></i></a></td></tr></#if>");
				});
			});
		</script>
		<script type="text/javascript">
			function loadCodes(obj){
			debugger;
				var mc_val = $("#batchCodes").val();
				$.ajax({
					async: false,
					url : "<@lc.url uri="/biz/material/materDataForm!doLoadData.action"/>",
					data : {codes:mc_val},
					dataType : 'json',
					success : function(rs){
					debugger;
						alert("3456789");
					}
				})
			}
		</script>
	</head>
	<body>
		<form action="<@lc.url uri="/biz/material/materDataForm!doSave.action"/>" name="myForm" id="myForm" " method="post" enctype="multipart/form-data" >
		<@s.hidden name="model.id" value="${model.id!}"/>
		<@s.hidden name="pageModel.query"/>
		<@s.hidden name="pageModel.currentPage"/>
		<@s.hidden name="pageModel.pageSize"/>
		<@s.hidden name="pageModel.orderBy"/>
		<@s.hidden name="isInitList"/>
		<#--
		<div id="bigClassArea" style="display:none;">
			<@s.textfield  name="mateClasses" label="物料类型" readOnly="true" cssClass="materialTypeName" onClick="openTreeDialog(this)" onChoose="openTreeDialog(this)" theme="simple"/>
		</div>
		-->
		<#-- 菜单导向 --->
		<div class="guide">
			<ul class="breadcrumb">
				<li>
					物料管理
				</li>
				<li>
					物料主数据维护申请表
				</li>
			</ul>
		</div>
			<#-- 主体 -->
			<div class="row materDataForm_body">
		        <div class="box col-md-12">
		            <div class="box-inner">
		                <div class="box-header well" data-original-title="">
		                    <h2><i class="glyphicon glyphicon-th"></i> <#if model.id??>修改<#else>新增</#if>物料主数据维护申请表</h2>
		                    <div class="box-icon">
		                        <a href="javascript:void(0);" class="btn btn-round btn-default ajax-link ret_btn" title="返回"><i 
		                        class="glyphicon glyphicon-repeat"></i></a>
		                    </div>
		                </div>
		                <div>
		                    <div>
		                    	<@s.actionerror />
								<@s.actionmessage />
								<table border="1" class="edit_table">
									<tr>
										<td class="tdLabel"><label for="model_title" class="label">标题</label></td>
										<td colspan="12">
											<input type="hidden" name="model.id" value="${model.id!}"/>
											<@s.textfield name="model.title" theme="simple" class="inp" cssStyle="border:0; outline-style:none;" value="物料主数据维护--${((.now)?string('yyyy-MM-dd'))!}"/>
										</td>
										<#--
										<td class="tdLabel"><label for="model_purchaser" class="label">购买方</label></td>
										<td colspan="6" ><@s.textfield name="model.purchaser" theme="simple" class="inp" /></td>
										-->
									</tr>
									<tr>
										<td class="tdLabel"><label for="model_buyer" class="label">采购员</label></td>
										<td colspan="5"><input type="text" name="model.buyer" value="${(loginer.nickname)!}" id="model_buyer" class="inp" readonly="readonly"></td>
										<td class="tdLabel"><label for="model_dateTime" class="label" readonly="readonly">日期</label></td>
										<td colspan="6"><@s.textfield name="model.dateTime"  onclick="WdatePicker({el:$dp.$('model_appliDate'),dateFmt:'yyyy-MM-dd'})" theme="simple" value="${((.now)?string('yyyy-MM-dd'))!}" class="inp" /></td>
									</tr>
									<tr>
										<td class="tdLabel"><label for="model_category" class="label">类别</label></td>
										<td colspan="5">
										    <input type="hidden" name="model.category" value="${model.category!}">
											<#if model?? && model.category?? && model.category="修改物料">
												<input type="checkbox" name="model_category" value="新增物料" class="checkbox" disabled="disabled" />新增物料
												<input type="checkbox" name="model_category" value="修改物料" class="checkbox" disabled="disabled"  checked="checked"/>修改物料
											<#else>	
												<input type="checkbox" name="model_category" value="新增物料" class="checkbox" disabled="disabled" checked="checked"/>新增物料
												<input type="checkbox" name="model_category" value="修改物料" class="checkbox" disabled="disabled"/>修改物料
											</#if>
										</td>
										<td class="tdLabel"><label for="model_modifications" class="label">修改内容</label></td>
										<td colspan="6"><@s.textfield name="model.modifications" theme="simple" class="inp" value=""/></td>
									</tr>
									<tr>
										<td colspan="13" class="sub_title">物料主数据 <a href="javascript:;"><i class="glyphicon glyphicon-plus" id="add" class="addT"></i></a><button class="btn btn-success btn-xs" style="margin-left:20px;" id="BatchImport" onclick="openDialog();">批量导入</button></td>
									</tr>
									
									<#--物料主数据-->
									
									<tr>
										<td class="tdLabel"><label class="label">类型</label></td>
										<td>物料编码</td>
										<td>物料名称</td>
										<td>基本单位</td>
										<td>采购单位</td>
										<td>单位转换系数</td>
										<td>最小包装规格</td>
										<td>起订量</td>
										<td>采购周期</td>
										<td>物料分类<div style="width:200px;"></div></td>
										<td><font style="color:red">*</font>工厂</td>
										<td>备注</td>
										<td>操作</td>
									</tr>
									<tbody>
									<#if model.id??>
								<#--body--物料主数据 -position:中间表格  修改板块-->
									<#list (models!) as model_>
											<#list (model_.materialList!) as s>
												 <#if ((viewAndEdit!)!='999')>
														<tr>	
															<td class="tdLabel"><label class="label">新值</label><input type='hidden' name='types_' value='新值'/></td>
															<input type="hidden" name="maId" value="${s.id!}">
															<td><input type="text" name="materialCodes" class="inp mat_code" value="${s.materialCode!}" readonly="readonly" onchange="load_data(this)"/></td>
															<td><input type="text" name="materialNames" class="inp" value="${s.materialName!}"/></td>
															<td><input type="text" name="basicUnits" class="inp" value="${s.basicUnit!}"/></td>
															<td><input type="text" name="procurementUnits" class="inp" value="${s.procurementUnit!}"/></td>
															<td><input type="text" name="conversionFactors" class="inp dig_point" value="${s.conversionFactor!}"/></td>
															<td><input type="text" name="minPackings" class="inp dig_point" value="${s.minPacking!}"/></td>
															<td><input type="text" name="moqs" class="inp dig_point" value="${s.moq!}"/></td>
															<td><input type="text" name="procurementCycles" class="inp dig_point" value="${s.procurementCycle!}"/></td>
																<#--<@s.textfield  name="mateClasses"  label="物料类型" readOnly="true" cssClass="materialTypeName" onClick="openTreeDialog(this)" onChoose="openTreeDialog(this)" theme="simple"/>-->
															<td>
																<input type="text" name="mateClasses" value="${s.materialClass!}" id="mateClasses" class="materialTypeName" onclick="openTreeDialog(this)" readonly="true" style=";width:152px;float:left;">
																<ul class="opt_bt"><li><input type="button" onclick="openTreeDialog(this)" value="选择" class="select" id="mateClasses_select_bt"></li></ul>
															</td>
															<td><input type="text" name="maFactory" class="inp mat_factory" value="${s.factory!}" readonly="readonly"/></td>
															<td><input type="text" name="remarks" class="inp" value="${s.remark!}"/></td>
															<td rowspan="2"><a href="javascript:;"><i style="margin-left:9px;" class="glyphicon glyphicon-trash" onclick="remove2Tr(this)"></i></a></td>
														</tr>
														<tr>	
															<td class="tdLabel"><label class="label">原值</label><input type='hidden' name='types_' value='原值'/></td>
																<td>${s.materialCode!}<input type='hidden' name='materialCodes' value='${s.materialCode!}'/></td>
																<td>${s.materialName!}<input type='hidden' name='materialNames' value='${s.materialName!}'/></td>
																<td>${s.basicUnit!}<input type='hidden' name='basicUnits' value='${s.basicUnit!}'/></td>
																<td>${s.procurementUnit!}<input type='hidden' name='procurementUnits' value='${s.procurementUnit!}'/></td>
																<td>${s.conversionFactor!}<input type='hidden' name='conversionFactors' value='${s.conversionFactor!}'/></td>
																<td>${s.minPacking!}<input type='hidden' name='minPackings' value='${s.minPacking!}'/></td>
																<td>${s.moq!}<input type='hidden' name='moqs' value='${s.moq!}'/></td>
																<td>${s.procurementCycle!}<input type='hidden' name='procurementCycles' value='${s.procurementCycle!}'/></td>
																<td>${s.materialClass!}<input type='hidden' name='mateClasses' value='${s.materialClass!}'/></td>
																<td>${s.factory!}<input type='hidden' name='maFactory' value='${s.factory!}'/></td>
																<td>${s.remark!}<input type='hidden' name='remarks' value='${s.remark!}'/></td>
														</tr>
													<#else>
														<#if (s.type!)=='新值'><#--这个if else 用于物料维护进来的edit页面-->
															<tr>	
																<td class="tdLabel"><label class="label">新值</label><input type='hidden' name='types_' value='新值'/></td>
																<input type="hidden" name="maId" value="${s.id!}">
																<td><input type="text" name="materialCodes" class="inp mat_code" value="${s.materialCode!}" readonly="readonly"/></td>
																<td><input type="text" name="materialNames" class="inp" value="${s.materialName!}"/></td>
																<td><input type="text" name="basicUnits" class="inp" value="${s.basicUnit!}"/></td>
																<td><input type="text" name="procurementUnits" class="inp" value="${s.procurementUnit!}"/></td>
																<td><input type="text" name="conversionFactors" class="inp dig_point" value="${s.conversionFactor!}"/></td>
																<td><input type="text" name="minPackings" class="inp dig_point" value="${s.minPacking!}"/></td>
																<td><input type="text" name="moqs" class="inp dig_point" value="${s.moq!}"/></td>
																<td><input type="text" name="procurementCycles" class="inp dig_point" value="${s.procurementCycle!}"/></td>
																	<#--<@s.textfield  name="mateClasses"  label="物料类型" readOnly="true" cssClass="materialTypeName" onClick="openTreeDialog(this)" onChoose="openTreeDialog(this)" theme="simple"/>-->
																<td>
																	<input type="text" name="mateClasses" value="${s.materialClass!}" id="mateClasses" class="materialTypeName" onclick="openTreeDialog(this)" readonly="true" style=";width:152px;float:left;">
																	<ul class="opt_bt"><li><input type="button" onclick="openTreeDialog(this)" value="选择" class="select" id="mateClasses_select_bt"></li></ul>
																</td>
																<td><input type="text" name="maFactory" class="inp mat_factory" value="${s.factory!}" readonly="readonly"/></td>
																<td><input type="text" name="remarks" class="inp" value="${s.remark!}"/></td>
																<td rowspan="2"><a href="javascript:;"><i style="margin-left:9px;" class="glyphicon glyphicon-trash" onclick="remove2Tr(this)"></i></a></td>
															</tr>
														<#else>
															<tr>	
																<td class="tdLabel"><label class="label">原值</label><input type='hidden' name='types_' value='原值'/></td>
																	<td>${s.materialCode!}<input type='hidden' name='materialCodes' value='${s.materialCode!}'/></td>
																	<td>${s.materialName!}<input type='hidden' name='materialNames' value='${s.materialName!}'/></td>
																	<td>${s.basicUnit!}<input type='hidden' name='basicUnits' value='${s.basicUnit!}'/></td>
																	<td>${s.procurementUnit!}<input type='hidden' name='procurementUnits' value='${s.procurementUnit!}'/></td>
																	<td>${s.conversionFactor!}<input type='hidden' name='conversionFactors' value='${s.conversionFactor!}'/></td>
																	<td>${s.minPacking!}<input type='hidden' name='minPackings' value='${s.minPacking!}'/></td>
																	<td>${s.moq!}<input type='hidden' name='moqs' value='${s.moq!}'/></td>
																	<td>${s.procurementCycle!}<input type='hidden' name='procurementCycles' value='${s.procurementCycle!}'/></td>
																	<td>${s.materialClass!}<input type='hidden' name='mateClasses' value='${s.materialClass!}'/></td>
																	<td>${s.factory!}<input type='hidden' name='maFactory' value='${s.factory!}'/></td>
																	<td>${s.remark!}<input type='hidden' name='remarks' value='${s.remark!}'/></td>
															</tr>
														</#if>
													</#if>
											</#list>
										</#list>
									<#--body--物料主数据   新增板块-->	
									<#else>
										<tr>	
											<td class="tdLabel"><label class="label">新值</label><input type='hidden' name='types_' value='新值'/></td>
											<td><input type="text" name="materialCodes" class="inp mat_code" /></td>
											<td><input type="text" name="materialNames" class="inp" /></td>
											<td><input type="text" name="basicUnits" class="inp" /></td>
											<td><input type="text" name="procurementUnits" class="inp" /></td>
											<td><input type="text" name="conversionFactors" class="inp dig_point" /></td>
											<td><input type="text" name="minPackings" class="inp dig_point" /></td>
											<td><input type="text" name="moqs" class="inp dig_point" /></td>
											<td><input type="text" name="procurementCycles" class="inp dig_point" /></td>
											<td>
												<input type="text" name="mateClasses"  id="mateClasses" class="materialTypeName" onclick="openTreeDialog(this)" readonly="true" style=";width:152px;float:left;">
												<ul class="opt_bt"><li><input type="button" onclick="openTreeDialog(this)" value="选择" class="select" id="mateClasses_select_bt"></li></ul>
											</td>
											<td><input type="text" name="maFactory" class="inp mat_factory" /></td>
											<td><input type="text" name="remarks" class="inp" /></td>
											<td><a href="javascript:;"<i style="margin-left:9px;" class="glyphicon glyphicon-trash" onclick="removeTr(this)"></i></a></td>
										</tr>
									</#if>
									<tbody id="addTr" class="del"></tbody>
									<tr>
										<td colspan="13" class="sub_title">供应商数据 <a href="javascript:;"><i class="glyphicon glyphicon-plus" id="addMaterial" class="addT"></i></a></td>
									</tr>
									
									<#--供应商列-->
									
									<tr>
										<td class="tdLabel"><label class="label">类型</label></td>
										<td>物料编码</td>
										<td>物料名称</td>
										<td>供应商编码</td>
										<td>供应商简称</td>
										<td colspan="2">品牌/产地</td>
										<td colspan="2">周期内最大运货量</td>
										<td>物料分类</td>
										<td><font style="color:red">*</font>工厂</td>
										<td>备注</td>
										<td>操作</td>
									</tr>
									<#if model.id??>
									<#--body--供应商数据--修改板块-->
										<#list (supp_List?keys)! as key>
											<#list (supp_List.get(key)!) as sup_1>
											 <#if ((viewAndEdit!)!='999')>
											 		   <tr>
															<td class="tdLabel"><label class="label">新值</label><input type='hidden' name='types_' value='新值'/></td>
															<input type="hidden" name="sid" value="${sup_1.id!}"/>
															<td><input type="text" name="materialSupplierCodes" value="${sup_1.materialCode!}" class="inp sup_code" readonly="readonly"/></td>
															<td><input type="text" name="materialSupplierNames" value="${sup_1.materialName!}" class="inp" readonly="readonly"/></td>
															<td><input type="text" name="vendorCodes" class="inp" value="${sup_1.vendorCodes!}" readonly="readonly"/></td>
															<td><input type="text" name="abbreviations" class="inp" value="${sup_1.supplierAbbr!}" readonly="readonly"/></td>
															<td colspan="2"><input type="text" name="brands" class="inp" value="${sup_1.brand!}"/></td>
															<td colspan="2"><input type="text" name="maxTransports" class="inp dig_point" value="${sup_1.maxTransport!}"/></td>
															<td>
																<input type="text" name="mateClasses" value="${sup_1.materialClass!}" id="mateClasses" class="materialTypeName" onclick="openTreeDialog(this)" readonly="true" style=";width:152px;float:left;">
																<ul class="opt_bt"><li><input type="button" onclick="openTreeDialog(this)" value="选择" class="select" id="mateClasses_select_bt"></li></ul>
															</td>
															<td><input type="text" name="supFactory" class="inp  sup_factory" value="${sup_1.factory!}" readonly="readonly"/></td>
															<td><input type="text" name="supplierRemarks" class="inp" value="${sup_1.remark!}"/></td>
															<td rowspan="2"><a href="javascript:;"><i style="margin-left:9px;" class="glyphicon glyphicon-trash" onclick="remove2Tr(this)"></i></a></td>
														</tr>
														<tr>
															<td class="tdLabel"><label class="label">原值</label><input type='hidden' name='types_' value='原值'/></td>
															<td>${sup_1.materialCode!}<input type='hidden' name='materialSupplierCodes' value='${sup_1.materialCode!}'/></td>
															<td>${sup_1.materialName!}<input type='hidden' name='materialSupplierNames' value='${sup_1.materialName!}'/></td>
															<td>${sup_1.vendorCodes!}<input type='hidden' name='vendorCodes' value='${sup_1.vendorCodes!}'/></td>
															<td>${sup_1.supplierAbbr!}<input type='hidden' name='abbreviations' value='${sup_1.supplierAbbr!}'/></td>
															<td colspan="2">${sup_1.brand!}<input type='hidden' name='brands' value='${sup_1.brand!}'/></td>
															<td colspan="2">${sup_1.maxTransport!}<input type='hidden' name='maxTransports' value='${sup_1.maxTransport!}'/></td>
															<td>${sup_1.materialClass!}<input type='hidden' name='mateClasses' value='${sup_1.materialClass!}'/></td>
															<td>${sup_1.factory!}<input type='hidden' name='supFactory' value='${sup_1.factory!}'/></td>
															<td>${sup_1.remark!}<input type='hidden' name='supplierRemarks' value='${sup_1.remark!}'/></td>
														</tr>
													<#else>
														 <#if ((sup_1.type!)=='新值')><#--这个if else 用于物料维护进来的edit页面-->
															<tr>
																<td class="tdLabel"><label class="label">新值</label><input type='hidden' name='types_' value='新值'/></td>
																<input type="hidden" name="sid" value="${sup_1.id!}"/>
																<td><input type="text" name="materialSupplierCodes" value="${sup_1.materialCode!}" class="inp sup_code" readonly="readonly"/></td>
																<td><input type="text" name="materialSupplierNames" value="${sup_1.materialName!}" class="inp" readonly="readonly"/></td>
																<td><input type="text" name="vendorCodes" class="inp" value="${sup_1.vendorCodes!}" readonly="readonly"/></td>
																<td><input type="text" name="abbreviations" class="inp" value="${sup_1.supplierAbbr!}" readonly="readonly"/></td>
																<td colspan="2"><input type="text" name="brands" class="inp" value="${sup_1.brand!}"/></td>
																<td colspan="2"><input type="text" name="maxTransports" class="inp dig_point" value="${sup_1.maxTransport!}"/></td>
																<td>
																	<input type="text" name="mateClasses" value="${sup_1.materialClass!}" id="mateClasses" class="materialTypeName" onclick="openTreeDialog(this)" readonly="true" style=";width:152px;float:left;">
																	<ul class="opt_bt"><li><input type="button" onclick="openTreeDialog(this)" value="选择" class="select" id="mateClasses_select_bt"></li></ul>
																</td>
																<td><input type="text" name="supFactory" class="inp  sup_factory" value="${sup_1.factory!}" readonly="readonly"/></td>
																<td><input type="text" name="supplierRemarks" class="inp" value="${sup_1.remark!}"/></td>
																<td rowspan="2"><a href="javascript:;"><i style="margin-left:9px;" class="glyphicon glyphicon-trash" onclick="remove2Tr(this)"></i></a></td>
															</tr>
														<#else>
															<tr>
																<td class="tdLabel"><label class="label">原值</label><input type='hidden' name='types_' value='原值'/></td>
																<td>${sup_1.materialCode!}<input type='hidden' name='materialSupplierCodes' value='${sup_1.materialCode!}'/></td>
																<td>${sup_1.materialName!}<input type='hidden' name='materialSupplierNames' value='${sup_1.materialName!}'/></td>
																<td>${sup_1.vendorCodes!}<input type='hidden' name='vendorCodes' value='${sup_1.vendorCodes!}'/></td>
																<td>${sup_1.supplierAbbr!}<input type='hidden' name='abbreviations' value='${sup_1.supplierAbbr!}'/></td>
																<td colspan="2">${sup_1.brand!}<input type='hidden' name='brands' value='${sup_1.brand!}'/></td>
																<td colspan="2">${sup_1.maxTransport!}<input type='hidden' name='maxTransports' value='${sup_1.maxTransport!}'/></td>
																<td>${sup_1.materialClass!}<input type='hidden' name='mateClasses' value='${sup_1.materialClass!}'/></td>
																<td>${sup_1.factory!}<input type='hidden' name='supFactory' value='${sup_1.factory!}'/></td>
																<td>${sup_1.remark!}<input type='hidden' name='supplierRemarks' value='${sup_1.remark!}'/></td>
															</tr>
														</#if>		
													</#if>		
											</#list>
										</#list>
									<#else>
										<tr>
											<td class="tdLabel"><label class="label">新值</label><input type='hidden' name='types_' value='新值'/></td>
											<td><input type="text" name="materialSupplierCodes" class="inp sup_code"/></td>
											<td><input type="text" name="materialSupplierNames" class="inp"/></td>
											<td><input type="text" name="vendorCodes" class="inp" /></td>
											<td><input type="text" name="abbreviations" class="inp" /></td>
											<td colspan="2"><input type="text" name="brands" class="inp" /></td>
											<td colspan="2"><input type="text" name="maxTransports" class="inp dig_point" /></td>
											<td>
												<input type="text" name="mateClasses"  id="mateClasses" class="materialTypeName" onclick="openTreeDialog(this)" readonly="true" style=";width:152px;float:left;">
													<ul class="opt_bt"><li><input type="button" onclick="openTreeDialog(this)" value="选择" class="select" id="mateClasses_select_bt"></li></ul>
											</td>
											<td><input type="text" name="supFactory" class="inp sup_factory" /></td>
											<td><input type="text" name="supplierRemarks" class="inp" /></td>
											<td><a href="javascript:;"><i style="margin-left:9px;" class="glyphicon glyphicon-trash" onclick="removeTr(this)"></i></a></td>
										</tr>
									</#if>
									<tbody id="addTab" class="del"></tbody>
									<tr><td class="sub_title" colspan="13"></td></tr>
									<tr>
										<td colSpan="13" align="center" class="buttons">
											<p class="p_buttons">
												<@lc.button type="button" cssClass="btn-success" iconClass="glyphicon-ok" actionClass="${baseAction.class.name}" method="doSave" value="保存" onclick="checkSameRecord()"/>
												<button class="btn btn-danger btn-sm" type="reset">
												<i class="glyphicon glyphicon-retweet"></i>重置</button><#t/>
												<@lc.button type="if" actionUri="/biz/material/materDataForm!doList.action"><button class="btn btn-warning btn-sm ret_btn" type="button"><i class="glyphicon glyphicon-repeat"></i> 返回</button><#t/></@lc.button>
											</p>
										</td>
									</tr>
								</table>
								<#--<div class="showCodes">
									<@s.textarea label="物料编码" name="batchCodes" onchange="load_data(this)"/>
								</div>-->
		                    </div>
		                </div>
		            </div>
		        </div>
		    </div>
		</form>
	</body>
</html>

上一篇文章      下一篇文章      查看所有文章
2016-03-29 22:59:18  
360图书馆 论文大全 母婴/育儿 软件开发资料 网页快照 文字转语音 购物精选 软件 美食菜谱 新闻中心 电影下载 小游戏 Chinese Culture
生肖星座解梦 人民的名义 人民的名义在线看 三沣玩客 拍拍 视频 开发 Android开发 站长 古典小说 网文精选 搜图网 天下美图
中国文化英文 多播视频 装修知识库
2017-4-30 15:07:05
多播视频美女直播
↓电视,电影,美女直播,迅雷资源↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  软件世界网 --