CourseTimeHours.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/CourseTimeHours/Edit";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. })
  6. function reload() {
  7. $("#dgList").cmsXDataTable("load", $.getDataGridParams("dgList"));
  8. }
  9. //获取选中的数据
  10. function validChoose() {
  11. var d = [];
  12. $.each($("#dgList").cmsXDataTable("getSelections"), function (index) {
  13. d.push(this.CourseTimeHoursID);
  14. });
  15. return d;
  16. }
  17. //新增
  18. function CourseTimeHours_Add() {
  19. var redirectTo = url + '?MNU=' + mnu;
  20. $.popupTopWindow('学时转换设置新增', redirectTo, 800, 200, null, null);
  21. }
  22. //点击列表更新
  23. function edit(rowindex, rowdata) {
  24. var redirectTo = url + "?CoursesTimeID=" + rowdata.CourseTimeHoursID + "&MNU=" + mnu + '&isView=1';
  25. $.popupTopWindow('学时转换设置详情', redirectTo, 800, 200, null, null);
  26. }
  27. //修改按钮
  28. function CourseTimeHours_Update() {
  29. var d = validChoose();
  30. if (d == "") {
  31. $.messager.alert("系统信息", "请选择您要修改的学时转换设置。");
  32. return;
  33. }
  34. if (d.length > 1) {
  35. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  36. return;
  37. }
  38. var redirectTo = url + "?CoursesTimeID=" + d + "&MNU=" + mnu;
  39. $.popupTopWindow('学时转换设置修改', redirectTo, 800, 200, null, null);
  40. }
  41. //删除
  42. function CourseTimeHours_Delete() {
  43. var d = validChoose().join(',');
  44. if (d.length == 0) {
  45. $.messager.alert("系统信息", "请选择您要删除学时转换设置数据!!");
  46. return;
  47. }
  48. $.messager.confirm("系统提示", "您确定要删除的学时转换设置数据?", function (r) {
  49. if (r) {
  50. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/CourseTimeHours/Delete', { ids: d }, function (data) {
  51. if (data == "删除成功") {
  52. $.messager.alert("系统提示", "删除成功!");
  53. $("#dgList").cmsXDataTable('load');
  54. } else {
  55. $.messager.alert("系统提示", data);
  56. }
  57. });
  58. }
  59. });
  60. }