<%@ 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='salaryConfOperate'/>?init=true&oper=planAdd",550,550,"添加调薪计划",refreshWindow);
}

function typeEdit(){
	if(getCheckedCount("sid")!=1){
		msgAlert("请选择一条您要修改的调薪计划。");
		return;
	}
	var confId=getConfId();
	if(confId==""){
		msgAlert("您选择的员工当前不存在调薪计划，不能进行修改操作。");
		return;
	}	
	iframeWindow("<s:url action='salaryConfOperate'/>?oper=planEdit&salaryConf.id="+confId,550,550,"修改调薪计划",refreshWindow);
}

function typeDel(){
	if(getCheckedCount("sid")!=1){
		msgAlert("请选择一条您要删除的调薪计划。");
		return;
	}
	var confId=getConfId();
	if(confId==""){
		msgAlert("您选择的员工当前不存在调薪计划，无需删除。");
		return;
	}
	msgConfirm("您确认要删除该调薪计划吗？",function(){
		iframeWindow("<s:url action='salaryConfOperate'/>?oper=planDelete&salaryConf.id="+confId,400,200,"删除调薪计划",refreshWindow);
	});
}

function getConfId(){
	return 	gi("conf_id_"+getCheckedValue("sid")).value;
}

</script>
</head>

<body>
<div class="body_list">
  <s:include value="../common/body.jsp" />
  <s:form action="salaryConfPlanList" 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="5">查询条件</td>
      </tr>
      <tr class="form_item">
        <td width="21%">工号：
          <s:textfield name="salaryConf.emplInfo.emplNo" title="工号必须为数字。"  cssStyle="width:100px;"/></td>
        <td width="21%" align="left">部门：
          <s:textfield name="salaryConf.emplInfo.emplOrg.name" readonly="true" onClick="codeTree('emplOrgTree',gi('eimpOrgId'),this)" cssStyle="width:100px;" cssClass="find_input"/>
          <s:hidden name="salaryConf.emplInfo.emplOrg.id" id="eimpOrgId"/></td>
        <td width="26%" align="left">薪资级别：<s:select cssStyle="width:120px;" name="salaryConf.salaryLevel.id"  list='salaryLevelList' headerKey="" headerValue="" listKey="id" listValue="name"/></td>
        <td width="32%">生效月份：
          <s:textfield name="salaryConf.beginMonth" readonly="true" onClick="showDate(this)" cssClass="date_input" cssStyle="width:85px;"/>
          至
          <s:textfield name="salaryConf.endMonth" readonly="true" onClick="showDate(this)" cssClass="date_input" cssStyle="width:85px;"/>
        
        </td>
      </tr>
      <tr class="form_item1">
        <td>姓名：
          <s:textfield name="salaryConf.emplInfo.name" cssStyle="width:100px;"/></td>
        <td align="left">状态：
        <s:select cssStyle="width:100px;" name="salaryConf.adjustStatus.id" list='#request.SysCodeFinder.find("SALARY_CONF_PLAN_STATUS")' headerKey="" headerValue="" listKey="id" listValue="codeName"/>
        </td>
        <td align="left">薪资帐套：<s:select cssStyle="width:120px;" name="salaryConf.salaryAccount.id"  list='salaryAccountList'   headerKey="" headerValue="" listKey="id" listValue="name"/></td>
        <td><div class="query_bnt"><input name="q" value="查 询" onclick="query()" type="button" /></div></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,'sid')" value="checkbox" /></td>
        <td width="6%">工号</td>
        <td width="6%">姓名</td>
        <td width="16%">部门</td>
        <td width="13%">原有薪资级别<br />
        新的薪资级别</td>
        <td width="12%">原有薪资帐套<br />
        新的薪资帐套</td>
        <td width="15%">原有薪资配置</td>
        <td width="14%">新的薪资配置</td>
        <td width="8%">生效月份</td>
        <td width="7%">状态</td>
      </tr>
      <s:iterator value="confList" 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='emplInfo.id'/>" lang="sid"/></td>
          <td class="center"><s:property value="emplInfo.emplNo"/></td>
          <td class="center" id="name_<s:property value='emplInfo.id'/>"><s:property value="emplInfo.name"/></td>
          <td><s:property value="emplInfo.emplOrg.fullName"/></td>
          <td class="center"><s:property value="origSalaryConf.salaryLevel.name"/><br />
			<s:property value="salaryLevel.name"/><input id="conf_id_<s:property value='emplInfo.id'/>" type="hidden" value="<s:property value='id'/>" /></td>
          <td class="center"><s:property value="origSalaryConf.salaryAccount.name"/><br/>
			<s:property value="salaryAccount.name"/></td>
          <td><s:iterator value="origSalaryConf.detSet">
          	  <div style="padding:1px 3px;">
              <s:property value="accountItem.name"/>：<s:property value="confValue"/>
              </div>
              </s:iterator></td>
          <td><s:iterator value="detSet">
          	  <div style="padding:1px 3px;">
              <s:property value="accountItem.name"/>：<s:property value="confValue"/>
              </div>
              </s:iterator></td>
          <td class="center"><s:property value="beginMonth"/></td>
          <td class="center"><s:property value="adjustStatus.codeName"/></td>
        </tr>
      </s:iterator>
    </table>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="list_page">
      <tr>
         <td style="text-align:left;"><span class="info">调薪计划将在下次生成“生效月份”的工资条时生效。</span></td>
		<td><cm:pager/></td>
      </tr>
    </table>
  </s:form>
</div>
</body>
</html>