<!-- include '../header' -->
<link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>css/jquery.validator.css"> 
<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/jquery.validator.min.js"></script>
<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/zh-CN.js"></script>
<script type="text/javascript" src="<?= receipt ?>"></script>
<script type="text/javascript" >

function receiptTrainApprovalDo(status){
	 var form = $('#receiptTrainApprovalForm'); 
	 $('#status').val(status);
	 form.submit(); 
}
function receiptTrainApprovalBackDo(ridKey){
	var opinion=$('#opinion').val();
	
	var url="/receiptTrainApprovalBackDo";
	$.ajax({
		url:url,
		type: "post",
		cache: false,
		dataType: "json",
		data: {
			ridKey:ridKey,
			opinion:opinion
		},
		global: true,
		success: function(data){
			if(data.status==2){
				alert('参数错误');
			}else{
				window.location.href="/approvalExpenses/pendApproval";
			}
		},
		error:function(err){
		}
		});
}

</script>

<body>
	<div class="mainLayout">
		<div class="mainMenu">
			<div class="menuItem">
				<a href="#" class="mLogo">CLD</a>
				<ul>
					<!-- include '../admin/menuReceipt' -->
				</ul>
			</div>
		</div>
		<div class="warpContent">
			<div class="subMenu fL">
				<div class="menuItem">
					<!-- include '../admin/receipt_menu' -->
				</div>
			</div>
			<div class="adminContent autoHeight" style="height: 821px;">
				<legend>{{receiptTrainingDetail.trainName}}</legend>
				<div class="borad-news">
					<div class="subNav">
			    		<!-- include 'receiptTrainMenu' -->
					</div>
			  		<div class="saeaList">
			  		<form action="/receiptTrainImplementDo" method="post" id="receiptTrainApprovalForm" name="receiptTrainApprovalForm">
	  					<input type="hidden" name="ridKey" value="{{receiptDetail.ridKey}}"></input>

						<!--审批-->
						<legend>执行结算</legend>
						<div class="censorList clearfix">
							<ul>
							<!-- if {{empty(rlList)}} -->
		  						<li class="post" >
		  							<div class="avtra"><img src="{{receiptDetail.staffDetail.avatar}}_2.jpg" width="32"></div>
		  							<div class="comment">
		  								<p><span class="fR">
		  								{{receiptDetail.date}}
		  								</span>{{receiptDetail.staffDetail.username}}</p>
		  								<p>提交审批</p>
		  							</div>
		  						</li>
		  					<!-- endif -->
		  					
							<!-- loop rlList -->
							<li <!-- if {{rlList' value.status}}==2 -->
							class="post"
							<!-- elseif {{rlList' value.status}}==1 -->
							class="done"
							<!-- elseif {{rlList' value.status}}==4 -->
							class="back" 
							<!-- endif --> >
									<div class="avtra"><img src="{{rlList' value.img}}_2.jpg" width="32"></div>
									<div class="comment">
										<p <!-- if {{rlList' value.status}}!=2 --> class="colGray" <!-- endif --> >
										<span class="fR" <!-- if {{rlList' value.status}}==2 --> title="提交时间" <!-- endif --> >
										{{rlList' value.date}}</span>{{rlList' value.username}} 
										</p>
										<p>{{rlList' value.opinion}}</p>
									</div>
							</li>
		  					<!-- endloop -->
							
							<!-- loop verifyList -->
							<!-- if  {{verifyList' value.status}}!=1||{{empty(rlList)}} -->
								<li <!-- if {{verifyList' value.status}}==3 -->
								class="undone"
								<!-- endif --> >
										<div class="avtra"><img src="{{rlList' value.img}}_2.jpg" width="32"></div>
										<!-- if {{verifyList' value.status}}==4  -->
										
										<!-- else -->
										<div class="comment">
											<p <!-- if {{rlList' value.status}}!=2 --> class="colGray" <!-- endif --> >
											<span class="fR" <!-- if {{rlList' value.status}}==2 --> title="提交时间" <!-- endif --> >
											{{rlList' value.date}}</span>{{verifyList' value.1}}
											</p>
											<p>{{rlList' value.opinion}}</p>
										</div>
										<!-- endif -->
								</li>
								<!-- endif -->
							<!-- endloop -->
							
							
							<!-- loop executeList -->
		  						
		  						<li <!-- if {{executeList' value.status}}==1 --> class="done" <!-- elseif {{executeList' value.status}}==3 --> class="undone"  <!-- endif -->>
										<div class="avtra"><img src="{{executeList' value.2}}_2.jpg" width="32"></div>
										
										<!-- if {{executeList' value.status}}==4 -->
			  							<div class="comment">
			  								<p class="colGray">{{executeList' value.1}}（费用执行）</p>
			  								<p><textarea name="opinion" id="opinion_{{receiptList' value.rid}}" placeholder="填写审批意见（可选）"></textarea></p>
			  								<!-- if {{button2}}==1 -->
			  								
			  								
			  								
			  								
			  								
			  								<div class="reportButton">
	  					<!-- if empty({{wbDetail}}) -->
	  					
	  					<!-- if {{lastOne}} -->
	  					<div class="modal fade" id="confirm2">
	<div class="modal-dialog">
		<div class="modal-content">
		    <div class="modal-header">
		    	<h3>该费用未生成流水</h3>
		    </div>
		    <div class="modal-body saeaList">
		    	<p>请生成流水后继续执行。</p>
		    </div>
			<div class="modal-footer">
				<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
			</div>
		</div>
	</div>
</div>
	<div class="invoButton clearfix">
	  	<a  href="#confirm2"  data-toggle="modal"  class="buttonDone buttonBlock">执行完成</a>	
	  					</div>
	  					<!-- else -->
	  					
	  					<div class="modal fade" id="confirm1">
		<div class="modal-dialog">
			<div class="modal-content">
			    <div class="modal-header">
			    	<h3>该费用未生成流水</h3>
			    </div>
			    <div class="modal-body saeaList">
			    	<p>该费用有多个执行人，请确认是否需要生成流水；</p>
			    	<p>若您不生成流水，将由其他执行人生成。</p>
			    </div>
				<div class="modal-footer">
				<input type="submit" value="确认执行（不生成流水）" class="button buttonDone buttonBlock" >
					
					<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
				</div>
			</div>
		</div>
	</div>
	
	
	<div class="invoButton clearfix">
	  			<a  href="#confirm1"  data-toggle="modal"  class="buttonDone buttonBlock">执行完成</a>		
	  			</div>	
	  					<!-- endif -->
	  					
	  					
	  					<!-- else -->
	  					<div class="invoButton clearfix">
	  					<input type="submit" class="buttonDone buttonBlock" value="执行完成">
	  					</div>	
	  					
<!-- endif -->
			  								
			  								
			  								
			  								
			  								
			  								
						  				
											
											
											
											
											<!-- endif -->
			  							</div>
			  							<!-- else -->
			  							
			  							<div class="comment">
			  								<p class="colGray">{{executeList' value.1}}（费用执行）<span class="fR">{{executeList' value.date}}</span></p>
			  								<p>{{executeList' value.opinion}}</p>
			  							</div>
			  							<!-- endif -->
										
										
										
										
										
									</li>
								<!-- endloop -->
							
							
							
							</ul>
							
						</div>
						</form>
						
					</div>
				</div>
		</div>
	</div>
	
    <!--弹出内容-->
<script type="text/javascript">autoFlashHeight();</script>
</body>
