<%@ 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 type="text/javascript">
function doAdjust(){
	msgConfirm("您确认要调整社保基数吗？",function(){
		gi("queryForm").submit();
	});
}

function avgDetail(id){
	iframeWindow("<s:url action='salaryConfInsurBaseAdjust'/>?oper=avg&beginMonth=${param.beginMonth}&endMonth=${param.endMonth}&salaryConf.emplInfo.id="+id,330,400,"平均月薪计算明细");
}
</script>
</head>

<body>
<div class="body_list">
  <s:include value="../common/body.jsp" />
  <s:form action="salaryConfInsurBaseAdjust" id="queryForm" namespace="/salary" onsubmit="return checkForm(this)" >
  	<div class="info" style="margin:10px 0;">
	<strong>提示：</strong>下表中社保基数的当前值与调整值不一致的记录以<span class="warn">红色</span>显示，请注意核对。
	</div>
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line">
      <tr class="list_title">
        <td width="8%">工号</td>
        <td width="7%">姓名</td>
        <td width="22%">部门</td>
        <td width="52%" style="padding:0;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="33%">基数名称</td>
            <td width="33%">当前值</td>
            <td width="33%">调整值</td>
          </tr>
        </table></td>
		<td width="11%">平均月薪</td>
      </tr>
      <s:iterator value="insurBaseAdjustDTOList" status="st">
        <s:set name="ttop" value="top"/>
		<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="oldConf.emplInfo.emplNo"/></td>
          <td class="center"><s:property value="oldConf.emplInfo.name"/></td>
          <td><s:property value="oldConf.emplInfo.emplOrg.fullName"/></td>
          <td valign="top" class="center" style="padding:0; ">
		  	<s:if test="oldConf.salaryAccount.staticDetSet!=null && oldConf.salaryAccount.staticDetSet.size()>0">
			<table width="100%" border="0" cellpadding="0" cellspacing="0">			
				<s:iterator value="oldConf.salaryAccount.staticDetSet" status="subSt">
				<s:if test="accountItem.isInsurBase">
					<s:set name="row_note" value=""/>
					<s:if test="oldConf.getDetByAccountItem(accountItem.id).confValue!=#ttop.getNewDetByAccountItem(accountItem.id).confValue">
					  <s:set name="row_note" value="%{'warn'}"/>
					</s:if>
				<tr class="list_data center <s:property value='#row_note'/>">
					  <td width="33%" align="center"><s:property value="accountItem.name"/></td>
					  <td width="33%" align="right" >
					   	<s:property value="%{oldConf.getDetByAccountItem(accountItem.id).confValue}"/>					  </td>
					  <td width="33%">
							<s:textfield 
							  		name="insurBaseAdjustDTOList[%{#st.index}].newDetList[%{#subSt.index}].confValue" 
							   		title="%{accountItem.name} 为必填项，且必须为合法的金额格式。" 
									value="%{#ttop.getNewDetByAccountItem(accountItem.id).confValue}" 
									cssStyle="width:100px;text-align:right;" cssClass="css_input"/>
                			<s:hidden name="insurBaseAdjustDTOList[%{#st.index}].newDetList[%{#subSt.index}].id" 
									value="%{oldConf.getDetByAccountItem(accountItem.id).id}"/>						</td>
				</tr>
				</s:if>
				</s:iterator>
			</table>
			</s:if>		  </td>
			<td align="right">
				<a href="javascript:avgDetail(<s:property value='oldConf.emplInfo.id'/>)" title="点击查看平均月薪计算明细">
          		<s:property value="salaryAvg"/>
          		</a>
			</td>
        </tr>
      </s:iterator>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
	  <tr>
		<td align="center" style="padding:10px;">
		  <input type="button" name="bnt" onclick="javascript:history.back(-1)" value="上一步" />&nbsp;
		  <input type="button" name="Submit" onclick="doAdjust()" 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 -->
		  <s:hidden name="oper" value="do" />
		</td>
	  </tr>
	</table>
	
  </s:form>
</div>
</body>
</html>