<%@ 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 applyRecord(){
	if(getCheckedCount("sid")!=1){
		msgAlert("请选择一条您要备案的的出差单记录。");
		return;
	}
	iframeWindow("<s:url action='attTravelApplyRecord'/>?apply.id="+getCheckedValue("sid"),400,180,"出差单备案",refreshWindow);
}

function applyConfirm(){
	if(getCheckedCount("sid")!=1){
		msgAlert("请选择一条您要核准的出差单记录。");
		return;
	}
	iframeWindow("<s:url action='attTravelApplyTerminate'/>?apply.id="+getCheckedValue("sid"),550,500,"出差单核销",refreshWindow);
}

function applyDestory(){
	if(getCheckedCount("sid")!=1){
		msgAlert("请选择一条您要作废的出差单记录。");
		return;
	}
	iframeWindow("<s:url action='attTravelApplyDestory'/>?apply.id="+getCheckedValue("sid"),550,500,"出差单作废",refreshWindow);
}

function flowDetail(nodeId){
	iframeWindow("<s:url action='attApproveFlowDetail'/>?node.id="+nodeId,550,300,"审批流程");
}
</script>
</head>

<body>
<div class="body_list">
<s:include value="../common/body.jsp" />
<s:form action="attTravelApplyHrList" 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="7">查询条件</td>
      </tr>
      <tr class="form_item">
        <td>工号：
          <s:textfield name="apply.applyEmplInfo.emplNo" title="工号必须为数字。"  cssStyle="width:100px;"/></td>
        <td>部门：
          <s:textfield name="apply.applyEmplInfo.emplOrg.name" readonly="true" onClick="codeTree('emplOrgTree',gi('eimpOrgId'),this)" cssStyle="width:100px;" cssClass="find_input"/>
          <s:hidden name="apply.applyEmplInfo.emplOrg.id" id="eimpOrgId"/></td>
        <td>出差地区：
          <s:select cssStyle="width:100px;" name="apply.travelArea.id" list='#request.SysCodeFinder.find("ATT_TRAVEL_AREA")' headerKey="" headerValue="" listKey="id" listValue="codeName"/></td>
        <td colspan="2">出差时间：
          <s:textfield name="apply.beginTime" readonly="true" onClick="showDate(this)" cssClass="date_input" cssStyle="width:85px;">
            <s:param name="value">
              <s:date name="apply.beginTime" format="yyyy-MM-dd"/>
            </s:param>
          </s:textfield>
          至
          <s:textfield name="apply.endTime" readonly="true" onClick="showDate(this)" cssClass="date_input" cssStyle="width:85px;">
            <s:param name="value">
              <s:date name="apply.endTime" format="yyyy-MM-dd"/>
            </s:param>
          </s:textfield></td>
      </tr>
      <tr class="form_item1">
        <td width="20%">姓名：
          <s:textfield name="apply.applyEmplInfo.name" cssStyle="width:100px;"/></td>
        <td width="20%">状态：
          <s:select cssStyle="width:100px;" name="apply.status.id" list='#request.SysCodeFinder.find("ATT_TRAVEL_APPLY_STATUS")' headerKey="" headerValue="" listKey="id" listValue="codeName"/></td>
        <td width="24%">出差原因：
          <s:textfield name="apply.cause" cssStyle="width:100px;"/></td>
        <td width="25%">　创建人：
          <s:textfield name="apply.createEmplInfo.name" cssStyle="width:100px;"/></td>
        <td width="11%" class="center"><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="delete" onclick="applyRecord()" value="备 案"/>
      <input type="button" name="delete" onclick="applyConfirm()" value="核 销"/>
      <input type="button" name="delete" onclick="applyDestory()" value="作 废"/>
      <input type="button" name="delete" onclick="sysOperLog()" 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="7%">工号</td>
        <td width="7%">姓名</td>
        <td width="10%">部门</td>
        <td width="16%">出差时间</td>
        <td width="8%">出差地区</td>
        <td width="22%">出差原因</td>
        <td width="8%">申请时间</td>
        <td width="7%">创建人 </td>
        <td width="12%">状态</td>
      </tr>
      <s:iterator value="applyList" 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"/><s:hidden name="log_%{id}" value="%{#request.SysOperLogID.format('ATT_TRAVEL_APPLY',id)}" /></td>
          <td class="center"><s:property value="applyEmplInfo.emplNo"/></td>
          <td class="center"><s:property value="applyEmplInfo.name"/></td>
          <td class="center"><s:property value="applyEmplInfo.emplOrg.name"/></td>
          <td class="center" title='<s:date name="beginTime" format="yyyy-MM-dd HH:mm"/>至<s:date name="endTime" format="yyyy-MM-dd HH:mm"/>'><s:date name="beginTime" format="MM-dd HH:mm"/>至<s:date name="endTime" format="MM-dd HH:mm"/>
			<br />（<s:property value="top.getTravelDays(null)"/>天）
			</td>
          <td class="center"><s:property value="travelArea.codeName"/></td>
          <td><s:property value="cause"/></td>
          <td class="center"><s:date name="createTime" format="MM-dd HH:mm"/></td>
          <td class="center"><s:property value="createEmplInfo.name"/></td>
          <td class="center" title=""><s:property value="status.codeName"/>
			<s:if test="attApproveLog!=null"> 
			 <br />
             <span style="color:#666; font-size:12px;" 
                	title="等待【<s:property value='attApproveLog.approver.name'/>】审批...">
					<a href="javascript:flowDetail('<s:property value='attApproveLog.attApproveFlowNode.id'/>');">（<s:property value='attApproveLog.approver.name'/>）</a>
			 </span>
			</s:if></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>