<!DOCTYPE html>
<html lang="zh">
<head>
	<@meta/>
	<title>数据导出</title>
	<#include "admin/common/include_hplus.ftl">
</head>
<body class="gray-bg">
<input type="hidden" id="moduleId" value="${module.oid}"/>
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox ">
				<div class="ibox-title">
					<h3>${module.name}</h3></a>
				</div>
				<div class="ibox-content">

					<form  class="form-inline">
						<div class="form-group">
							<label>时间范围</label>
							<input class="form-control input-sm" type="text" data-date-range="date" name="startDate" id="startDate">
						</div>
						<div class="form-group">
							<input class="form-control input-sm" type="text" data-date-range="date" name="endDate" id="endDate">
						</div>
					</form>

					<form class="form-horizontal m-t">
						<div class="form-group" style="margin-left: unset;">
							<button class="btn btn-info" type="button" id="btn_ep_inquiry">导出问诊订单</button>
						</div>
						<div class="form-group" style="margin-left: unset;">
							<button class="btn btn-info" type="button" id="btn_ep_medicine">导出药品订单</button>
							<button class="btn btn-info" type="button" id="btn_ep_medicine_detail">导出药品订单明细</button>
						</div>
						<div class="form-group" style="margin-left: unset;">
							<button class="btn btn-info" type="button" id="btn_ep_finance">导出资金明细</button>
						</div>
					</form>

				</div>
			</div>
		</div>
	</div>
</div>
<script>
    $(function(){

		laydate.render({
			elem: '#startDate'
			,format: 'yyyy-MM-dd'
		});
		laydate.render({
			elem: '#endDate'
			,format: 'yyyy-MM-dd'
		});

        $('#btn_ep_inquiry').click(function(e){
			var startDate = $('input[name=startDate]').val() || '';
			if (!startDate) return MsgBox.warn('请选择开始时间');
			var endDate = $('input[name=endDate]').val() || '';
			window.location.href = Config.ROOT + '/yiliao/export/inquiry?startDate=' + startDate + '&endDate=' + endDate;
		});

		$('#btn_ep_medicine').click(function(e){
			var startDate = $('input[name=startDate]').val() || '';
			if (!startDate) return MsgBox.warn('请选择开始时间');
			var endDate = $('input[name=endDate]').val() || '';
			window.location.href = Config.ROOT + '/yiliao/export/medicine?startDate=' + startDate + '&endDate=' + endDate;
		});

		$('#btn_ep_medicine_detail').click(function(e){
			var startDate = $('input[name=startDate]').val() || '';
			if (!startDate) return MsgBox.warn('请选择开始时间');
			var endDate = $('input[name=endDate]').val() || '';
			window.location.href = Config.ROOT + '/yiliao/export/medicineDetail?startDate=' + startDate + '&endDate=' + endDate;
		});

		$('#btn_ep_finance').click(function(e){
			var startDate = $('input[name=startDate]').val() || '';
			if (!startDate) return MsgBox.warn('请选择开始时间');
			var endDate = $('input[name=endDate]').val() || '';
			window.location.href = Config.ROOT + '/yiliao/export/finance?startDate=' + startDate + '&endDate=' + endDate;
		});

    });
</script>
</body>
</html>
