<!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-balance-add">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">用户：</label>
                    <div class="col-sm-8">
<!--                        <input name="userId" class="form-control" type="text">-->
                        <select class="form-control" name="userId" th:with="users=${@user.getUserList()}">
                            <option value="">请选择</option>
                            <option th:each="user : ${users}" th:text="${user.customerName}" th:value="${user.customerId}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">期初数：</label>
                    <div class="col-sm-8">
                        <input name="openingBalance" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">收入：</label>
                    <div class="col-sm-8">
                        <input name="income" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">支出：</label>
                    <div class="col-sm-8">
                        <input name="payment" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">期末数：</label>
                    <div class="col-sm-8">
                        <input name="closingBalance" class="form-control" type="text">
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "business/balance"
        $("#form-balance-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-balance-add').serialize());
            }
        }
    </script>
</body>
</html>