 <!-- include 'header' -->
  <script src="<?= WEB_SITE_GLOBAL ?>js/receipt.js"></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>
				<!-- if {{status}}==2  -->
				您有{{receiptApprovalCount}}份报销单需要审批
				<!-- endif -->
				</legend>
				
				<div class="demandCate">
				<form action="/approval" id="up" method="post">
				<input type="hidden" name="status" value="{{status}}"></input>
					<ul class="cateList">
	  					<li>
		  					<a <!-- if {{status}}==2 --> class="now" <!-- endif --> href="/approval/2">需要我审批</a>
		  					<a <!-- if {{ap}}==4 --> class="now" <!-- endif --> href="/approval/4">我已审批</a>
		  					<a <!-- if {{status}}==1 --> class="now" <!-- endif --> href="/approval/1">同意支付</a>
		  					
		  					<a <!-- if {{status}}==5 --> class="now" <!-- endif --> href="/approval/5">撤回</a>
		  					
		  					<a <!-- if {{status}}==3 --> class="now" <!-- endif --> href="/approval/3">终止</a>
	  					</li>
	  					<li><a  href="/remittance">汇款模式</a></li>
	  					<li>
	  						<select name="year" id="Y" onChange="receiptYear();">
	  					<!-- include 'year' --></select>
	  						<select name="month" id="M" onChange="receiptMoth();">
	  					<option value="">所有月份</option>
	  					{{mothHtml}}
	  					</select>
	  					</li>
	  					<li>
	  						<select name="cid" onChange="receiptYear();">
	  						<option value="">办事处</option>
	  						<!-- loop categoryList -->
	  						<option <!-- if {{categoryList' value.cid}}=={{cid}} --> selected <!-- endif --> value="{{categoryList' value.cid}}">{{categoryList' value.title}}</option>
	  						<!-- endloop -->
	  						</select>
	  						<select name="sid" onChange="receiptYear();">
	  						<option value="">员工</option>
	  						<!-- loop staffList -->
	  							<option <!-- if {{categoryList' value.sid}}=={{sid}} --> selected <!-- endif --> value="{{categoryList' value.sid}}">{{categoryList' value.username}}</option>
	  						<!-- endloop -->
	  						</select>
	  					</li>
	  				</ul>
	  				
	  				<ul class="cateList">
	  					<li>
	  					<a class="now" href="#">全部</a>
	  					<a href="#">待审批</a>
	  					<a href="#">审批中</a>
	  					<a href="#">执行中</a>
	  					<a href="#">费用完成</a>
	  					<a href="#">撤回</a>
	  					<a href="#">终止</a>
	  					</li>
	  					<li>
						<select name="year" id="Y" onChange="receiptYear();">
	  					<!-- include 'year' --></select>
	  						<select name="month" id="M" onChange="receiptMoth();">
	  					<option value="">所有月份</option>
	  					{{mothHtml}}
	  					</select>
						</li>
	  					<li>
	  						<select name="cid" onChange="receiptYear();">
	  						<option value="">办事处</option>
	  						<!-- loop categoryList -->
	  						<option <!-- if {{categoryList' value.cid}}=={{cid}} --> selected <!-- endif --> value="{{categoryList' value.cid}}">{{categoryList' value.title}}</option>
	  						<!-- endloop -->
	  						</select>
	  						<select name="sid" onChange="receiptYear();">
	  						<option value="">员工</option>
	  						<!-- loop staffList -->
	  							<option <!-- if {{categoryList' value.sid}}=={{sid}} --> selected <!-- endif --> value="{{categoryList' value.sid}}">{{categoryList' value.username}}</option>
	  						<!-- endloop -->
	  						</select>
	  					</li>
	  				</ul>
	  				
	  				
	  			</form>
	  		</div>
				
	  		<div class="saeaList">
	  		
	  		
	  			<div class="entry">
	  				
	  				<table class="table table-bordered table-condensed">
	  					<thead><tr><th width="54">上报人</th><th width="80" class="taC">费用类型</th><th width="100">报销总金额</th>
	  					<th width="120">费用所在办事处</th><th width="120">报销单号</th><th>报销说明</th><th width="100">状态</th><th width="100">操作</th></tr></thead>
	  					<tbody>
	  					<!-- loop receiptList -->
	  						<tr>
	  							<td><div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg" width="32"><br>{{receiptList' value.staffDetail.username}}</div></td>
	  							<td><!-- if {{receiptDetail' value.Rtype}}==1 --> <!-- else --> <!-- endif --> </td>
	  							<td class="taR colOrange"><b>￥{{receiptDetail' value.sum}}</b></td>
	  							<td>{{receiptDetail' value.category}}</td>
	  							<td>{{receiptDetail' value.receiptOrder}}<p class="colGray">{{receiptDetail' value.date}}</p></td>
	  							<td>{{receiptDetail' value.explanation}}</td>
	  							<td>我已审批</td>
	  							<td><a class="button" href="/approvalDetails/{{receiptDetail' value.rid}}">详情</a></td>
	  						</tr>
	  					<!-- endloop -->	
	  					</tbody>
	  				
	  				</table>
	  			
	  				<table class="table table-bordered table-condensed">
	  				<!-- if {{status}}==4 -->
	  					<thead><tr><th width="54">上报人</th><th width="80" class="taC">费用类型</th><th width="100">报销总金额</th>
	  					<th width="120">费用所在办事处</th><th width="120">报销单号</th><th>报销说明</th><th width="100">状态</th><th width="100">操作</th></tr></thead>
	  					<tbody>
	  					<!-- loop receiptList -->
	  						<tr>
	  							<td><div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg" width="32"><br>{{receiptList' value.staffDetail.username}}</div></td>
	  							<td class="taR colOrange"><b>￥{{receiptDetail' value.sum}}</b></td>
	  							<td>{{receiptDetail' value.category}}</td>
	  							<td>{{receiptDetail' value.receiptOrder}}<p class="colGray">{{receiptDetail' value.date}}</p></td>
	  							<td>{{receiptDetail' value.explanation}}</td>
	  							<td>我已审批</td>
	  							<td><a class="button" href="/approvalDetails/{{receiptDetail' value.rid}}">详情</a></td>
	  						</tr>
	  					<!-- endloop -->	
	  					</tbody>
	  				<!-- elseif {{status}}==1 -->
	  					
	  					<thead><tr><th width="54">上报人</th><th width="100">报销总金额</th><th width="120">费用所在办事处</th><th width="120">报销单号</th><th>报销说明</th><th width="100">状态</th><th width="100">操作</th></tr></thead>
	  					<tbody>
	  					<!-- loop receiptList -->
	  						<tr>
	  							<td><div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg" width="32"><br>{{receiptList' value.staffDetail.username}}</div></td>
	  							<td class="taR colOrange"><b>￥{{receiptDetail' value.sum}}</b></td>
	  							<td>{{receiptDetail' value.category}}</td>
	  							<td>{{receiptDetail' value.receiptOrder}}<p class="colGray">{{receiptDetail' value.date}}</p></td>
	  							<td>{{receiptDetail' value.explanation}}</td>
	  							<td class="colGreen">同意支付
	  								<p class="colGray">{{receiptDetail' value.pastDate}}</p>
	  							</td>
	  							<td><a class="button" href="/approvalDetails/{{receiptDetail' value.rid}}">详情</a></td>
	  						</tr>
	  					<!-- endloop -->	
	  					</tbody>
	  				
	  				<!-- elseif {{status}}==5 -->
	  				
	  				<thead><tr><th width="54">上报人</th><th width="100">报销总金额</th><th width="120">费用所在办事处</th><th width="120">报销单号</th><th>报销说明</th><th width="100">状态</th><th width="100">操作</th></tr></thead>
	  					<tbody>
	  					<!-- loop receiptList -->
	  						<tr>
	  							<td><div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg" width="32"><br>{{receiptList' value.staffDetail.username}}</div></td>
	  							<td class="taR colOrange"><b>￥{{receiptDetail' value.sum}}</b></td>
	  							<td>{{receiptDetail' value.category}}</td>
	  							<td>{{receiptDetail' value.receiptOrder}}<p class="colGray">{{receiptDetail' value.date}}</p></td>
	  							<td>{{receiptDetail' value.explanation}}</td>
	  							<td class="colOrange">撤回</td>
	  							<td><a class="button" href="/approvalDetails/{{receiptDetail' value.rid}}">详情</a></td>
	  						</tr>
	  					<!-- endloop -->	
	  					</tbody>
	  				
	  				<!-- elseif {{status}}==3 -->
	  				
	  				<thead><tr><th width="54">上报人</th><th width="100">报销总金额</th><th width="120">费用所在办事处</th><th width="120">报销单号</th><th>报销说明</th><th width="100">状态</th><th width="100">操作</th></tr></thead>
	  					<tbody>
	  					<!-- loop receiptList -->
	  						<tr>
	  							<td><div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg" width="32"><br>{{receiptList' value.staffDetail.username}}</div></td>
	  							<td class="taR colOrange"><b>￥{{receiptDetail' value.sum}}</b></td>
	  							<td>{{receiptDetail' value.category}}</td>
	  							<td>{{receiptDetail' value.receiptOrder}}<p class="colGray">{{receiptDetail' value.date}}</p></td>
	  							<td>{{receiptDetail' value.explanation}}</td>
	  							<td class="colRed">终止</td>
	  							<td><a class="button" href="/approvalDetails/{{receiptDetail' value.rid}}">详情</a></td>
	  						</tr>
	  					<!-- endloop -->	
	  					</tbody>
	  				
	  					<!-- else -->
	  					<thead><tr><th width="54">上报人</th><th width="100">报销总金额</th><th width="120">费用所在办事处</th><th width="120">报销单号</th><th>报销说明</th><th width="100">操作</th></tr></thead>
	  					<tbody>
	  					<!-- loop receiptList -->
	  						<tr>
	  							<td><div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg" width="32"><br>{{receiptList' value.staffDetail.username}}</div></td>
	  							<td class="taR colOrange"><b>￥{{receiptDetail' value.sum}}</b></td>
	  							<td>{{receiptDetail' value.category}}</td>
	  							<td>{{receiptDetail' value.receiptOrder}}<p class="colGray">{{receiptDetail' value.date}}</p></td>
	  							<td>{{receiptDetail' value.explanation}}</td>
	  							<td><a class="button" href="/approvalEdi/{{receiptDetail' value.rid}}">去审批</a></td>
	  						</tr>
	  					<!-- endloop -->	
	  					</tbody>
	  					<!-- endif -->
	  				</table>
	  			</div>
	  		
	  		<!-- loop receiptList -->
	  			<div id="{{receiptList' value.Locate}}"  class="entry" style="display:none">
	  				<div class="seTable reportTable">
	  					
	  					<table class="table table-bordered table-condensed table-hover">
	  					<tbody>
	  						
	  						<tr><th colspan="2" class="taC">日常相关费用</th></tr>
	  						<!-- loop receiptList' value.accountItem.日常相关费用 -->
	  							<tr><th>{{receiptList' value' value.name}}<div class="repMark fR"><i class="rmDone">●</i><i class="rmUdone">●</i><i class="rmClear">●</i></div></th><td  width="140" class="taR">￥{{receiptList' value' value.price}}</td></tr>
	  						<!-- endloop -->
	  						<tr><th class="taR">合计</th><td class="colGreen taR">￥{{receiptList' value.accountItem.cSum.agencySum}}</td></tr>
	  						
	  						<tr><th colspan="2" class="taC">差旅相关费用</th></tr>
	  						<!-- loop receiptList' value.accountItem.差旅相关费用 -->
	  						<tr><th>{{receiptDetail' value' value.name}}<div class="repMark fR"><i class="rmDone">●</i><i class="rmUdone">●</i><i class="rmClear">●</i></div></th><td  width="140" class="taR">￥{{receiptDetail' value' value.price}}</td></tr>
	  						<!-- endloop -->
	  						<tr><th class="taR">合计</th><td class="colGreen taR">￥{{receiptDetail' value.accountItem.cSum.travelSum}}</td></tr>
	  						
	  						<tr><th colspan="2" class="taC">培训班费用</th></tr>
	  						<!-- loop receiptList' value.accountItem.培训班费用 -->
	  						<tr><th>{{receiptDetail' value' value.name}}<div class="repMark fR"><i class="rmDone">●</i><i class="rmUdone">●</i><i class="rmClear">●</i></div></th><td  width="140" class="taR">￥{{receiptDetail' value' value.price}}</td></tr>
	  						<!-- endloop -->
	  						<tr><th class="taR">合计</th><td class="colGreen taR">￥{{receiptDetail' value.accountItem.cSum.trainSum}}</td></tr>
	  						
	  						<tr><th colspan="2" class="taC">其他</th></tr>
	  						<!-- loop receiptList' value.accountItem.其他 -->
	  						<tr><th>{{receiptDetail' value' value.name}}<div class="repMark fR"><i class="rmDone">●</i><i class="rmUdone">●</i><i class="rmClear">●</i></div></th><td  width="140" class="taR">￥{{receiptDetail' value' value.price}}</td></tr>
	  						<!-- endloop -->
	  						<tr><th class="taR">合计</th><td class="colGreen taR">￥{{receiptDetail' value.accountItem.cSum.otherSum}}</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>
	  						
	  						<!-- if {{status}}==2 -->
	  						<tr class="error"><td colspan="2" class="taR">
	  						<form action="/revisePrice" method="post"  name="revisePrice_{{receiptList' value.rid}}">
	  						<input type="text" name="description" placeholder="输入金额调整描述" class="span4"> ￥<span data-placement="top" data-toggle="ctooltip" data-original-title="扣款请在金额前加“-”">
	  						<input type="number" name="price" placeholder="输入调整金额" pattern="[0-9]" step="0.01" class="span2"></span>
	  						<input type="hidden" name="rid" value="{{receiptList' value.rid}}">
	  						<input type="submit" value="添加" class="btn">
	  						</form>
	  						</td>
	  						</tr>
	  						<!-- endif -->
	  						
	  						<!-- loop receiptList' value.reviseDetail -->
	  						<tr><th><a href="/revocationAdjustment/{{receiptList' value' value.sid}}/{{receiptList' value' value.price}}/{{receiptList' value.rid}}">撤销</a><span class="interval">|</span>{{receiptList' value' value.name}}：{{receiptList' value' value.description}}</th><td class="taR">￥{{receiptList' value' value.price}}</td></tr>
	  						<!-- endloop -->
	  						
	  						<tr><th class="taR">合计</th><td class="colOrange taR">￥{{receiptList' value.revisePrice}}</td></tr>
	  						
	  						<tr class="warning"><td class="taR"><b>（{{receiptDetail' value.receiptOrder}}）本次报销费用合计</b></td>
	  						<td class="colGreed taR"><b style="font-size:24px">￥{{receiptDetail' value.sum}}</b></td></tr>

						</tbody>
	  					</table>
	  				</div>
	  				<div class="seCensor">
	  					<form action="/updateApprovalReceipt" method="post" id="verifyOpinion_{{receiptList' value.rid}}" name="verifyOpinion_{{receiptList' value.rid}}">
	  						<input type="hidden" id="status_{{receiptList' value.rid}}" name="status" value=""></input>
	  						<input type="hidden" name="rid" value="{{receiptList' value.rid}}"></input>
	  						<input type="hidden" name="Locate" value="{{receiptList' value.Locate}}"></input>
	  						
		  					<div class="title">
		  					{{receiptDetail' value.receiptOrder}}
		  					</div>
		  					<div class="censorList">
		  					<ul>
		  						<li class="post">
		  							<div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg" width="32"></div>
		  							<div class="comment">
		  								<p><span class="fR">{{receiptDetail' value.date}}</span>{{receiptList' value.staffDetail.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>
		  							<!-- if {{receiptDetail' value' value.status}}==4 -->
		  							<div class="comment">
		  								{{receiptDetail' value' value.1}}
		  								<p><textarea name="opinion" id="opinion_{{receiptList' value.rid}}" placeholder="填写审批意见（可选）"></textarea></p>
		  							</div>
		  							<!-- else -->
		  							<div class="comment">
		  								<p class="colGray"><span class="fR">{{receiptDetail' value' value.date}}</span>{{receiptDetail' value' value.1}}</p>
		  								<p>{{receiptDetail' value' value.opinion}}</p>
		  							</div>
		  							<!-- endif -->
		  						</li>
		  						<!-- endloop -->
		  						
		  					</ul>
		  					</div>
		  					<div class="reportButton">
		  						<!-- if {{receiptDetail' value.button}}==4 -->
		  						<a href="javascript:void(0)" onClick="updateApprovalReceipt(3,{{receiptList' value.rid}})" class="buttonUndone">退回</a>
		  						<a href="javascript:void(0)" onClick="updateApprovalReceipt(1,{{receiptList' value.rid}})" class="buttonDone">同意支付</a>
		  						<!-- endif -->
		  					</div>
	  					</form>
	  				</div>
	  				<!--<div class="seReport">
	  					<div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg">{{receiptList' value.staffDetail.username}}</div>
	  					<div class="taC">{{receiptList' value.staffDetail.category}}</div>
	  				</div>-->
	  			</div>
	  		<!-- endloop -->	
	  			
	  		</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>