MinorControl.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/MinorControl/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. function reload() {
  8. $("#dgMinorControlList").cmsXDataTable("load", $.getDataGridParams("dgMinorControlList"));
  9. }
  10. //获取选中的数据
  11. function validChoose() {
  12. var d = [];
  13. $.each($("#dgMinorControlList").cmsXDataTable("getSelections"), function (index) {
  14. d.push(this.MinorControlID);
  15. });
  16. return d;
  17. }
  18. //辅修控制新增
  19. function MinorControl_Add() {
  20. var d = validChoose();
  21. if (d.length > 0) {
  22. $.popupTopWindow('辅修控制复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/MinorControl/CopyAdd?minorControlID=' + d[0] + '&MNU=' + mnu, 680, 320, null, null);
  23. } else {
  24. var redirectTo = url + "?MNU=" + mnu;
  25. $.popupTopWindow('辅修控制新增', redirectTo, 680, 320, null, null);
  26. }
  27. }
  28. //辅修控制修改
  29. function MinorControl_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 + "?minorControlID=" + d + "&MNU=" + mnu;
  40. $.popupTopWindow('辅修控制修改', redirectTo, 650, 230, null, null);
  41. }
  42. //删除
  43. function MinorControl_Delete() {
  44. var d = validChoose();
  45. if (d.length == 0) {
  46. $.messager.alert("系统提示", "请选择您要删除的信息。");
  47. return;
  48. }
  49. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  50. if (r) {
  51. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/MinorControl/Delete', { minorControlIDs: d.join(',') }, function (data) {
  52. if (data == "删除成功。") {
  53. $.messager.alert("系统提示", data);
  54. $("#dgMinorControlList").cmsXDataTable('load');
  55. } else {
  56. $.messager.alert("系统提示", data);
  57. }
  58. });
  59. }
  60. });
  61. }