/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:超级管理员 * 日 期:2019-08-26 17:03 * 描 述:选修课合班明细 */ var weekChina = ["一", "二", "三", "四", "五", "六", "日"]; var refreshGirdData; var EmId = request("EmId"); var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); // 新增 $('#lr_add').on('click', function () { learun.layerForm({ id: 'form', title: '新增', url: top.$.rootUrl + '/EducationalAdministration/ElectiveMergeItem/Form', width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); }); // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('EMIId'); if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'form', title: '编辑', url: top.$.rootUrl + '/EducationalAdministration/ElectiveMergeItem/Form?keyValue=' + keyValue, width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); } }); // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('EMIId'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/ElectiveMergeItem/DeleteForm', { keyValue: keyValue}, function () { refreshGirdData(); }); } }); } }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGridLei({ url: top.$.rootUrl + '/EducationalAdministration/ElectiveMergeItem/GetPageList', headData: [ { label: "上课节次", name: "LessonSection", width: 100, align: "left", formatter: function (cellvalue, row) { return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1) + "节"; } }, { label: "上课时间", name: "LessonTime", 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: "ClassRoomName", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo', key: row.ClassRoomNo, keyId: 'classroomno', callback: function (_data) { callback(_data['classroomname']); } }); } }, ], mainId:'EMIId', isPage: true, sidx: 'LessonSection', sord: 'asc' }); page.search(); }, search: function (param) { param = param || {}; param.EmId = EmId; $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { page.search(); }; page.init(); }