LessonRecordList.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. })
  6. function reload() {
  7. $("#dgLessonRecordList").cmsXDataTable("load", $.getDataGridParams("dgLessonRecordList"));
  8. }
  9. function startDateChanged(dp) {
  10. $("#StartDate").val($dp.cal.getNewDateStr());
  11. reload();
  12. }
  13. function endDateChanged(dp) {
  14. $("#EndDate").val($dp.cal.getNewDateStr());
  15. reload();
  16. }
  17. function validChoose() {
  18. var d = [];
  19. $.each($("#dgLessonRecordList").cmsXDataTable("getSelections"), function (index) {
  20. d.push(this);
  21. });
  22. return d;
  23. }
  24. function show(rowIndex, rowData) {
  25. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/LessonRecord/Edit?lessonRecordID=" + rowData.LessonRecordID + "&isShow=1&MNU=" + mnu;
  26. $.popupTopWindow('听课记录', redirectTo, 800, 600, null, null);
  27. }
  28. function LessonRecord_Add() {
  29. $.popupTopWindow('添加听课记录', CMS_SystemConfig.VirtualDirectoryPath + "/LessonRecord/Edit?MNU=" + mnu, 800, 600, null, null);
  30. }
  31. function LessonRecord_Edit() {
  32. var d = validChoose();
  33. if (d == "") {
  34. $.messager.alert("系统信息", "请选择您要修改的听课记录信息。");
  35. return;
  36. }
  37. if (d.length > 1) {
  38. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  39. return;
  40. }
  41. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/LessonRecord/Edit?lessonRecordID=" + d[0].LessonRecordID + "&MNU=" + mnu;
  42. $.popupTopWindow('修改听课记录', redirectTo, 800, 600, null, null);
  43. }
  44. function LessonRecord_Delete() {
  45. var d = validChoose();
  46. if (d.length == 0) {
  47. $.messager.alert("系统提示", "请选择您要删除的听课记录。");
  48. return;
  49. }
  50. $.messager.confirm("系统提示", "您确定要删除听课记录信息?", function (r) {
  51. if (r) {
  52. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/LessonRecord/Delete', { lessonRecordIDs: $.map(d, function (x) { return x.LessonRecordID; }).join(',') },
  53. function (data) {
  54. if (data.IsSuccess) {
  55. $.messager.alert("系统提示", "删除成功!");
  56. $("#dgLessonRecordList").cmsXDataTable('load');
  57. } else {
  58. $.messager.alert("系统提示", data.Message);
  59. }
  60. });
  61. }
  62. });
  63. }
  64. function LessonRecord_Export() {
  65. $("[name='LessonRecordIDs']").val($.map(validChoose(), function (x) { return x.LessonRecordID; }).join(','));
  66. $("#formQuery").submit();
  67. }