<!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-setting-edit" th:object="${wsyySetting}">
        <input name="wsyysetId" th:field="*{wsyysetId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">最多往后预约几天：</label>
            <div class="col-sm-8">
                <input name="timeScope" th:field="*{timeScope}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">周末是否接受预约：</label>
            <div class="col-sm-8">
                <select name="holidayWork" class="form-control m-b">
                    <option th:selected="*{holidayWork=='1'}" value="1">周六</option>
                    <option th:selected="*{holidayWork=='2'}" value="2">周日</option>
                    <option th:selected="*{holidayWork=='3'}" value="3">周六日</option>
                    <option th:selected="*{holidayWork=='4'}" value="4">不接受</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">每个时间段最多预约多少人：</label>
            <div class="col-sm-8">
                <input name="timeQuantumNum" th:field="*{timeQuantumNum}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">节假日更新：</label>
            <div class="col-sm-8">
                <button type="button" class="btn btn-sm btn-primary" onclick="submitHandlerHoliday()"><i
                        class="fa fa-check"></i>点击更新(不要频繁点击，一年一次)
                </button>&nbsp;
            </div>
        </div>
        <div class="row">
            <div class="col-sm-offset-5 col-sm-10">
                <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i
                        class="fa fa-check"></i>更新配置
                </button>&nbsp;
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "wsyy/setting";
    $("#form-setting-edit").validate({
        focusCleanup: true
    });

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

    function submitHandlerHoliday() {
        if ($.validate.form()) {
            $.operate.post(prefix + "/holiday");
        }
    }
</script>
</body>
</html>