MinorPlanApprove.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. $(function () {
  2. mnu = $.SystemGeneral.getUrlParam("MNU");
  3. })
  4. function reload() {
  5. $("#dgMinorPlanApprove").cmsXDataTable("load", $.getDataGridParams("dgMinorPlanApprove"));
  6. }
  7. //获取选中的数据
  8. function validChoose() {
  9. var d = [];
  10. $.each($("#dgMinorPlanApprove").cmsXDataTable("getSelections"), function (index) {
  11. d.push(this.GradeMinorApplicationID);
  12. });
  13. return d;
  14. }
  15. function validChooseState() {
  16. var d = [];
  17. $.each($("#dgMinorPlanApprove").cmsXDataTable("getSelections"), function (index) {
  18. d.push(this.ApprovalStatus);
  19. });
  20. return d;
  21. }
  22. function MinorPlanApprove_Approve() {
  23. var d = validChoose();
  24. var state = validChooseState().join(',');
  25. if (d.length == 0) {
  26. $.messager.alert("系统提示", "请选择您要审核的信息!");
  27. return;
  28. }
  29. var st = state.split(',')[0];
  30. for (var i = 0; i < state.split(',').length; i++) {
  31. if (state.split(',')[i] != "" && state.split(',')[i] != st) {
  32. $.messager.alert("系统提示", "您选择处理的数据审核状态不一致,请重新选择!");
  33. return;
  34. }
  35. }
  36. var firstID = d[0];
  37. $.popupTopWindow('审核信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ApproveHandler?TableName=CF_GrademinorApplication&FormID=' + firstID,
  38. 400, 300, MinorPlanApprove_Approve_Confirm);
  39. }
  40. function MinorPlanApprove_Approve_Confirm(action) {
  41. if (!action) return;
  42. if (action.ActionID == "") return;
  43. var d = validChoose().join(',');
  44. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + "/MinorPlanApprove/Approve", { GradeMinorApplicationIDs: 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. //点击列表更新
  53. function edit(rowindex, rowdata) {
  54. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/MinorPlanApply/Edit?GradeMinorApplicationIDs=" + rowdata.GradeMinorApplicationID + "&MNU=" + mnu + '&isView=1';
  55. $.popupTopWindow('辅修课程信息详情', redirectTo, 800, 600, null, null);
  56. }
  57. //导出Excel
  58. function MinorPlanApprove_Export() {
  59. var d = validChoose().join(',')
  60. if (d != "") {
  61. document.getElementById("GradeMinorApplicationID").value = d;
  62. }
  63. else {
  64. document.getElementById("GradeMinorApplicationID").value = "";
  65. }
  66. $("#formQuery").submit();
  67. }