 <!-- 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 src="<?= WEB_SITE_GLOBAL ?>js/receipt.js"></script>

 <script >
	 $(function() {

		 $("input[id^='inttrain_']").change(function() {

			 $i=0;
			 $("input[id^='inttrain_']").each(function(i){
				 $i+=parseFloat(this.value);

			 });
			 $("#inttrainResult").html("￥"+$i.toFixed(2));
			 $("#inttrainR").val($i.toFixed(2));

			 var agencyR=$("#agencyR").val();
			 var otherR=parseFloat($("#otherR").val());
			 var travelR=parseFloat($("#travelR").val());
			 var RS=parseFloat($i)+parseFloat(agencyR)+travelR+otherR;

			 $("#RS").html("￥"+RS.toFixed(2));
		 });

	 })
 </script>

<body>
	<div class="mainLayout">
		<div class="mainMenu">
			<div class="menuItem">
				<a href="#" class="mLogo">CLD</a>
				<ul>
					<!-- include 'menuReceipt' -->
				</ul>
			</div>
		</div>
		<div class="warpContent">
			<div class="subMenu fL">
				<div class="menuItem">
					<ul>
						<!-- include 'receipt_menu' -->
					</ul>
				</div>
			</div>
			<div class="adminContent autoHeight" style="height: 821px;">
				<legend><div class="fR"></div>编辑报销单</legend>
				
				
				
				<div class="saeaList ">
	  			<!-- loop receiptList -->
	  			<div class="entry loan-list" >
	  			<!-- 
	  				<!-- if {{receiptList' value.status}}==1 -->
	  				<div class="seal done"></div>
	  				<!-- elseif {{receiptList' value.status}}==3 -->
	  				<div class="seal undone"></div>	
	  				<!-- elseif {{receiptList' value.status}}==4 -->
	  				<div class="seal back"></div>	
	  				<!-- endif -->
	  				 -->
	  				
	  				
	  			
	  			<div class="seTable">
						<table class="table table-bordered table-condensed table-hover">
							<tbody>
							<tr><th colspan="2" class="taC">借款费用</th></tr>
							
							<!-- loop receiptList' value.loanItem.借款费用 -->
	  							<tr><th>{{receiptList' value' value.name}}</th><td  width="140" class="taR">￥{{receiptList' value' value.price}}</td></tr>
	  						<!-- endloop -->
							<tr><th>借款费用</th><td width="140" class="taR">￥{{receiptList' value.accountItem.cSum.loanSum}}</td></tr>
							
							<tr><th class="taC" colspan="2">产生费用所在办事处</th></tr>
							<tr><th style="text-align:center" colspan="2">{{receiptDetail' value.category}}</th></tr>
							<tr><th class="taC" colspan="2">费用说明</th>
							</tr><tr><td colspan="2">{{receiptDetail' value.explanation}}</td></tr>
							
							<tr class="warning"><td class="taR"><b>（{{receiptDetail' value.receiptOrder}}）本次费用合计</b></td>
							<td class="taR"><b style="font-size:24px">￥{{receiptDetail' value.sum}}</b><br>{{receiptDetail' value.BIGsum}}</td></tr>
							</tbody>
						</table>
					</div>
	  			
	  			
	  			
	  			
	  				
	  				<div class="seCensor loan-censor">
	  					
	  				
	  					<div class="title">
	  					{{receiptDetail' value.receiptOrder}}
	  					</div>
	  					<div class="censorList">
	  					<ul>
		  						<li class="post">
		  							<div class="avtra"><img src="{{staff.0.avatar}}_2.jpg" width="32"></div>
		  							<div class="comment">
		  								<p><span class="fR">{{receiptDetail' value.date}}</span>{{staff.0.username}}</p>
		  								<p>提交审批</p>
		  							</div>
		  							
		  						</li>
		  						
		  						
		  						
		  						
		  						<!-- loop receiptDetail' value.verifyList -->
		  						
		  						
		  						
			  						<li <!-- if {{receiptDetail' value' value.status}}==1 --> class="done" <!-- elseif {{receiptDetail' value' value.status}}==3 --> class="undone"  <!-- endif -->>
			  							<div class="avtra"><img src="{{receiptDetail' value' value.2}}_2.jpg"></div>
			  							
			  							<div class="comment">
			  								<p class="colGray"><span class="fR">{{receiptDetail' value' value.date}}</span>{{receiptDetail' value' value.1}}<!-- if isset({{receiptDetail' value' value.rolename}}) --> （{{receiptDetail' value' value.rolename}}） <!-- endif --></p>
			  								<p>{{receiptDetail' value' value.opinion}}</p>
			  							</div>
			  							
			  						</li>
		  						
		  						
		  						<!-- endloop -->
		  						
	  						
	  					</ul>
	  					
	  					</div>
	  					
	  					
	  				</div>
	  			</div>
	  			<!-- endloop -->
	  			
			</div>
				
				
				
				
				
				
				
				
	  		<div class="saeaList">
	  			<div class="entry">
	  				<div class="seTable">
	  				<input type="hidden" id="agencyR" value="{{cSum.agencySum}}" />
	  				<input type="hidden" id="travelR" value="{{cSum.travelSum}}" />
	  				<input type="hidden" id="trainR" value="{{cSum.trainSum}}" />
	  				<input type="hidden" id="otherR" value="{{cSum.otherSum}}" />
	  				<form action="/updateReceipt" name="recepitAdd" method="post">
	  					<input type="hidden" name="rid" value="{{ridKey}}"/>
	  					<table class="table table-bordered table-condensed table-hover">
	  					<tbody>
	  					   
	  						<tr><th colspan="2" class="taC">日常相关费用</th></tr>
	  						<!-- loop acItem -->
		  						<!-- if {{acItem' value.category}} =="日常相关费用" -->
		  						<tr>
		  						<th>{{acItem' value.name}}</th>
		  						<td  width="200" class="taR">
		  						￥<input type="number" <!-- if !empty({{acItem' value.price}}) --> value="{{acItem' value.price}}" <!-- else --> value="0" <!-- endif --> id="agency_{{acItem' value.aid}}" name="agency[]"  placeholder="输入{{acItem' value.name}}" pattern="[0-9]" step="0.01" min="0" class="span2">
		  						</td>
		  						</tr>
		  						<!-- endif -->
	  						<!-- endloop -->
	  						<tr><th class="taR">合计</th><td class="colGreen taR" id="agencyResult">￥{{cSum.agencySum}}</td></tr>
	  						
	  						
	  						<tr><th colspan="2" class="taC">差旅相关费用</th></tr>
	  						<!-- loop acItem -->
		  						<!-- if {{acItem' value.category}} =="差旅相关费用" -->
	  						<tr>
	  						<th>{{acItem' value.name}}</th>
	  						<td  width="200" class="taR">￥<input type="number" id="travel_{{acItem' value.aid}}" name="travel[]" <!-- if !empty({{acItem' value.price}}) --> value="{{acItem' value.price}}" <!-- else --> value="0" <!-- endif --> placeholder="输入{{acItem' value.name}}" pattern="[0-9]" step="0.01" min="0" class="span2"></td>
	  						</tr>
	  							<!-- endif -->
	  						<!-- endloop -->
	  						<tr><th class="taR">合计</th><td class="colGreen taR" id="travelResult">￥{{cSum.travelSum}}</td></tr>


							<tr><th colspan="2" class="taC">内部培训费用</th></tr>
							<!-- loop acItem -->
							<!-- if {{acItem' value.category}} =="内部培训费用" -->
							<tr>
								<th>{{acItem' value.name}}</th>
								<td  width="200" class="taR">

									￥<input type="number" id="inttrain_{{acItem' value.aid}}" name="inttrain[]" <!-- if !empty({{acItem' value.price}}) --> value="{{acItem' value.price}}" <!-- else --> value="0" <!-- endif --> placeholder="输入{{acItem' value.name}}" pattern="[0-9]" step="0.01" min="0" class="span2"></td>
							</tr>
							<!-- endif -->
							<!-- endloop -->
							<tr><th class="taR">合计</th><td class="colGreen taR" id="inttrainResult">￥{{cSum.inttrainSum}}</td></tr>


							<tr><th colspan="2" class="taC">培训班费用</th></tr>
	  						<!-- loop acItem -->
		  						<!-- if {{acItem' value.category}} =="培训班费用" -->
	  						<tr>
	  						<th>{{acItem' value.name}}</th>
	  						<td  width="200" class="taR">￥<input type="number" id="train_{{acItem' value.aid}}" name="train[]" <!-- if !empty({{acItem' value.price}}) --> value="{{acItem' value.price}}" <!-- else --> value="0" <!-- endif --> placeholder="输入{{acItem' value.name}}" pattern="[0-9]" step="0.01" min="0" class="span2"></td>
	  						</tr>
	  							<!-- endif -->
	  						<!-- endloop -->
	  						
	  						<tr><th class="taR">合计</th><td class="colGreen taR" id="trainResult">￥{{cSum.trainSum}}</td></tr>
	  						
	  						<tr><th colspan="2" class="taC">其他</th></tr>
	  						<!-- loop acItem -->
		  						<!-- if {{acItem' value.category}} =="其他" -->
	  						<tr><th>{{acItem' value.name}}</th>
	  						<td  width="200" class="taR">￥<input type="number" id="other_{{acItem' value.aid}}" name="other[]" <!-- if !empty({{acItem' value.price}}) --> value="{{acItem' value.price}}" <!-- else --> value="0" <!-- endif --> placeholder="输入{{acItem' value.name}}" pattern="[0-9]" step="0.01" min="0" class="span2"></td></tr>
	  							<!-- endif -->
	  						<!-- endloop -->
	  						
	  						<tr><th class="taR">合计</th><td class="colGreen taR" id="otherResult">￥{{cSum.otherSum}}</td></tr>
	  						
	  						<tr class="warning"><td class="taR"><b>本次报销费用合计</b></td><td class="colGreed taR"><b style="font-size:24px" id="RS">￥{{sum}}</b></td></tr>
	  						<tr>
								<th>选择审批组</th>
								<td class="taR">
								<select name="verify">
								<!-- loop veList -->
								<option <!-- if {{receiptDetail.verify}}=={{veList' value.vid}} --> selected <!-- endif --> value="{{veList' value.vid}}" >{{veList' value.description}}（
								{{veList' value.staff}}
								
								
								）</option>
								<!-- endloop -->
								</select>
								</td>
							</tr>
	  						
	  						<tr><th colspan="2" class="taC">产生费用所在办事处</th></tr>
							<tr>
								<th>选择办事处</th>
								<td class="taR">
								<select name="cid" class="span2">
								<!-- loop category -->
								<option <!-- if {{receiptDetail.cid}}=={{category' value.cid}} --> selected <!-- endif --> value="{{category' value.cid}}" >{{category' value.title}}</option>
								<!-- endloop -->
								</select>
								</td>
							</tr>	
	  						
	  						
	  						<tr><th colspan="2" class="taC">收款信息</th></tr>
							<tr><th>收款人户名</th>
							<td><input type="text" name="remittanceName" id="remittanceName"  value="{{receiptDetail.remittanceName}}" placeholder="请输入收款人户名" ></td>
							</tr>
							
							<tr>
							<th>收款银行</th>
							<td>
							<select node-rbt name="remittanceBankType">
							<option value="0">广发银行</option>
							<option value="1">其他</option>
							</select>
							</td>
							</tr>
							
							<tr><th>收款开户银行名称</th><td>
							<input type="text" name="bankName" id="bankName" value="{{receiptDetail.bankName}}" placeholder="请输入收款开户银行名称" >
							</td></tr>
							<tr><th>收款账号</th><td>
							<input type="text" placeholder="请输入收款账号" id="bankNumber" name="bankNumber" value="{{receiptDetail.bankNumber}}">
							</td></tr>
							<tr node-cn style="display:none" ><th>联行号&nbsp;&nbsp;<span class="colRed">（如果不是广发银行，务必填上银行联行号）</span></th><td>
							<input type="text" placeholder="请输入联行号" id="coupletNumber" name="coupletNumber" value="{{receiptDetail.coupletNumber}}">
							</td></tr>
	  						
	  						<tr><th colspan="2" class="taC">报销说明</th></tr>
	  						<tr><th colspan="2">
	  									<textarea name="explanation" id="explanation" required="" rows="8" style="width:99%;resize: vertical" placeholder="市内交通费、邮寄费、公关费、办公费等费用说明，请详细填写在这。">{{receiptDetail.explanation}}</textarea>
	  						</th></tr>
	  						
	  						
	  						</tbody>
	  					</table>
	  					<table class="table">
	  						<tr><td><input type="submit" value="生成报销单 >>" class="button" /></td></tr>
	  					</table>
	  				</form>	
	  				</div>
	  				<div class="seCensor">
	  					<div class="title">
	  					报销单填写说明
	  					</div>
	  				</div>
	  			</div>
			</div>
		</div>
	</div>
	<!--弹出-->
<div class="modal hide fade" id="addCallout">
    <div class="modal-header">
    <h3>添加批注</h3>
    </div>
    <div class="modal-body">
    <form class="">
	    	<div class="control-group">
				<div class="controls clearfix">
					<label>
	                	批注内容
	              	</label>
	              	<textarea rows="8" class="span6"></textarea>
				</div>
	    	</div>
    </form>
    </div>
	<div class="modal-footer">
	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">取消</a>
	   	<a href="#" class="button">确定</a>
	</div>
</div>
    <!--弹出内容-->
<script type="text/javascript">autoFlashHeight();</script>	
</body>