/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 * 创建人:超级管理员 * 日 期:2021-11-29 11:43 * 描 述:开课计划 */ var acceptClick; var keyValue = request('keyValue'); var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { $('.lr-form-wrap').lrscroll(); page.bind(); page.initData(); }, bind: function () { $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); $('#AcademicYearNo').lrselect({ placeholder: "请选择学年", allowSearch: true, url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', value: 'value', text: 'text' }); $('#LessonSortDetailNo').lrDataSourceSelect({ code: 'CdLessonSortDetail', value: 'lessonsortdetailno', text: 'lessonsortdetailname' }); //年级 $('#Grade').lrselect({ placeholder: "请选择年级", allowSearch: true, url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetGradeData', value: 'value', text: 'text' }); $('#Semester').lrDataItemSelect({ code: 'Semester' }); $('#DeptNo').lrselect({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', value: 'deptno', text: 'deptname', maxHeight: 200, select: function (item) { var NDeptNo = $("#DeptNo").lrselectGet(); if (NDeptNo != null && NDeptNo != "" && NDeptNo != 'undefined') { $('#MajorNo').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', param: { strWhere: " 1=1 and CheckMark=1 and deptno in (" + NDeptNo + ")" }, value: "majorno", text: "majorname", maxHeight: 200 }); } else { $('#MajorNo').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', param: { strWhere: " 1=1 and CheckMark=1 " }, value: "majorno", text: "majorname", maxHeight: 200 }); } } }) $("#MajorNo").lrselect({ select: function (item) { if (item) { $('#LessonNo').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=LessonInfo', param: { strWhere: " 1=1 and CheckMark=1 and teachmajorno='" + item.majorno + "'" }, value: "lessonno", text: "lessonname", maxHeight: 200 }); } } }); $('#LessonNo').lrselect(); $('#TeachDeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); $('#ExamType').lrDataItemSelect({ code: 'ExamType' }); }, initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/GetFormData?keyValue=' + keyValue, function (data) { for (var id in data) { if (!!data[id].length && data[id].length > 0) { $('#' + id).jfGridSet('refreshdata', data[id]); } else { $('[data-table="' + id + '"]').lrSetFormData(data[id]); } } }); } $('#StuSortNo').val('02'); $('#LessonSortNo').val('1'); $('#CheckStyleNo').val('1'); $('#ScoreRecordStyleNo').val('1'); $('#CheckMark').val('1'); $('#ClassroomType').val('1'); $('#ClassroomPracticeType').val('99'); } }; // 保存数据 acceptClick = function (callBack) { if (!$('body').lrValidform()) { return false; } var nName = $("#LessonNo").find(".lr-select-placeholder").text(); var Narray = nName.split("("); $("#LessonName").val(Narray[0]); var postData = { strEntity: JSON.stringify($('body').lrGetFormData()) }; $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); } }); }; page.init(); }