<%@ 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>
<s:include value="../common/head.jsp" />
<link href="../resources/style/base.css" rel="stylesheet" type="text/css"/>
<style>
.list_data_2 td{
	padding:2px 5px;
	border-bottom:#CCCCCC 1px solid;
	border-right:#CCCCCC 1px solid;
	border-left:#F6F6F6 1px solid;
	border-top:#F6F6F6 1px solid;
	font-size:13px;
	background-color:#EBEBEB;
	color:#666;
}
</style>
<script language="javascript" src="../resources/js/calendar/calendar.js"></script>
<script language="javascript" src="../code/vm/ExtCodeJs.htm"></script>
</head>

<body>
<s:include value="../common/body.jsp" />
<script language="javascript">
$(function(){
	changeCheckbox();
});

function changeCheckbox(){
	var $cks=$("input[type='checkbox']");
	for(var i=0;i<$cks.length;i++){
		var ck=$cks.get(i);
		$("#accountItem_"+ck.value).attr("disabled",!ck.checked);
		$("#accountItem_"+ck.value).attr("class",ck.checked?"css_input":"css_input_disabled");
		$("#kind_tr_"+ck.value).attr("class",ck.checked?"list_data":"list_data_2");
	}
}
</script>
<s:form action="salaryInsurPayOperate" namespace="/salary"  onsubmit="return checkForm(this)">

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr class="form_tr">
      <td align="right"><span class="required">•</span>员工：</td>
      <td valign="top">
      	<s:textfield name="insurPay.emplInfo.name" readonly="true" onClick="codeTable('emplInfoTable',gi('addMid'),this)" id="addMname" cssStyle="width:145px;" cssClass="find_input" title="员工 为必填项。"/><s:hidden name="insurPay.emplInfo.id" id="addMid" />      </td>
    </tr>
    <tr class="form_tr">
      <td align="right"><span class="required">•</span>社保月份：</td>
      <td valign="top">
      <s:textfield title="开始月份 为必填项。" name="insurPay.insurMonth" readonly="true" onClick="showCalendar('yyyyMM',this)" cssClass="date_input" cssStyle="width:60px;"/>
      至
      <s:textfield name="insurPay.insurMonthEnd" readonly="true" onClick="showCalendar('yyyyMM',this)" cssClass="date_input" cssStyle="width:60px;"/>
      <span class="info">结束月份可以为空。</span>      </td>
    </tr>
    <tr class="form_tr">
      <td align="right"><span class="required">•</span>缴纳月份：</td>
      <td valign="top"><s:textfield title="缴纳月份 为必填项。" name="insurPay.payMonth" readonly="true" onClick="showCalendar('yyyyMM',this)" cssClass="date_input" cssStyle="width:60px;"/>
      <span class="info">数据将合并到“缴纳月份”的工资条中。</span>      </td>
    </tr>
	<tbody id="yearBody" style="display:none;">
    </tbody>
    <tr class="form_tr">
      <td align="right">社保基数：</td>
      <td valign="middle">
        <table width="300" border="0" cellpadding="0" cellspacing="0" class="table_line">
        <s:iterator value="insurBaseList" status="st">
          <tr class="list_data" id="kind_tr_<s:property value='id'/>">
            <td width="32" class="center">
              <s:if test="insurPay.getPayBase(id)!=null">
                <input type="checkbox" onclick="changeCheckbox()" value="<s:property value='id'/>" checked="checked" />
                </s:if>
              <s:else>
                <input type="checkbox" onclick="changeCheckbox()" value="<s:property value='id'/>" />
                </s:else>              </td>
            <td width="170"><s:property value="name"/>：</td>
            <td width="98">
            	<s:textfield id="accountItem_%{id}" title="“%{name}” 为必填项。" 
                	name="insurBaseMap['%{id}']" value="%{insurPay.getPayBase(id).insurBase}" cssStyle="width:100px;"/>            </td>
          </tr>
        </s:iterator>
        </table>      </td>
    </tr>
	    <tr class="form_tr">
      <td align="right">&nbsp;</td>
      <td align="left" style="padding:20px 0 0 0;">
	  <strong>注意：</strong>社保个人和社保单位应填写补缴总计金额。	  </td>
    </tr>
    <tr class="form_tr">
      <td align="right">
	  社保个人：	  </td>
      <td valign="middle">
       <table width="300" border="0" cellpadding="0" cellspacing="0" class="table_line">
        <s:iterator value="insurEmplList" status="st">
          <tr class="list_data" id="kind_tr_<s:property value='id'/>">
            <td width="32" class="center">
              <s:if test="insurPay.getPayDet(id)!=null">
                <input type="checkbox" onclick="changeCheckbox()" value="<s:property value='id'/>" checked="checked" />
                </s:if>
              <s:else>
                <input type="checkbox" onclick="changeCheckbox()" value="<s:property value='id'/>" />
                </s:else>              </td>
            <td width="170"><s:property value="name"/>：</td>
            <td width="98">
            	<s:textfield id="accountItem_%{id}" title="“%{name}” 为必填项。" 
                	name="insurEmplMap['%{id}']" value="%{insurPay.getPayDet(id).payValue}" cssStyle="width:100px;"/>            </td>
          </tr>
        </s:iterator>
        </table>      </td>
    </tr>
    <tr class="form_tr">
      <td align="right">社保单位：</td>
      <td valign="middle">
        <table width="300" border="0" cellpadding="0" cellspacing="0" class="table_line">
        <s:iterator value="insurCompList" status="st">
          <tr class="list_data" id="kind_tr_<s:property value='id'/>">
            <td width="32" class="center">
              <s:if test="insurPay.getPayDet(id)!=null">
                <input type="checkbox" onclick="changeCheckbox()" value="<s:property value='id'/>" checked="checked" />
                </s:if>
              <s:else>
                <input type="checkbox" onclick="changeCheckbox()" value="<s:property value='id'/>" />
                </s:else>              </td>
            <td width="170"><s:property value="name"/>：</td>
            <td width="98">
            	<s:textfield id="accountItem_%{id}" title="“%{name}” 为必填项。" 
                	name="insurCompMap['%{id}']" value="%{insurPay.getPayDet(id).payValue}" cssStyle="width:100px;"/>            </td>
          </tr>
        </s:iterator>
        </table>      </td>
    </tr>
    <tr class="form_tr">
      <td align="right">备注：</td>
      <td valign="middle"><s:textarea name="insurPay.descr" cssStyle="width:300px;height:35px;"/> </td>
    </tr>
    <tr class="form_tr">
      <td width="29%" align="right">&nbsp;</td>
      <td width="71%" height="50" valign="middle">
        <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="insurPay.id"/>
        <s:hidden name="oper"/>        </td>
    </tr>
  </table>
    
</s:form>
</body>
</html>