AdjustmentList.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. })
  6. function validChoose() {
  7. var d = [];
  8. $.each($("#dgEducationSchedulingAdjustmentList").cmsXDataTable("getSelections"), function (index) {
  9. d.push(this);
  10. });
  11. return d;
  12. }
  13. function startTimeChanged(dp) {
  14. $("#txtStartTime").val($dp.cal.getNewDateStr());
  15. reload();
  16. }
  17. function endTimeChanged(dp) {
  18. $("#txtEndTime").val($dp.cal.getNewDateStr());
  19. reload();
  20. }
  21. function reload() {
  22. $("#dgEducationSchedulingAdjustmentList").cmsXDataTable("load", $.getDataGridParams("dgEducationSchedulingAdjustmentList"));
  23. }
  24. function queryTeacher(data) {
  25. try {
  26. var jsonString = "({'QueryParamsDatas':'";
  27. var collegeID = $("#ddlCollege").combobox("getValue");
  28. if (collegeID != nonSelect) {
  29. jsonString += "CollegeDropdown|*|" + collegeID + "|@|";
  30. }
  31. jsonString += "'})";
  32. $("#cgbTeacher").combogridX("reload", eval(jsonString));
  33. reload();
  34. } catch (e) { }
  35. }
  36. function EducationSchedulingAdjustment_Add() {
  37. $.popupTopWindow('新增调课记录', CMS_SystemConfig.VirtualDirectoryPath + '/EducationSchedule/Adjustment?MNU=' + mnu, 1024, 768, reload, null);
  38. }
  39. function EducationSchedulingAdjustment_Update() {
  40. var d = validChoose();
  41. if (d.length == 0) {
  42. $.messager.alert("系统提示", "请选择要修改的记录。");
  43. return;
  44. }
  45. if (d.length > 1) {
  46. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  47. return;
  48. }
  49. if (d[0].RecordStatus != startStatusID && $.grep(backpointIDList, function (x) { return x == d[0].RecordStatus }).length == 0) {
  50. $.messager.alert("系统提示", "该记录已经提交,无法修改。");
  51. return;
  52. }
  53. $.popupTopWindow('修改调课记录', CMS_SystemConfig.VirtualDirectoryPath + '/EducationSchedule/AdjustmentEdit?EducationSchedulingAdjustmentID='
  54. + d[0].EducationSchedulingAdjustmentID + "&MNU=" + mnu, 800, 420, reload, null);
  55. }
  56. function EducationSchedulingAdjustment_Delete() {
  57. var d = $.map(validChoose(), function (x) { return x.EducationSchedulingAdjustmentID; }).join(',');
  58. if (d.length == 0) {
  59. $.messager.alert("系统提示", "请选择要删除的记录。");
  60. return;
  61. }
  62. $.postWithLoading('/EducationSchedule/AdjustmentDelete', { educationSchedulingAdjustmentIDs: d }, function (data) {
  63. if (data.IsSuccess) {
  64. $.messager.alert("系统提示", "删除成功!");
  65. reload();
  66. } else {
  67. $.messager.alert("系统提示", data.Message);
  68. }
  69. });
  70. }
  71. function EducationSchedulingAdjustment_Submit() {
  72. var d = $.map(validChoose(), function (x) { return x.EducationSchedulingAdjustmentID; }).join(',');
  73. if (d.length == 0) {
  74. $.messager.alert("系统提示", "请选择要提交的记录。");
  75. return;
  76. }
  77. $.postWithLoading('/EducationSchedule/AdjustmentSubmit', { educationSchedulingAdjustmentIDs: d }, function (data) {
  78. if (data.IsSuccess) {
  79. $.messager.alert("系统提示", "提交成功!");
  80. reload();
  81. } else {
  82. $.messager.alert("系统提示", data.Message.replace(/;/g, '<br>'));
  83. }
  84. });
  85. }
  86. function EducationSchedulingAdjustment_Excel() {
  87. var d = validChoose();
  88. if (d.length == 0) {
  89. $("[name='hidEducationSchedulingAdjustmentID']").val("");
  90. } else {
  91. $("[name='hidEducationSchedulingAdjustmentID']").val($.map(d, function (x) { return x.EducationSchedulingAdjustmentID; }).join(','))
  92. }
  93. $("#formQuery").submit();
  94. }