ClassroomReserve.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ClassroomReserve/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgClassroomReserveList").cmsXDataTable("load", $.getDataGridParams("dgClassroomReserveList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgClassroomReserveList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.ClassroomReserveID);
  16. });
  17. return d;
  18. }
  19. //预留(新增)
  20. function ClassroomReserve_Add() {
  21. //var redirectTo = url + "?MNU=" + mnu;
  22. //$.popupTopWindow('教室预留', redirectTo, 750, 300, null, null);
  23. //采用以下方式新增
  24. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ClassroomReserve/ClassroomReserveBatchAdd" + "?MNU=" + mnu;
  25. $.popupTopWindow('教室预留', redirectTo, 1080, 530, reload, null);
  26. }
  27. //修改按钮
  28. function ClassroomReserve_Edit() {
  29. var d = validChoose();
  30. if (d.length == 0) {
  31. $.messager.alert("系统信息", "请选择您要修改的信息。");
  32. return;
  33. }
  34. if (d.length > 1) {
  35. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  36. return;
  37. }
  38. var redirectTo = url + "?classroomReserveID=" + d + "&MNU=" + mnu + "&type=edit";
  39. $.popupTopWindow('教室预留修改', redirectTo, 750, 300, null, null);
  40. }
  41. //查看
  42. function edit(rowindex, rowdata) {
  43. var redirectTo = url + "?classroomReserveID=" + rowdata.ClassroomReserveID + "&MNU=" + mnu + "&type=detail";
  44. $.popupTopWindow('教室预留信息', redirectTo, 750, 300, null, null);
  45. }
  46. //解除(删除)
  47. function ClassroomReserve_Delete() {
  48. var d = validChoose().join(',');
  49. if (d == "") {
  50. $.messager.alert("系统提示", "请选择您要解除的信息。");
  51. return;
  52. }
  53. $.messager.confirm("系统提示", "您确定要解除选择的信息?", function (r) {
  54. if (r) {
  55. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ClassroomReserve/Delete', { classroomReserveIDs: d }, function (data) {
  56. if (data.IsSuccess) {
  57. $.messager.alert("系统提示", data.Message);
  58. $("#dgClassroomReserveList").cmsXDataTable('load');
  59. } else {
  60. $.messager.alert("系统提示", data.Message);
  61. }
  62. });
  63. }
  64. });
  65. }
  66. //排课分配院系明细(对应教室信息)
  67. function editScheduleCollege(rowindex, rowdata) {
  68. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Classroom/ClassroomCollegeList?classroomID=" + rowdata.ClassroomID + "&MNU=" + mnu;
  69. $.popupTopWindow('排课分配院系明细', redirectTo, 1080, 530, null, null);
  70. }
  71. //设置列颜色为红色
  72. function SetRedColumn(index, row, value) {
  73. return " <span style=\"color: red;\">" + value + "</span>";
  74. }
  75. //设置相应的行颜色为红色
  76. function SetRedGrid(rowIndex, rowData) {
  77. if (rowData.IsAvailable != true) {
  78. return "color: red;";
  79. } else {
  80. return "";
  81. }
  82. }
  83. //导出Excel
  84. function ClassroomReserve_Export() {
  85. $("#formQuery").submit();
  86. }
  87. //联动查询
  88. function queryCampus(data) {
  89. reload();
  90. }