<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ include file="../language.jsp" %>

<script> 
var _contractNo = ${param.contractNo};

var slaDetail='<fmt:message key="title.sla.slaDetail"/>';
var fitRule='<fmt:message key="title.sla.fitRule"/>';


</script>
<script src="../scripts/itsm/sla/slaDetail.js?random=<%=new java.util.Date().getTime()%>"></script>


<div style="padding:10px" id="SLAServiceManage_loading"><img src="../images/icons/loading.gif" /></div>



<div id="SLAServiceManage_content" class="easyui-panel" border="none" fit="true" style="padding:3px;display:none">



<div id="addRuleDiv" class="easyui-panel" border="none" fit="true">

	<div class="easyui-layout" fit="true">

	<div region="north" border="false" style="overflow: hidden; border-top: #99bbe8 1px solid; border-left: #99bbe8 1px solid; border-right: #99bbe8 1px solid; height: 35px; padding: 4px; text-align: right">
	<a class="easyui-linkbutton" plain="true" icon="icon-undo" style="margin-right:15px" onClick="javascript:itsm.common.utility.tabUtility.addTab('<fmt:message key="title.security.slaContract"/>','../pages/sla/slaMain.jsp')"><fmt:message key="common.returnToList"/></a>
	</div>

	<!-- 左边规则信息 -->
	<div region="west" id="slaDetailWest" split="true" title="<fmt:message key="common.basicInfo"/>" style="width:320px;">


	<input type="hidden" name="rule.rulePackage.rulePackageNo" value="${slaContractDTO.rulePackageNo}" /> 

	<div class="lineTableBgDiv">
		<table style="width:100%" class="lineTable" cellspacing="1">

			<tr>
				<td style="width: 30%" height="32"><fmt:message key="label.sla.contractName"/></td>
				<td style="width: 70%">${slaContractDTO.contractName}</td>
			</tr>

			<tr>
				<td height="32"><fmt:message key="label.sla.slaStartTime"/></td>
				<td><fmt:formatDate type="date" value="${slaContractDTO.beginTime}"  pattern="yyyy-MM-dd HH:mm:ss" /></td>
			</tr>

			<tr>
				<td height="32"><fmt:message key="label.sla.slaEndTime"/></td>
				<td><fmt:formatDate type="date" value="${slaContractDTO.endTime}"  pattern="yyyy-MM-dd HH:mm:ss" /></td>
			</tr>
	
			<tr>
				<td height="32"><fmt:message key="label.sla.ownerOrg"/></td>
				<td>${slaContractDTO.serviceOrgName}</td>
			</tr>

			<tr>
				<td height="32"><fmt:message key="label.sla.slaServiceAgreement"/></td>
				<td>${slaContractDTO.agreement}</td>
			</tr>

		</table>
	</div>
	</div>

	<!-- 扩展信息 start -->
	<div region="center" style="background: #eee;" id="slaDetailTab">

	<div class="easyui-tabs" fit="true" id="slaDetailMainTab" border="false">



	<div title="<fmt:message key="title.sla.expecteCompleted"/>" style="overflow: hidden; padding: 3px">

		<table id="slaDetail_ruleGrid"></table>
		<div id="slaDetail_ruleGridPager" class="scroll" style="text-align:center;"></div>
		
		
		<div id="slaDetail_ruleGridToolbar" style="display:none">
		
		<sec:authorize url="/pages/slaRule!save.action">
			<a class="easyui-linkbutton"  plain="true" icon="icon-add" id="slaDetail_ruleGrid_add" ><fmt:message key="common.add"/></a> 
		</sec:authorize>
		
		<sec:authorize url="/pages/slaRule!edit.action">
			<a class="easyui-linkbutton"  plain="true" icon="icon-edit" id="slaDetail_ruleGrid_edit"><fmt:message key="common.edit"/></a>
		</sec:authorize>
		
		<sec:authorize url="/pages/slaRule!delete.action">
			<a class="easyui-linkbutton"  plain="true" icon="icon-cancel" id="slaDetail_ruleGrid_delete"><fmt:message key="common.delete"/></a> 
		</sec:authorize>
		
		</div>
		
		
	</div>
	

	
	<div title="<fmt:message key="title.sla.autoUpdate"/>" style="overflow: hidden; padding: 3px">


		<table id="autoUpdateGrid"></table>
		<div id="autoUpdateGridPager" class="scroll" style="text-align:center;"></div>
		
		
		<div id="autoUpdateGridToolbar" style="display:none">
			<a class="easyui-linkbutton"  plain="true" icon="icon-add" id="autoUpdateGrid_add" ><fmt:message key="common.add"/></a> 
			<a class="easyui-linkbutton"  plain="true" icon="icon-edit" id="autoUpdateGrid_edit"  ><fmt:message key="common.edit"/></a>
			<a class="easyui-linkbutton"  plain="true" icon="icon-cancel" id="autoUpdateGrid_delete" ><fmt:message key="common.delete"/></a> 
		</div>





	</div>
	


	</div>
	</div>


	</div>


