MinorPlanApply.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/MinorPlanApply/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. function reload() {
  8. $("#dgMinorPlanApply").cmsXDataTable("load", $.getDataGridParams("dgMinorPlanApply"));
  9. }
  10. //获取选中的数据
  11. function validChoose() {
  12. var d = [];
  13. $.each($("#dgMinorPlanApply").cmsXDataTable("getSelections"), function (index) {
  14. d.push(this.GradeMinorApplicationID);
  15. });
  16. return d;
  17. }
  18. function validChooseStatusName() {
  19. var d = [];
  20. $.each($("#dgMinorPlanApply").cmsXDataTable("getSelections"), function (index) {
  21. d.push(this.ApprovalStatusName);
  22. });
  23. return d;
  24. }
  25. //新增
  26. function MinorPlanApply_Apply(){
  27. var d = validChoose();
  28. if (d.length == 1) {
  29. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/MinorPlanApply/CopyAdd?GradeMinorApplicationIDs=" + d + "&MNU=" + mnu;
  30. $.popupTopWindow('辅修课程信息复制新增', redirectTo, 800, 600, null, null);
  31. }
  32. else {
  33. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/MinorPlanApply/MinorPlanApplyChoiceList?MNU=" + mnu;
  34. $.popupTopWindow('辅修申请新增', redirectTo, 1000, 560, null, null);
  35. }
  36. }
  37. //点击列表更新
  38. function edit(rowindex, rowdata) {
  39. var redirectTo = url + "?GradeMinorApplicationIDs=" + rowdata.GradeMinorApplicationID + "&MNU=" + mnu + '&isView=1';
  40. $.popupTopWindow('辅修课程信息详情', redirectTo, 800, 600, null, null);
  41. }
  42. //修改按钮
  43. function MinorPlanApply_Update() {
  44. var d = validChoose();
  45. if (d.length == 0) {
  46. $.messager.alert("系统信息", "请选择您要修改的辅修课程信息。");
  47. return;
  48. }
  49. if (d.length > 1) {
  50. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  51. return;
  52. }
  53. var redirectTo = url + "?GradeMinorApplicationIDs=" + d + "&MNU=" + mnu;
  54. $.popupTopWindow('辅修申请信息修改', redirectTo, 800, 600, null, null);
  55. }
  56. //删除
  57. function MinorPlanApply_Delete() {
  58. var d = validChoose().join(',');
  59. if (d == "") {
  60. $.messager.alert("系统信息", "请选择您要删除辅修课程申请信息。");
  61. return;
  62. }
  63. $.messager.confirm("系统提示", "您确定要删除该辅修课程申请信息?", function (r) {
  64. if (r) {
  65. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorPlanApply/Delete', { GradeMinorApplicationIDs: d }, function (data) {
  66. if (data == "删除成功") {
  67. $.messager.alert("系统提示", "删除成功。");
  68. $("#dgMinorPlanApply").cmsXDataTable('load');
  69. } else {
  70. $.messager.alert("系统提示", data);
  71. }
  72. });
  73. }
  74. });
  75. }
  76. function MinorPlanApply_GradeCopy()
  77. {
  78. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/MinorPlanApply/CopyByGrade?MNU=" + mnu;
  79. $.popupTopWindow('专业计划年级复制', redirectTo, 1000, 200, null, null);
  80. }
  81. function MinorSpecialtyCourse_Export() {
  82. var d = validChoose().join(',')
  83. if (d != "") {
  84. document.getElementById("MinorCourseID").value = d;
  85. }
  86. else {
  87. document.getElementById("MinorCourseID").value = "";
  88. }
  89. $("#formQuery").submit();
  90. }
  91. function MinorPlanApply_Submit() {
  92. var d = validChoose().join(',');
  93. if (d == "") {
  94. $.messager.alert("系统信息", "请选择您要提交的辅修申请信息。");
  95. return;
  96. }
  97. var statusNames = validChooseStatusName().join(',');
  98. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorPlanApply/SubmitPlanApplication', { GradeMinorApplicationIDs: d, statusNames: statusNames }, function (data) {
  99. if (data == "成功") {
  100. $.messager.alert("系统提示", "辅修申请提交成功。");
  101. $("#dgMinorPlanApply").cmsXDataTable('load');
  102. } else {
  103. $.messager.alert("系统提示", data);
  104. }
  105. });
  106. }