|
|
|
@ -1,9 +1,40 @@
|
|
|
|
|
layui.define([ 'form', 'laydate', 'table','teachingManagementApi','table'], function(exports) {
|
|
|
|
|
layui.define(['form', 'laydate', 'table', 'teachingManagementApi', 'table', 'xmSelect'], function (exports) {
|
|
|
|
|
var form = layui.form;
|
|
|
|
|
var table = layui.table;
|
|
|
|
|
var xmSelect = layui.xmSelect;
|
|
|
|
|
var teachingManagementApi = layui.teachingManagementApi;
|
|
|
|
|
var index = layui.index;
|
|
|
|
|
var xxTable = null;
|
|
|
|
|
|
|
|
|
|
var universityFacultyId = $("#addForm select[name='universityFacultyInfo']").val();
|
|
|
|
|
|
|
|
|
|
var universitySystemId = $("#addForm select[name='universitySystemInfo']").val();
|
|
|
|
|
var classData = Common.getAjax('/jlw/schoolClass/getValues.json', {
|
|
|
|
|
universitySystemId: universitySystemId,
|
|
|
|
|
universityFacultyId: universityFacultyId
|
|
|
|
|
}).data;//上课班级多选框data
|
|
|
|
|
var xmSeValue = $("#demo1").data('value');
|
|
|
|
|
var xmSeInitValue = [];
|
|
|
|
|
if (!$.isEmpty(xmSeValue)) {
|
|
|
|
|
if (xmSeValue.toString().indexOf(",") >= 0) {
|
|
|
|
|
xmSeValue.split(',').forEach(function (value) {
|
|
|
|
|
xmSeInitValue.push(parseInt(value))
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
xmSeInitValue.push(xmSeValue)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*班级下拉多选*/
|
|
|
|
|
var demo1 = xmSelect.render({
|
|
|
|
|
el: '#demo1',
|
|
|
|
|
name: 'schoolClassInfo',
|
|
|
|
|
data: classData,
|
|
|
|
|
initValue: xmSeInitValue,//xxxx为你当前的value值
|
|
|
|
|
prop: { // 也许你的数据库返回的并不是name和value, 也许你提交的时候不止name和value, 怎么办? 自定义就行
|
|
|
|
|
name: 'className',
|
|
|
|
|
value: 'classId'
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
xxTable = table.render({
|
|
|
|
|
elem : '#xxTable',
|
|
|
|
|
height : Lib.getTableHeight(1),
|
|
|
|
@ -89,12 +120,28 @@ layui.define([ 'form', 'laydate', 'table','teachingManagementApi','table'], func
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
//查询专业
|
|
|
|
|
form.on('select(select_universityFaculty)', function (obj) {
|
|
|
|
|
form.on('select(select_universityFaculty)', function (obj) {//院系
|
|
|
|
|
Lib.getUniversitySystems($("select[name='universitySystemInfo']"),obj.value);
|
|
|
|
|
universitySystemId = $("#addForm select[name='universitySystemInfo']").val();
|
|
|
|
|
classData = Common.getAjax('/jlw/schoolClass/getValues.json', {
|
|
|
|
|
universitySystemId: universitySystemId,
|
|
|
|
|
universityFacultyId: obj.value
|
|
|
|
|
}).data;//上课班级多选框data
|
|
|
|
|
demo1.update({
|
|
|
|
|
data: classData
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
//查询班级
|
|
|
|
|
form.on('select(select_universitySystem)', function (obj) {
|
|
|
|
|
form.on('select(select_universitySystem)', function (obj) {//专业
|
|
|
|
|
Lib.getClassByUniSys($("select[name='schoolClassInfo']"),obj.value);
|
|
|
|
|
universityFacultyId = $("#addForm select[name='universityFacultyInfo']").val();
|
|
|
|
|
classData = Common.getAjax('/jlw/schoolClass/getValues.json', {
|
|
|
|
|
universitySystemId: obj.value,
|
|
|
|
|
universityFacultyId: universityFacultyId
|
|
|
|
|
}).data;//上课班级多选框data
|
|
|
|
|
demo1.update({
|
|
|
|
|
data: classData
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
exports('add',view);
|
|
|
|
|
});
|
|
|
|
|