Specialty.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/Specialty/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgSpecialtyList").cmsXDataTable("load", $.getDataGridParams("dgSpecialtyList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgSpecialtyList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.SpecialtyID);
  16. });
  17. return d;
  18. }
  19. //新增
  20. function Specialty_Add() {
  21. var d = validChoose();
  22. if (d.length > 0) {
  23. $.popupTopWindow('专业信息复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/Specialty/CopyAdd?specialtyID=' + d[0] + '&MNU=' + mnu, 650, 320, null, null);
  24. } else {
  25. var redirectTo = url + "?MNU=" + mnu;
  26. $.popupTopWindow('专业信息新增', redirectTo, 650, 320, null, null);
  27. }
  28. }
  29. //查看
  30. function edit(rowindex, rowdata) {
  31. var redirectTo = url + "?specialtyID=" + rowdata.SpecialtyID + "&Isdisplay=false&MNU=" + mnu;
  32. $.popupTopWindow('专业信息', redirectTo, 650, 320, null, null);
  33. }
  34. //修改按钮
  35. function Specialty_Update() {
  36. var d = validChoose();
  37. if (d == "") {
  38. $.messager.alert("系统提示", "请选择您要修改的信息。");
  39. return;
  40. }
  41. if (d.length > 1) {
  42. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  43. return;
  44. }
  45. var redirectTo = url + "?specialtyID=" + d + "&MNU=" + mnu;
  46. $.popupTopWindow('专业信息修改', redirectTo, 650, 320, null, null);
  47. }
  48. //删除
  49. function Specialty_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 + '/Specialty/Delete', { specialtyIDs: d }, function (data) {
  58. if (data == "删除成功。") {
  59. $.messager.alert("系统提示", data);
  60. $("#dgSpecialtyList").cmsXDataTable('load');
  61. } else {
  62. $.messager.alert("系统提示", data);
  63. }
  64. });
  65. }
  66. });
  67. }
  68. //设置相应的行颜色为红色
  69. function SetRedGrid(rowIndex, rowData) {
  70. if (rowData.RecordStatus <= 0) {
  71. return "color: red;";
  72. } else {
  73. return "";
  74. }
  75. }
  76. //Excel导出
  77. function Specialty_Export() {
  78. $("#formQuery").submit();
  79. }
  80. //Excel导入
  81. function Specialty_Import() {
  82. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Specialty/Import?MNU=' + mnu;
  83. $.popupTopWindow('专业信息导入', redirectTo, 420, 300, reload);
  84. }
  85. //联动
  86. function QueryStandardDropdownList(data) {
  87. reload();
  88. }
  89. function QueryEducationDropdownList(data) {
  90. reload();
  91. }
  92. function QueryLearningformDropdownList(data) {
  93. reload();
  94. }