PlanApplicationApprove.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/PlanApplicationApprove/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgPlanApplicationApproveList").cmsXDataTable("load", $.getDataGridParams("dgPlanApplicationApproveList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgPlanApplicationApproveList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.PlanApplicationID);
  16. });
  17. return d;
  18. }
  19. //查看明细
  20. function edit(rowindex, rowdata) {
  21. var redirectTo = url + "?planApplicationID=" + rowdata.PlanApplicationID + "&MNU=" + mnu + "&type=detail";
  22. $.popupTopWindow('计划审核信息', redirectTo, 685, 540, null, null);
  23. }
  24. //删除
  25. function PlanApplicationApprove_Delete() {
  26. var d = validChoose().join(',');
  27. if (d == "") {
  28. $.messager.alert("系统提示", "请选择您要删除的信息。");
  29. return;
  30. }
  31. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  32. if (r) {
  33. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/PlanApplicationApprove/Delete', { planApplicationIDs: d }, function (data) {
  34. if (data.IsSuccess) {
  35. $.messager.alert("系统提示", data.Message);
  36. $("#dgPlanApplicationApproveList").cmsXDataTable('load');
  37. } else {
  38. $.messager.alert("系统提示", data.Message);
  39. }
  40. });
  41. }
  42. });
  43. }
  44. //审核
  45. function PlanApplicationApprove_Approve() {
  46. var planApplicationIDs = validChoose();
  47. if (planApplicationIDs.length == 0) {
  48. $.messager.alert("系统提示", "请选择您要审核的信息。");
  49. return;
  50. }
  51. if (planApplicationIDs.length > 1) {
  52. //批量审核
  53. var approveID = planApplicationIDs[0];
  54. $.popupTopWindow('审核信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ApproveHandler?TableName=EM_PlanApplication&FormID=' + approveID,
  55. 400, 300, PlanApplicationApprove_ApproveConfirm);
  56. }
  57. else {
  58. var planApplicationID = planApplicationIDs;
  59. //单个审核
  60. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/PlanApplicationApprove/Approve?MNU=" + mnu + "&planApplicationID=" + planApplicationID;
  61. $.popupTopWindow('计划申请审核', redirectTo, 685, 540, null, null);
  62. }
  63. }
  64. //确定(审核)
  65. function PlanApplicationApprove_ApproveConfirm(action) {
  66. if (!action) {
  67. return;
  68. }
  69. if (action.ActionID == "") {
  70. return;
  71. }
  72. var approveIDs = validChoose().join(',');
  73. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + "/PlanApplicationApprove/ApproveConfirm", { planApplicationIDs: approveIDs, actionID: action.Action, comment: action.Comment },
  74. function (data) {
  75. if (data.IsSuccess) {
  76. reload();
  77. }
  78. $.messager.alert("系统提示", data.Message);
  79. }, 'json');
  80. }
  81. //设置列颜色为红色
  82. function SetRedColumn(index, row, value) {
  83. return " <span style=\"color: red;\">" + value + "</span>";
  84. }
  85. //Excel导出
  86. function PlanApplicationApprove_Export() {
  87. $("#formQuery").submit();
  88. }
  89. //联动查询
  90. function queryCampus(data) {
  91. var campusID = $("#CampusDropdown").combogridX("getValue");
  92. if (campusID != nonSelect) {
  93. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  94. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  95. }
  96. else {
  97. $("#CollegeDropdown").combogridX("reload");
  98. }
  99. queryClass();
  100. }
  101. function queryCollege(data) {
  102. var campusID = $("#CampusDropdown").combogridX("getValue");
  103. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  104. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  105. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  106. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  107. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  108. queryClass();
  109. }
  110. function querySchoolyear(data) {
  111. queryClass();
  112. }
  113. function queryStandard(data) {
  114. queryClass();
  115. }
  116. function queryGrademajor(data) {
  117. queryClass();
  118. }
  119. function queryClass() {
  120. var jsonString = "";
  121. var parameterString = "";
  122. var campusID = $("#CampusDropdown").combogridX("getValue");
  123. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  124. var schoolYearID = $("#DictionarySchoolyear").combogridX("getValue"); //combobox
  125. var standardID = $("#DictionaryStandard").combogridX("getValue");
  126. var educationID = $("#DictionaryEducation").combogridX("getValue");
  127. var learningFormID = $("#DictionaryLearningform").combogridX("getValue");
  128. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  129. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  130. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  131. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  132. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  133. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  134. if (parameterString != "") {
  135. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  136. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  137. $("#GrademajorComboGrid").combogridX("reload", eval(jsonString));
  138. }
  139. else {
  140. $("#DictionaryStandard").combogridX("reload");
  141. $("#GrademajorComboGrid").combogridX("reload");
  142. }
  143. reload();
  144. }