123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/ClassroomReserve/Edit";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //刷新
- function reload() {
- $("#dgClassroomReserveList").cmsXDataTable("load", $.getDataGridParams("dgClassroomReserveList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgClassroomReserveList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.ClassroomReserveID);
- });
- return d;
- }
- //预留(新增)
- function ClassroomReserve_Add() {
- //var redirectTo = url + "?MNU=" + mnu;
- //$.popupTopWindow('教室预留', redirectTo, 750, 300, null, null);
- //采用以下方式新增
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ClassroomReserve/ClassroomReserveBatchAdd" + "?MNU=" + mnu;
- $.popupTopWindow('教室预留', redirectTo, 1080, 530, reload, null);
- }
- //修改按钮
- function ClassroomReserve_Edit() {
- var d = validChoose();
- if (d.length == 0) {
- $.messager.alert("系统信息", "请选择您要修改的信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择单个记录进行修改。");
- return;
- }
- var redirectTo = url + "?classroomReserveID=" + d + "&MNU=" + mnu + "&type=edit";
- $.popupTopWindow('教室预留修改', redirectTo, 750, 300, null, null);
- }
- //查看
- function edit(rowindex, rowdata) {
- var redirectTo = url + "?classroomReserveID=" + rowdata.ClassroomReserveID + "&MNU=" + mnu + "&type=detail";
- $.popupTopWindow('教室预留信息', redirectTo, 750, 300, null, null);
- }
- //解除(删除)
- function ClassroomReserve_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要解除的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要解除选择的信息?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ClassroomReserve/Delete', { classroomReserveIDs: d }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", data.Message);
- $("#dgClassroomReserveList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //排课分配院系明细(对应教室信息)
- function editScheduleCollege(rowindex, rowdata) {
- redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Classroom/ClassroomCollegeList?classroomID=" + rowdata.ClassroomID + "&MNU=" + mnu;
- $.popupTopWindow('排课分配院系明细', redirectTo, 1080, 530, null, null);
- }
- //设置列颜色为红色
- function SetRedColumn(index, row, value) {
- return " <span style=\"color: red;\">" + value + "</span>";
- }
- //设置相应的行颜色为红色
- function SetRedGrid(rowIndex, rowData) {
- if (rowData.IsAvailable != true) {
- return "color: red;";
- } else {
- return "";
- }
- }
- //导出Excel
- function ClassroomReserve_Export() {
- $("#formQuery").submit();
- }
- //联动查询
- function queryCampus(data) {
- reload();
- }
|