RecruitSpecialty.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/RecruitSpecialty/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新列表
  8. function reload() {
  9. $("#dgRecruitSpecialtyList").cmsXDataTable("load", $.getDataGridParams("dgRecruitSpecialtyList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgRecruitSpecialtyList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.RecruitSpecialtyID);
  16. });
  17. return d;
  18. }
  19. //新增(批量)
  20. function RecruitSpecialty_Add() {
  21. //var d = validChoose();
  22. //if (d.length > 0) {
  23. // $.popupTopWindow('招生专业复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/RecruitSpecialty/CopyAdd?recruitSpecialtyID=' + d[0] + '&MNU=' + mnu, 600, 320, null, null);
  24. //} else {
  25. // var redirectTo = url + "?MNU=" + mnu;
  26. // $.popupTopWindow('招生专业新增', redirectTo, 600, 320, null, null);
  27. //}
  28. //采用以下方式进行新增
  29. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/RecruitSpecialty/RecruitSpecialtyBatchAdd" + "?MNU=" + mnu;
  30. $.popupTopWindow('招生专业新增', redirectTo, 950, 540, reload, null);
  31. }
  32. //修改按钮
  33. function RecruitSpecialty_Edit() {
  34. var d = validChoose();
  35. if (d == "") {
  36. $.messager.alert("系统提示", "请选择您要修改的信息。");
  37. return;
  38. }
  39. if (d.length > 1) {
  40. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  41. return;
  42. }
  43. var redirectTo = url + "?recruitSpecialtyID=" + d + "&MNU=" + mnu + "&type=edit";
  44. $.popupTopWindow('招生专业修改', redirectTo, 600, 320, null, null);
  45. }
  46. //查看
  47. function edit(rowindex, rowdata) {
  48. var redirectTo = url + "?recruitSpecialtyID=" + rowdata.RecruitSpecialtyID + "&MNU=" + mnu + "&type=detail";
  49. $.popupTopWindow('招生专业信息', redirectTo, 600, 320, null, null);
  50. }
  51. //删除
  52. function RecruitSpecialty_Delete() {
  53. var d = validChoose().join(',');
  54. if (d == "") {
  55. $.messager.alert("系统提示", "请选择您要删除的信息。");
  56. return;
  57. }
  58. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  59. if (r) {
  60. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/RecruitSpecialty/Delete', { recruitSpecialtyIDs: d }, function (data) {
  61. if (data.IsSuccess) {
  62. $.messager.alert("系统提示", data.Message);
  63. $("#dgRecruitSpecialtyList").cmsXDataTable('load');
  64. } else {
  65. $.messager.alert("系统提示", data.Message);
  66. }
  67. });
  68. }
  69. });
  70. }
  71. //专业班级生成
  72. function RecruitSpecialty_GenerateClass() {
  73. var d = validChoose().join(',');
  74. if (d == "") {
  75. $.messager.alert("系统提示", "请选择您要生成专业班级的信息。");
  76. return;
  77. }
  78. $.messager.confirm("系统提示", "您确定要对选择的信息生成专业班级?", function (r) {
  79. if (r) {
  80. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/RecruitSpecialty/GenerateClass', { recruitSpecialtyIDs: d }, function (data) {
  81. if (data.IsSuccess == true) {
  82. $("#dgRecruitSpecialtyList").cmsXDataTable('load');
  83. }
  84. $.messager.alert("系统提示", data.Message);
  85. });
  86. }
  87. });
  88. }
  89. //设置列颜色为红色
  90. function SetRedColumn(index, row, value) {
  91. return " <span style=\"color: red;\">" + value + "</span>";
  92. }
  93. //设置相应的行颜色为红色
  94. function SetRedGrid(rowIndex, rowData) {
  95. if (rowData.isGenerated != true) {
  96. return "color: red;";
  97. } else {
  98. return "";
  99. }
  100. }
  101. //Excel导出
  102. function RecruitSpecialty_Export() {
  103. $("#formQuery").submit();
  104. }
  105. //Excel导入
  106. function RecruitSpecialty_Import() {
  107. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/RecruitSpecialty/Import?MNU=' + mnu;
  108. $.popupTopWindow('招生专业导入', redirectTo, 420, 300, reload);
  109. }
  110. //联动查询
  111. function queryCampus(data) {
  112. var campusID = $("#CampusDropdown").combogridX("getValue");
  113. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  114. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  115. reload();
  116. }
  117. function queryCollege(data) {
  118. var campusID = $("#CampusDropdown").combogridX("getValue");
  119. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  120. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  121. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  122. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  123. reload();
  124. }
  125. function queryGrade(data) {
  126. reload();
  127. }
  128. function queryStandard(data) {
  129. reload();
  130. }