You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

158 lines
6.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!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">
<script src="../../lib/jquery-1.12.4.min.js"></script>
<script src="../../lib/ztree/jquery.ztree.core-3.5.min.js"></script>
<!-- 让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;
}
.inline {
display: inline-block;
vertical-align: top;
}
ul.log li {
color: #666666;
list-style: none;
padding-left: 10px;
}
</style>
</head>
<body>
<div class="weadmin-body">
<table border=0 align=left width="100%">
<tr>
<td align=left valign=top style="padding-left:10px">
<div class="layui-form-item inline " id="div3">
<label for="" class="layui-form-label" style="padding:9px 0;text-align: left;">
课程类型
</label>
<div class="layui-input-inline" id="select_3"></div>
<script type="text/html" id="test3">
<select name="service_type" id="sel3" onchange="changeCourseType()">
<% for (var i = 0; i < data.length; i ++) { %>
<option value="<%=data[i].kind_id%>"><%=data[i].kind_name%></option>
<% } %>
</select>
</script>
</div>
<div class="layui-form-item inline" id="div4">
<label for="" class="layui-form-label" style="padding:9px 0;text-align: left;">
课程子类
</label>
<div class="layui-input-inline" id="select_4"></div>
<script type="text/html" id="test4">
<select id="sel4" name="service_type" lay-filter="top1">
<option value="-1">请选择</option>
<% for (var i = 0; i < data.length;i ++) { %>
<option value="<%=data[i].kind_id%>"><%=data[i].kind_name%></option>
<% } %></select>
</script>
</div>
</td>
</tr>
<tr>
<td align="center">
<div class="layui-btn" type="button" id="next" onclick="next();">
<span class="layui-icon layui-icon-shrink-right"></span>下一步
</div>
</td>
</tr>
</table>
</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) {
var 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', 'laytpl', 'admin', 'layer', 'table'], function () {
var form = layui.form,
$ = layui.jquery,
admin = layui.admin,
layer = layui.layer,
table = layui.table,
laytpl = layui.laytpl;
// 绑定课程类型
window.bindCourseType = function (parent_id) {
$.ajax({
type: "GET",
async: false,
dataType: "json",
url: "/baseService/teachbase/bindCourseType?parent_id=" + parent_id,
success: function (data) {
if (parent_id == -1) {
var html = template.render('test3', data);
document.getElementById('select_3').innerHTML = html;
} else {
var html = template.render('test4', data);
document.getElementById('select_4').innerHTML = html;
}
}
})
};
//绑定第一个下拉框
bindCourseType(-1);
//绑定第二个下拉框
bindCourseType($("#sel3").val());
//变更课程类型
window.changeCourseType = function () {
//绑定第二个下拉框
bindCourseType($("#sel3").val());
};
//下一步
window.next = function () {
var level_1_id = $("#sel3").val();
var level_2_id = $("#sel4").val();
var level1_name = $("#sel3").find("option:selected").text();
var level2_name = $("#sel4").find("option:selected").text();
var title = '';
if (level_2_id == -1) {
title = '步骤2 ' + level1_name ;
} else {
title = '步骤2 ' + level1_name + '-' + level2_name;
};
//关闭当前frame
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
//打开新的
parent.WeAdminShow(title, './rule_add_course_2.html?level_1_id='+level_1_id+"&level_2_id="+level_2_id+"&rule_id="+GetQueryString("rule_id"), $(parent.window).width() - 100, 680);
};
})
</script>
</body>
</html>