ChargeProject.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ChargeProject/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgChargeProjectList").cmsXDataTable("load", $.getDataGridParams("dgChargeProjectList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgChargeProjectList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.ChargeProjectID);
  16. });
  17. return d;
  18. }
  19. //查看明细
  20. function edit(rowindex, rowdata) {
  21. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/ChargeProject/Details" + "?chargeProjectID=" + rowdata.ChargeProjectID + "&MNU=" + mnu;
  22. $.popupTopWindow('收费项目信息', redirectTo, 450, 240, null, null);
  23. }
  24. //新增
  25. function ChargeProject_Add() {
  26. var redirectTo = url + "?MNU=" + mnu;
  27. $.popupTopWindow('收费项目新增', redirectTo, 450, 240, null, null);
  28. }
  29. //修改按钮
  30. function ChargeProject_Update(){
  31. var d = validChoose();
  32. if (d == "") {
  33. $.messager.alert("系统提示", "请选择您要修改的信息。");
  34. return;
  35. }
  36. if (d.length > 1) {
  37. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  38. return;
  39. }
  40. var redirectTo = url + "?chargeProjectID=" + d + "&MNU=" + mnu;
  41. $.popupTopWindow('收费项目修改', redirectTo, 450, 240, null, null);
  42. }
  43. //删除
  44. function ChargeProject_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 + '/ChargeProject/Delete', { chargeProjectIDs: d }, function (data) {
  53. if (data == "删除成功。") {
  54. $.messager.alert("系统提示", "删除成功。");
  55. $("#dgChargeProjectList").cmsXDataTable('load');
  56. } else {
  57. $.messager.alert("系统提示", data);
  58. }
  59. });
  60. }
  61. });
  62. }
  63. //Excel导出
  64. function ChargeProject_Export() {
  65. $("#formQuery").submit();
  66. }