ChangeApprove.js 6.2 KB

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