DegreeConditionPackage.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/DegreeConditionPackage/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgDegreeConditionPackageList").cmsXDataTable("load", $.getDataGridParams("dgDegreeConditionPackageList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgDegreeConditionPackageList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.DegreeConditionPackageID);
  16. });
  17. return d;
  18. }
  19. //新增
  20. function DegreeConditionPackage_Add() {
  21. var d = validChoose();
  22. if (d.length > 0) {
  23. $.popupTopWindow('学位公式复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/DegreeConditionPackage/CopyAdd?DegreeConditionPackageID=' + d[0] + '&MNU=' + mnu, 750, 480, null, null);
  24. } else {
  25. var redirectTo = url + "?MNU=" + mnu;
  26. $.popupTopWindow('学位公式新增', redirectTo, 750, 480, null, null);
  27. }
  28. }
  29. //修改
  30. function DegreeConditionPackage_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 + "?DegreeConditionPackageID=" + d + "&MNU=" + mnu;
  41. $.popupTopWindow('学位公式修改', redirectTo, 750, 480, null, null);
  42. }
  43. //删除
  44. function DegreeConditionPackage_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 + '/DegreeConditionPackage/Delete', { degreeConditionPackageIDs: d }, function (data) {
  53. if (data == "删除成功。") {
  54. $.messager.alert("系统提示", data);
  55. $("#dgDegreeConditionPackageList").cmsXDataTable('load');
  56. } else {
  57. $.messager.alert("系统提示", data);
  58. }
  59. });
  60. }
  61. });
  62. }
  63. //查看明细
  64. function detail(rowindex, rowdata) {
  65. var redirectTo = url + "?DegreeConditionPackageID=" + rowdata.DegreeConditionPackageID + "&Type=1";
  66. $.popupTopWindow('学位公式信息', redirectTo, 750, 480, null, null);
  67. }
  68. //设置相应的行颜色为红色
  69. function SetRedGrid(rowIndex, rowData) {
  70. if (rowData.IsDefault) {
  71. return "color: red;";
  72. } else {
  73. return "";
  74. }
  75. }
  76. //Excel导出
  77. function DegreeConditionPackage_Export() {
  78. $("#formQuery").submit();
  79. }