FreeSelectionCourseApprove.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/FreeSelectionCourseApprove/Details";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //获取选中的数据
  8. function validChoose() {
  9. var d = [];
  10. $.each($("#dgFreeSelectionCourseApproveList").cmsXDataTable("getSelections"), function (index) {
  11. d.push(this);
  12. });
  13. return d;
  14. }
  15. //明细
  16. function Details(rowindex, rowdata) {
  17. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/FreeSelectionCourseApprove/Details?MNU=" + mnu + "&freeSelectionCourseApplyID=" + rowdata.FreeSelectionCouseApplyID + "&MNU=" + mnu;
  18. $.popupTopWindow("开课审核信息", redirectTo, 750, 550, null, null);
  19. }
  20. //Excel导出
  21. function FreeSelectionCourseApprove_Export() {
  22. $("#formQuery").submit();
  23. }
  24. //审核信息
  25. function FreeSelectionCourse_Approve() {
  26. var d = validChoose();
  27. if (d.length == 0) {
  28. $.messager.alert("系统提示", "请选择您要审核的信息。");
  29. return;
  30. }
  31. var approveStatus = d[0].ApprovalStatus;
  32. if ($.grep(d, function (v, i) { return v.ApprovalStatus != approveStatus; }).length > 0) {
  33. $.messager.alert("系统提示", "请选择相同状态的信息进行审核。");
  34. return;
  35. }
  36. var firstID = d[0].FreeSelectionCouseApplyID;
  37. $.popupTopWindow('审核信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ApproveHandler?TableName=EM_FreeSelectionCouseApply&FormID=' + firstID,
  38. 400, 300, FreeSelectionCourse_Approve_Confirm);
  39. }
  40. //审核提交
  41. function FreeSelectionCourse_Approve_Confirm(action) {
  42. if (!action) return;
  43. var d = $.map(validChoose(), function (x) { return x.FreeSelectionCouseApplyID; }).join(',');
  44. $.post(CMS_SystemConfig.VirtualDirectoryPath + "/FreeSelectionCourseApprove/Approve", { formIDs: d, actionID: action.Action, comment: action.Comment },
  45. function (data) {
  46. $.messager.alert("系统提示", data.Message);
  47. if (data.IsSuccess) {
  48. reload();
  49. }
  50. }, 'json');
  51. }
  52. function reload() {
  53. $("#dgFreeSelectionCourseApproveList").cmsXDataTable("load", $.getDataGridParams("dgFreeSelectionCourseApproveList"));
  54. }
  55. //校区查询下拉
  56. function QueryCampusComboGridList() {
  57. var campusID = $("#CampusDropdown").combogridX("getValue");
  58. if (campusID != nonSelect) {
  59. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  60. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  61. }
  62. reload();
  63. }
  64. //院系所查询下拉
  65. function QueryCollegeComboGridList() {
  66. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  67. if (collegeID != nonSelect) {
  68. var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID + "|@|'})";
  69. $("#DepartmentDropdown").combogridX("reload", eval(jsonString));
  70. }
  71. reload();
  72. }
  73. //教研室查询下拉
  74. function QueryDepartmentComboGridList() {
  75. reload();
  76. }
  77. //点击上课周次信息收缩
  78. function swapWeekSettings() {
  79. if ($("#weekExpander").attr("expanded") == "0") {
  80. $("#weekExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  81. $("#weekExpander").closest("tr")
  82. .next().css("display", "")
  83. .next().css("display", "")
  84. .next().css("display", "")
  85. .next().css("display", "");
  86. $("#weekExpander").attr("expanded", "1");
  87. } else {
  88. $("#weekExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  89. $("#weekExpander").closest("tr")
  90. .next().css("display", "none")
  91. .next().css("display", "none")
  92. .next().css("display", "none")
  93. .next().css("display", "none");
  94. $("#weekExpander").attr("expanded", "0");
  95. }
  96. }