<%@ 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="../resources/js/calendar/calendar.js"></script>
<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("disable","false");
	}else{
		$("#WKBody").hide();	
		$("#worktimeConfID").attr("disable","true");
	}
}
$(function(){
	changeType();
});
</script>
</head>

<body>
<s:include value="../common/body.jsp" />
<s:form action="attEmplConfOperate" namespace="/att"  onsubmit="return checkForm(this)">

<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr class="form_tr">
      <td align="right">工号：</td>
      <td valign="top">
    		<s:property value="conf.emplInfo.emplNo"/>
            <s:hidden name="conf.emplInfo.id" />
       </td>
    </tr>
    <tr class="form_tr">
      <td align="right">姓名：</td>
      <td valign="top">
        <s:property value="conf.emplInfo.name"/>
      </td>
    </tr>
    <tr class="form_tr">
      <td align="right">部门：</td>
      <td valign="top"><s:property value="conf.emplInfo.emplOrg.name"/></td>
    </tr>
        <tr class="form_tr">
          <td align="right">入职日期：</td>
          <td valign="top"><s:date name="conf.emplInfo.inCompDate" format="yyyy-MM-dd"/></td>
        </tr>
        <tr class="form_tr">
          <td align="right"><span class="required">•</span>生效日期：</td>
          <td valign="top">
          <s:textfield name="conf.beginDate" title="生效日期 为必填项" readonly="true" onClick="showCalendar('yyyy-MM-dd',this)" cssClass="date_input" cssStyle="width:150px;">
      			<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 valign="top">
            <s:select cssStyle="width:150px;" 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 valign="top">
      <s:select id="worktimeConfID" cssStyle="width:150px;" 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 valign="top">
       <s:select cssStyle="width:150px;" 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="38%" align="right">&nbsp;</td>
      <td width="62%" valign="top">
        <s:if test="oper=='edit'">
          <input type="submit" name="button" id="button" value="修 改" />
          </s:if>
        <s:if test="oper=='add'">
          <input type="submit" name="button" id="button" value="添 加" />
          </s:if>
        &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 -->
        <s:hidden name="conf.id" />
        <s:hidden name="oper" />
        </td>
    </tr>
  </table>
    
</s:form>
</body>
</html>