SubjectCountLimit.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationSubjectCountLimit/Edit";
  2. var addUrl = CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationSubjectCountLimit/Add";
  3. var mnu;
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. });
  7. function SubjectCountLimit_Export() {
  8. $(document.forms[0]).submit();
  9. }
  10. function SubjectCountLimit_Add() {
  11. redirectTo = addUrl + "?MNU=" + mnu;
  12. $.popupTopWindow("门数限制新增", redirectTo, 800, 400, null, null);
  13. }
  14. function reload() {
  15. $("#dgSubjectCountLimitList").cmsXDataTable("load", $.getDataGridParams("dgSubjectCountLimitList"));
  16. }
  17. //获取选中的数据
  18. function validChoose() {
  19. var d = [];
  20. $.each($("#dgSubjectCountLimitList").cmsXDataTable("getSelections"), function (index) {
  21. d.push(this.ExaminationSubjectCountLimitID);
  22. });
  23. return d;
  24. }
  25. function validChooseFacultymajorID() {
  26. var d = [];
  27. $.each($("#dgSubjectCountLimitList").cmsXDataTable("getSelections"), function (index) {
  28. d.push(this.FacultymajorID);
  29. });
  30. return d;
  31. }
  32. function validChooseYears() {
  33. var d = [];
  34. $.each($("#dgSubjectCountLimitList").cmsXDataTable("getSelections"), function (index) {
  35. d.push(this.Years);
  36. });
  37. return d;
  38. }
  39. //批量修改执行前触发事件
  40. SystemBatchModifyControl.OnSubmit = function (a) {
  41. if (document.getElementById("ExaminationTypeIDDropdownList_div").style.display != "none") {
  42. var facultymajorIDs = validChooseFacultymajorID().join(",");
  43. var years = validChooseYears().join(",");
  44. var examinationType = $("#ExaminationTypeID_DropdownList").combobox("getValue");
  45. var bool = true;
  46. $.ajax({ url: CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSubjectCountLimit/Validation?examinationType=' + examinationType + '&facultymajorIDs=' + facultymajorIDs + '&years=' + years,
  47. type: "post", dataType: "json", async: false,
  48. success: function (data) {
  49. if (data.IsSuccess != true) {
  50. $.messager.alert("系统提示", data.Message);
  51. bool = false;
  52. }
  53. }
  54. });
  55. if (bool != true)
  56. return false;
  57. }
  58. }
  59. //点击列表更新
  60. function edit(rowindex, rowdata) {
  61. redirectTo = url + "?SubjectCountLimitID=" + rowdata.ExaminationSubjectCountLimitID + "&MNU=" + mnu + "&isView=1";
  62. $.popupTopWindow("门数限制详情", redirectTo, 800, 200, null, null);
  63. }
  64. //修改按钮
  65. function SubjectCountLimit_Update() {
  66. var d = validChoose();
  67. if (d.length == 0) {
  68. $.messager.alert("系统提示", "请选择您要修改的门数限制。");
  69. return;
  70. }
  71. if (d.length > 1) {
  72. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  73. return;
  74. }
  75. redirectTo = url + "?SubjectCountLimitID=" + d + "&MNU=" + mnu;
  76. $.popupTopWindow("门数限制修改", redirectTo, 800, 200, null, null);
  77. }
  78. //删除
  79. function SubjectCountLimit_Delete() {
  80. var d = validChoose().join(',');
  81. if (d == "") {
  82. $.messager.alert("系统提示", "请选择您要删除的门数限制。");
  83. return;
  84. }
  85. $.messager.confirm("系统提示", "您确定要删除该门数限制?", function (r) {
  86. if (r) {
  87. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationSubjectCountLimit/Delete', { subjectCountLimitIDs: d }, function (data) {
  88. if (data == "删除成功") {
  89. $.messager.alert("系统提示", "删除成功!");
  90. $("#dgSubjectCountLimitList").cmsXDataTable('load');
  91. } else {
  92. $.messager.alert("系统提示", data);
  93. }
  94. });
  95. }
  96. });
  97. }