|
@@ -4,7 +4,7 @@
|
|
<meta charset="utf-8">
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<!--360浏览器优先以webkit内核解析-->
|
|
<!--360浏览器优先以webkit内核解析-->
|
|
- <title>首佳介绍</title>
|
|
|
|
|
|
+ <title>学区查询</title>
|
|
<link rel="shortcut icon" href="favicon.ico">
|
|
<link rel="shortcut icon" href="favicon.ico">
|
|
<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
|
|
<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
|
|
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
|
|
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
|
|
@@ -42,7 +42,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
- <label class="col-sm-3 control-label is-required">学校:</label>
|
|
|
|
|
|
+ <label class="col-sm-3 control-label">学校:</label>
|
|
<div id="schoolId" class="col-sm-8"></div>
|
|
<div id="schoolId" class="col-sm-8"></div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</form>
|
|
@@ -57,17 +57,23 @@
|
|
<script th:src="@{/ajax/libs/select2/select2.min.js?v=4.0.13}"></script>
|
|
<script th:src="@{/ajax/libs/select2/select2.min.js?v=4.0.13}"></script>
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
function submitHandler() {
|
|
function submitHandler() {
|
|
- $.post("/schooldistrict/index/list", {
|
|
|
|
- schoolType: $("#schoolType").val(),
|
|
|
|
- pId: $("#pId").val(),
|
|
|
|
- vId: $("#vId").val()
|
|
|
|
- }, function(result) {
|
|
|
|
- var name = "";
|
|
|
|
- $.each(result.rows, function (i, item) {
|
|
|
|
- name += item.schoolName + ",";
|
|
|
|
- })
|
|
|
|
- $("#schoolId").empty().append(name.substring(0, name.length-1));
|
|
|
|
- });
|
|
|
|
|
|
+ if ($.validate.form('form-pv-add')) {
|
|
|
|
+ $.post("/schooldistrict/index/list", {
|
|
|
|
+ schoolType: $("#schoolType").val(),
|
|
|
|
+ pId: $("#pId").val(),
|
|
|
|
+ vId: $("#vId").val()
|
|
|
|
+ }, function(result) {
|
|
|
|
+ var name = "";
|
|
|
|
+ if (result.rows.length == 0) {
|
|
|
|
+ name += "暂无学区 ";
|
|
|
|
+ } else {
|
|
|
|
+ $.each(result.rows, function (i, item) {
|
|
|
|
+ name += item.schoolName + ",";
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ $("#schoolId").empty().append(name.substring(0, name.length-1));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
function getData(array) {
|
|
function getData(array) {
|
|
@@ -81,24 +87,25 @@
|
|
$(function() {
|
|
$(function() {
|
|
$('#pId').select2({
|
|
$('#pId').select2({
|
|
placeholder: "请选择派出所",
|
|
placeholder: "请选择派出所",
|
|
- allowClear: true
|
|
|
|
|
|
+ allowClear: false
|
|
}).on('select2:select', function (e) {
|
|
}).on('select2:select', function (e) {
|
|
//处理自己的业务
|
|
//处理自己的业务
|
|
$.get("/schooldistrict/policestationvillage/getAllByParentId?parentId=" + this.value, function(result) {
|
|
$.get("/schooldistrict/policestationvillage/getAllByParentId?parentId=" + this.value, function(result) {
|
|
$('#vId').empty().select2({
|
|
$('#vId').empty().select2({
|
|
data: getData(result),
|
|
data: getData(result),
|
|
placeholder: "请选择委(村)",
|
|
placeholder: "请选择委(村)",
|
|
- allowClear: true
|
|
|
|
|
|
+ allowClear: false
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
$('#vId').select2({
|
|
$('#vId').select2({
|
|
placeholder: "请选择委(村)",
|
|
placeholder: "请选择委(村)",
|
|
- allowClear: true
|
|
|
|
|
|
+ allowClear: false
|
|
});
|
|
});
|
|
$('#schoolType').select2({
|
|
$('#schoolType').select2({
|
|
placeholder: "请选择中、小学",
|
|
placeholder: "请选择中、小学",
|
|
- allowClear: true
|
|
|
|
|
|
+ allowClear: false,
|
|
|
|
+ minimumResultsForSearch: -1
|
|
});
|
|
});
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|