PersonalScoreEdit.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/PersonalScore/NewList";
  2. var mnu = "";
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. var jsonString = "";
  6. var parameterString = "";
  7. var resultTypeID = $("#ResultTypeID").combobox("getValue");
  8. var examsStateID = $("#ExamsStateID").combobox("getValue");
  9. //var resultTypeDetailID = $("#rTD").val();
  10. //$("#ResultTypeDetailID").combogridX("setValue", resultTypeDetailID);
  11. if (examsStateID == 1 || examsStateID == "-1" || examsStateID == 10) {
  12. if (resultTypeID != 100 && resultTypeID != "-1") {
  13. $("[name='TotalScore']").attr("disabled", "disabled");
  14. $("[name='TotalScore']").hide();
  15. $("#ResultTypeDetailID").next().show();
  16. } else {
  17. $("[name='TotalScore']").removeAttr("disabled");
  18. $("[name='TotalScore']").show();
  19. $("#ResultTypeDetailID").next().hide();
  20. //$("#ResultTypeID").combobox("setValue", 100);
  21. }
  22. } else {
  23. $("[name='TotalScore']").show();
  24. $("#ResultTypeDetailID").next().hide();
  25. $("[name='TotalScore']").attr("disabled", "disabled");
  26. }
  27. StudentChange();
  28. })
  29. //$(function () {
  30. // debugger;
  31. // var resultTypeDetailID = $("#rTD").val();
  32. // $("#ResultTypeDetailID").combogridX("setValue", resultTypeDetailID);
  33. //})
  34. function setValue() {
  35. // debugger;
  36. // var resultTypeDetailID = $("#rTD").val();
  37. // $("#ResultTypeDetailID").combogridX("setValue", resultTypeDetailID);
  38. }
  39. function ResultTypeChange() {
  40. var jsonString = "";
  41. var parameterString = "";
  42. var resultTypeID = $("#ResultTypeID").combobox("getValue");
  43. var examsStateID = $("#ExamsStateID").combobox("getValue");
  44. if (examsStateID == 1 || examsStateID == "-1") {
  45. if (resultTypeID != 100 && resultTypeID != "-1") {
  46. $("[name='TotalScore']").attr("disabled", "disabled");
  47. $("[name='TotalScore']").hide();
  48. $("#ResultTypeDetailID").next().show();
  49. if (resultTypeID != nonSelect) {
  50. $("#ResultTypeDetailID").combobox("setValue", "");
  51. $("#ResultTypeDetailID").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/PersonalScore/GetTypeNameByID?typeID=" + resultTypeID + "");
  52. } else {
  53. //$("#ResultTypeDetailID").combobox("reload");
  54. }
  55. } else {
  56. $("[name='TotalScore']").removeAttr("disabled");
  57. $("[name='TotalScore']").show();
  58. $("[name='TotalScore']").val("");
  59. $("#ResultTypeDetailID").next().hide();
  60. }
  61. }
  62. }
  63. function ExamsStateChange() {
  64. var examsStateID = $("#ExamsStateID").combobox("getValue");
  65. //var examsStateName =
  66. if (examsStateID != 1 && examsStateID != "-1" && examsStateID != 10) {
  67. $("[name='TotalScore']").show();
  68. $("#ResultTypeDetailID").next().hide();
  69. var examsStateName = $("#ExamsStateID").next().find(".combo-text.validatebox-text").val();
  70. $("[name='TotalScore']").val(examsStateName);
  71. $("[name='TotalScore']").attr("disabled","disabled");
  72. } else {
  73. $("[name='TotalScore']").show();
  74. $("#ResultTypeDetailID").next().hide();
  75. $("[name='TotalScore']").removeAttr("disabled");
  76. $("[name='TotalScore']").val(0);
  77. }
  78. }
  79. function PersonScore_Save() {
  80. var userID = $.SystemGeneral.getUrlParam("UserID");
  81. var windowID = $.SystemGeneral.getUrlParam("WindowID");
  82. var coursematerialID = $("#CoursematerialID").combogridX("getValue");
  83. var examsCategoryID = $("#ExamsCategoryID").combobox("getValue");
  84. var startTermID = $("#StarttermID").combobox("getValue");
  85. var changedUserID = $("#UserID").combogridX("getValue");
  86. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StudentScore/ValidateDuplicate', {
  87. submitedScoreID: $.SystemGeneral.getUrlParam("SubmitedScoreID"),
  88. userID: userID,
  89. coursematerialID: coursematerialID,
  90. examsCategoryID: examsCategoryID,
  91. startTermID: startTermID
  92. }, function (data) {
  93. if (data.IsSuccess) {
  94. $(document.forms[0]).submit();
  95. } else {
  96. $.messager.confirm('提示', data.Message, function (r) {
  97. if (r) {
  98. $(document.forms[0]).submit();
  99. }
  100. });
  101. }
  102. });
  103. }
  104. function StudentScore_Save() {
  105. var userID = $("#UserID").combogridX("getValue");
  106. var coursematerialID = $("#CoursematerialID").combogridX("getValue");
  107. var examsCategoryID = $("#ExamsCategoryID").combobox("getValue");
  108. var startTermID = $("#StarttermID").combobox("getValue");
  109. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StudentScore/ValidateDuplicate', {
  110. submitedScoreID: $.SystemGeneral.getUrlParam("submitedScoreID"),
  111. userID: userID,
  112. coursematerialID: coursematerialID,
  113. examsCategoryID: examsCategoryID,
  114. startTermID: startTermID
  115. }, function (data) {
  116. if (data.IsSuccess) {
  117. $(document.forms[0]).submit();
  118. } else {
  119. $.messager.confirm('提示', data.Message, function (r) {
  120. if (r) {
  121. $(document.forms[0]).submit();
  122. }
  123. });
  124. }
  125. });
  126. }
  127. function selectSchoolyearNum() {
  128. var schoolyearNum = $("#SchoolyearNumID").combobox("getValue");
  129. var startTermObj = $("#StarttermID");
  130. var startTerm = startTermObj.combobox("getValue");
  131. if (startTerm > (schoolyearNum * 2) || startTerm < ((schoolyearNum - 1) * 2)) {
  132. startTermObj.combobox("setValue", (schoolyearNum * 2) - 1);
  133. }
  134. }
  135. function selectStartTerm() {
  136. var schoolyearNumObj = $("#SchoolyearNumID");
  137. var startTermObj = $("#StarttermID");
  138. var startTerm = startTermObj.combobox("getValue");
  139. schoolyearNumObj.combobox("setValue", Math.ceil(parseFloat(startTerm) / parseFloat(2)));
  140. }
  141. function StudentChange() {
  142. var userID = $("#UserID").combogridX("getValue");
  143. var className = "";
  144. var url = CMS_SystemConfig.VirtualDirectoryPath + '/PersonalScore/GetClassNameByUserID';
  145. if (userID != null && userID != "") {
  146. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/PersonalScore/GetClassNameByUserID', {
  147. userID: userID
  148. }, function (data) {
  149. document.getElementById("ClassName").value = data.Message;
  150. });
  151. }
  152. }
  153. function queryClass() {
  154. var SchoolyearNumID = $("#SchoolyearNumID").combobox("getValue");
  155. var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentScore/BindDropdownListBySchoolyearNum?bindType=PleaseSelect&year=" + SchoolyearNumID;
  156. $("#StarttermID").combobox("reload", url);
  157. }