<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('提交订单退款')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-post-add">
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">订单id：</label>
				<div class="col-sm-8">
					<input th:value="71619365224734720" class="form-control" type="text" name="orderTicketsId" id="orderTicketsId" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">快递费：</label>
				<div class="col-sm-8">
					<input th:value="0" class="form-control" type="text" name="RefundPriceExpress">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">入场人：</label>
				<div class="col-sm-8">
					<div class="col-sm-12 select-table table-bordered">
						<table id="bootstrap-table"></table>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea name="reason" class="form-control"></textarea>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "kylin/refund";
	    
		$("#form-post-add").validate({
			onkeyup: false,
			rules:{
				orderTicketsId:{
					submitHandler: function(form) {
						var config = {
							url: prefix + "/applyOrder",
							type: "post",
							dataType: "json",
							data: {
								"orderTicketsId" : function() {
									return $.common.trim($("#orderTicketsId").val());
								}
							},
							beforeSend: function () {
								$.modal.loading("正在查询订单，请稍后...");
							},
							success: function(result) {
								$.modal.closeLoading();
								console.log(result)
							}
						};
						$.ajax(config)
					}
				},
			},
		    focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/apply", $('#form-post-add').serialize());
	        }
	    }
	</script>
</body>
</html>
