SelectCourseOpenControlSetting.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/SelectCourseOpenControlSetting/Edit";
  2. var bathval = "";
  3. var mnu;
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. });
  7. function SelectCourseControl_Export() {
  8. $(document.forms[0]).submit();
  9. }
  10. //新增
  11. function SelectCourseControl_Add() {
  12. redirectTo = url + "?MNU=" + mnu;
  13. $.popupTopWindow("限选控制新增", redirectTo, 650, 300, null, null);
  14. }
  15. function reload() {
  16. $("#dgOpenControlSettingList").cmsXDataTable("load", $.getDataGridParams("dgOpenControlSettingList"));
  17. }
  18. //获取选中的数据
  19. function validChoose() {
  20. var d = [];
  21. $.each($("#dgOpenControlSettingList").cmsXDataTable("getSelections"), function (index) {
  22. d.push(this.SelectCourseOpenControlSettingID);
  23. });
  24. return d;
  25. }
  26. //点击列表更新
  27. function edit(rowindex, rowdata) {
  28. redirectTo = url + "?selectCourseOpenControlSettingID=" + rowdata.SelectCourseOpenControlSettingID + "&MNU=" + mnu + "&isView=1";
  29. $.popupTopWindow("限选控制信息", redirectTo, 650, 300, null, null);
  30. }
  31. //修改按钮
  32. function SelectCourseControl_Update() {
  33. var d = validChoose();
  34. if (d.length == 0) {
  35. $.messager.alert("系统提示", "请选择您要修改的信息。");
  36. return;
  37. }
  38. if (d.length > 1) {
  39. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  40. return;
  41. }
  42. redirectTo = url + "?selectCourseOpenControlSettingID="+ d+ "&MNU=" + mnu;
  43. $.popupTopWindow("限选控制修改", redirectTo, 650, 300, null, null);
  44. }
  45. //删除
  46. function SelectCourseControl_Delete() {
  47. var d = validChoose().join(',');
  48. if (d == "") {
  49. $.messager.alert("系统提示", "请选择您要删除的信息。");
  50. return;
  51. }
  52. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  53. if (r) {
  54. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/SelectCourseOpenControlSetting/Delete', { openControlSettingIDs: d }, function (data) {
  55. if (data == "删除成功!") {
  56. $.messager.alert("系统提示", data);
  57. $("#dgOpenControlSettingList").cmsXDataTable('load');
  58. } else {
  59. $.messager.alert("系统提示", data);
  60. }
  61. });
  62. }
  63. });
  64. }
  65. function queryCollege(data) {
  66. $("#CollegeDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/College/CollegeDropdownListBanid?campusID=" + data.Value + "");
  67. }
  68. //联动查询
  69. function queryStandard(data) {
  70. queryClass();
  71. reload();
  72. }
  73. function queryCollege(data) {
  74. var campusID = $("#CampusDropdown").combogridX("getValue");
  75. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  76. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  77. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  78. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  79. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  80. // if (campusID != nonSelect) {
  81. // var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  82. // $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  83. // }
  84. queryClass();
  85. reload();
  86. }
  87. function queryClass() {
  88. var jsonString = "";
  89. var parameterString = "";
  90. var campusID = $("#CampusDropdown").combogridX("getValue");
  91. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  92. //var educationID = $("#Education").combobox("getValue");
  93. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  94. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  95. //var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
  96. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  97. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  98. //if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  99. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  100. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  101. //if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  102. if (parameterString != "") {
  103. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  104. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  105. } else {
  106. $("#ClassmajorDropdown").combogridX("reload");
  107. }
  108. reload();
  109. }