<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改使用记录')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-record_use-edit" th:object="${recordUse}">
            <input name="objId" th:field="*{objId}" type="hidden">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">设备ID：</label>
                    <div class="col-sm-8">
                        <input name="deviceId" th:field="*{deviceId}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">设备编码：</label>
                    <div class="col-sm-8">
                        <input name="deviceCode" th:field="*{deviceCode}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">设备名称：</label>
                    <div class="col-sm-8">
                        <input name="deviceName" th:field="*{deviceName}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">设备类型：</label>
                    <div class="col-sm-8">
                        <select name="deviceType" class="form-control" th:with="type=${@baseTypeService.selectBaseTypeList(null)}">
                            <option th:each="dict : ${type}" th:text="${dict.deviceTypeName}" th:value="${dict.deviceTypeName}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">开锁时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="openTime" th:value="${#dates.format(recordUse.openTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">关锁时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="closeTime" th:value="${#dates.format(recordUse.closeTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">使用时间(小时)：</label>
                    <div class="col-sm-8">
                        <input name="useTime" th:field="*{useTime}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">默认使用时间：</label>
                    <div class="col-sm-8">
                        <input name="defaultTime" th:field="*{defaultTime}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">计费价格：</label>
                    <div class="col-sm-8">
                        <input name="chargePrice" th:field="*{chargePrice}" class="form-control" type="text">
                    </div>
                </div>
            </div>

            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">超时状态：</label>
                    <div class="col-sm-8">
                        <select name="overtimeState" class="form-control"  th:field="*{overtimeState}" th:with="type=${@dict.getType('overtime_state')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">使用状态：</label>
                    <div class="col-sm-8">
                        <select name="useState" class="form-control" th:field="*{useState}" th:with="type=${@dict.getType('record_use_state')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">借用人：</label>
                    <div class="col-sm-8">
                        <input name="useUser" th:field="*{useUser}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">借用单位：</label>
                    <div class="col-sm-8">
                        <input name="useUnit" th:field="*{useUnit}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">统计年份：</label>
                    <div class="col-sm-8">
                        <input name="queryYear" th:field="*{queryYear}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">统计月份：</label>
                    <div class="col-sm-8">
                        <input name="queryMonth" th:field="*{queryMonth}" class="form-control" type="text">
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "device/record_use";
        $("#form-record_use-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-record_use-edit').serialize());
            }
        }

        $("input[name='openTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='closeTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>