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.

262 lines
10 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 lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>分配辅导员</title>
<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/ztree/zTreeStyle.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;
}
.disabled {
pointer-events: none;
border: 1px solid #e6e6e6;
background: #FBFBFB;
color: #C9C9C9;
cursor: not-allowed;
opacity: 1;
}
.searchTxt {
width: 194px;
border: 1px solid #dedede;
border-radius: 3px;
height: 37px;
padding-left: 13px;
vertical-align: top;
}
.search {
border: none;
margin-left: 12px;
}
.iconDel {
position: absolute;
right: 92px;
top: 10px;
display: none;
}
.aaa {
background-color: #FBFBFB;
border: 1px solid #e6e6e6;
color: #C9C9C9;
cursor: not-allowed;
opacity: 1;
}
</style>
</head>
<body>
<form class="layui-form">
<div class="weadmin-body">
<input type="hidden" value="" id="class_id">
<div class="layui-form-item">
<label for="" class="layui-form-label" style="padding:9px 0;text-align: left;width:80px">
入学年份
</label>
<div class="layui-input-inline" disabled="true">
<input type="text" id="entry_year" name="entry_year" class="layui-input" style="width:250px" disabled="true">
</div>
</div>
<div class="layui-form-item">
<label for="" class="layui-form-label" style="padding:9px 0;text-align: left;width:80px">
班号
</label>
<div class="layui-form-item inline" disabled="true">
<input type="text" id="class_code" name="class_code" class="layui-input" style="width:250px">
</div>
</div>
<div class="layui-form-item">
<label for="" class="layui-form-label" style="padding:9px 0;text-align: left;width:80px">
班级名称
</label>
<div class="layui-input-inline" disabled="true">
<input type="text" id="class_name" name="class_name" class="layui-input" style="width:250px">
</div>
</div>
<div class="layui-form-item">
<label for="" class="layui-form-label" style="padding:9px 0;text-align: left;width:80px">
班级别名
</label>
<div class="layui-input-inline" disabled="true">
<input type="text" id="altas_name" name="altas_name" class="layui-input" style="width:250px">
</div>
</div>
<div class="layui-form-item" id="fivetothree" style="display: none">
<label for="" class="layui-form-label" style="padding:9px 0;text-align: left;width:80px">
转段标志
</label>
<div class="layui-input-inline " id="view"></div>
<span style="margin-right:55px">
<input type="radio" value="0" id="fivetothree_flag" name="fivetothree_flag" title="未转段" lay-verify="required">
<input type="radio" value="1" id="fivetothree_flag" name="fivetothree_flag" title="已转段" lay-verify="required">
</span>
</div>
<div class="layui-form-item">
<label for="" class="layui-form-label" style="padding:9px 0;text-align: left;width:80px">
选辅导员
</label>
<div class="layui-form-item inline" id="select_1"></div>
<script type="text/html" id="test1" >
<select lay-filter="sel1" lay-verify="required" name="person_id" id="sel1" style="width:250px" lay-search="">
<option value="">----暂无----</option>
{{#layui.each(d.data,function(index,item){ }}
<option value={{item.person_id}}>{{item.person_name}}</option>
{{# }) }}
</select>
</script>
</div>
<div class="layui-form-item" align="center">
<buttin class="layui-btn" id="setTeacherToClass">保存</buttin>
</div>
</div>
<script src="../../lib/layui/layui.js"></script>
<script src="../../lib/template.js"></script>
<script src="../../lib/base64.js"></script>
<script>
//获取url传参的办法
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', 'admin', 'table', 'laytpl', 'layer'], function () {
var form = layui.form,
$ = layui.jquery,
admin = layui.admin,
laytpl = layui.laytpl;
//给定初始值
window.getClassInfo = function (class_id) {
$.ajax({
type: "GET",
async: false,
dataType: "json",
url: "/baseService/xueji/common_getClassInfoById?class_id="+class_id,
success: function (data) {
$("#class_id").val(data.data[0].class_id);
$("#entry_year").val(data.data[0].entry_year);
$("#class_name").val(data.data[0].class_name);
$("#altas_name").val(data.data[0].altas_name);
$("#class_code").val(data.data[0].class_code);
if(data.data[0].allowfivetothree){
$("#fivetothree").show();
}else{
$("#fivetothree").hide();
}
if(data.data[0].fivetothree_flag){
$('input:radio[name=fivetothree_flag]')[1].checked = true;
}else{
$('input:radio[name=fivetothree_flag]')[0].checked = true;
}
}
})
}
window.getTeacherList = function (person_id) {
$.ajax({
type: "GET",
async: false,
dataType: "json",
url: "/baseService/xueji/common_getTeacherList",
success: function (data) {
var lis = [];
var list = {};
for (var i = 0; i < data.data.length; i++) {
lis.push(data.data[i]);
}
list = {
data: lis
}
var getTpl = test1.innerHTML
, select_1 = document.getElementById('select_1');
laytpl(getTpl).render(list, function (html) {
select_1.innerHTML = html;
$("#sel1").find("option[value="+person_id+"]").prop("selected",true);
});
form.render();
}
})
}
$(function () {
var class_id=GetQueryString("class_id");
var person_id=GetQueryString("person_id");
getClassInfo(class_id);
getTeacherList(person_id);
})
$(document).on('click', '#setTeacherToClass', function (data) {
var class_id = $("#class_id").val();
var class_code = $("#class_code").val();
var class_name = $("#class_name").val();
var altas_name = $("#altas_name").val();
var person_id = $("#sel1").val();
var data = {};
var fivetothree_flag=$('input[name="fivetothree_flag"]:checked').val();
//增加
var url = "";
data = {
"class_id": class_id,
"class_code": class_code,
"class_name": class_name,
"altas_name": altas_name,
"person_id": person_id,
"fivetothree_flag":fivetothree_flag
};
url = "/baseService/xueji/new_setTeacherToClass"
//正确
$.ajax({
type: "POST",
dataType: "json",
async: false,
data: data,
url: url,
success: function (data) {
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('tableNewClassList', {page: {curr: 1}});
});
}
});
});
})
</script>
</form>
</body>
</html>