PrintControl.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/PrintControl/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. function reload() {
  8. $("#dgPrintControlList").cmsXDataTable("load", $.getDataGridParams("dgPrintControlList"));
  9. }
  10. //获取选中的数据
  11. function validChoose() {
  12. var d = [];
  13. $.each($("#dgPrintControlList").cmsXDataTable("getSelections"), function (index) {
  14. d.push(this.PrintControlID);
  15. });
  16. return d;
  17. }
  18. function PrintControl_Add() {
  19. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/PrintControl/Edit?MNU=" + mnu;
  20. $.popupTopWindow('打印控制设置', redirectTo, 500, 250, null, null);
  21. }
  22. function PrintControl_Edit() {
  23. var d = validChoose();
  24. if (d.length == 0) {
  25. $.messager.alert("系统信息", "请选择您要进行设置的控制信息。");
  26. return;
  27. }
  28. if (d.length > 1) {
  29. $.messager.alert("系统信息", "只能选择单个记录进行设置。");
  30. return;
  31. }
  32. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/PrintControl/Edit?printControlID=" + d + "&MNU=" + mnu;
  33. $.popupTopWindow('打印控制设置', redirectTo, 500, 250, null, null);
  34. }
  35. function PrintControl_Delete() {
  36. var d = validChoose();
  37. if (d.length == 0) {
  38. $.messager.alert("系统信息", "请选择您要删除的控制信息。");
  39. return;
  40. }
  41. $.messager.confirm("系统提示", "您确定要删除选中的控制信息?", function (r) {
  42. if (r) {
  43. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/PrintControl/Delete', { printControlIDs: d.join(',') }, function (data) {
  44. if (data.IsSuccess) {
  45. $.messager.alert("系统提示", "删除成功。");
  46. reload();
  47. } else {
  48. $.messager.alert("系统提示", data.Message);
  49. }
  50. });
  51. }
  52. });
  53. }