<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="cm" uri="/commons-tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系统编码管理</title>
<link href="../resources/style/base.css" rel="stylesheet" type="text/css"/>
<s:include value="../common/head.jsp" />
<script type="text/javascript">

function codeAdd(){
	iframeWindow("<s:url action='sysCodeOperate'/>?oper=add",450,300,"添加系统编码",refreshWindow);
}

function codeEdit(){
	if(getCheckedCount("sid")!=1){
		msgAlert("请选择一条您要修改的记录。");
		return;
	}
	iframeWindow("<s:url action='sysCodeOperate'/>?oper=edit&item.id="+getCheckedValue("sid"),450,300,"修改系统编码",refreshWindow);
}

function able(flag){
	var oper=flag?"启用":"停用";
	if(getCheckedCount("sid")<1){
		msgAlert("请选择您要"+oper+"的记录。");
		return;
	}
	msgConfirm("您确认要将选中的"+getCheckedCount("sid")+"条记录"+oper+"吗？",function(){
		iframeWindow("<s:url action='sysCodeOperate'/>?oper=able&ids="+getCheckedValues("sid")+"&able="+flag,450,170,
			oper+"系统编码",refreshWindow);
	});
}

</script>
</head>

<body>
<div class="body_list">
<s:include value="../common/body.jsp" />
<s:form action="sysCodeList" id="queryForm" namespace="/system">

 <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line">
    <tr class="form_title">
      <td colspan="4">查询条件</td>
    </tr>
    <tr class="form_item">
      <td width="31%">类型：
      	<s:select name="item.sysCodeKind.id" cssStyle="width:120px;"
				list='kindList' headerKey="" headerValue="" 
				listKey="id" listValue="name"/></td>
      <td width="31%">名称：
        <s:textfield name="item.codeName" cssStyle="width:120px;"/></td>
      <td width="29%">状态：
      	<s:select name="item.recordStatus" cssStyle="width:120px;"
				list='recordTypeArray' headerKey="" headerValue="" 
				listKey="code" listValue="desc"/>
      </td>
      <td width="9%" class="center"><input name="q" value="查 询" onclick="query()" type="button" /></td>
	</tr>
  </table>
  
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"  style="margin:15px 0 5px 0;" >
    <tr>
      <td>
	  	<input type="button" name="add" onclick="codeAdd()" value="添 加"/>
		<input type="button" name="edit" onclick="codeEdit()" value="修 改"/>
        <input type="button" name="edit" onclick="able(false)" value="停 用"/>
        <input type="button" name="edit" onclick="able(true)" value="启 用"/>
      </td>
    </tr>
  </table>
  
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line">
    <tr class="list_title">
      <td width="3%" align="center"><input type="radio" name="array" onclick="checkedAll(this)" value="checkbox" /></td>
      <td width="12%">排序编号</td>
      <td width="51%">名称</td>
      <td width="21%">类型</td>
      <td width="13%">状态</td>
      </tr>
    <s:iterator value="itemList" status="st">
        <s:set name="row_cls" value=""/><s:if test="#st.Even"><s:set name="row_cls" value="%{'row_a'}"/></s:if>
        <tr class="list_data <s:property value='#row_cls'/> center">
          <td align="center"><input type="radio" name="array" value="<s:property value='id'/>" lang="sid"/></td>
          <td><s:property value="orderBy"/></td>
          <td><s:property value="codeName"/></td>
          <td><s:property value="sysCodeKind.name"/></td>
          <td><s:property value="recordStatusDesc"/></td>
        </tr>
    </s:iterator>
  </table>
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="list_page">
    <tr>
      <td><cm:pager/></td>
    </tr>
  </table>

</s:form>
</div>
</body>
</html>