<!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-time-edit" th:object="${tbEnrollmentTime}">
        <input name="id" th:field="*{id}" type="hidden">
<!--        <input name="id" th:field="*{schoolCnName}" type="hidden">-->
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">学校：</label>
            <div class="col-sm-8">
                <input name="schoolCnName" id="schoolCnName" th:field="*{schoolCnName}" class="form-control" type="text" disabled="true">
            </div>
        </div>
<!--        <input name="id" th:field="*{schoolCampus}" type="hidden">-->
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">专业：</label>
            <div class="col-sm-8">
                <input name="majorName" id="majorName" th:field="*{majorName}" class="form-control" type="text" disabled="true">
            </div>
        </div>
<!--        <input name="id" th:field="*{majorName}" type="hidden">-->
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">学位：</label>
            <div class="col-sm-8">
                <input name="degreeCnName" id="degreeCnName" th:field="*{degreeCnName}" class="form-control" type="text" disabled="true">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">入学时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="enrollmentTime" th:value="${#dates.format(tbEnrollmentTime.enrollmentTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled="true">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">申请开始时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="applyStartDate" th:value="${#dates.format(tbEnrollmentTime.applyStartDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled="true">
<!--                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">申请结束时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="applyEndDate" th:value="${#dates.format(tbEnrollmentTime.applyEndDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled="true">
<!--                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">审核结果：</label>
            <div class="col-sm-8">
                <input name="checkResult" id="checkResult" th:field="*{checkResult}" class="form-control" type="text" required>
            </div>
        </div>
        <input id="checkStatusDesc" name="checkStatusDesc" th:field="*{checkStatusDesc}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">审核状态：</label>
            <div class="col-sm-8">
                <select id="checkStatus" class="form-control select2-multiple">
                    <option>请选择审核状态：</option>
                </select>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "system/checkTime";
    $("#form-time-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-time-edit').serialize()+
                "&checkStatus="+$('#checkStatus')[0].value);
        }
    }

    $(document).ready(function() {
        $.ajax({
            url: ctx+"system/dict/data/business_check_status",
            type: "get",
            dataType: "json",
            success: function(data){
                for(var i=0; i<data.length; i++){
                    $("#checkStatus").append("<option value='" + data[i].dictValue + "'>" + data[i].dictLabel + "</option>");
                }
                var vtext = $("#checkStatusDesc")[0].value;
                $("#checkStatus").find("option").each(function(){
                    if($(this).text() == vtext)	{
                        $(this).attr("selected",true);
                    }
                });
            }
        });
    });

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

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

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

</script>
</body>
</html>