EvaluationGradeControlBatchAdd.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //刷新
  2. function reload() {
  3. $("#dgGrademajorNoAddList").cmsXDataTable("load", $.getDataGridParams("dgGrademajorNoAddList"));
  4. }
  5. //获取选中的数据
  6. function validChoose() {
  7. var d = [];
  8. $.each($("#dgGrademajorNoAddList").cmsXDataTable("getSelections"), function (index) {
  9. d.push(this.GrademajorID);
  10. });
  11. return d;
  12. }
  13. //获取选中的数据All
  14. function validChooseAll() {
  15. var d = [];
  16. $.each($("#dgGrademajorNoAddList").cmsXDataTable("getSelections"), function (index) {
  17. d.push(this);
  18. });
  19. return d;
  20. }
  21. //确定生成成功后不关闭弹出页面
  22. function formSuccessReloadNoClose(data) {
  23. if (data.IsSuccess == true) {
  24. reload();
  25. }
  26. $.messager.alert("系统提示", data.Message);
  27. }
  28. //确定
  29. function EvaluationGradeControlBatchAdd_Confirm() {
  30. var schoolyearID = $("#SchoolyearID").combobox("getValue");
  31. if (schoolyearID == "" || schoolyearID == "-1" || schoolyearID == null) {
  32. $.messager.alert("系统提示", "请选择学年学期。");
  33. return;
  34. }
  35. var number = $("#Number").val();
  36. if (number == "" || number == null) {
  37. $.messager.alert("系统提示", "可评次数不能为空。");
  38. return;
  39. }
  40. var startDate = $("#StartTime").val();
  41. var endDate = $("#EndTime").val();
  42. if (startDate == "" || startDate == null) {
  43. $.messager.alert("系统提示", "开始时间不能为空。");
  44. return;
  45. }
  46. if (endDate == "" || endDate == null) {
  47. $.messager.alert("系统提示", "结束时间不能为空。");
  48. return;
  49. }
  50. var sd = new Date(startDate.replace(/\-/g, "\/"));
  51. var ed = new Date(endDate.replace(/\-/g, "\/"));
  52. if (startDate != "" && endDate != "" && sd >= ed) {
  53. $.messager.alert("系统提示", "结束时间不能小于开始时间。");
  54. return;
  55. }
  56. var d = validChoose();
  57. if (d.length == 0) {
  58. $.messager.alert("系统提示", "请选择您要新增的年级专业信息。");
  59. return;
  60. }
  61. $("#grademajorIDList").val(JSON.stringify(d));
  62. $(document.forms[0]).submit();
  63. }
  64. //设置列颜色为红色
  65. function SetRedColumn(index, row, value) {
  66. return " <span style=\"color: red;\">" + value + "</span>";
  67. }
  68. //联动查询
  69. function queryCampus(data) {
  70. var campusID = $("#CampusDropdown").combogridX("getValue");
  71. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  72. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  73. queryClass();
  74. }
  75. function queryCollege(data) {
  76. var campusID = $("#CampusDropdown").combogridX("getValue");
  77. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  78. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  79. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  80. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  81. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  82. queryClass();
  83. }
  84. function queryStandard(data) {
  85. queryClass();
  86. }
  87. function queryClass() {
  88. var jsonString = "";
  89. var parameterString = "";
  90. var campusID = $("#CampusDropdown").combogridX("getValue");
  91. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  92. var standardID = $("#DictionaryStandard").combogridX("getValue");
  93. var educationID = $("#DictionaryEducation").combogridX("getValue");
  94. var learningformID = $("#DictionaryLearningform").combogridX("getValue");
  95. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  96. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  97. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  98. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  99. if (learningformID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningformID + "|@|";
  100. if (parameterString != "") {
  101. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  102. $("#DictionaryStandard").combogridX("reload", eval(jsonString));
  103. }
  104. else {
  105. $("#DictionaryStandard").combogridX("reload");
  106. }
  107. reload();
  108. }