Department.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Department/Edit";
  2. var loadurl = CMS_SystemConfig.VirtualDirectoryPath + "/Department/List";
  3. var mnu = "";
  4. //加载
  5. $(function () {
  6. mnu = $.SystemGeneral.getUrlParam("MNU");
  7. })
  8. //刷新
  9. function reload() {
  10. $("#dgDepartmentList").cmsXDataTable("load", $.getDataGridParams("dgDepartmentList"));
  11. }
  12. //获取选中的数据
  13. function validChoose() {
  14. var d = [];
  15. $.each($("#dgDepartmentList").cmsXDataTable("getSelections"), function (index) {
  16. d.push(this.DepartmentID);
  17. });
  18. return d;
  19. }
  20. //获取菜单Url
  21. function load() {
  22. window.location.href = loadurl + "?MNU=" + mnu;
  23. }
  24. //新增
  25. function Department_Add() {
  26. var d = validChoose();
  27. if (d.length > 0) {
  28. $.popupTopWindow('教研室复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/Department/CopyAdd?departmentID=' + d[0] + '&MNU=' + mnu, 650, 350, null, null);
  29. } else {
  30. var redirectTo = url + "?MNU=" + mnu;
  31. $.popupTopWindow('教研室新增', redirectTo, 650, 350, null, null);
  32. }
  33. }
  34. //修改按钮
  35. function Department_Update() {
  36. var d = validChoose();
  37. if (d == "") {
  38. $.messager.alert("系统信息", "请选择您要修改的信息。");
  39. return;
  40. }
  41. if (d.length > 1) {
  42. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  43. return;
  44. }
  45. var redirectTo = url + "?departmentID=" + d + "&MNU=" + mnu + "&type=edit";
  46. $.popupTopWindow('教研室修改', redirectTo, 650, 350, null, null);
  47. }
  48. //查看
  49. function edit(rowindex, rowdata) {
  50. window.event.cancelBubble = true;
  51. var redirectTo = url + "?departmentID=" + rowdata.DepartmentID + "&MNU=" + mnu + "&type=detail";
  52. $.popupTopWindow('教研室信息', redirectTo, 650, 350, null, null);
  53. }
  54. //删除
  55. function Department_Delete() {
  56. var d = validChoose().join(',');
  57. if (d == "") {
  58. $.messager.alert("系统信息", "请选择您要删除的信息。");
  59. return;
  60. }
  61. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  62. if (r) {
  63. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Department/Delete', { departmentIDs: d }, function (data) {
  64. if (data.IsSuccess) {
  65. $.messager.alert("系统提示", data.Message);
  66. $("#dgDepartmentList").cmsXDataTable('load');
  67. } else {
  68. $.messager.alert("系统提示", data.Message);
  69. }
  70. });
  71. }
  72. });
  73. }
  74. //教研室对应的教师明细
  75. function editStaffCount(rowindex, rowdata) {
  76. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Department/StaffList?departmentID=" + rowdata.DepartmentID + "&MNU=" + mnu;
  77. $.popupTopWindow('教师信息明细', redirectTo, 1024, 540, null, null);
  78. }
  79. //Excel导出
  80. function Department_Export() {
  81. $("#formQuery").submit();
  82. }
  83. //Excel导入
  84. function Department_Import() {
  85. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Department/Import?MNU=' + mnu;
  86. $.popupTopWindow('教研室导入', redirectTo, 420, 300, reload);
  87. }
  88. //联动
  89. function queryCampus() {
  90. var campusID = $("#CampusDropdown").combogridX("getValue");
  91. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  92. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  93. reload();
  94. }
  95. function queryCollege(data) {
  96. reload();
  97. }