University.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/University/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgUniversityList").cmsXDataTable("load", $.getDataGridParams("dgUniversityList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgUniversityList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.UniversityID);
  16. });
  17. return d;
  18. }
  19. //新增
  20. function University_Add() {
  21. var d = validChoose();
  22. if (d.length > 0) {
  23. $.popupTopWindow('学校信息复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/University/CopyAdd?universityID=' + d[0] + '&MNU=' + mnu, 700, 540, null, null);
  24. } else {
  25. var redirectTo = url + "?MNU=" + mnu;
  26. $.popupTopWindow('学校信息新增', redirectTo, 700, 540, null, null);
  27. }
  28. }
  29. //修改
  30. function University_Update() {
  31. var d = validChoose();
  32. if (d.length == 0) {
  33. $.messager.alert("系统信息", "请选择要修改的信息。");
  34. return;
  35. }
  36. if (d.length > 1) {
  37. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  38. return;
  39. }
  40. var redirectTo = url + "?universityID=" + d + "&MNU=" + mnu + "&type=edit";
  41. $.popupTopWindow('学校信息修改', redirectTo, 700, 540, null, null);
  42. }
  43. //查看
  44. function edit(rowindex, rowdata) {
  45. var redirectTo = url + "?universityID=" + rowdata.UniversityID + "&MNU=" + mnu + "&type=detail";
  46. $.popupTopWindow('学校信息', redirectTo, 700, 540, null, null);
  47. }
  48. //删除
  49. function University_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 + '/University/Delete', { universityIDs: d }, function (data) {
  58. if (data.IsSuccess) {
  59. $.messager.alert("系统提示", data.Message);
  60. $("#dgUniversityList").cmsXDataTable('load');
  61. } else {
  62. $.messager.alert("系统提示", data.Message);
  63. }
  64. });
  65. }
  66. });
  67. }
  68. //导出Excel
  69. function University_Export() {
  70. $("#formQuery").submit();
  71. }