CheckingApprove.js 5.6 KB

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