CompletionList.js 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/CompletionList/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgCompletionList").cmsXDataTable("load", $.getDataGridParams("dgCompletionList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgCompletionList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.GraduationApplyID);
  16. });
  17. return d;
  18. }
  19. //修改
  20. function CompletionList_Edit() {
  21. var d = validChoose();
  22. if (d.length == 0) {
  23. $.messager.alert("系统信息", "请选择您要修改的信息。");
  24. return;
  25. }
  26. if (d.length > 1) {
  27. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  28. return;
  29. }
  30. var redirectTo = url + "?graduationApplyID=" + d + "&MNU=" + mnu;
  31. $.popupTopWindow('结业名单修改', redirectTo, 680, 320, null, null);
  32. }
  33. //删除
  34. function CompletionList_Delete() {
  35. var d = validChoose().join(',');
  36. if (d == "") {
  37. $.messager.alert("系统提示", "请选择您要删除的信息。");
  38. return;
  39. }
  40. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  41. if (r) {
  42. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/CompletionList/Delete', { graduationApplyIDs: d }, function (data) {
  43. if (data == "删除成功。") {
  44. $.messager.alert("系统提示", data);
  45. $("#dgCompletionList").cmsXDataTable('load');
  46. } else {
  47. $.messager.alert("系统提示", data);
  48. }
  49. });
  50. }
  51. });
  52. }
  53. //获取列表字段查询对应比较符
  54. function GetDynamicCondition() {
  55. var attribute = eval('(' + $("[name='Attribute']").val() + ')').Value;
  56. var conditionString = $("[name='Condition']").val();
  57. var value = $("[name='Condition']").parent().parent().next().find("[name^=" + attribute + "]").val();
  58. value = $.trim(value);
  59. var sql = "";
  60. if (conditionString == "=" || conditionString == ">" || conditionString == "<" || conditionString == "<>") {
  61. sql = attribute + conditionString + value;
  62. } else if (conditionString == "左") {
  63. sql = attribute + " like '" + value + "%'";
  64. } else if (conditionString == "右") {
  65. sql = attribute + " like '%" + value + "'";
  66. } else if (conditionString == "中") {
  67. sql = attribute + " like '%" + value + "%'";
  68. }
  69. return sql;
  70. }
  71. //结业证书打印(结业)
  72. function CompletionList_Certificate() {
  73. var d = [];
  74. $.each($("#dgCompletionList").cmsXDataTable("getSelections"), function (index) {
  75. d.push(this.UserID);
  76. });
  77. var SchoolyearID = $("#GradSchoolyearDropdown").combobox("getValue");
  78. var CollegeID = $("#CollegeDropdown").combogridX("getValue");
  79. var Year = $("#DictionarySchoolyear").combobox("getValue");
  80. var StandardID = $("#DictionaryStandard").combogridX("getValue");
  81. var EducationID = $("#DictionaryEducation").combogridX("getValue");
  82. var LearningformID = $("#DictionaryLearningform").combogridX("getValue");
  83. var LearnSystem = $("#DictionaryLearnSystem").combogridX("getValue");
  84. var IsDreamProject = "-1";
  85. var GraduationTypeID = $("#DictionaryGraduationType").combobox("getValue");
  86. var sql = GetDynamicCondition();
  87. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/CompletionList/Certificate?MNU=' + mnu;
  88. var id = d.join(",");
  89. var windowDiv = $.popupTopWindow('结业证书打印', redirectTo, 1000, 750, null, {
  90. schoolyearID: SchoolyearID,
  91. collegeID: CollegeID,
  92. standardID: StandardID,
  93. year: (Year == nonSelect) ? null : Year,
  94. educationID: EducationID,
  95. learningformID: LearningformID,
  96. isDreamProject: (IsDreamProject == nonSelect) ? null : IsDreamProject,
  97. learnSystem: LearnSystem,
  98. conditionString: sql,
  99. graduationTypeID: (GraduationTypeID == nonSelect) ? null : GraduationTypeID,
  100. ids: id
  101. });
  102. }
  103. //学生最终成绩明细
  104. function editFinallyScore(rowindex, rowdata) {
  105. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/GraduationApply/FinallyScoreList?graduationApplyID=" + rowdata.GraduationApplyID + "&MNU=" + mnu;
  106. $.popupTopWindow('学生最终成绩明细', redirectTo, 1200, 540, null, null);
  107. }
  108. //设置列颜色为红色
  109. function SetRedColumn(index, row, value) {
  110. return " <span style=\"color: red;\">" + value + "</span>";
  111. }
  112. //Excel导出
  113. function CompletionList_Export() {
  114. $("#formQuery").submit();
  115. }
  116. //结业证书编号Excel导入
  117. function CompletionNo_Import() {
  118. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/CompletionList/CompletionNoImport?MNU=' + mnu;
  119. $.popupTopWindow('结业证书编号导入', redirectTo, 420, 300, reload);
  120. }
  121. //联动查询
  122. function queryCampus(data) {
  123. var campusID = $("#CampusDropdown").combogridX("getValue");
  124. if (campusID != nonSelect) {
  125. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  126. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  127. }
  128. queryClass();
  129. }
  130. function queryCollege(data) {
  131. var campusID = $("#CampusDropdown").combogridX("getValue");
  132. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  133. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  134. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  135. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  136. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  137. queryClass();
  138. }
  139. function querySchoolyear(data) {
  140. queryClass();
  141. }
  142. function queryStandard(data) {
  143. queryClass();
  144. }
  145. function queryClass() {
  146. var jsonString = "";
  147. var parameterString = "";
  148. var campusID = $("#CampusDropdown").combogridX("getValue");
  149. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  150. var schoolYearID = $("#DictionarySchoolyear").combobox("getValue");
  151. var standardID = $("#DictionaryStandard").combogridX("getValue");
  152. var educationID = $("#DictionaryEducation").combogridX("getValue");
  153. var learningFormID = $("#DictionaryLearningform").combogridX("getValue");
  154. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  155. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  156. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  157. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  158. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  159. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  160. if (parameterString != "") {
  161. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  162. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  163. }
  164. else {
  165. $("#DictionaryStandard").combogridX("reload");
  166. }
  167. reload();
  168. }