University.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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;
  41. $.popupTopWindow('学校信息修改', redirectTo, 700, 540, null, null);
  42. }
  43. //删除
  44. function University_Delete() {
  45. var d = validChoose().join(',');
  46. if (d == "") {
  47. $.messager.alert("系统信息", "请选择您要删除的信息。");
  48. return;
  49. }
  50. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  51. if (r) {
  52. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/University/Delete', { universityIDs: d }, function (data) {
  53. if (data == "删除成功。") {
  54. $.messager.alert("系统提示", data);
  55. $("#dgUniversityList").cmsXDataTable('load');
  56. } else {
  57. $.messager.alert("系统提示", data);
  58. }
  59. });
  60. }
  61. });
  62. }
  63. //查看
  64. function edit(rowindex, rowdata) {
  65. //TODO:临时性加参数控制、屏蔽列表进入无保存按钮权限 2016年10月24日16:56:17~
  66. var redirectTo = url + "?UniversityID=" + rowdata.UniversityID + "&MNU=" + mnu + "&Type=1";
  67. $.popupTopWindow('学校信息', redirectTo, 700, 540, null, null);
  68. }
  69. //导出Excel
  70. function University_Export() {
  71. $("#formQuery").submit();
  72. }