StudentPicComparison.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. //刷新
  2. function reload() {
  3. $("#dgStudentPicComparisonList").cmsXDataTable("load", $.getDataGridParams("dgStudentPicComparisonList"));
  4. }
  5. //获取选中的数据IsPicComparison
  6. function validChooseIsPicComparison() {
  7. var d = [];
  8. $.each($("#dgStudentPicComparisonList").cmsXDataTable("getSelections"), function (index) {
  9. d.push(this.IsPhotoComparison);
  10. });
  11. return d;
  12. }
  13. //获取选中的数据UserID
  14. function validChoose() {
  15. var d = [];
  16. $.each($("#dgStudentPicComparisonList").cmsXDataTable("getSelections"), function (index) {
  17. d.push(this.UserID);
  18. });
  19. return d;
  20. }
  21. //确定生成成功后不关闭弹出页面
  22. function formSuccessReloadNoClose(data) {
  23. if (data.IsSuccess == true) {
  24. reload();
  25. }
  26. $.messager.alert("系统提示", data.Message);
  27. }
  28. //通过
  29. function Student_PicComparisonPass() {
  30. var d = validChoose().join(',');
  31. if (d == "") {
  32. $.messager.alert("系统提示", "请选择您要比对通过的信息。");
  33. return;
  34. }
  35. var r = validChooseIsPicComparison();
  36. if ($.grep(r, function (v, i) { return v == true; }).length > 0) {
  37. $.messager.alert("系统提示", "选择比对通过的信息中,存在已比对的信息,无法再次比对通过。");
  38. return;
  39. }
  40. $.messager.confirm("系统提示", "您确定要对选择的信息进行比对通过?", function (r) {
  41. if (r) {
  42. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Student/PicComparisonPass', { userIDs: d }, function (data) {
  43. if (data.IsSuccess = true) {
  44. $.messager.alert("系统提示", data.Message);
  45. $("#dgStudentPicComparisonList").cmsXDataTable('load');
  46. }
  47. else {
  48. $.messager.alert("系统提示", data.Message);
  49. }
  50. });
  51. }
  52. });
  53. }
  54. //驳回
  55. function Student_PicComparisonUndo() {
  56. var d = validChoose().join(',');
  57. if (d == "") {
  58. $.messager.alert("系统提示", "请选择您要比对驳回的信息。");
  59. return;
  60. }
  61. var r = validChooseIsPicComparison();
  62. if ($.grep(r, function (v, i) { return v == false; }).length > 0) {
  63. $.messager.alert("系统提示", "选择比对驳回的信息中,存在未比对的信息,无法再次比对驳回。");
  64. return;
  65. }
  66. $.messager.confirm("系统提示", "您确定要对选择的信息进行比对驳回?", function (r) {
  67. if (r) {
  68. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Student/PicComparisonUndo', { userIDs: d }, function (data) {
  69. if (data.IsSuccess = true) {
  70. $.messager.alert("系统提示", data.Message);
  71. $("#dgStudentPicComparisonList").cmsXDataTable('load');
  72. }
  73. else {
  74. $.messager.alert("系统提示", data.Message);
  75. }
  76. });
  77. }
  78. });
  79. }
  80. //设置列颜色为红色
  81. function SetRedColumn(index, row, value) {
  82. return " <span style=\"color: red;\">" + value + "</span>";
  83. }
  84. //Excel导出
  85. function Student_PicComparisonExport() {
  86. var userIDs = validChoose().join(',');
  87. if (userIDs == "") {
  88. document.getElementById("UserIDs").value = "";
  89. }
  90. else {
  91. document.getElementById("UserIDs").value = userIDs;
  92. }
  93. $("#formQuery").attr("action", CMS_SystemConfig.VirtualDirectoryPath + "/Student/PicComparison_Excel");
  94. $("#formQuery").submit();
  95. }
  96. //联动查询
  97. function queryCampus(data) {
  98. var campusID = $("#CampusDropdown").combogridX("getValue");
  99. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  100. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  101. queryClass();
  102. }
  103. function queryCollege(data) {
  104. var campusID = $("#CampusDropdown").combogridX("getValue");
  105. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  106. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  107. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  108. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  109. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  110. queryClass();
  111. }
  112. function queryGrade(data) {
  113. queryClass();
  114. }
  115. function queryStandard(data) {
  116. queryClass();
  117. }
  118. function queryLearnSystem(data) {
  119. queryClass();
  120. }
  121. function queryGrademajor(data) {
  122. queryClass();
  123. }
  124. function queryClass() {
  125. var jsonString = "";
  126. var parameterString = "";
  127. var campusID = $("#CampusDropdown").combogridX("getValue");
  128. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  129. var gradeID = $("#DictionaryGrade").combogridX("getValue");
  130. var standardID = $("#DictionaryStandard").combogridX("getValue");
  131. var educationID = $("#DictionaryEducation").combogridX("getValue");
  132. var learningformID = $("#DictionaryLearningform").combogridX("getValue");
  133. var learnSystem = $("#DictionaryLearnSystem").combogridX("getValue");
  134. //var grademajorID = $("#GrademajorComboGrid").combogridX("getValue");
  135. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  136. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  137. if (gradeID != nonSelect) parameterString += "DictionaryGrade|*|" + gradeID + "|@|";
  138. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  139. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  140. if (learningformID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningformID + "|@|";
  141. if (learnSystem != nonSelect) parameterString += "DictionaryLearnSystem|*|" + learnSystem + "|@|";
  142. //if (grademajorID != nonSelect) parameterString += "GrademajorComboGrid|*|" + grademajorID + "|@|";
  143. if (parameterString != "") {
  144. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  145. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  146. //$("#GrademajorComboGrid").combogridX("reload", eval(jsonString));
  147. $("#ClassmajorComboGrid").combogridX("reload", eval(jsonString));
  148. }
  149. else {
  150. $("#DictionaryStandard").combogridX("reload");
  151. //$("#GrademajorComboGrid").combogridX("reload");
  152. $("#ClassmajorComboGrid").combogridX("reload");
  153. }
  154. reload();
  155. }