<!-- 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="/receiptTrainApprovalDo" method="post" id="receiptTrainApprovalForm" name="receiptTrainApprovalForm">
			  			<input type="hidden"  name="status" id="status" value=""></input>
	  					<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.2}}_2.jpg" width="32"></div>
										<!-- if {{verifyList' value.status}}==4  -->
										<div class="comment">
				  							{{verifyList' value.1}}
				  							<!-- if isset({{verifyList' value.rolename}}) --> （{{verifyList' value.rolename}}） <!-- endif -->
				  							<p><textarea name="opinion" id="opinion"  placeholder="填写审批意见（可选）"></textarea></p>
				  						</div>
										<div class="invoButton clearfix">
						<a href="javascript:void(0)" onClick="receiptTrainApprovalDo('AGREE')" style="width:300px" class="buttonDone ">同意</a>
<a href="javascript:void(0)" onClick="receiptTrainApprovalBackDo('{{receiptDetail.ridKey}}')"  class="buttonBack" style="width:100px;margin:0 10px" data-placement="top" data-toggle="ctooltip" data-original-title="上报人修改后由你继续审批">撤回</a>								
<a href="javascript:void(0)" onClick="receiptTrainApprovalDo('END')" class="buttonUndone" data-placement="top" data-toggle="ctooltip" data-original-title="终止结算申请" style="width:100px">终止</a>
										</div>
										<!-- 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 -->
							
							</ul>
						</div>
						
						</form>
						
					</div>
				</div>
		</div>
	</div>
	
    <!--弹出内容-->
<script type="text/javascript">autoFlashHeight();</script>
</body>
