StopList.js 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. })
  6. function validChoose() {
  7. var d = [];
  8. $.each($("#dgEducationSchedulingStopList").cmsXDataTable("getSelections"), function (index) {
  9. d.push(this);
  10. });
  11. return d;
  12. }
  13. function reload() {
  14. $("#dgEducationSchedulingStopList").cmsXDataTable("load", $.getDataGridParams("dgEducationSchedulingStopList"));
  15. }
  16. function queryTeacher(data) {
  17. try {
  18. var jsonString = "({'QueryParamsDatas':'";
  19. var collegeID = $("#ddlCollege").combobox("getValue");
  20. if (collegeID != nonSelect) {
  21. jsonString += "CollegeDropdown|*|" + collegeID + "|@|";
  22. }
  23. jsonString += "'})";
  24. $("#cgbTeacher").combogridX("reload", eval(jsonString));
  25. reload();
  26. } catch (e) { }
  27. }
  28. function EducationSchedulingStop_Add() {
  29. $.popupTopWindow('新增停课记录', CMS_SystemConfig.VirtualDirectoryPath + '/EducationSchedule/StopScheduling?MNU=' + mnu, 1024, 768, reload, null);
  30. }
  31. function EducationSchedulingStop_Update() {
  32. var d = validChoose();
  33. if (d.length == 0) {
  34. $.messager.alert("系统提示", "请选择要修改的记录。");
  35. return;
  36. }
  37. if (d.length > 1) {
  38. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  39. return;
  40. }
  41. if (d[0].RecordStatus != startStatusID && $.grep(backpointIDList, function (x) { return x == d[0].RecordStatus }).length == 0) {
  42. $.messager.alert("系统提示", "该记录已经提交,无法修改。");
  43. return;
  44. }
  45. $.popupTopWindow('修改停课记录', CMS_SystemConfig.VirtualDirectoryPath + '/EducationSchedule/StopEdit?EducationSchedulingStopID='
  46. + d[0].EducationSchedulingStopID + "&MNU=" + mnu, 480, 250, reload, null);
  47. }
  48. function EducationSchedulingStop_Delete() {
  49. var d = $.map(validChoose(), function (x) { return x.EducationSchedulingStopID; }).join(',');
  50. if (d.length == 0) {
  51. $.messager.alert("系统提示", "请选择要删除的记录。");
  52. return;
  53. }
  54. $.postWithLoading('/EducationSchedule/StopDelete', { educationSchedulingStopIDs: d }, function (data) {
  55. if (data.IsSuccess) {
  56. $.messager.alert("系统提示", "删除成功!");
  57. reload();
  58. } else {
  59. $.messager.alert("系统提示", data.Message);
  60. }
  61. });
  62. }
  63. function EducationSchedulingStop_Submit() {
  64. var d = $.map(validChoose(), function (x) { return x.EducationSchedulingStopID; }).join(',');
  65. if (d.length == 0) {
  66. $.messager.alert("系统提示", "请选择要提交的记录。");
  67. return;
  68. }
  69. $.postWithLoading('/EducationSchedule/StopSubmit', { educationSchedulingStopIDs: d }, function (data) {
  70. if (data.IsSuccess) {
  71. $.messager.alert("系统提示", "提交成功!");
  72. reload();
  73. } else {
  74. $.messager.alert("系统提示", data.Message);
  75. }
  76. });
  77. }
  78. function EducationSchedulingStop_Excel() {
  79. var d = validChoose();
  80. if (d.length == 0) {
  81. $("[name='hidEducationSchedulingStopID']").val("");
  82. } else {
  83. $("[name='hidEducationSchedulingStopID']").val($.map(d, function (x) { return x.EducationSchedulingStopID; }).join(','))
  84. }
  85. $("#formQuery").submit();
  86. }