<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
<title>编辑</title>
<%@ include file="/include/header.jsp"%>
<link type="text/css" rel="stylesheet" href="${ctx}/css/baseFrame.css" />
<style>
	.page a {
		color: #333;
	}
	input.page_input{
		border:1px solid #ddd;
	}
</style>
</head>
<body >
	<div>
		<div class="b_box" style="max-height:550px;overflow:auto;">
			<form id="sysRoleForm" action="post">
				<table class="c_table m_t10">
					<tr>
						<td class="t_tit">CodeNo</td>
						<td class="inputCon"><input type="text" id="CodeNo" disabled="disabled" name="CodeNo" data-key="CodeNo" value="${CodeNo}"/></td>
					</tr>
					<tr>
						<td class="t_tit">ItemNo</td>
						<td class="inputCon"><input type="text" id="ItemNo" disabled="disabled" name="ItemNo" data-key="ItemNo" value="${ItemNo}"/></td>
					</tr>
					<tr>
						<td class="t_tit">ItemName</td>
						<td class="inputCon"><input type="text" id="ItemName" name="ItemName"  data-key="ItemName" value="${ItemName}"/></td>
					</tr>
					<tr>
						<td class="t_tit">Itemaval</td>
						<td class="inputCon"><input type="text" id="Itemaval" name="Itemaval" data-key="Itemaval" value="${Itemaval}"/></td>
					</tr>
					<tr>
						<td class="t_tit">SortNo</td>
						<td class="inputCon"><input type="text" id="SortNo" name="SortNo" data-key="SortNo" value="${SortNo}"/></td>
					</tr>
					<tr>
						<td class="t_tit">IsInUse</td>
						<td class="inputCon"><input type="text" id="IsInUse" name="IsInUse" data-key="IsInUse" value="${IsInUse}"/></td>
					</tr>
					<tr>
						<td class="t_tit">ItemDescribe</td>
						<td class="inputCon"><input type="text" id="ItemDescribe" name="ItemDescribe"   data-key="ItemDescribe" value="${ItemDescribe}"/></td>
					</tr>
					<tr>
						<td class="t_tit">ItemAttribute</td>
						<td class="inputCon"><input type="text" id="ItemAttribute" name="ItemAttribute" data-key="ItemAttribute"  value="${ItemAttribute}"/></td>
					</tr>
					<tr>
						<td class="t_tit">Attribute1</td>
						<td class="inputCon"><input type="Attribute1"  name="Attribute1" data-key="Attribute1" value="${Attribute1}"/></td>
					</tr>
					<tr>
						<td class="t_tit">Attribute2</td>
						<td class="inputCon"><input type="Attribute2" name="Attribute2" data-key="Attribute2" value="${Attribute2}"/></td>
					</tr>
					<tr>
						<td class="t_tit">Attribute3</td>
						<td class="inputCon"><input type="Attribute3"  name="Attribute3" data-key="Attribute3"  value="${Attribute3}"/></td>
					</tr>
					<tr>
						<td class="t_tit">Attribute4</td>
						<td class="inputCon"><input type="Attribute4"  name="Attribute4" data-key="Attribute4" value="${Attribute4}"/></td>
					</tr>
					<tr>
						<td class="t_tit">Attribute5</td>
						<td class="inputCon"><input type="Attribute5"  name="Attribute5" data-key="Attribute5" value="${Attribute5}"/></td>
					</tr>
					<tr>
						<td class="t_tit">Attribute6</td>
						<td class="inputCon"><input type="Attribute6"  name="Attribute6" data-key="Attribute6" value="${Attribute6}"/></td>
					</tr>
					<tr>
						<td class="t_tit">Attribute7</td>
						<td class="inputCon"><input type="Attribute7"  name="Attribute7" data-key="Attribute7" value="${Attribute7}"/></td>
					</tr>
					<tr>
						<td class="t_tit">Attribute8</td>
						<td class="inputCon"><input type="Attribute8"  name="Attribute8" data-key="Attribute8" value="${Attribute8}"/></td>
					</tr>
					<tr>
						<td class="t_tit">InputUser</td>
						<td class="inputCon"><input type="InputUser" name="InputUser" data-key="InputUser" value="${InputUser}"/></td>
					</tr>
					<tr>
						<td class="t_tit">InputTime</td>
						<td class="inputCon"><input type="InputTime"  name="InputTime" data-key="InputTime" value="${InputTime}"/></td>
					</tr>
					<tr>
						<td class="t_tit">InputOrg</td>
						<td class="inputCon"><input type="InputOrg" id="InputOrg" name="InputOrg" data-key="InputOrg" value="${InputOrg}"/></td>
					</tr>
					<tr>
						<td class="t_tit">UpdateTime</td>
						<td class="inputCon"><input type="UpdateTime" id="UpdateTime" name="UpdateTime" data-key="UpdateTime" value="${UpdateTime}"/></td>
					</tr>
					<tr>
						<td class="t_tit">UpdateUser</td>
						<td class="inputCon"><input type="UpdateUser" id="UpdateUser" name="UpdateUser" data-key="UpdateUser" value="${UpdateUser}"/></td>
					</tr>
					<tr>
						<td class="t_tit">Remark</td>
						<td class="inputCon"><input type="Remark" id="Remark" name="Remark" data-key="Remark" value="${Remark}"/></td>
					</tr>
					<tr>
						<td class="t_tit">HelpText</td>
						<td class="inputCon"><input type="HelpText" id="HelpText" name="HelpText" data-key="HelpText" value="${HelpText}"/></td>
					</tr>
				</table>			
			</form>
		</div>
		<div class="action_box m_t10 t_c">
			<input type="button" class="b_btn" id="editBtn" value="保存" />
		</div>
	</div>

	<script type="text/javascript">
	// 验证
	seajs.use(["component/validate", "component/tip"], function(validate, tip) {
		var ntip = function() {
			// 定义一个提示对象
			return new tip({});
		};

		// 定义一个验证对象
		var d = new validate({
			con: "#adminRankForm",
			// 验证容器
			ntip: ntip,
			onSubmit: "#editBtn" // 提交按钮
		});

		// 设置拼装规则: 这里加上各个验证规则
		//d.setValidateRule({ ItemName: ["isBlank", "checkLen"] });
		d.setValidateRule({ Itemaval: ["isBlank", "checkLen"] });
		
		// 注册保存按钮事件
		d.bind("onsubmit", function() {
			if (confirm('确定修改？')) {
				// 序列化表单参数
				var re={};
				$(".inputCon input").each(function(){
					var key2=$(this).data("key")+'';
					re[key2] = $(this).val();
				});
				$.post("${ctx}/outService/update.do", {re:JSON.stringify(re)}, function(result) {
					if ("succ" == result.isSucc) {
						alert("操作成功");
						// 刷新列表页面
						parent.location.replace("${ctx}/sysPara/codeLibrary.do?ts=" + new Date().getTime()); //如果发表成功则跳到列表界面 
						// 关闭弹窗窗口
						parent.sysRoleDialog.close();
					} else if ("notThroughSecurityCheck" == result["isThroughSecurityCheck"]) { // 如果不通过安全检查
						var mess = result["mess"];
						$.post("${ctx}/common/notThroughSecurityCheck.do?ts=" + new Date().getTime(), mess, function(res) {
							alert(res);
						}, "json");

					} else {
						alert("系统错误");
					}
				},
				"json");
			}
	
		});
	});
	</script>
</body>
</html>