NewStudentCollege.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/NewStudentCollege/Edit";
  2. var mnu = "";
  3. //url个性化配置
  4. var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='NewStudentCollegeEdit']");
  5. if (customerUrl.attr("value")) {
  6. url = CMS_SystemConfig.VirtualDirectoryPath + customerUrl.attr("value");
  7. }
  8. //加载
  9. $(function () {
  10. mnu = $.SystemGeneral.getUrlParam("MNU");
  11. })
  12. //刷新
  13. function reload() {
  14. $("#dgNewStudentCollegeList").cmsXDataTable("load", $.getDataGridParams("dgNewStudentCollegeList"));
  15. }
  16. //获取选中的数据
  17. function validChoose() {
  18. var d = [];
  19. $.each($("#dgNewStudentCollegeList").cmsXDataTable("getSelections"), function (index) {
  20. d.push(this.NewStudentID);
  21. });
  22. return d;
  23. }
  24. //查看
  25. function detail(rowindex, rowdata) {
  26. var redirectTo = url + "?newStudentID=" + rowdata.NewStudentID + "&MNU=" + mnu + "&type=detail";
  27. $.popupTopWindow('新生分配信息', redirectTo, 650, 540, null, null);
  28. }
  29. //导入分配
  30. function NewStudentCollege_AssignCollegeImport() {
  31. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentCollege/AssignCollegeImport?MNU=' + mnu;
  32. $.popupTopWindow('导入分配', redirectTo, 420, 300, reload);
  33. }
  34. //名单分配
  35. function NewStudentCollege_AssignCollege() {
  36. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/NewStudentCollege/AssignCollegeBatchAdd" + "?MNU=" + mnu;;
  37. $.popupTopWindow('名单分配', redirectTo, 900, 550, reload);
  38. }
  39. //删除照片
  40. function NewStudentCollege_PicDelete() {
  41. var d = validChoose().join(',');
  42. if (d == "") {
  43. $.messager.alert("系统提示", "请选择您要删除照片的信息。");
  44. return;
  45. }
  46. $.messager.confirm("系统提示", "您确定要删除选择的信息对应的照片?", function (r) {
  47. if (r) {
  48. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentCollege/PicDelete', { newStudentIDs: d }, function (data) {
  49. if (data.IsSuccess) {
  50. $.messager.alert("系统提示", data.Message);
  51. $("#dgNewStudentCollegeList").cmsXDataTable('load');
  52. } else {
  53. $.messager.alert("系统提示", data.Message);
  54. }
  55. });
  56. }
  57. });
  58. }
  59. //取消分配
  60. function NewStudentCollege_CancleAssign() {
  61. var d = validChoose().join(',');
  62. if (d == "") {
  63. $.messager.alert("系统提示", "请选择您要取消分配的信息。");
  64. return;
  65. }
  66. $.messager.confirm("系统提示", "您确定要对选择的信息取消分配?", function (r) {
  67. if (r) {
  68. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentCollege/CancleAssign', { newStudentIDs: d }, function (data) {
  69. if (data.IsSuccess = true) {
  70. $.messager.alert("系统提示", data.Message);
  71. $("#dgNewStudentCollegeList").cmsXDataTable('load');
  72. }
  73. else {
  74. $.messager.alert("系统提示", data.Message);
  75. }
  76. });
  77. }
  78. });
  79. }
  80. //提交分配
  81. function NewStudentCollege_SubmitAssign() {
  82. var d = validChoose().join(',');
  83. if (d == "") {
  84. $.messager.alert("系统提示", "请选择您要提交的信息。");
  85. return;
  86. }
  87. $.messager.confirm("系统提示", "您确定要对选择的信息进行提交?", function (r) {
  88. if (r) {
  89. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentCollege/SubmitAssign', { newStudentIDs: d }, function (data) {
  90. if (data.IsSuccess = true) {
  91. $.messager.alert("系统提示", data.Message);
  92. $("#dgNewStudentCollegeList").cmsXDataTable('load');
  93. }
  94. else {
  95. $.messager.alert("系统提示", data.Message);
  96. }
  97. });
  98. }
  99. });
  100. }
  101. //设置列颜色为红色
  102. function SetRedColumn(index, row, value) {
  103. return " <span style=\"color: red;\">" + value + "</span>";
  104. }
  105. //Excel导出
  106. function NewStudentCollege_Export() {
  107. $("#formQuery").submit();
  108. }
  109. //Excel导入新生(匹配相应的配置表,个性化配置)
  110. function NewStudentCollege_Import() {
  111. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentCollege/Import?MNU=' + mnu;
  112. $.popupTopWindow('招生信息导入', redirectTo, 420, 300, reload);
  113. }
  114. //导入照片(个性化配置,默认照片以“F”或“Z”+考生号命名)
  115. function NewStudentCollege_PicImport() {
  116. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/NewStudentCollege/PicImport?MNU=' + mnu;
  117. $.popupTopWindow('导入照片', redirectTo, 420, 300, reload);
  118. }
  119. //联动查询
  120. function queryCampus(data) {
  121. var campusID = $("#CampusDropdown").combogridX("getValue");
  122. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  123. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  124. reload();
  125. }
  126. function queryCollege(data) {
  127. var campusID = $("#CampusDropdown").combogridX("getValue");
  128. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  129. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  130. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  131. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  132. reload();
  133. }
  134. function queryGrade(data) {
  135. reload();
  136. }
  137. function queryStandard(data) {
  138. reload();
  139. }