RoomSetting.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. function RoomSetting_Export() {
  2. $(document.forms[0]).submit();
  3. }
  4. var mnu = "";
  5. //加载
  6. $(function () {
  7. mnu = $.SystemGeneral.getUrlParam("MNU");
  8. })
  9. function RoomSetting_Add() {
  10. $.popupTopWindow('教室基本信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ClassroomSelect?FromMNU=' + mnu, 900, 500, ClassroomSelect_Close, null);
  11. }
  12. function ClassroomSelect_Close(classroomList) {
  13. if (!classroomList) return;
  14. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationRoomSetting/Add', { classroomIDs: $.map(classroomList, function (x) { return x.ClassroomID; }).join(',') }, function (data) {
  15. if (data == "添加成功") {
  16. $.messager.alert("系统提示", "添加成功!");
  17. $("#dgRoomSettingList").cmsXDataTable('load');
  18. } else {
  19. $.messager.alert("系统提示", data);
  20. }
  21. });
  22. }
  23. function reload() {
  24. $("#dgRoomSettingList").cmsXDataTable("load", $.getDataGridParams("dgRoomSettingList"));
  25. }
  26. //获取选中的数据
  27. function validChoose() {
  28. var d = [];
  29. $.each($("#dgRoomSettingList").cmsXDataTable("getSelections"), function (index) {
  30. d.push(this.ClassroomID);
  31. });
  32. return d;
  33. }
  34. //删除
  35. function RoomSetting_Delete() {
  36. var d = validChoose().join(',');
  37. if (d == "") {
  38. $.messager.alert("系统提示", "请选择您要删除的考场。");
  39. return;
  40. }
  41. $.messager.confirm("系统提示", "您确定要删除该考场?", function (r) {
  42. if (r) {
  43. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationRoomSetting/Delete', { classroomIDs: d }, function (data) {
  44. if (data == "删除成功") {
  45. $.messager.alert("系统提示", "删除成功!");
  46. $("#dgRoomSettingList").cmsXDataTable('load');
  47. } else {
  48. $.messager.alert("系统提示", data);
  49. }
  50. });
  51. }
  52. });
  53. }
  54. function QueryCampusDropdownList(data) {
  55. reload();
  56. }
  57. function QueryBuildingsDropdownList(data) {
  58. reload();
  59. }
  60. function QueryIsSpecialDropdownList(data) {
  61. reload();
  62. }