</div>









<!-- 新增/编辑SLA规则 -->





<div id="addSLARuleDiv">
<form id="addSLARuleForm">

<div id="addSLARuleDivWindow" class="easyui-window" closed="true" collapsible="false" minimizable="false" maximizable="false" modal="true" title="<fmt:message key="title.sla.addAutoUpdate"/>"
style="width:580px; height:450px; padding:3px;line-height: 20px;">
	
	
	
	
	<input type="hidden" id="contractNo" name="rule.slaContract.contractNo" value="${param.contractNo}" />


	<s:hidden name="rule.dialect" value="mvel" />
	<s:hidden name="rule.condition.patternBinding" value="dto" />
	<s:hidden name="rule.condition.patternType" value="RequestDTO" />

	
	<s:hidden id="rule_condition_rulePatternNo" name="rule.condition.rulePatternNo" />
	<input type="hidden" name="rule.rulePackage.rulePackageNo" value="${slaContractDTO.rulePackageNo}" />
	<input type="hidden" name="rule.ruleNo" id="rule_ruleNo" />


	 <div class="easyui-layout" fit="true">
	 <div region="center" style="height:110px">


	 <div class="easyui-tabs" fit="true" style="height:300px;" border="none" id="slaTab_main">
	
		 <div title="<fmt:message key="title.sla.slaDetail"/>">
		
		 <!-- SLA明细 start-->
		
		<div class="lineTableBgDiv">
		<table style="width:100%" class="lineTable" cellspacing="1">
	
	
			<tr>
				<td style="width:20%" ><fmt:message key="label.sla.ruleName"/></td>
				<td style="width:80%" >
				<input type="text" name="rule.ruleName" id="rule_ruleName" class="easyui-validatebox input" validType="length[1,200]" required="true"/>
				</td>
			</tr>
	
			<tr>
				<td><fmt:message key="label.sla.requestTime"/></td>
				<td>
				
				  <select name="rule.rday" id="rule_rday">
	                    <c:forEach  var="i" begin="0" end="99">
	                       <option value="${i}">${i}</option>
	                     </c:forEach>
	              </select> <fmt:message key="label.sla.day"/>
				  
				  <select name="rule.rhour" id="rule_rhour">
	                    <c:forEach  var="i" begin="0" end="23">
	                       <option value="${i}">${i}</option>
	                     </c:forEach>
	              </select> <fmt:message key="label.sla.hour"/>
	              <select name="rule.rminute" id="rule_rminute">
	                     <c:forEach var="i" begin="0" end="59">
	                        <option value="${i}">${i}</option>
	                     </c:forEach>
	              </select> <fmt:message key="label.sla.minute"/>
	              
				</td>
			</tr>
			
			<tr>
				<td><fmt:message key="label.sla.completeTime"/></td>
				<td>
				
				
				
				
					<select name="rule.fday" id="rule_fday">
		                    <c:forEach  var="i" begin="0" end="99">
		                       <option value="${i}">${i}</option>
		                     </c:forEach>
		              </select> <fmt:message key="label.sla.day"/>
					  
					  <select name="rule.fhour" id="rule_fhour">
		                    <c:forEach  var="i" begin="0" end="23">
		                       <option value="${i}">${i}</option>
		                     </c:forEach>
		              </select> <fmt:message key="label.sla.hour"/>
		              <select name="rule.fminute" id="rule_fminute"> 
		                     <c:forEach var="i" begin="0" end="59">
		                        <option value="${i}">${i}</option>
		                     </c:forEach>
		              </select> <fmt:message key="label.sla.minute"/>
				
				</td>
			</tr>
			
			<tr>
				<td><fmt:message key="label.sla.responseRate"/></td>
				<td>
				<input type="text" name="rule.responseRate" id="rule_responseRate" style="width:50%" class="easyui-numberbox" validType="persent" />&nbsp;&nbsp;<fmt:message key="label.sla.percentRate"/>
				</td>
			</tr>
			
			<tr>
				<td><fmt:message key="label.sla.completeRate"/></td>
				<td>
				<input type="text" name="rule.completeRate" id="rule_completeRate" style="width:50%" class="easyui-numberbox" validType="persent"/>&nbsp;&nbsp;<fmt:message key="label.sla.percentRate"/>
				</td>
			</tr>
			
			<tr>
				<td><fmt:message key="label.sla.allDayBase"/></td>
				<td>
					<input type="hidden" name="rule.includeHoliday" id="rule_includeHolidayVl">
					<input type="radio" name="rule_includeHoliday" value="true"><fmt:message key="label.sla.yes"/>
					<input type="radio" name="rule_includeHoliday" value="false" checked><fmt:message key="label.sla.no"/>
				</td>
			</tr>
			
			
	
	
		</table>
		
		</div>
		
		<!-- SLA明细 end -->
		
		
		</div>
	
	
		<div title="<fmt:message key="title.sla.fitRule"/>" style="padding:3px">

   
  
			<div class="easyui-panel" title="<fmt:message key="title.sla.addOrEditRule"/>" >
			
				<div class="lineTableBgDiv">
					<table style="width:100%" class="lineTable" cellspacing="1">
						<tr>
							<td style="width:20%"><fmt:message key="label.sla.fitStyle"/></td>
							<td style="width:80%">		
							<input id="addSLARule_or" type="radio" name="orand" value="or" checked/><fmt:message key="label.sla.fitOne"/>
							<input id="addSLARule_and" type="radio" name="orand" value="and" /><fmt:message key="label.sla.fitAll"/>
							</td>
						</tr>
						<tr>
							<td><fmt:message key="label.sla.ruleDetail"/></td>
							<td>
				
							<table style="width:100%">
							
							<tr>
							<td style="width:15%">
								<select id="addSLARule_team" style="width:100px">
								</select> 
							</td>
							<td style="width:15%">
								<select id="addSLARule_matical">
								</select> 
							</td>
							<td style="width:30%">
								<div id="addSLARule_propertyValueDIV" style="float:left">
									<input id="addSLARule_propertyValue" size="15" value="" />  
								</div>
							</td>
							
							<td style="width:40%">
								<a class="easyui-linkbutton" plain="true" icon="icon-ok" id="slaDetail_ruleGrid_addRuleToList"><fmt:message key="label.rule.confirm"/></a>
							</td>
							
							</tr>
							
							
							</table>
				
							
							</td>
						</tr>
						
					</table>
				</div>
			</div>
			
			<div style="height:3px"></div>
			
			<div class="easyui-panel" title="<fmt:message key="label.sla.ruleList"/>" >
			
					<div class="lineTableBgDiv">
					<table id="addRule_constraintsTable" style="width:100%" class="lineTable" cellspacing="1">
						<thead>
						<tr>
							<td style="width: 25%; font-weight: bold; text-align: center; color: #15428b"><fmt:message key="label.sla.condition"/></td>
							<td style="width: 50%; font-weight: bold; text-align: center; color: #15428b"><fmt:message key="label.sla.ruleContent"/></td>
							<td style="width: 25%; font-weight: bold; text-align: center; color: #15428b"><fmt:message key="label.sla.operation"/></td>
						</tr>
						</thead>
						<tbody></tbody>
					</table>
				</div>
			</div>
		
		


	</div>
	

