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

47 lines
1.8 KiB
JavaScript

layui.define([ 'form', 'laydate', 'table','teacherOpenCourseNoticeApi', 'layedit'], function(exports) {
var form = layui.form;
var teacherOpenCourseNoticeApi = layui.teacherOpenCourseNoticeApi;
var index = layui.index;
var layedit = layui.layedit;
var one = layedit.build('noticeContent');
var view = {
init:function(){
Lib.initGenrealForm($("#addForm"),form);
this.initSubmit();
},
initSubmit:function(){
$("#addButton").click(function(){
$("#addForm input[name='noticeContent']").val(layedit.getContent(one));
form.on('submit(form)', function(){
var teacherOpenCourseNoticeId = $("#addForm input[name='teacherOpenCourseNoticeId']").val();
if(!$.isEmpty(teacherOpenCourseNoticeId)){
teacherOpenCourseNoticeApi.updateTeacherOpenCourseNotice($('#addForm'),function(){
parent.window.dataReload();
Common.info("更新成功");
Lib.closeFrame();
});
}else{
teacherOpenCourseNoticeApi.addTeacherOpenCourseNotice($('#addForm'),function(){
parent.window.dataReload();
Common.info("添加成功");
Lib.closeFrame();
});
}
});
});
$("#addButton-cancel").click(function(){
Lib.closeFrame();
});
}
}
form.on('select(select_courseInfoIds)', function (obj) {
Lib.getClassByteacherOpenCourseNotice($("select[name='schoolClassIds']"),obj.value);
});
exports('add',view);
});