|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2023-05-30 10:02
- * 描 述:线上选修课程设置
- */
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- 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: 'LessonInfoOfElectiveOnline', value: 'lessonno', text: 'lessonname' });
-
- //设置选课专业
- $('#lr_editMajor').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var rowdata = $('#gridtable').jfGridGet('rowdata');
- //判断选中记录是否可以批量管理专业
- $.ajax({
- url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/IsBatchEditMajor',
- data: { data: JSON.stringify(rowdata) },
- type: "post",
- dataType: "json",
- async: false,
- cache: false,
- success: function (data) {
- if (data.data == true) {
- learun.layerForm({
- id: 'formMajor',
- title: '管理选课专业',
- url: top.$.rootUrl + '/EducationalAdministration/ElectiveMajorOnline/Index?LIOEOId=' + keyValue,
- width: 1000,
- height: 700,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- } else {
- return learun.alert.warning('只有同学期同课程支持批量管理专业!');
- }
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- learun.httpErrorLog(textStatus);
- },
- beforeSend: function () {
- },
- complete: function () {
- }
- });
-
- }
- });
-
- //设置人数
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'formNum',
- title: '设置人数',
- url: top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/FormNum?keyValue=' + keyValue,
- width: 400,
- height: 300,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
-
- //查看已审学生
- $('#lr_view').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录进行查看!");
- return;
- }
- learun.layerForm({
- id: 'form',
- title: '查看学生',
- url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectiveOnline/FinishIndex?LIOEOId=' + keyValue,
- width: 1000,
- height: 700,
- btn: null,
- end: function () {
- refreshGirdData();
- }
- });
- }
- });
- //审核学生
- $('#lr_audit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录进行查看!");
- return;
- }
- learun.layerForm({
- id: 'form',
- title: '审核学生',
- url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectiveOnline/AuditIndex?LIOEOId=' + keyValue,
- width: 1000,
- height: 700,
- btn: null,
- end: function () {
- refreshGirdData();
- }
- });
- }
- });
-
- //设置可选
- $('#lr_AllowSelect').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/SetUpIsAllowSelect', { keyValue: keyValue, IsAllowSelect: 1 },
- function () {
- refreshGirdData();
- });
- }
- });
- //取消可选
- $('#lr_CancelSelect').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/SetUpIsAllowSelect', { keyValue: keyValue, IsAllowSelect: 0 },
- function () {
- refreshGirdData();
- });
- }
- });
- },
- 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 () {
- }
- });
-
-
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/GetPageList',
- headData: [
- { label: "课程编号", name: "LessonNo", width: 150, align: "left" },
- { label: "课程名称", name: "LessonName", width: 150, align: "left" },
- { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
- { label: "学期", name: "Semester", width: 100, align: "left" },
- {
- label: "建课教师", name: "EmpNo", width: 150, align: "left"
- },
- {
- label: "建课学校", name: "F_SchoolId", width: 150, align: "left"
- },
- { label: "人数上限", name: "StuNumMax", width: 60, align: "left" },
- { label: "已报人数", name: "StuNumOfApply", width: 60, align: "left" },
- { label: "通过人数", name: "StuNum", width: 60, align: "left" },
- {
- label: "是否可选", name: "IsAllowSelect", width: 80, align: "left",
- formatter: function (cellvalue, rowObject) {
- return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
- }
-
- },
- {
- label: "是否已选专业", name: "IsElectiveMajor", width: 100, align: "left", formatter: function (cellvalue, row) {
- if (!!row.ElectiveMajorOnlineList && row.ElectiveMajorOnlineList.length > 0) {
- return "<span class=\"label label-success\">是</span>";
- } else {
- return "<span class=\"label label-default\">否</span>";
- }
- }
- },
- {
- label: "选课专业", name: "ElectiveMajorOnlineList", width: 150, align: "left", formatter: function (cellvalue, row) {
- var str = "";
- if (!!cellvalue && cellvalue.length > 0) {
- for (var i = 0; i < cellvalue.length; i++) {
- str += cellvalue[i].Grade + "级" + cellvalue[i].MajorName;
- if (i != cellvalue.length - 1) {
- str += ",";
- }
- }
- }
- return str;
- }
- }
- ],
- mainId: 'Id',
- isPage: true,
- isMultiselect: true,
- sidx: 'AcademicYearNo DESC, Semester DESC, LessonNo ASC'
- });
- //page.search();
- },
- search: function (param) {
- param = param || {};
- param.CheckMark = "1";//已启用
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- var param = { "AcademicYearNo": $('#AcademicYearNo').lrselectGet(), "Semester": $('#Semester').lrselectGet() };
- page.search(param);
- };
- page.init();
- }
|