<!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-requirements-edit" th:object="${tbSchoolEntranceRequirements}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">学校名称：</label>
                <div class="col-sm-8">
                    <input name="schoolCnName" th:field="*{schoolCnName}" 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">
                    <input th:field="*{educationType}" 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">
                    <textarea name="requireDesc" rows="10" class="form-control" disabled="true">[[*{requireDesc}]]</textarea>
                </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" />
    <script th:inline="javascript">
        var prefix = ctx + "system/requirementsCheck";
        $("#form-requirements-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-requirements-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);
                        }
                    });
                }
            });
        });
    </script>
</body>
</html>