<%@ 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 type="text/javascript">
function refreshWindow(){
	location.reload();
}

function addLeave(){
	iframeWindow("<s:url namespace='/employe' action='emplLeaveOperate'/>?oper=add&leave.emplInfo.id=<s:property value='emplInfo.id'/>",550,500,"添加离职/复职记录",refreshWindow);
}

function editLeave(id){
	iframeWindow("<s:url namespace='/employe' action='emplLeaveOperate'/>?oper=edit&leave.id="+id,550,500,"修改离职/复职记录",refreshWindow);
}

function deleteLeave(id,typeName){
	msgConfirm("您确认要删除该 “"+typeName+"” 记录吗？ 删除后该员工将处于 “"+(typeName=="离职"?"在职":"离职")+"” 状态。",function(){
	iframeWindow("<s:url namespace='/employe' action='emplLeaveDelete'/>?leave.id="+id,400,200,'删除'+typeName+'记录',refreshWindow);
	});
}

function addTransfer(){
	iframeWindow("<s:url namespace='/employe' action='emplTransferOperate'/>?oper=add&transfer.emplInfo.id=<s:property value='emplInfo.id'/>",550,550,"添加调动记录",refreshWindow);
}

function editTransfer(id){
	iframeWindow("<s:url namespace='/employe' action='emplTransferOperate'/>?oper=edit&transfer.id="+id,550,550,"修改调动记录",refreshWindow);
}

function deleteTransfer(id){
	msgConfirm("您确认要删除该调动记录吗？ 删除后该员工将恢复到以前的部门和职位。",function(){
	iframeWindow("<s:url namespace='/employe' action='emplTransferDelete'/>?transfer.id="+id,400,200,'删除调动记录',refreshWindow);
	});
}

function addContract(){
	iframeWindow("<s:url namespace='/employe' action='emplContractOperate'/>?oper=add&contract.emplInfo.id=<s:property value='emplInfo.id'/>",550,550,"添加人事合同",refreshWindow);
}

function editContract(id){
	iframeWindow("<s:url namespace='/employe' action='emplContractOperate'/>?oper=edit&contract.id="+id,550,550,"修改人事合同",refreshWindow);
}

function deleteContract(id){
	msgConfirm("您确认要删除该人事合同记录吗？",function(){
	iframeWindow("<s:url namespace='/employe' action='emplContractDelete'/>?contract.id="+id,400,200,'删除人事合同',refreshWindow);
	});
}

function addReward(){
	iframeWindow("<s:url namespace='/employe' action='emplRewardOperate'/>?oper=add&reward.emplInfo.id=<s:property value='emplInfo.id'/>",550,550,"添加奖惩记录",refreshWindow);
}

function editReward(id){
	iframeWindow("<s:url namespace='/employe' action='emplRewardOperate'/>?oper=edit&reward.id="+id,550,550,"修改奖惩记录",refreshWindow);
}

function deleteReward(id){
	msgConfirm("您确认要删除该奖惩记录吗？",function(){
	iframeWindow("<s:url namespace='/employe' action='emplRewardDelete'/>?reward.id="+id,400,200,'删除奖惩记录',refreshWindow);
	});
}


</script>
</head>

