<%@ 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 typeAdd(){
	iframeWindow("<s:url action='salaryInsurPayOperate'/>?oper=add",550,$(parent.window).height()-10,"添加社保补缴记录",refreshWindow);
}

function isAddType(){
	var addType="<s:property value='@com.hrmex.web.constants.ConstantCode$SalaryInsurPayTimeType@ADD'/>";
	return $("#payTimeType_"+getCheckedValue("sid")).val()==addType;
}

function typeEdit(){
	if(getCheckedCount("sid")!=1){
		msgAlert("请选择一条您要修改的社保补缴记录。");
		return;
	}
	if(!isAddType()){
		msgAlert("只能对“补缴”类型的社保记录进行修改操作。");
		return;
	}
	iframeWindow("<s:url action='salaryInsurPayOperate'/>?oper=edit&insurPay.id="+getCheckedValue("sid"),
		550,$(parent.window).height()-10,"修改社保补缴记录",refreshWindow);
}
function typeDel(){
	if(getCheckedCount("sid")!=1){
		msgAlert("请选择一条您要删除社保补缴的记录。");
		return;
	}
	if(!isAddType()){
		msgAlert("只能对“补缴”类型的社保记录进行删除操作。");
		return;
	}	
	msgConfirm("您确认要删除该记录吗？",function(){
		iframeWindow("<s:url action='salaryInsurPayOperate'/>?oper=delete&insurPay.id="+getCheckedValue("sid"),
			400,200,"删除社保补缴记录",refreshWindow);
	});
}

</script>
</head>

<body>
<div class="body_list">
  <s:include value="../common/body.jsp" />
  <s:form action="salaryInsurPayList" 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="4">查询条件</td>
      </tr>
      <tr class="form_item">
        <td>工号：
          <s:textfield name="insurPay.emplInfo.emplNo" title="工号必须为数字。"  cssStyle="width:100px;"/></td>
        <td>部门：
          <s:textfield name="insurPay.emplInfo.emplOrg.name" readonly="true" onClick="codeTree('emplOrgTree',gi('eimpOrgId'),this)" cssStyle="width:100px;" cssClass="find_input"/>
          <s:hidden name="insurPay.emplInfo.emplOrg.id" id="eimpOrgId"/></td>
        <td>社保月份：
          <s:textfield name="insurPay.insurMonth" readonly="true" onClick="showCalendar('yyyyMM',this,false)" cssClass="date_input" cssStyle="width:65px;"/>
          至
          <s:textfield name="insurPay.insurMonthEnd" readonly="true" onClick="showCalendar('yyyyMM',this,false)" cssClass="date_input" cssStyle="width:65px;"/></td>
        <td>备注：
          <s:textfield name="insurPay.descr" cssStyle="width:100px;"/></td>
      </tr>
      <tr class="form_item1">
        <td width="24%">姓名：
          <s:textfield name="insurPay.emplInfo.name" cssStyle="width:100px;"/></td>
        <td width="26%">类型：
          <s:select cssStyle="width:100px;" name="insurPay.payTimeType.id" list='#request.SysCodeFinder.find("SALARY_INSUR_PAY_TIME_TYPE")' headerKey="" headerValue="" listKey="id" listValue="codeName"/></td>
        <td width="25%">缴纳月份：
          <s:textfield name="beginMonth" readonly="true" onClick="showCalendar('yyyyMM',this,false)" cssClass="date_input" cssStyle="width:65px;"/>
          至
          <s:textfield name="endMonth" readonly="true" onClick="showCalendar('yyyyMM',this,false)" cssClass="date_input" cssStyle="width:65px;"/></td>
        <td width="25%"><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="typeAdd()" value="补 缴"/>
          <input type="button" name="edit" onclick="typeEdit()" value="修 改"/>
          <input type="button" name="edit" onclick="typeDel()" 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="6%">工号</td>
        <td width="6%">姓名</td>
        <td width="15%">部门</td>
        <td width="7%">类型</td>
        <td width="13%">社保月份</td>
        <td width="8%">缴纳月份</td>
        <td width="10%">个人合计</td>
        <td width="9%">单位合计</td>
        <td width="23%">备注</td>
      </tr>
      <s:iterator value="insurPayList" 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="radio" name="array" value="<s:property value='id'/>" lang="sid"/></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="payTimeType.codeName"/>
            <input id="payTimeType_<s:property value='id'/>" type="hidden" value="<s:property value='payTimeType.id'/>" /></td>
          <td class="center"><s:property value="insurMonth"/>
            <s:if test="insurMonthEnd!=null && insurMonthEnd.length()>0 "> 至
              <s:property value="insurMonthEnd"/>
            </s:if></td>
          <td class="center"><s:property value="payMonth"/></td>
          <td class="center"><s:property value="emplTotal"/></td>
          <td class="center"><s:property value="compTotal"/></td>
          <td><s:property value="descr"/></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>