Library.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Library/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //新增
  8. function Library_Add() {
  9. var redirectTo = url + '?MNU=' + mnu;
  10. $.popupTopWindow('书库基本信息新增', redirectTo, 700, 270, null, null);
  11. }
  12. function reload() {
  13. $("#dgLibraryList").cmsXDataTable("load", $.getDataGridParams("dgLibraryList"));
  14. }
  15. //获取选中的数据
  16. function validChoose() {
  17. var d = [];
  18. $.each($("#dgLibraryList").cmsXDataTable("getSelections"), function (index) {
  19. d.push(this.LibraryID);
  20. });
  21. return d;
  22. }
  23. //点击列表更新
  24. function edit(rowindex, rowdata) {
  25. var redirectTo = url + "?libraryID=" + rowdata.LibraryID + "&MNU=" + mnu + "&isView=1";
  26. $.popupTopWindow("书库基本信息详情", redirectTo, 700, 270, null, null);
  27. }
  28. //修改按钮
  29. function Library_Update() {
  30. var d = validChoose();
  31. if (d.length == 0) {
  32. $.messager.alert("系统提示", "请选择您要修改的书库信息。");
  33. return;
  34. }
  35. if (d.length > 1) {
  36. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  37. return;
  38. }
  39. var redirectTo = url + "?libraryID=" + d + "&MNU=" + mnu;
  40. $.popupTopWindow("书库基本信息修改", redirectTo, 700, 270, null, null);
  41. }
  42. //删除
  43. function Library_Delete() {
  44. var d = validChoose().join(',');
  45. if (d == "") {
  46. $.messager.alert("系统提示", "请选择您要删除的书库信息!");
  47. return;
  48. }
  49. $.messager.confirm("系统提示", "您确定要删除该书库信息?", function (r) {
  50. if (r) {
  51. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Library/Delete', { libraryIDs: d }, function (data) {
  52. if (data == "删除成功") {
  53. $.messager.alert("系统提示", "删除成功!");
  54. $("#dgLibraryList").cmsXDataTable('load');
  55. } else {
  56. $.messager.alert("系统提示", data);
  57. }
  58. });
  59. }
  60. });
  61. }
  62. function Library_Export() {
  63. $("#formQuery").submit();
  64. }
  65. function SelectCampusCode(v) {
  66. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/Library/GetCampusCodeByCampusID', { campusID: v.Value }, function (data) {
  67. $('input[name="CampusCode"]').val(data);
  68. });
  69. }