<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('钱包列表')" />
	<th:block th:include="include :: layout-latest-css" />
	<th:block th:include="include :: ztree-css" />
</head>
<body class="gray-bg">
	<div class="ui-layout-center">
		<div class="container-div">
			<div class="row">
				<div class="col-sm-12 search-collapse">
					<form id="user-form">
						<input type="hidden" id="deptId" name="deptId">
		                <input type="hidden" id="parentId" name="parentId">
						<div class="select-list">
							<ul>
								<li>
									<p th:utext="#{wallet.information.list.userExtId}"></p>：<input type="text" name="userExtId"/>
								</li>
								<li>
									<p th:utext="#{wallet.information.list.userExtName}"></p>：<input type="text" name="userExtName"/>
								</li>
                                <li>
                                    <p th:utext="#{wallet.information.list.walletNo}"></p>：<input type="text" name="walletNo"/>
                                </li>
								<li>
									<p th:utext="#{wallet.information.list.currency}"></p>：<select name="currency" th:with="type=${@dict.getType('adam_trans_currency')}">
										<option value=""><p th:utext="#{admin.page.common.all}"></p></option>
										<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
									</select>
								</li>
                                <li>
                                    <p th:utext="#{wallet.information.list.status}"></p>：<select name="status" th:with="type=${@dict.getType('fin_wallet_status')}">
                                    <option value=""><p th:utext="#{admin.page.common.all}"></p></option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                                </li>
                                <li>
                                    <p th:utext="#{wallet.information.list.payStatus}"></p>：<select name="payStatus" th:with="type=${@dict.getType('fin_wallet_pay_status')}">
                                    <option value=""><p th:utext="#{admin.page.common.all}"></p></option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                                </li>
								<li class="select-time">
									<label><p th:utext="#{wallet.information.list.createTime}"></p>： </label>
									<input type="text" class="time-input" id="startTime" th:placeholder="#{admin.page.common.startTime}" name="startTimeStr"/>
									<span>-</span>
									<input type="text" class="time-input" id="endTime" th:placeholder="#{admin.page.common.endTime}" name="endTimeStr"/>
								</li>
								<li>
									<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;<p th:utext="#{admin.page.common.search}"></p></a>
								    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;<p th:utext="#{admin.page.common.reset}"></p></a>
								</li>
							</ul>
						</div>
					</form>
				</div>

		        <div class="col-sm-12 select-table table-striped">
				    <table id="bootstrap-table"></table>
				</div>
			</div>
		</div>
	</div>

	<th:block th:include="include :: footer" />
	<th:block th:include="include :: layout-latest-js" />
	<th:block th:include="include :: ztree-js" />
	<script th:inline="javascript">
		var editFlag = [[${@permission.hasPermi('system:user:edit')}]];
		var removeFlag = [[${@permission.hasPermi('system:user:remove')}]];
        var datasStatus = [[${@dict.getType('fin_wallet_status')}]];
        var datasPayStatus = [[${@dict.getType('fin_wallet_pay_status')}]];
		var prefix = ctx + "wallet/information";

		$(function() {
		    var panehHidden = false;
		    if ($(this).width() < 769) {
		        panehHidden = true;
		    }
		    $('body').layout({ initClosed: panehHidden, west__size: 185 });
		    queryUserList();
		});

		function queryUserList() {
		    var options = {
		        url: prefix + "/list",
		        exportUrl: prefix + "/export",
		        importUrl: prefix + "/importData",
		        importTemplateUrl: prefix + "/importTemplate",
		        sortName: "createTime",
		        sortOrder: "desc",
		        modalName: "用户",
		        columns: [{
		            checkbox: false
		        },
		        {
		            field: 'userExtId',
		            title: [[#{wallet.information.list.userExtId}]]
		        },
		        {
		            field: 'userExtName',
		            title: [[#{wallet.information.list.userExtName}]]
		        },
		        {
		            field: 'walletNo',
		            title: [[#{wallet.information.list.walletNo}]]
		        },
		        {
		            field: 'alias',
		            title: [[#{wallet.information.list.alias}]]
		        },
		        {
		            field: 'currency',
		            title: [[#{wallet.information.list.currency}]]
		        },
		        {
		            field: 'status',
		            title: [[#{wallet.information.list.status}]],
                    align: 'center',
                    formatter: function(value) {
                        return $.table.selectDictLabel(datasStatus, value);
                    }
		        },
		        {
		            field: 'payStatus',
		            title: [[#{wallet.information.list.payStatus}]],
                    align: 'center',
                    formatter: function(value) {
                        return $.table.selectDictLabel(datasPayStatus, value);
                    }
		        },
		        {
		            field: 'balance',
		            title: [[#{wallet.information.list.balance}]],
                    align: 'right'
		        },
		        {
		            field: 'balanceAvailable',
		            title: [[#{wallet.information.list.balanceAvailable}]],
                    align: 'right'
		        },
		        {
		            field: 'balancePending',
		            title: [[#{wallet.information.list.balancePending}]],
                    align: 'right'
		        },
		        {
		            field: 'balanceFrozen',
		            title: [[#{wallet.information.list.balanceFrozen}]],
                    align: 'right'
		        },
		        {
		            field: 'createTime',
		            title: [[#{wallet.information.list.createTime}]],
                    formatter: function (value) {
                        var arr = value;
                        if (arr == null || arr == "") {
                            return "-";
                        } else {
                            for (var i = 0; i < arr.length; i++) {
                                if (arr[i] < 10) {
                                    arr[i] = "0" + arr[i];
                                }
                            }
                            if (arr.length == 5) {
                                var getFormatTime = arr[0] + "-" + arr[1] + "-" + arr[2] + "\t" + arr[3] + ":" + arr[4] + ":" + "00";
                            } else {
                                var getFormatTime = arr[0] + "-" + arr[1] + "-" + arr[2] + "\t" + arr[3] + ":" + arr[4] + ":" + arr[5];
                            }
                            return getFormatTime;
                        }
                    }
		        }]
		    };
		    $.table.init(options);
		}

		$('#btnExpand').click(function() {
			$._tree.expandAll(true);
		    $(this).hide();
		    $('#btnCollapse').show();
		});

		$('#btnCollapse').click(function() {
			$._tree.expandAll(false);
		    $(this).hide();
		    $('#btnExpand').show();
		});
	</script>
</body>
</html>
