<%@ 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>
</head>

<body>
<s:include value="../common/body.jsp" />
<script language="javascript">
function changeType(){
	var isWK=$("#worktimeTypeId").val()=="<s:property value='@com.hrmex.web.constants.ConstantCode$AttWorktimeType@WORKTIME'/>";
	if(isWK){
		$("#WKBody").show();
		$("#worktimeConfID").attr("disabled",false);
	}else{
		$("#WKBody").hide();	
		$("#worktimeConfID").attr("disabled",true);
	}
}
function changeBeginDateType(){
	var isSpec=$("#isInCompDate").val()=="false";
	if(isSpec){
		$("#beginDate").show();	
		$("#beginDate").attr("disabled",false);
	}else{
		$("#beginDate").hide();	
		$("#beginDate").attr("disabled",true);
	}
}
$(function(){
	changeType();
	changeBeginDateType();
});
</script>

<s:form action="attEmplConfBatchAdd" onsubmit="return checkForm(this)">

<table width="520" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr class="form_tr">
      <td align="right"><span class="required">•</span>员工列表：</td>
      <td>
			<s:textarea name="emplNames" title="员工列表 为必填项" readonly="true" 
                    		onClick="codeTable('emplInfoTable',gi('addMid'),this,'no')" 
							id="addMname" cssClass="find_input" cssStyle="width:248px;height:50px;"/>
            <s:hidden name="emplIds" id="addMid" />			
	</td>
    </tr>
        <tr class="form_tr">
          <td align="right"><span class="required">•</span>生效日期：</td>
          <td>
          	<s:select id="isInCompDate" name="isInCompDate" headerKey="" cssStyle="width:120px;" headerValue="" onchange="changeBeginDateType()" 
				   list="#{'true':'入职日期', 'false':'指定日期'}" title="日 期 类型 为必填项"
			/>
			<s:textfield id="beginDate" name="conf.beginDate" title="生效日期 为必填项" onClick="showCalendar('yyyy-MM-dd',this)" cssClass="date_input" cssStyle="width:120px;">
      			<s:param name="value"><s:date name="conf.beginDate" format="yyyy-MM-dd"/></s:param>
      		</s:textfield>
		  </td>
        </tr>    
    <tr class="form_tr">
      <td align="right"><span class="required">•</span>考勤类型：</td>
      <td>
            <s:select cssStyle="width:248px;" id="worktimeTypeId" title="考勤类型 为必填项" onchange="changeType()" 
            	name="conf.worktimeType.id" list='#request.SysCodeFinder.find("ATT_WORKTIME_TYPE")' 
                headerKey="" headerValue="" listKey="id" listValue="codeName"/>
	  </td>
    </tr>
    <tbody id="WKBody">
    <tr class="form_tr">
      <td align="right"><span class="required">•</span>考勤班次：</td>
      <td>
      <s:select id="worktimeConfID" cssStyle="width:248px;" title="考勤班次 为必填项" name="conf.worktimeConf.id"
      	list='worktimeConfList'  headerKey="" headerValue="" listKey="id" listValue="name"/>      </td>
    </tr>
    </tbody>
    <tr class="form_tr">
      <td align="right"><span class="required">•</span>是否需要打卡：</td>
      <td>
      <s:select cssStyle="width:248px;" title="是否需要打卡 为必填项"  name="conf.isNeedSign.id"  list='#request.SysCodeFinder.find("YES_NO")'  headerKey="" headerValue="" listKey="id" listValue="codeName"/>      </td>
    </tr>    
    <tr class="form_tr">
      <td width="29%" align="right">&nbsp;</td>
      <td width="71%" valign="top">
          <input type="submit" name="button" id="button" value="添 加" />
        &nbsp; 
        <!-- back begin -->
        <input name="winID" type="hidden" value="${param.winID}" />
        <input type="button" onclick="iframeWindowClose('${param.winID}')" name="button" id="button" value="返 回" />  
        <!-- back end -->   
	  </td>
    </tr>
  </table>
    
</s:form>
</body>
</html>