<body style="background-color:#FFF;">
<div class="body_list">
  <s:include value="../common/body.jsp" />
  
  <s:form action="emplInfoExtconfList" id="queryForm" namespace="/employe">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line">
      <tr>
        <td colspan="8" class="big_title"><div style="float:left;padding-top:2px;">人事合同</div>
          <div class="sub_add" title="添加人事合同" onclick="addContract()">添加</div></td>
      </tr>
      <s:if test="contractList!=null && contractList.size()>0">
        <tr class="sub_list_title center">
          <td width="8%">开始日期</td>
          <td width="9%">结束日期</td>
          <td width="13%">合同编号</td>
          <td width="11%">合同类型</td>
          <td width="12%">合同状态</td>
          <td width="38%">备注</td>
          <td width="9%">操作</td>
        </tr>
        <s:iterator value="contractList" 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><s:date name="beginDate" format="yyyy-MM-dd" /></td>
            <td><s:date name="endDate" format="yyyy-MM-dd" /></td>
            <td><s:property value="contractNo"/></td>
            <td><s:property value="contractType.codeName"/></td>
            <td><s:property value="status.codeName"/></td>
            <td><s:property value="descr"/></td>
            <td class="center">
            <s:if test="attach!=null&&attach.id!=null&&attach.id!=''">
            	<a title="<s:property value='attach.name'/>" href="<s:url namespace='/system' action='sysFileItemGet'/>?id=<s:property value='attach.id'/>" target="_blank"><img src="../resources/style/images/attach.gif" border="0" width="16" height="16" /></a>
                &nbsp;
            </s:if>
            <s:if test="#st.index==contractList.size()-1">
           		<img src="../resources/style/images/delete.gif" width="16" height="16" alt="删除" 
                	onclick="deleteContract(<s:property value='id'/>)" class="pointer" /> 
                	&nbsp; 
                <img src="../resources/style/images/edit.gif" width="16" height="16" alt="修改" 
                	class="pointer" onclick="editContract(<s:property value='id'/>)"/>
            </s:if>
            </td>
          </tr>
        </s:iterator>
      </s:if>
    </table>
  </s:form>
  
  <s:form action="emplInfoExtconfList" id="queryForm" namespace="/employe">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line" style="margin-top:15px;">
      <tr>
        <td colspan="8" class="big_title"><div style="float:left;padding-top:2px;">调动记录</div>
          <div class="sub_add" title="添加调动记录" onclick="addTransfer()">添加</div></td>
      </tr>
      <s:if test="transferList!=null && transferList.size()>0">
        <tr class="sub_list_title center">
          <td width="7%">调动日期</td>
          <td width="8%">调动类型</td>
          <td width="10%">原部门</td>
          <td width="10%">原职位</td>
          <td width="12%">新部门</td>
          <td width="10%">新职位</td>
          <td width="34%">调动原因</td>
          <td width="9%">操作</td>
        </tr>
        <s:iterator value="transferList" 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 class="center"><s:date name="transDate" format="yyyy-MM-dd" /></td>
            <td class="center"><s:property value="transType.codeName"/></td>
            <td class="center"><s:property value="oldOrg.name"/></td>
            <td class="center"><s:property value="oldJob.codeName"/></td>
            <td class="center"><s:property value="newOrg.name"/></td>
            <td class="center"><s:property value="newJob.codeName"/></td>
            <td><s:property value="transReason"/></td>
            <td class="center">
            <s:if test="#st.index==transferList.size()-1">
            	<img src="../resources/style/images/delete.gif" width="16" height="16" alt="删除" 
            		onclick="deleteTransfer(<s:property value='id'/>)" class="pointer" />
                    &nbsp; 
            	<img src="../resources/style/images/edit.gif" width="16" height="16" alt="修改" 
                	class="pointer" onclick="editTransfer(<s:property value='id'/>)"/>
             </s:if>
            </td>
          </tr>
        </s:iterator>
      </s:if>
    </table>
  </s:form>
  
 <s:form action="emplInfoExtconfList" id="queryForm" namespace="/employe">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line" style="margin-top:15px;">
      <tr>
        <td colspan="5" class="big_title"><div style="float:left;padding-top:2px;">奖惩记录</div>
          <div class="sub_add" title="添加奖惩记录" onclick="addReward()">添加</div></td>
      </tr>
      <s:if test="rewardList!=null && rewardList.size()>0">
        <tr class="sub_list_title center">
          <td width="12%">奖惩日期</td>
          <td width="9%">种类</td>
          <td width="17%">奖惩形式</td>
          <td width="54%">奖惩备注</td>
          <td width="8%">操作</td>
        </tr>
        <s:iterator value="rewardList" 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 class="center"><s:date name="exeDate" format="yyyy-MM-dd" /></td>
            <td class="center"><s:property value="rewardPunish.codeName"/></td>
            <td class="center"><s:property value="exeType.codeName"/></td>
            <td><s:property value="descr"/></td>
            <td class="center">
            	<img src="../resources/style/images/delete.gif" width="16" height="16" alt="删除" 
            		onclick="deleteReward(<s:property value='id'/>)" class="pointer" />
                    &nbsp; 
            	<img src="../resources/style/images/edit.gif" width="16" height="16" alt="修改" 
                	class="pointer" onclick="editReward(<s:property value='id'/>)"/>
            </td>
          </tr>
        </s:iterator>
      </s:if>
    </table>
  </s:form>  
  
  <s:form action="emplInfoExtconfList" id="queryForm" namespace="/employe">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line" style="margin-top:15px;">
      <tr>
        <td colspan="6" class="big_title"><div style="float:left;padding-top:2px;">离职/复职记录</div>
          <div class="sub_add" title="添加离职记录" onclick="addLeave()">添加</div></td>
      </tr>
      <s:if test="leaveList!=null && leaveList.size()>0">
        <tr class="sub_list_title center">
          <td width="6%">类型</td>
          <td width="11%">离职/复职日期</td>
          <td width="12%">离职类型</td>
          <td width="10%">审批人</td>
          <td width="52%">备注</td>
          <td width="9%">操作</td>
        </tr>
        <s:iterator value="leaveList" 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 class="center"><s:property value="leaveRecover.codeName" /></td>
            <td class="center"><s:date name="leaveRecoverDate" format="yyyy-MM-dd" /></td>
            <td class="center"><s:property value="leaveType.codeName"/></td>
            <td class="center"><s:property value="approver.name" /></td>
            <td><s:property value="descr"/></td>
            <td class="center">
            <s:if test="#st.index==leaveList.size()-1">
                <img src="../resources/style/images/delete.gif" width="16" height="16" title="删除" 
                    onclick="deleteLeave(<s:property value='id'/>,'<s:property value='leaveRecover.codeName'/>')" class="pointer" /> &nbsp; 
                <img src="../resources/style/images/edit.gif" width="16" height="16" title="修改" 
                    class="pointer" onclick="editLeave(<s:property value='id'/>)"/>
            </s:if>
            </td>
          </tr>
        </s:iterator>
      </s:if>
    </table>
  </s:form>
</div>
</body>
</html>