MinorSpecialtyCourse.js 3.0 KB

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