<%@ 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 language="javascript" src="../code/vm/ExtCodeJs.htm"></script>
<script language="javascript" src="../resources/js/calendar/calendar.js"></script>
<script type="text/javascript">
function typeInit(){
  	iframeWindow("<s:url action='attYearHolidayInit'/>",450,300,"年额度假期初始化",refreshWindow);
}

function typeEdit(){
	if(getCheckedCount("sid")!=1){
		msgAlert("请选择一条您要修改的记录。");
		return;
	}
	iframeWindow("<s:url action='attYearHolidayEdit'/>?yearHoliday.id="+getCheckedValue("sid"),500,450,"修改年额度假期",refreshWindow);
}

function typeConfirm(){
	if(getCheckedCount("sid")<1){
		msgAlert("请至少选择一条您要审核的记录。");
		return;
	}
	msgConfirm("您确认要将选择的 "+getCheckedCount("sid")+" 条记录标记为已审核状态吗？",function(){
		iframeWindow("<s:url action='attYearHolidayConfirm'/>?ids="+getCheckedValues("sid"),400,200,"审核年额度假期",refreshWindow);
	});
}
</script>
</head>

<body>
<div class="body_list">
  <s:include value="../common/body.jsp" />
  <s:form action="attYearHolidayList" id="queryForm" onsubmit="return checkForm(this)">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line">
      <tr class="form_title">
        <td colspan="6">查询条件</td>
      </tr>
      <tr class="form_item">
        <td>工号：
          <s:textfield name="yearHoliday.emplInfo.emplNo" title="工号必须为数字。"  cssStyle="width:100px;"/></td>
        <td>部门：
          <s:textfield name="yearHoliday.emplInfo.emplOrg.name" readonly="true" onClick="codeTree('emplOrgTree',gi('eimpOrgId'),this)" cssStyle="width:123px;" cssClass="find_input"/>
          <s:hidden name="yearHoliday.emplInfo.emplOrg.id" id="eimpOrgId"/></td>
        <td>假期类型：
          <s:select cssStyle="width:100px;" name="yearHoliday.leaveType.id"  list='leaveTypeList' headerKey="" headerValue="" listKey="id" listValue="name"/></td>
        <td colspan="2">有效日期：
          <s:textfield name="dateBegin" readonly="true" onClick="showDate(this)" cssClass="date_input" cssStyle="width:85px;">
            <s:param name="value">
              <s:date name="dateBegin" format="yyyy-MM-dd"/>
            </s:param>
          </s:textfield>
          至
			<s:textfield name="dateEnd" readonly="true" onClick="showDate(this)" cssClass="date_input" cssStyle="width:85px;">
            <s:param name="value">
              <s:date name="dateEnd" format="yyyy-MM-dd"/>
            </s:param>
          </s:textfield>
          </td>
      </tr>
      <tr class="form_item1">
        <td width="19%">姓名：
          <s:textfield name="yearHoliday.emplInfo.name" cssStyle="width:100px;"/></td>
        <td width="22%">年份：
          <s:textfield name="yearBegin" readonly="true" onClick="showCalendar('yyyy',this)" cssClass="date_input" cssStyle="width:50px;"/>
          至
          <s:textfield name="yearEnd" readonly="true" onClick="showCalendar('yyyy',this)" cssClass="date_input" cssStyle="width:50px;"/></td>
        <td width="22%"> 是否审核：
          <s:select cssStyle="width:100px;" name="yearHoliday.status.id"  list='#request.SysCodeFinder.find("YES_NO")'  headerKey="" headerValue="" listKey="id" listValue="codeName"/></td>
        <td width="28%">额度剩余：
          <s:textfield name="yearHoliday.usedNum" cssStyle="width:30px;"/>
          至
          <s:textfield name="yearHoliday.freezeNum" cssStyle="width:30px;"/> 小时</td>
        <td width="9%"><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="typeInit()" value="初始化"/>
          <input type="button" name="edit" onclick="typeEdit()" value="修 改"/>
          <input type="button" name="free" onclick="typeConfirm()" 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="checkbox" name="array" onclick="checkedAll(this)" value="checkbox" /></td>
        <td width="5%">年份</td>
        <td width="8%">工号</td>
        <td width="6%">姓名</td>
        <td width="20%">部门</td>
        <td width="9%">假期类型</td>
        <td width="14%">额度总数</td>
        <td width="9%">额度已用</td>
        <td width="9%">额度待审</td>
        <td width="8%">有效日期</td>
        <td width="9%">是否已审核</td>
      </tr>
      <s:iterator value="yearHolidayList" 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'/>">
          <td align="center"><input type="checkbox" name="array" value="<s:property value='id'/>" lang="sid"/></td>
          <td class="center"><s:property value="attYear"/></td>
          <td class="center"><s:property value="emplInfo.emplNo"/></td>
          <td class="center"><s:property value="emplInfo.name"/></td>
          <td><s:property value="emplInfo.emplOrg.fullName"/></td>
          <td class="center"><s:property value="leaveType.name"/></td>
          <td class="center"><s:property value="totalNum"/> 小时 （<s:property value="totalDays"/>天）</td>
          <td class="center"><s:property value="usedNum"/> 小时 </td>
          <td class="center"><s:property value="freezeNum"/> 小时 </td>
          <td class="center"><s:date name="endDate" format="yyyy-MM-dd"/></td>
          <td class="center"><s:property value="status.codeName"/></td>
        </tr>
      </s:iterator>
    </table>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="list_page">
      <tr>
        <td style="text-align:left;">
        	<span class="info">提示：已审核状态为 <strong>“是” </strong>的记录，员工才可以请假。</span>
        </td>
        <td><cm:pager/></td>
      </tr>
    </table>
  </s:form>
</div>
</body>
</html>