AdjustmentApprove.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. if (((data.length && data.length > 0) || data)
  26. && $("#cgbTeacher").length > 0 && $.data($("#cgbTeacher")[0], "combogridX")) {
  27. var jsonString = "({'QueryParamsDatas':'";
  28. var collegeID = $("#ddlCollege").combobox("getValue");
  29. if (collegeID != nonSelect) {
  30. jsonString += "CollegeDropdown|*|" + collegeID + "|@|";
  31. }
  32. jsonString += "'})";
  33. $("#cgbTeacher").combogridX("reload", eval(jsonString));
  34. }
  35. }
  36. function EducationSchedulingAdjustment_Approve() {
  37. var d = validChoose();
  38. if (d.length == 0) {
  39. $.messager.alert("系统提示", "请选择要审核的记录。");
  40. return;
  41. }
  42. var firstStatus = d[0].RecordStatus;
  43. if ($.grep(d, function (x) { return x.RecordStatus != firstStatus }).length > 0) {
  44. $.messager.alert("系统提示", "请选择相同状态的记录进行审核。");
  45. return;
  46. }
  47. var firstID = d[0].EducationSchedulingAdjustmentID;
  48. $.popupTopWindow('审核信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ApproveHandler?TableName=ES_EducationSchedulingAdjustment&FormID=' + firstID,
  49. 400, 300, EducationSchedulingAdjustment_Approve_Confirm);
  50. }
  51. function EducationSchedulingAdjustment_Approve_Confirm(action) {
  52. if (!action) return;
  53. if (action.ActionID == "") return;
  54. var d = $.map(validChoose(), function (x) { return x.EducationSchedulingAdjustmentID; }).join(',');
  55. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + "/EducationSchedule/AdjustmentApprove", { educationSchedulingAdjustmentIDs: d, actionID: action.Action, comment: action.Comment },
  56. function (data) {
  57. $.messager.alert("系统提示", data.Message.replace(/;/g, '<br>'));
  58. if (data.IsSuccess) {
  59. reload();
  60. }
  61. }, 'json');
  62. }
  63. function EducationSchedulingAdjustment_Excel() {
  64. var d = validChoose();
  65. if (d.length == 0) {
  66. $("[name='hidEducationSchedulingAdjustmentID']").val("");
  67. } else {
  68. $("[name='hidEducationSchedulingAdjustmentID']").val($.map(d, function (x) { return x.EducationSchedulingAdjustmentID; }).join(','))
  69. }
  70. $("#formQuery").submit();
  71. }