FinalExaminationStudentEdit.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. var mnu = "";
  2. var atype = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. atype = $.SystemGeneral.getUrlParam("aType");
  7. })
  8. function reload() {
  9. $("#dgStudentList").cmsXDataTable("load", $.getDataGridParams("dgStudentList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this);
  16. });
  17. return d;
  18. }
  19. function validChooseStudentID() {
  20. var d = [];
  21. $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) {
  22. d.push(this.UserID);
  23. });
  24. return d;
  25. }
  26. //弹出添加学生页面
  27. function FinalExamination_SettingsAdd() {
  28. var finalExamination = document.getElementById("FinalExaminationID").value;
  29. $.popupTopWindow('添加学生', CMS_SystemConfig.VirtualDirectoryPath + '/FinalExamination/StudentAdd?finalExamination=' + finalExamination + '&MNU=' +
  30. mnu, 650, 300, reload);
  31. }
  32. //修改学生
  33. function FinalExamination_SettingsEdit() {
  34. var d = validChooseStudentID();
  35. if (d.length == 0) {
  36. $.messager.alert("系统提示", "请选择要修改的学生。");
  37. return;
  38. }
  39. if (d.length > 1) {
  40. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  41. return;
  42. }
  43. var finalExamination = document.getElementById("FinalExaminationID").value;
  44. $.popupTopWindow('修改学生', CMS_SystemConfig.VirtualDirectoryPath + '/FinalExamination/StudentAdd?finalExamination=' + finalExamination + '&UserID=' + d + '&MNU=' +
  45. mnu, 650, 300, reload);
  46. }
  47. //删除学生
  48. function FinalExamination_SettingsDelete() {
  49. var d = validChooseStudentID().join(',');
  50. if (d == "") {
  51. $.messager.alert("系统提示", "请选择你要删除的信息!");
  52. return;
  53. }
  54. var finalExamination = document.getElementById("FinalExaminationID").value;
  55. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  56. if (r) {
  57. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/FinalExamination/StudentDelete', { finalExaminationID: finalExamination, UserIDs: d }, function (data) {
  58. if (data == "删除成功!") {
  59. $.messager.alert("系统提示", data);
  60. //刷新学生名单列表
  61. $("#dgStudentList").cmsXDataTable("load", $.getDataGridParams("dgStudentList"));
  62. } else {
  63. $.messager.alert("系统提示", data);
  64. }
  65. });
  66. }
  67. });
  68. }