<!-- 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 computePrice(){
	var schoolDay=$('#schoolDay').val();
	var price=$('#price').val();
	console.log(schoolDay);
	console.log(schoolDay);
	var sum=price*schoolDay;
	$('#schPrice').html(sum);
	
}
</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;">
				<!-- include 'receiptTrainApprovalForm' -->
				<div class="borad-news">
					<div class="subNav">
			    		<!-- include 'receiptTrainMenu' -->
					</div>
			  		<div class="saeaList">
			  			<!--支出项-->
			  			<div class="clearfix">
			  			<legend><div class="fR"><button type="submit" class="button" href="#add-teach" data-toggle="modal">添加协助人</button></div>协助人</legend>
				  			<table class="table table-bordered table-condensed">
								<tbody>
									<tr><th class="taC">姓名</th><th class="taC"></th></tr>
									<!-- loop RAssistList -->
									<tr>
										<td>{{RAssistList' value.username}}</td>
										<td><a href="javascript:if(confirm('确定移除?')){window.location='/receiptTrainAssistDelDo/{{RAssistList' value.aidKey}}/{{receiptDetail.ridKey}}';}">移除</a></td>
									</tr>
									<!-- endloop -->
								</tbody>
							</table>
						</div>
					</div>
				</div>
		</div>
	</div>
	
	
	
	<div class="modal hide fade " id="add-teach" >
	 <form action="/receiptTrainAssistAddDo" name="receiptTrainAssistAddDo" method="post" class="nice-validator n-yellow" novalidate="novalidate">
        <input type="hidden" name="ridKey" value="{{receiptDetail.ridKey}}">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h3>添加协作人</h3>
                </div>
                <div class="modal-body saeaList">
                	<p>协作人可以与您一起管理培训班结算。</p>
					<select name='sidKey'>
					<!-- loop $assistStaffList -->
						<option value="{{$assistStaffList' value.sidKey}}">{{$assistStaffList' value.category}}-{{$assistStaffList' value.username}}</option>
					<!-- endloop -->
					</select>
                </div>
                <div class="modal-footer">
                	<input type="submit" value="确定" class="button">
                    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
                </div>
            </div>
        </div>
        </form>
    </div>
	
	
	<!--弹出 添加指出 -->
    <div class="modal hide fade" id="add-teach">
    <form action="/receiptTrainLecturerAddDo" name="receiptTrainLecturerAdd" method="post" class="nice-validator n-yellow" novalidate="novalidate">
        <input type="hidden" name="ridKey" value="{{receiptDetail.ridKey}}">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h3>添加讲师</h3>
                </div>
                <div class="modal-body saeaList">
                	<table class="table table-bordered table-condensed">
						<tbody>
						<tr>
							<th class="taC">选择讲师类型</th>
							<td>
								<select name='ltype' id='ltype' ltype>
									<option selected value='INSIDE'>员工</option>
									<option value='OUTSIDE'>外聘</option>
								</select>
							</td>
						</tr>
					</tbody>
				</table>
					<table class="table table-bordered table-condensed">
					<tbody>
						<tr>
							<th class="taC">讲师</th><td>
							<select name='lecturerName' id='lecturerName' selectLecture >
								{{INSIDEhtml}}
							</select>
						</tr>
						
						<tr node-taxation style="display:none;">
							<th class="taC">计税</th><td>
							<select name="taxation">
								<option value='TAXATION'>计税</option>
								<option value='NOTAXATION'>不计税（需提供发票）</option>
							</select>
						</td></tr>
						
						<tr>
							<th class="taC">授课日数</th>
							<td><input name='schoolDay' id='schoolDay' value="0" onkeyup="computePrice()" placeholder="输入授课天数" pattern="[0-9]" min="0" step="0.5" type="number"></td>
						</tr>
						<tr>
							<th class="taC">日授课费</th>
							<td><input name='price' id='price' value="0" onkeyup="computePrice()" placeholder="输入日授课费" pattern="[0-9]" min="0" step="10" type="number"></td>
						</tr>
						<tr>
							<th class="taC">合计应发授课费</th><td id="schPrice"></td>
						</tr>
						</tbody>
					</table>
                </div>
                <div class="modal-footer">
                	<input type="submit" value="确定" class="button">
                    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
                </div>
            </div>
        </div>
        </form>
    </div>
    <!--弹出内容-->
<script type="text/javascript">

$(function() {
	$("select[ltype]").change(function() {
		var ltypeVal=$(this).val();
		var selectLecture=$("select[selectLecture]");
		
		if(ltypeVal=='INSIDE'){
			$("tr[node-taxation]").hide();
			selectLecture.html('{{INSIDEhtml}}');
		}else if(ltypeVal=='OUTSIDE'){
			$("tr[node-taxation]").show();
			selectLecture.html('{{OUTSIDEhtml}}');
		}
	});
	
})
autoFlashHeight();
</script>
</body>
