|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-05-14 09:49
- * 描 述:选修课排课
- */
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
-
- // 当前学期选修排课数据同步
- $('#lr_arrange').on('click', function () {
- learun.layerConfirm('是否确认同步数据!', function (res) {
- if (res) {
- learun.getForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermOfElective/AsyncArrangeLessonOfElectiveData', function () {
- refreshGirdData();
- });
- }
- });
-
- });
- //清空当前学期选修排课数据
- $('#lr_update').on('click', function () {
- learun.layerConfirm('是否确认清空数据!', function (res) {
- if (res) {
- learun.getForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermOfElective/AsyncModifyArrangeLessonOfElectiveData', function () {
- refreshGirdData();
- });
- }
- });
-
- });
- // 按条件清空
- $('#emptyByCondition').on('click', function () {
- learun.layerForm({
- id: 'EmptyByConditionForm',
- title: '按条件清空选修排课数据',
- url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermOfElective/EmptyByConditionForm',
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 按条件同步
- $('#syncByCondition').on('click', function () {
- learun.layerForm({
- id: 'SyncByConditionForm',
- title: '按条件同步选修排课数据',
- url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermOfElective/SyncByConditionForm',
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermOfElective/GetPageList',
- headData: [
- { label: "上课日期", name: "LessonDate", width: 130, align: "left" },
- { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
- { label: "学期", name: "Semester", width: 100, align: "left" },
- { label: "课程号", name: "LessonNo", width: 100, align: "left" },
- {
- label: "课程名称", name: "LessonNo", width: 150, 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: "LessonSortNo", width: 100, align: "left" },
- { label: "上课节次(如 11 代表星期一第一节课)", name: "LessonSection", width: 220, align: "left" },
- { label: "上课时间", name: "LessonTime", width: 100, align: "left" },
- { label: "学分", name: "StudyScore", width: 100, align: "left" },
- { label: "教师号", name: "EmpNo", width: 100, align: "left" },
- {
- label: "教师姓名", name: "EmpNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
- key: value,
- keyId: 'empno',
- callback: function (_data) {
- callback(_data['empname']);
- }
- });
- }
- },
- { label: "教室号", name: "ClassRoomNo", width: 100, align: "left" },
- {
- label: "教室名称", name: "ClassRoomNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo',
- key: value,
- keyId: 'classroomno',
- callback: function (_data) {
- callback(_data['classroomname']);
- }
- });
- }
- },
- ],
- mainId: 'Id',
- isPage: true,
- sidx: 'PaiKeId,LessonDate',
- sord: 'asc'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|