ClassroomExcessiveUse.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. var mnu = "";
  2. var editPageUrl = "/ClassroomExcessiveUse/Edit";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. editPageUrl = CMS_SystemConfig.VirtualDirectoryPath + editPageUrl;
  7. })
  8. function queryClassroom(data) {
  9. if (((data.length && data.length > 0) || data)
  10. && $("#cbgClassroom").length > 0 && $.data($("#cbgClassroom")[0], "combogridX")) {
  11. var buildingID = $("#cbgBuilding").combogridX("getValue");
  12. if (buildingID != nonSelect) {
  13. var jsonString = "({'QueryParamsDatas':'BuildingsDropdown|*|" + buildingID + "|@|'})";
  14. $("#cbgClassroom").combogridX("reload", eval(jsonString));
  15. }
  16. }
  17. }
  18. //获取选中的数据
  19. function validChoose() {
  20. var d = [];
  21. $.each($("#dgClassroomExecessiveUse").cmsXDataTable("getSelections"), function (index) {
  22. d.push(this.ClassroomExcessiveUseID);
  23. });
  24. return d;
  25. }
  26. function reload() {
  27. $("#dgClassroomExecessiveUse").cmsXDataTable("load", $.getDataGridParams("dgClassroomExecessiveUse"));
  28. }
  29. function ClassroomExcessiveUse_Add() {
  30. $.popupTopWindow('新增课外教室使用登记', editPageUrl + "?MNU=" + mnu, 600, 500, reload);
  31. }
  32. function ClassroomExcessiveUse_Edit() {
  33. var d = validChoose();
  34. if (d.length == 0) {
  35. $.messager.alert("系统提示", "请选择您要修改的信息。");
  36. return;
  37. }
  38. if (d.length > 1) {
  39. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  40. return;
  41. }
  42. $.popupTopWindow('修改课外教室使用登记', editPageUrl + "?MNU=" + mnu + "&classroomExecessiveUseID=" + d[0], 600, 500, reload);
  43. }
  44. function ClassroomExcessiveUse_Delete() {
  45. var d = validChoose().join(',');
  46. if (d == "") {
  47. $.messager.alert("系统提示", "请选择您要删除的信息。");
  48. return;
  49. }
  50. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  51. if (r) {
  52. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ClassroomExcessiveUse/Delete', { classroomExcessiveUseIDs: d }, function (data) {
  53. if (data.IsSuccess) {
  54. $.messager.alert("系统提示", data.Message);
  55. $("#dgClassroomExecessiveUse").cmsXDataTable('load');
  56. } else {
  57. $.messager.alert("系统提示", data.Message);
  58. }
  59. });
  60. }
  61. });
  62. }
  63. function ClassroomExcessiveUse_Export() {
  64. $("#formQuery").submit();
  65. }