College.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/College/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgCollegeList").cmsXDataTable("load", $.getDataGridParams("dgCollegeList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgCollegeList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.CollegeID);
  16. });
  17. return d;
  18. }
  19. //新增
  20. function College_Add() {
  21. var d = validChoose();
  22. if (d.length > 0) {
  23. $.popupTopWindow(EMIS_CollegeLabel + '复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/College/CopyAdd?collegeID=' + d[0] + '&MNU=' + mnu, 600, 350, null, null);
  24. } else {
  25. var redirectTo = url + "?MNU=" + mnu;
  26. $.popupTopWindow(EMIS_CollegeLabel + '新增', redirectTo, 600, 350, null, null);
  27. }
  28. }
  29. //修改按钮
  30. function College_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 + "?collegeID=" + d + "&MNU=" + mnu + "&type=edit";
  41. $.popupTopWindow(EMIS_CollegeLabel + '修改', redirectTo, 600, 350, null, null);
  42. }
  43. //查看
  44. function edit(rowindex, rowdata) {
  45. var redirectTo = url + "?CollegeID=" + rowdata.CollegeID + "&MNU=" + mnu + "&type=detail";
  46. $.popupTopWindow(EMIS_CollegeLabel + '信息', redirectTo, 600, 350, null, null);
  47. }
  48. //删除
  49. function College_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 + '/College/Delete', { collegeIDs: d }, function (data) {
  58. if (data.IsSuccess) {
  59. $.messager.alert("系统提示", data.Message);
  60. $("#dgCollegeList").cmsXDataTable('load');
  61. } else {
  62. $.messager.alert("系统提示", data.Message);
  63. }
  64. });
  65. }
  66. });
  67. }
  68. //院系所对应的教研室明细
  69. function editDepartmentCount(rowindex, rowdata) {
  70. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/College/DepartmentList?collegeID=" + rowdata.CollegeID + "&MNU=" + mnu;
  71. $.popupTopWindow('教研室明细', redirectTo, 850, 500, null, null);
  72. }
  73. //院系所对应的教师明细
  74. function editStaffCount(rowindex, rowdata) {
  75. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/College/StaffList?collegeID=" + rowdata.CollegeID + "&MNU=" + mnu;
  76. $.popupTopWindow('教师信息明细', redirectTo, 1024, 540, null, null);
  77. }
  78. //院系所对应的院系专业明细
  79. function editFacultymajorCount(rowindex, rowdata) {
  80. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/College/FacultymajorList?collegeID=" + rowdata.CollegeID + "&MNU=" + mnu;
  81. $.popupTopWindow('院系专业明细', redirectTo, 1024, 550, null, null);
  82. }
  83. //导出Excel
  84. function College_Export() {
  85. $("#formQuery").submit();
  86. }
  87. //Excel导入
  88. function College_Import() {
  89. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/College/Import?MNU=' + mnu;
  90. $.popupTopWindow(EMIS_CollegeLabel + '信息导入', redirectTo, 420, 300, reload);
  91. }
  92. //联动
  93. function queryCampus() {
  94. reload();
  95. }