ChangeReport.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ChangeReport/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgChangeReportList").cmsXDataTable("load", $.getDataGridParams("dgChangeReportList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgChangeReportList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.ChangeReportID);
  16. });
  17. return d;
  18. }
  19. //新增
  20. function ChangeReport_Add() {
  21. var d = validChoose();
  22. if (d.length > 0) {
  23. $.popupTopWindow('异动报表复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/ChangeReport/CopyAdd?changeReportID=' + d[0] + '&MNU=' + mnu, 600, 250, null, null);
  24. } else {
  25. var redirectTo = url + "?MNU=" + mnu;
  26. $.popupTopWindow('异动报表新增', redirectTo, 600, 250, null, null);
  27. }
  28. }
  29. //修改按钮
  30. function ChangeReport_Edit() {
  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 + "?changeReportID=" + d + "&MNU=" + mnu + "&type=edit";
  41. $.popupTopWindow('异动报表修改', redirectTo, 600, 250, null, null);
  42. }
  43. //查看明细
  44. function edit(rowindex, rowdata) {
  45. var redirectTo = url + "?changeReportID=" + rowdata.ChangeReportID + "&MNU=" + mnu + "&type=detail";
  46. $.popupTopWindow('异动报表明细', redirectTo, 600, 250, null, null);
  47. }
  48. //删除
  49. function ChangeReport_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 + '/ChangeReport/Delete', { changeReportIDs: d }, function (data) {
  58. if (data.IsSuccess) {
  59. $.messager.alert("系统提示", data.Message);
  60. $("#dgChangeReportList").cmsXDataTable('load');
  61. } else {
  62. $.messager.alert("系统提示", data.Message);
  63. }
  64. });
  65. }
  66. });
  67. }
  68. //设置列颜色为红色
  69. function SetRedColumn(index, row, value) {
  70. return " <span style=\"color: red;\">" + value + "</span>";
  71. }
  72. //导出Excel
  73. function ChangeReport_Export() {
  74. $("#formQuery").submit();
  75. }