MinorGraduationApply.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/MinorGraduationApply/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgMinorGraduationApplyList").cmsXDataTable("load", $.getDataGridParams("dgMinorGraduationApplyList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgMinorGraduationApplyList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.MinorGraduationApplyID);
  16. });
  17. return d;
  18. }
  19. //名单生成
  20. function MinorGraduationApply_Create() {
  21. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/MinorGraduationApply/Generate?MNU=" + mnu;
  22. $.popupTopWindow('辅修毕业申请生成', redirectTo, 340, 300, null, null);
  23. }
  24. //新增
  25. function MinorGraduationApply_Add() {
  26. var d = validChoose();
  27. if (d.length > 0) {
  28. $.popupTopWindow('毕业申请复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/MinorGraduationApply/CopyAdd?minorGraduationApplyID=' + d[0] + '&MNU=' + mnu, 680, 320, null, null);
  29. } else {
  30. var redirectTo = url + "?MNU=" + mnu;
  31. $.popupTopWindow('毕业申请新增', redirectTo, 680, 320, null, null);
  32. }
  33. }
  34. //修改
  35. function MinorGraduationApply_Edit() {
  36. var d = validChoose();
  37. if (d.length == 0) {
  38. $.messager.alert("系统信息", "请选择您要修改的信息。");
  39. return;
  40. }
  41. if (d.length > 1) {
  42. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  43. return;
  44. }
  45. var redirectTo = url + "?graduationApplyID=" + d + "&MNU=" + mnu;
  46. $.popupTopWindow('毕业申请修改', redirectTo, 680, 320, null, null);
  47. }
  48. //删除
  49. function MinorGraduationApply_Delete() {
  50. var d = validChoose().join(',');
  51. if (d == "") {
  52. $.messager.alert("系统提示", "请选择您要删除的信息。");
  53. return;
  54. }
  55. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  56. if (r) {
  57. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorGraduationApply/Delete', { minorGraduationApplyIDs: d }, function (data) {
  58. if (data == "删除成功。") {
  59. $.messager.alert("系统提示", data);
  60. $("#dgMinorGraduationApplyList").cmsXDataTable('load');
  61. } else {
  62. $.messager.alert("系统提示", data);
  63. }
  64. });
  65. }
  66. });
  67. }
  68. //提交(毕业申请提交)
  69. function MinorGraduationApply_Submit() {
  70. var d = validChoose();
  71. if (d == "") {
  72. $.messager.alert("系统提示", "请选择您要提交的信息。");
  73. return;
  74. }
  75. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/MinorGraduationApply/Submit" + "?MNU=" + mnu;
  76. $.popupTopWindow('毕业申请提交', redirectTo, 500, 280, null, d);
  77. }
  78. //设置列颜色为红色
  79. function SetRedColumn(index, row, value) {
  80. return " <span style=\"color: red;\">" + value + "</span>";
  81. }
  82. //Excel导出
  83. function MinorGraduationApply_Export() {
  84. var d = validChoose().join(',');
  85. $("[name='SelectedID']").val(d);
  86. $("#formQuery").submit();
  87. }
  88. //联动查询
  89. function queryStandard(data) {
  90. queryClass();
  91. reload();
  92. }
  93. function queryCollege(data) {
  94. var campusID = $("#CampusDropdown").combogridX("getValue");
  95. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  96. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  97. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  98. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  99. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  100. queryClass();
  101. reload();
  102. }
  103. function queryClass() {
  104. var jsonString = "";
  105. var parameterString = "";
  106. var campusID = $("#CampusDropdown").combogridX("getValue");
  107. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  108. var educationID = $("#DictionaryEducation").combogridX("getValue");
  109. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  110. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  111. var learningFormID = $("#DictionaryLearningform").combogridX("getValue");
  112. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  113. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  114. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  115. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  116. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  117. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  118. if (parameterString != "") {
  119. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  120. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  121. } else {
  122. $("#StandardDictionaryDropDown").combogridX("reload");
  123. }
  124. reload();
  125. }