</div>

</div>

<div region="south" style="height:50px;padding:10px">


<a class="easyui-linkbutton" icon="icon-save" style="margin-right:15px" id="slaDetail_ruleGrid_saveRule"><fmt:message key="common.save"/></a>
	
</div>

</div>

	

</div>


</form>


</div>








<!-- 新增升级策略 -->




<div id="autoUpdateWindow" class="easyui-window" closed="true" collapsible="false" minimizable="false" maximizable="false" modal="true" title="<fmt:message key="title.sla.addEditAutoUpdate"/>" style="width:420px;height:auto">
	
	
	<form id="autoUpdateForm">
	
				<div class="lineTableBgDiv">
				<table style="width:100%" class="lineTable" cellspacing="1">
				
				
				<tr>
				<td style="width:80px"><fmt:message key="label.sla.autoUpdateName"/></td>
				<td>
				
				<input type="text" name="promoteRuleDTO.ruleName" id="promoteRule_ruleName" class="easyui-validatebox" required="true" style="color:#555;width:96%" />
				
				</td>
				
				</tr>
				
		
				<tr>
				<td><fmt:message key="label.sla.updateStyle"/></td>
				<td>
				
				<input type="radio" name="promoteRuleDTO.beforeOrAfter" value="true" checked> <fmt:message key="label.sla.updateAfter"/>&nbsp;
				<input type="radio" name="promoteRuleDTO.beforeOrAfter" value="false"><fmt:message key="label.sla.updateBefore"/>
				
				
				</td>
				
				</tr>
				

				<tr>
				<td><fmt:message key="label.sla.updateTime"/></td>
				<td>
				
					  <select name="promoteRuleDay" id="promoteRuleDay" style="width:35px">
		                    <c:forEach  var="i" begin="0" end="99">
		                       <option value="${i}">${i}</option>
		                     </c:forEach>
		              </select> <fmt:message key="label.sla.day"/> &nbsp;
					  
					  <select name="promoteRuleHour" id="promoteRuleHour" style="width:35px">
		                    <c:forEach  var="i" begin="0" end="23">
		                       <option value="${i}">${i}</option>
		                     </c:forEach>
		              </select> <fmt:message key="label.sla.hour"/> &nbsp;
		              <select name="promoteRuleMinute" id="promoteRuleMinute" style="width:35px">
		                     <c:forEach var="i" begin="0" end="59">
		                        <option value="${i}">${i}</option>
		                     </c:forEach>
		              </select> <fmt:message key="label.sla.minute"/>
				
				
				</td>
				
				</tr>
				
				
				<tr>
				<td><fmt:message key="label.sla.allDayBase"/></td>
				<td>
					<input type="radio" name="promoteRuleDTO.isIncludeHoliday" value="false"><fmt:message key="label.sla.yes"/>
					<input type="radio" name="promoteRuleDTO.isIncludeHoliday" value="true" checked><fmt:message key="label.sla.no"/>
				</td>
				
				</tr>

				
				
				<tr>
				<td><fmt:message key="label.sla.updateTo"/></td>
				<td>
					<input id="promoteRule_assigneeName" style="width:96%;cursor:pointer" class="easyui-validatebox" required="true" readonly>
					<input type="hidden" name="promoteRuleDTO.assigneeNo" id="promoteRule_assigneeNo" value="1">
				</td>
				
				</tr>
				
				
				<tr>
				<td style="height:50px" colspan="2">
				
					<input type="hidden" name="promoteRuleDTO.ruleNo" id="promoteRule_ruleNo">
					<input type="hidden" name="promoteRuleDTO.contractNo" value="${param.contractNo}">
					<a class="easyui-linkbutton" icon="icon-save" id="autoUpdateGrid_save"><fmt:message key="common.save"/></a>
				
				</td>
			
				</tr>

				</table>
				</div>

	</form>
	
	
	</div>



</div>