<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>患者消费记录</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link rel="icon" th:href="@{image/sgl.png}" sizes="32x32">
    <script th:src="@{/layui/layui.js}"></script>
    <script th:src="@{/layui/jquery-3.4.1.min.js}"></script>
    <script th:src="@{/js/common.js}"></script>
    <script th:src="@{/js/rules.js}"></script>
    <link rel="stylesheet" th:href="@{/css/common.css}">
</head>
<style>
.btn:hover{color: #555;}
.layui-table-view {margin: 0;}
.layui-tab-card{box-shadow:none;border-radius: 0px;}
.layui-tab{margin:0;}
.layui-tab-content{padding:0;}
.layui-form-radio{margin:0;}
.tdBackground-color{background-color:#ff0000;}
</style>

<body class="layui-layout-body">

	<div class="toolbar">           	
        <div class="layui-inline">
			<button class="layui-btn layui-btn-sm" data-type="search" id="search"><i class="layui-icon">&#xe615;</i>查询</button>
		</div>
    </div>
    	
	<table id="demo" lay-filter="test"></table>	
	   
	
		
</body>   
</html>
<script th:inline="javascript">


</script>
<script>
	var element ,
	    table,
	    laydate,
	    layer,
	    form,
	    tree;
	var tHeight = $(".toolbar").height()+6;
    layui.use(['element','table','laydate','layer','form','tree'], function(){
		element = layui.element;
	    table = layui.table;
	    laydate = layui.laydate;
	    layer = layui.layer;
	    form = layui.form;
	    tree = layui.tree;
	    
	    //表格加载
		table.render({
			elem: '#demo',
			height: 'full-'+tHeight,
			url: '/patient/findPatientAccountPageList?type=9', //数据接口
			title: '退款表',
			page: true ,//开启分页
			limit:20,
			limits:[20,30,50],
			//toolbar: '', //开启工具栏，此处显示默认图标，可以自定义模板
			defaultToolbar: [],	 
			id:'test', 
			cols: [
			 [ //表头
			   {type: 'numbers', title: '序号', width: 30},
			   {field: 'ORDER_NO', title: '订单号', sort: false},
			   {field: 'PATIENT_ID', title: '患者id', sort: false},
			  /*  {field: 'TRUE_NAME', title: '患者姓名', sort: false},
			   {field: 'CARD_NO', title: '就诊卡号', sort: false},
			   {field: 'TYPE', title: '业务类型', sort: false},
			   {field: 'SOURCE', title: '来源', sort: false},
			   {field: 'PAY_WAY', title: '支付方式', sort: false}, */
			   {field: 'REFUND_MONEY', title: '退款金额', sort: false},
			   {field: 'PAY_DATE', title: '退款时间', sort: false},
			   /* {field: 'MONEY_TYPE', title: '费用类型', sort: false},
			   {field: 'PAY_STATUS', title: '支付状态', sort: false}, */
			 ]
			]
		});
	
		//时间控件
		laydate.render({
	  		elem:'#date', //指定元素
	  		eventElem: '.date-input-icon',
	  		trigger: 'click',
		});
		
		//查询
		$("#search").on('click',function(){
			findPatientAccountPageList();
		});
		
        $(".downpanel").on("click", ".layui-select-title", function (e) {
            $(".layui-form-select").not($(this).parents(".layui-form-select")).removeClass("layui-form-selected");
            $(this).parents(".downpanel").toggleClass("layui-form-selected");
            layui.stope(e);
        }).on("click", "dl i", function (e) {
            layui.stope(e);
        });
        $(document).on("click", function (e) {
            $(".layui-form-select").removeClass("layui-form-selected");
        });
    });
    
    
  	function findPatientAccountPageList(){
		var hospitalName = $("#hospitalName").val();
		table.reload('test', {
			method: 'get',
			url:'/patient/findPatientAccountPageList',
			where: {
				'hospitalName':hospitalName,
				'type':9
			},
			page: {
				curr: 1
			}
		});
	}
    </script>