|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-08-26 16:58
- * 描 述:选修合班设置
- */
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- //选课开始后无法进行编辑
- learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/IsSelectElectiveLesson', function (result) {
- if (result.code == 200) {
- } else {
- learun.alert.warning("学生选课已开始,合班编辑功能已停用。");
- $('#lr_add').hide();
- $('#lr_delete').hide();
- }
- });
- page.initGird();
- page.bind();
- page.bindSemesterAndYear();
- },
- bind: function () {
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- page.search(queryJson);
- }, 220, 400);
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- $('#AcademicYearNo').lrselect({
- placeholder: "学年",
- allowSearch: false,
- url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
- value: 'value',
- text: 'text'
- });
- //学期
- $('#Semester').lrselect({
- placeholder: "学期",
- allowSearch: false,
- url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
- value: 'value',
- text: 'text'
- });
- $('#LessonName').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
- // 管理合班
- $('#lr_add').on('click', function () {
- //选课开始后无法进行编辑
- learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/IsSelectElectiveLesson', function (result) {
- if (result.code == 200) {
- learun.layerForm({
- id: 'formmerge',
- title: '管理合班',
- url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/Index',
- width: 1200,
- height: 600,
- btn: null,
- end: function () {
- refreshGirdData();
- }
- });
- } else {
- learun.alert.warning("学生选课已开始,合班编辑功能已停用。");
- $('#lr_add').hide();
- $('#lr_delete').hide();
- }
- });
- });
- // 合班明细
- $('#lr_viewitem').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EMId');
- var LessonName = $('#gridtable').jfGridValue('LessonName');
- var LessonNo = $('#gridtable').jfGridValue('LessonNo');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'formitem',
- title: LessonName + '(' + LessonNo + ')合班明细',
- url: top.$.rootUrl + '/EducationalAdministration/ElectiveMergeItem/Index?EmId=' + keyValue,
- width: 1200,
- height: 600,
- btn: null
- });
- }
-
- });
- // 取消合班
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EMId');
- if (learun.checkrow(keyValue)) {
- learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/IsSelectElectiveLesson', function (result) {
- if (result.code == 200) {
- learun.layerConfirm('是否确认取消合班!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/ElectiveMerge/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- } else {
- learun.alert.warning("学生选课已开始,合班编辑功能已停用。");
- $('#lr_add').hide();
- $('#lr_delete').hide();
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/ElectiveMerge/GetPageList',
- headData: [
- { label: "学年", name: "AcademicYearNo", width: 80, align: "left" },
- { label: "学期", name: "Semester", width: 60, align: "left" },
- { label: "课程编号", name: "LessonNo", width: 100, align: "left" },
- {
- label: "课程名称", name: "LessonNo", width: 200, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
- key: value,
- keyId: 'lessonno',
- callback: function (_data) {
- callback(_data['lessonname']);
- }
- });
- }
- },
- { label: "学分", name: "StudyScore", width: 60, align: "left" }
- ],
- mainId: 'EMId',
- isPage: true
- });
- //page.search();
- },
- bindSemesterAndYear: function () {
- $.ajax({
- url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetSemesterAndYear',
- type: "GET",
- dataType: "json",
- async: false,
- cache: false,
- success: function (res) {
- var data = res.data;
- if (!!data) {
- $('#AcademicYearNo').lrselectSet(data.AcademicYearShort);
- var Semester = data.Semester;
- $('#Semester').lrselectSet(Semester);
-
- var param = { "AcademicYearNo": data.AcademicYearShort, "Semester": data.Semester };
- page.search(param);
- }
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- learun.httpErrorLog(textStatus);
- },
- beforeSend: function () {
- },
- complete: function () {
- }
- });
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- var param = {};
- param.AcademicYearNo = $('#AcademicYearNo').lrselectGet();
- param.Semester = $('#Semester').lrselectGet();
- param.LessonName = $('#LessonName').lrselectGet();
- page.search(param);
- };
- page.init();
- }
|