Facultymajor.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Facultymajor/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgFacultymajorList").cmsXDataTable("load", $.getDataGridParams("dgFacultymajorList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgFacultymajorList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.FacultymajorID);
  16. });
  17. return d;
  18. }
  19. //新增
  20. function Facultymajor_Add() {
  21. var d = validChoose();
  22. if (d.length > 0) {
  23. $.popupTopWindow('院系专业复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/Facultymajor/CopyAdd?facultymajorID=' + d[0] + '&MNU=' + mnu, 650, 420, null, null);
  24. } else {
  25. var redirectTo = url + "?MNU=" + mnu;
  26. $.popupTopWindow('院系专业新增', redirectTo, 650, 420, null, null);
  27. }
  28. }
  29. //修改按钮
  30. function Facultymajor_Update() {
  31. var d = validChoose();
  32. if (d == "") {
  33. $.messager.alert("系统提示", "请选择您要修改的信息。");
  34. return;
  35. }
  36. if (d.length > 1) {
  37. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  38. return;
  39. }
  40. var redirectTo = url + "?facultymajorID=" + d + "&MNU=" + mnu + "&type=edit";
  41. $.popupTopWindow('院系专业修改', redirectTo, 650, 420, null, null);
  42. }
  43. //查看
  44. function edit(rowindex, rowdata) {
  45. var redirectTo = url + "?facultymajorID=" + rowdata.FacultymajorID + "&MNU=" + mnu + "&type=detail";
  46. $.popupTopWindow('院系专业信息', redirectTo, 650, 420, null, null);
  47. }
  48. //删除
  49. function Facultymajor_Delete() {
  50. var d = validChoose().join(',');
  51. if (d == "") {
  52. $.messager.alert("系统提示", "请选择您要删除的信息。");
  53. return;
  54. }
  55. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  56. if (r) {
  57. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Facultymajor/Delete', { facultymajorIDs: d }, function (data) {
  58. if (data.IsSuccess) {
  59. $.messager.alert("系统提示", data.Message);
  60. $("#dgFacultymajorList").cmsXDataTable('load');
  61. } else {
  62. $.messager.alert("系统提示", data.Message);
  63. }
  64. });
  65. }
  66. });
  67. }
  68. //院系专业对应的年级专业明细
  69. function editGrademajorCount(rowindex, rowdata) {
  70. var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue");
  71. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Facultymajor/GrademajorList?inSchoolStatus=" + inSchoolStatus + "&facultymajorID=" + rowdata.FacultymajorID + "&MNU=" + mnu;
  72. $.popupTopWindow('年级专业明细', redirectTo, 850, 540, null, null);
  73. }
  74. //院系专业学生明细
  75. function editStudentCount(rowindex, rowdata) {
  76. var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue");
  77. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Facultymajor/ClassStudentListView?inSchoolStatus=" + inSchoolStatus + "&facultymajorID=" + rowdata.FacultymajorID + "&MNU=" + mnu;
  78. $.popupTopWindow('院系专业学生明细', redirectTo, 850, 540, null, null);
  79. }
  80. //Excel导出
  81. function Facultymajor_Export() {
  82. $("#formQuery").submit();
  83. }
  84. //Excel导入
  85. function Facultymajor_Import() {
  86. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Facultymajor/Import?MNU=' + mnu;
  87. $.popupTopWindow('院系专业信息导入', redirectTo, 420, 300, reload);
  88. }
  89. //联动查询
  90. function queryCampus(data) {
  91. var campusID = $("#CampusDropdown").combogridX("getValue");
  92. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  93. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  94. reload();
  95. }
  96. function queryCollege(data) {
  97. var campusID = $("#CampusDropdown").combogridX("getValue");
  98. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  99. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  100. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  101. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  102. reload();
  103. }