|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<title>增加中招招生计划</title>
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
|
<meta name="renderer" content="webkit">
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
<meta name="viewport"
|
|
|
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
|
|
<link rel="stylesheet" href="../../static/css/font.css">
|
|
|
<link rel="stylesheet" href="../../static/css/weadmin.css">
|
|
|
<link rel="stylesheet" href="../../lib/layui/css/layui.css">
|
|
|
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
|
|
|
<!--[if lt IE 9]>
|
|
|
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
|
|
|
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
|
|
|
<![endif]-->
|
|
|
<style>
|
|
|
select {
|
|
|
width: 180px;
|
|
|
height: 38px;
|
|
|
line-height: 38px;
|
|
|
border: 1px solid #ccc;
|
|
|
border-radius: 3px;
|
|
|
font-size: 15px;
|
|
|
padding-left: 6px;
|
|
|
color: #666;
|
|
|
}
|
|
|
</style>
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
<div class="weadmin-body">
|
|
|
<div class="layui-form-item">
|
|
|
<label for="" class="layui-form-label">
|
|
|
<span class="we-red">*</span> 省份
|
|
|
</label>
|
|
|
<div class="layui-input-inline" id="select_1"></div>
|
|
|
<script type="text/html" id="test1">
|
|
|
<select name="sel1" id="sel1">
|
|
|
<% for (var i = 0; i < data.length; i ++) { %>
|
|
|
<option value="<%=data[i].area_code%>"><%=data[i].area_name%></option>
|
|
|
<% } %>
|
|
|
</select>
|
|
|
</script>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<label for="" class="layui-form-label">
|
|
|
<span class="we-red">*</span> 专业
|
|
|
</label>
|
|
|
<div class="layui-input-inline" id="select_2"></div>
|
|
|
<script type="text/html" id="test2">
|
|
|
<select id="sel2" name="service_type" lay-filter="top1">
|
|
|
<% for (var i = 0; i < data.length;
|
|
|
i ++) { %>
|
|
|
<option value="<%=data[i].zhuanye_code%>"><%=data[i].zhuanye_name%></option>
|
|
|
<% } %></select>
|
|
|
</script>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<label for="" class="layui-form-label">
|
|
|
<span class="we-red">*</span> 招生对象
|
|
|
</label>
|
|
|
<div class="layui-input-inline " id="select_3"></div>
|
|
|
<script type="text/html" id="test3">
|
|
|
<select id="sel3" name="service_type" lay-filter="top1">
|
|
|
<% for (var i = 0; i < data.length;
|
|
|
i ++) { %>
|
|
|
<option value="<%=data[i].zsdx_id%>"><%=data[i].zsdx_name%></option>
|
|
|
<% } %>
|
|
|
</select>
|
|
|
</script>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<label for="" class="layui-form-label">
|
|
|
<span class="we-red">*</span> 计划人数
|
|
|
</label>
|
|
|
<div class="layui-input-inline ">
|
|
|
<input type="text" id="zhaosheng_count" name="zhaosheng_count" lay-verify="required|contentLength"
|
|
|
min="2" max="64" autocomplete="off" class="layui-input" style=" width: 350px">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<label for="" class="layui-form-label">
|
|
|
</label>
|
|
|
<button class="layui-btn" lay-filter="save" lay-submit="" id="save">确定</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<script src="../../lib/layui/layui.js"></script>
|
|
|
<script src="../../lib/template.js"></script>
|
|
|
<script src="../../lib/base64.js"></script>
|
|
|
<script>
|
|
|
window.GetQueryString = function (name, istop) {
|
|
|
const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
|
var r = window.location.search.substr(1).match(reg);
|
|
|
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
|
|
|
|
|
|
if (r != null) return unescape(r[2]);
|
|
|
return null;
|
|
|
};
|
|
|
|
|
|
layui.extend({
|
|
|
admin: '{/}../../static/js/admin'
|
|
|
});
|
|
|
layui.use(['form', 'jquery', 'admin', 'layer', 'laytpl'], function () {
|
|
|
var form = layui.form,
|
|
|
$ = layui.jquery,
|
|
|
admin = layui.admin,
|
|
|
layer = layui.layer,
|
|
|
laytpl = layui.laytpl;
|
|
|
//绑定省份下拉框
|
|
|
function bindShengFen() {
|
|
|
var area_code="";
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
dataType: "json",
|
|
|
url: "/baseService/xueji/common_getShengFen?area_code="+area_code,
|
|
|
success: function (data) {
|
|
|
var html = template.render('test1', data);
|
|
|
document.getElementById('select_1').innerHTML = html;
|
|
|
}
|
|
|
})
|
|
|
};
|
|
|
bindShengFen();
|
|
|
//绑定专业下拉框
|
|
|
function bindZhuanYeSelect() {
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
dataType: "json",
|
|
|
async: false,
|
|
|
url: "/baseService/xueji/common_getZhuanYe",
|
|
|
success: function (data) {
|
|
|
var html = template.render('test2', data);
|
|
|
document.getElementById('select_2').innerHTML = html;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
bindZhuanYeSelect();
|
|
|
//绑定招生对象下拉框
|
|
|
function bindZSDXSelect() {
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
dataType: "json",
|
|
|
async: false,
|
|
|
url: "/baseService/xueji/common_getZSDX?type_id=4",//type_id=1:高招、扩招;2:单招;3:对口升学;4:中招
|
|
|
success: function (data) {
|
|
|
var html = template.render('test3', data);
|
|
|
document.getElementById('select_3').innerHTML = html;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
bindZSDXSelect();
|
|
|
//监听提交
|
|
|
form.on('submit(save)', function (data) {
|
|
|
//读取初始化值
|
|
|
var batch_id = GetQueryString("batch_id");
|
|
|
var person_type_id = GetQueryString("person_type_id");
|
|
|
var area_code = $("#sel1").val();
|
|
|
var zhuanye_code = $("#sel2").val();
|
|
|
var zsdx_id=$("#sel3").val();
|
|
|
var zhaosheng_count = $("#zhaosheng_count").val();
|
|
|
var data = {
|
|
|
batch_id: batch_id,
|
|
|
person_type_id: person_type_id,
|
|
|
area_code:area_code,
|
|
|
zhuanye_code: zhuanye_code,
|
|
|
zsdx_id:zsdx_id,
|
|
|
zhaosheng_count: zhaosheng_count
|
|
|
}
|
|
|
if (zhaosheng_count == "") {
|
|
|
layer.alert("请输入计划招生个数", {icon: 0})
|
|
|
return;
|
|
|
}
|
|
|
var ival = parseInt(zhaosheng_count);
|
|
|
if(!isNaN(ival)) {
|
|
|
if ((ival < 0) || (ival > 10000)) {
|
|
|
layer.msg('输入计划人数范围不正确,请检查后重新输入!允许范围0-10000', {icon: 2, time: 2000, shade: 0.1});
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
layer.msg('输入计划人数不是合法的数字!', {icon: 2, time: 2000, shade: 0.1});
|
|
|
return;
|
|
|
}
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
async: false,
|
|
|
dataType: "json",
|
|
|
url: "/baseService/xueji/zz_addZhaoShengJiHua",
|
|
|
data: data,
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
layer.msg("保存成功", {icon: 1, time: 1000, shade: [0.5, '#000', true]}, function () {
|
|
|
var index = parent.layer.getFrameIndex(window.name);
|
|
|
parent.layer.close(index);
|
|
|
parent.layui.table.reload('idTest', {
|
|
|
page: {
|
|
|
curr: 1
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
|
layer.alert(data.message, {icon: 0})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
return false;
|
|
|
});
|
|
|
});
|
|
|
</script>
|
|
|
</body>
|
|
|
</html> |