FreeSelectionCourse.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/FreeSelectionCourse/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //新增
  8. function FreeSelectionCourse_Add() {
  9. var d = validChoose();
  10. if (d.length > 1) {
  11. $.messager.alert("系统信息", "只能选择单个记录进行复制新增。");
  12. return;
  13. }
  14. redirectTo = url + "?freeSelectionCourseIDs=" + d+ "&MNU=" + mnu + "&type=copyAdd";
  15. $.popupTopWindow("任选课程新增", redirectTo, 650, 550, null, null);
  16. }
  17. function reload() {
  18. $("#dgFreeSelectionCourseList").cmsXDataTable("load", $.getDataGridParams("dgFreeSelectionCourseList"));
  19. }
  20. //获取选中的数据
  21. function validChoose() {
  22. var d = [];
  23. $.each($("#dgFreeSelectionCourseList").cmsXDataTable("getSelections"), function (index) {
  24. d.push(this.FreeSelectionCouseID);
  25. });
  26. return d;
  27. }
  28. //点击列表更新
  29. function edit(rowindex, rowdata) {
  30. redirectTo = url + "?freeSelectionCourseIDs=" + rowdata.FreeSelectionCouseID + "&MNU=" + mnu + "&IsDisplay=false";
  31. $.popupTopWindow("任选课程信息", redirectTo, 650, 550, null, null);
  32. }
  33. //修改按钮
  34. function FreeSelectionCourse_Update() {
  35. var d = validChoose();
  36. if (d.length == 0) {
  37. $.messager.alert("系统信息", "请选择您要修改的信息。");
  38. return;
  39. }
  40. if (d.length > 1) {
  41. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  42. return;
  43. }
  44. redirectTo = url + "?freeSelectionCourseIDs=" + d+ "&MNU=" + mnu ;
  45. $.popupTopWindow("任选课程修改", redirectTo, 650, 550, null, null);
  46. }
  47. //删除
  48. function FreeSelectionCourse_Delete() {
  49. var d = validChoose().join(',');
  50. if (d == "") {
  51. $.messager.alert("系统信息", "请选择您要删除的信息!!");
  52. return;
  53. }
  54. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  55. if (r) {
  56. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/FreeSelectionCourse/Delete', { freeSelectionCourseIDs: d }, function (data) {
  57. if (data == "删除成功!") {
  58. $.messager.alert("系统提示", data);
  59. $("#dgFreeSelectionCourseList").cmsXDataTable('load');
  60. } else {
  61. $.messager.alert("系统提示", data);
  62. }
  63. });
  64. }
  65. });
  66. }
  67. function FreeSelectionCourse_Export() {
  68. $("#formQuery").submit();
  69. }
  70. function QueryCoursematerialComboGrid(data) {
  71. reload();
  72. }
  73. function QuerySpecialtyComboGrid(data) {
  74. reload();
  75. }
  76. function QuerySchoolcodeDropdownList(data) {
  77. reload();
  78. }
  79. function QueryStarttermDropdownList(data) {
  80. reload();
  81. }
  82. function QueryIsEnableDropdownList(data) {
  83. reload();
  84. }