SelectCourseList.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. })
  6. //获取选中的数据
  7. function validChoose() {
  8. var d = [];
  9. $.each($("#dgSelectCourseList").cmsXDataTable("getSelections"), function (index) {
  10. d.push(this.ID);
  11. });
  12. return d;
  13. }
  14. function courseTypeValidChoose() {
  15. var d = [];
  16. $.each($("#dgSelectCourseList").cmsXDataTable("getSelections"), function (index) {
  17. d.push(this.SelectCourseType);
  18. });
  19. return d;
  20. }
  21. function userIDValidChoose() {
  22. var d = [];
  23. $.each($("#dgSelectCourseList").cmsXDataTable("getSelections"), function (index) {
  24. d.push(this.UserID);
  25. });
  26. return d;
  27. }
  28. function statusValidChoose() {
  29. var d = [];
  30. $.each($("#dgSelectCourseList").cmsXDataTable("getSelections"), function (index) {
  31. d.push(this.RecordStatusCode);
  32. });
  33. return d;
  34. }
  35. function reload() {
  36. $("#dgSelectCourseList").cmsXDataTable("load", $.getDataGridParams("dgSelectCourseList"));
  37. }
  38. //导出
  39. function SelectCourseList_Export() {
  40. $(document.forms[0]).submit();
  41. }
  42. //删除
  43. function SelectCourseList_Delete() {
  44. var d = validChoose().join(',');
  45. var type = courseTypeValidChoose().join(','); //选修类型
  46. var userID = userIDValidChoose().join(',');
  47. var r = statusValidChoose();
  48. if (d == "") {
  49. $.messager.alert("系统信息", "请选择您要删除的信息。");
  50. return;
  51. }
  52. for (var i = 0; i < r.length; i++) {
  53. if (r[i] == CreatedStatus) {
  54. $.messager.alert("系统提示", "已开班状态的信息无法删除。");
  55. return;
  56. }
  57. }
  58. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  59. if (r) {
  60. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/SelectCourseList/Delete', { IDs: d, Types: type, UserIDs: userID }, function (data) {
  61. if (data.IsSuccess == true) {
  62. $("#dgSelectCourseList").cmsXDataTable('load');
  63. }
  64. $.messager.alert("系统提示", data.Message);
  65. });
  66. }
  67. });
  68. }
  69. //院系所
  70. function SelectCollegeComboGrid() {
  71. reload();
  72. }