NewPersonalScore.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/PersonalScore/Edit";
  2. var urlAdd = CMS_SystemConfig.VirtualDirectoryPath + "/PersonalScore/Add";
  3. var mnu = "";
  4. var changeUserID;
  5. //加载
  6. $(function () {
  7. mnu = $.SystemGeneral.getUrlParam("MNU");
  8. })
  9. //获取选中的数据
  10. function validChoose() {
  11. var d = [];
  12. $.each($("#dgCourseScheduleSettingList").cmsXDataTable("getSelections"), function (index) {
  13. d.push(this.SubmitedScoreID);
  14. });
  15. return d;
  16. }
  17. function reload() {
  18. $("#display_search_list").css('display', 'none');
  19. var userID = $("#StudentsComboGrid").combogridX("getValue");
  20. var userIDByName = $("#StudentsByNameComboGrid").combogridX("getValue");
  21. if (userIDByName != nonSelect && userIDByName != "") {
  22. $("#StudentsByNameComboGrid").combogridX("setValue", nonSelect);
  23. }
  24. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/PersonalScore/NewCoursematerialList', { userID: userID }, function (data) {
  25. if (data.length > 0) {
  26. var count = data[0].ListStarttermID.length;
  27. var width = " 20%";
  28. var a = "100%";
  29. if (count > 5) {
  30. var height = 0;
  31. a = 100 + (count - 5) * 20;
  32. width = 100 / count + "%";
  33. }
  34. $("#search_list").html("");
  35. StudentCoursematerialtable(data[0]);
  36. var html = "<div id='divScroll' style='width: " + a + "%'>";
  37. for (var i = 0; i < data[0].ListStarttermID.length; i++) {
  38. //PS:同一课程、可能开课学期不同~
  39. var listCourseGradeView = $.grep(data[0].ListCourseGradeView, function (x) { return (x.StarttermID == data[0].ListStarttermID[i]); });
  40. html += "<table cellpadding='0' cellspacing='0' style='width: " + width + "; margin-bottom: 5px; float:left;' class='Coursematerialtable'>";
  41. html += "<tr>";
  42. html += "<td align='center' colspan='3' style='background-color: #F0F0F0'>" + listCourseGradeView[0].StarttermName + "</td>";
  43. html += "</tr>";
  44. html += "<tr>";
  45. html += "<td align='center' style='background-color: #F0F0F0'>课程名称</td>";
  46. html += "<td align='center' style='background-color: #F0F0F0'>总成绩</td>";
  47. html += "<td align='center' style='background-color: #F0F0F0'>学分</td>";
  48. html += "</tr>";
  49. for (var j = 0; j < listCourseGradeView.length; j++) {
  50. var color = "'" + listCourseGradeView[j].CourseTypeColour + "'"
  51. html += "<tr>";
  52. if (listCourseGradeView[j].Club == null) {
  53. html += "<td style='background-color:" + listCourseGradeView[j].CourseTypeColour + "'" + " align=\"center\"><a href=\"#this\" onclick=\"return LoadScore('" + listCourseGradeView[j].CoursematerialID + "','" + listCourseGradeView[j].SchoolyearID + "','" + listCourseGradeView[j].UserID + "','" + data[0].ListStarttermID[i] + "');\"><font color=blue>" + listCourseGradeView[j].CourseName + "</font></a></td>";
  54. } else {
  55. html += "<td style='background-color:#32CD32' align=\"center\"><a href=\"#this\" onclick=\"return LoadScore('" + listCourseGradeView[j].CoursematerialID + "','" + listCourseGradeView[j].SchoolyearID + "','" + listCourseGradeView[j].UserID + "','" + data[0].ListStarttermID[i] + "');\"><font color=blue>" + listCourseGradeView[j].CourseName + "</font></a></td>";
  56. }
  57. if (listCourseGradeView[j].TotalScore < 60 || listCourseGradeView[j].TotalScore == "")
  58. html += "<td align='center' style='color:Red'>" + listCourseGradeView[j].TotalScoreStr + "</td>";
  59. else
  60. html += "<td align='center' >" + listCourseGradeView[j].TotalScoreStr + "</td>";
  61. html += "<td align='center'>" + isEmpty(listCourseGradeView[j].ScoreCredit) + "</td>";
  62. html += "</tr>";
  63. }
  64. html += "</table>";
  65. }
  66. html += "</div>";
  67. $("#search_list").html(html);
  68. }
  69. else {
  70. StudentCoursematerialtable(data[0]);
  71. var html = " <p style='color:Red;'>选择的学生成绩库中无成绩,请检查。</p>"
  72. $("#search_list").html(html);
  73. }
  74. });
  75. //reloadBack();
  76. }
  77. function reloadByName() {
  78. $("#display_search_list").css('display', 'none');
  79. var userID = $("#StudentsComboGrid").combogridX("getValue");
  80. var userIDByName = $("#StudentsByNameComboGrid").combogridX("getValue");
  81. if (userID != nonSelect && userID != "") {
  82. $("#StudentsComboGrid").combogridX("setValue", nonSelect);
  83. }
  84. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/PersonalScore/NewCoursematerialList', { userID: userIDByName }, function (data) {
  85. if (data.length > 0) {
  86. var count = data[0].ListStarttermID.length;
  87. var width = " 20%";
  88. var a = "100%";
  89. if (count > 5) {
  90. var height = 0;
  91. a = 100 + (count - 5) * 20;
  92. width = 100 / count + "%";
  93. }
  94. $("#search_list").html("");
  95. StudentCoursematerialtable(data[0]);
  96. var html = "<div id='divScroll' style='width: " + a + "%'>";
  97. for (var i = 0; i < data[0].ListStarttermID.length; i++) {
  98. //PS:同一课程、可能开课学期不同~
  99. var listCourseGradeView = $.grep(data[0].ListCourseGradeView, function (x) { return (x.StarttermID == data[0].ListStarttermID[i]); });
  100. html += "<table cellpadding='0' cellspacing='0' style='width: " + width + "; margin-bottom: 5px; float:left;' class='Coursematerialtable'>";
  101. html += "<tr>";
  102. html += "<td align='center' colspan='3' style='background-color: #F0F0F0'>" + listCourseGradeView[0].StarttermName + "</td>";
  103. html += "</tr>";
  104. html += "<tr>";
  105. html += "<td align='center' style='background-color: #F0F0F0'>课程名称</td>";
  106. html += "<td align='center' style='background-color: #F0F0F0'>总成绩</td>";
  107. html += "<td align='center' style='background-color: #F0F0F0'>学分</td>";
  108. html += "</tr>";
  109. for (var j = 0; j < listCourseGradeView.length; j++) {
  110. var color = "'" + listCourseGradeView[j].CourseTypeColour + "'"
  111. html += "<tr>";
  112. if (listCourseGradeView[j].Club == null) {
  113. html += "<td style='background-color:" + listCourseGradeView[j].CourseTypeColour + "'" + " align=\"center\"><a href=\"#this\" onclick=\"return LoadScore('" + listCourseGradeView[j].CoursematerialID + "','" + listCourseGradeView[j].SchoolyearID + "','" + listCourseGradeView[j].UserID + "','" + data[0].ListStarttermID[i] + "');\"><font color=blue>" + listCourseGradeView[j].CourseName + "</font></a></td>";
  114. } else {
  115. html += "<td style='background-color:#32CD32' align=\"center\"><a href=\"#this\" onclick=\"return LoadScore('" + listCourseGradeView[j].CoursematerialID + "','" + listCourseGradeView[j].SchoolyearID + "','" + listCourseGradeView[j].UserID + "','" + data[0].ListStarttermID[i] + "');\"><font color=blue>" + listCourseGradeView[j].CourseName + "</font></a></td>";
  116. }
  117. if (listCourseGradeView[j].TotalScore < 60 || listCourseGradeView[j].TotalScore == "")
  118. html += "<td align='center' style='color:Red'>" + listCourseGradeView[j].TotalScoreStr + "</td>";
  119. else
  120. html += "<td align='center' >" + listCourseGradeView[j].TotalScoreStr + "</td>";
  121. html += "<td align='center'>" + isEmpty(listCourseGradeView[j].ScoreCredit) + "</td>";
  122. html += "</tr>";
  123. }
  124. html += "</table>";
  125. }
  126. html += "</div>";
  127. $("#search_list").html(html);
  128. }
  129. else {
  130. StudentCoursematerialtable(data[0]);
  131. var html = " <p style='color:Red;'>选择的学生成绩库中无成绩,请检查。</p>"
  132. $("#search_list").html(html);
  133. }
  134. });
  135. //reloadBack();
  136. }
  137. function reloadBack() {
  138. $("#display_search_list").css('display', 'none');
  139. var userID = $("#StudentsComboGrid").combogridX("getValue");
  140. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/PersonalScore/NewCoursematerialList', { userID: userID }, function (data) {
  141. if (data.length > 0) {
  142. var count = data[0].ListStarttermID.length;
  143. var width = " 20%";
  144. var a = "100%";
  145. if (count > 5) {
  146. var height = 0;
  147. a = 100 + (count - 5) * 20;
  148. width = 100 / count + "%";
  149. }
  150. $("#search_list").html("");
  151. StudentCoursematerialtable(data[0]);
  152. var html = "<div id='divScroll' style='width: " + a + "%'>";
  153. for (var i = 0; i < data[0].ListStarttermID.length; i++) {
  154. //PS:同一课程、可能开课学期不同~
  155. var listCourseGradeView = $.grep(data[0].ListCourseGradeView, function (x) { return (x.StarttermID == data[0].ListStarttermID[i]); });
  156. html += "<table cellpadding='0' cellspacing='0' style='width: " + width + "; margin-bottom: 5px; float:left;' class='Coursematerialtable'>";
  157. html += "<tr>";
  158. html += "<td align='center' colspan='3' style='background-color: #F0F0F0'>" + listCourseGradeView[0].StarttermName + "</td>";
  159. html += "</tr>";
  160. html += "<tr>";
  161. html += "<td align='center' style='background-color: #F0F0F0'>课程名称</td>";
  162. html += "<td align='center' style='background-color: #F0F0F0'>总成绩</td>";
  163. html += "<td align='center' style='background-color: #F0F0F0'>学分</td>";
  164. html += "</tr>";
  165. for (var j = 0; j < listCourseGradeView.length; j++) {
  166. var color = "'" + listCourseGradeView[j].CourseTypeColour + "'"
  167. html += "<tr>";
  168. if (listCourseGradeView[j].Club == null) {
  169. html += "<td style='background-color:" + listCourseGradeView[j].CourseTypeColour + "'" + " align=\"center\"><a href=\"#this\" onclick=\"return LoadScore('" + listCourseGradeView[j].CoursematerialID + "','" + listCourseGradeView[j].SchoolyearID + "','" + listCourseGradeView[j].UserID + "','" + data[0].ListStarttermID[i] + "');\"><font color=blue>" + listCourseGradeView[j].CourseName + "</font></a></td>";
  170. } else {
  171. html += "<td style='background-color:#32CD32' align=\"center\"><a href=\"#this\" onclick=\"return LoadScore('" + listCourseGradeView[j].CoursematerialID + "','" + listCourseGradeView[j].SchoolyearID + "','" + listCourseGradeView[j].UserID + "','" + data[0].ListStarttermID[i] + "');\"><font color=blue>" + listCourseGradeView[j].CourseName + "</font></a></td>";
  172. }
  173. if (listCourseGradeView[j].TotalScore < 60 || listCourseGradeView[j].TotalScore == "")
  174. html += "<td align='center' style='color:Red'>" + listCourseGradeView[j].TotalScoreStr + "</td>";
  175. else
  176. html += "<td align='center' >" + listCourseGradeView[j].TotalScoreStr + "</td>";
  177. html += "<td align='center'>" + isEmpty(listCourseGradeView[j].ScoreCredit) + "</td>";
  178. html += "</tr>";
  179. }
  180. html += "</table>";
  181. }
  182. html += "</div>";
  183. $("#search_list").html(html);
  184. }
  185. else {
  186. StudentCoursematerialtable(data[0]);
  187. var html = " <p style='color:Red;'>请选择您要查看成绩的学生学号。</p>"
  188. $("#search_list").html(html);
  189. }
  190. });
  191. }
  192. //验证是否为空。
  193. function isEmpty(val) {
  194. switch (typeof (val)) {
  195. case 'string':
  196. return trim(val).length == 0 ? 0 : val;
  197. break;
  198. case 'number':
  199. return val == 0 ? 0 : val;
  200. break;
  201. case 'object':
  202. return val == null ? 0 : val;
  203. break;
  204. case 'array':
  205. return val.length == 0 ? 0 : val;
  206. break;
  207. default:
  208. return true;
  209. }
  210. };
  211. function StudentCoursematerialtable(data) {
  212. if (data != null) {
  213. //$("#StudentCoursematerialtable").find("tr.row").remove();
  214. var html = "";
  215. html += "<label><b>姓名:</b></label>";
  216. html += "&nbsp<label><b>" + data.UserName + "</b></label>";
  217. html += "&nbsp&nbsp<label><b>院系所:</b></label>";
  218. html += "&nbsp<label><b>" + data.CollegeName + "</b></label>";
  219. html += "&nbsp&nbsp<label><b>班级名称:</b></label>";
  220. html += "&nbsp<label><b>" + data.ClassName + "</b></label>";
  221. html += "&nbsp&nbsp<label><b>毕业时间:</b></label>";
  222. html += "<label><b>" + (data.PlanningGraduateDate == null ? "" : ChangeDateFormat(data.PlanningGraduateDate)) + "</b></label>";
  223. var html1 = "";
  224. html1 += "<label><b>门数:</b></label>";
  225. html1 += "&nbsp<label><b>" + data.CoursematerialCount + "</b></label>";
  226. html1 += "&nbsp&nbsp<label'><b>平均成绩:</b></label>";
  227. html1 += "&nbsp<label><b>" + (data.AVGScore == null ? 0 : data.AVGScore.toFixed(1)) + "</b></label>";
  228. html1 += "&nbsp&nbsp<label><b>总学分:</b></label>";
  229. html1 += "&nbsp<label><b>" + (data.TotalCredit == null ? 0 : data.TotalCredit.toFixed(1)) + "</b></label>";
  230. html1 += "&nbsp&nbsp<label><b>必修:</b></label>";
  231. html1 += "&nbsp<label><b>" + (data.RequiredCredit == null ? 0 : data.RequiredCredit.toFixed(1)) + "</b></label>";
  232. html1 += "&nbsp&nbsp<label><b>限选(含通识教育):</b></label>";
  233. html1 += "&nbsp<label><b>" + (data.OptionalCourseCredit == null ? 0 : data.OptionalCourseCredit.toFixed(1)) + "</b></label>";
  234. html1 += "&nbsp&nbsp<label><b>任选:</b></label>";
  235. html1 += "&nbsp<label><b>" + (data.FreeSelectionCourseCredit == null ? 0 : data.FreeSelectionCourseCredit.toFixed(1)) + "</b></label>";
  236. html1 += "&nbsp&nbsp<label><b>方向选修:</b></label>";
  237. html1 += "&nbsp<label><b>" + (data.ElectiveCredit == null ? 0 : data.ElectiveCredit.toFixed(1)) + "</b></label>";
  238. html1 += "&nbsp&nbsp<label><b>公共选修:</b></label>";
  239. html1 += "&nbsp<label><b>" + (data.ElectivePublicCredit == null ? 0 : data.ElectivePublicCredit.toFixed(1)) + "</b></label>";
  240. html1 += "&nbsp&nbsp<label><b>实践环节:</b></label>";
  241. html1 += "&nbsp<label><b>" + (data.PractiseNotCredit == null ? 0 : data.PractiseNotCredit.toFixed(1)) + "</b></label>";
  242. html1 += "&nbsp&nbsp<label><b>俱乐部(含校本):</b></label>";
  243. html1 += "&nbsp<label><b>" + (data.ClubWithSchoolbasedCredit == null ? 0 : data.ClubWithSchoolbasedCredit.toFixed(1)) + "</b></label>";
  244. // html += "<tr>";
  245. // html += "<td style='background-color: #F0F0F0; '>姓&nbsp&nbsp&nbsp名</td>";
  246. // html += "<td>" + data.UserName + "</td>";
  247. // html += "<td style='background-color: #F0F0F0'>院系</td>";
  248. // html += "<td>" + data.CollegeName + "</td>";
  249. // html += "<td style='background-color: #F0F0F0'>班&nbsp&nbsp&nbsp级</td>";
  250. // html += "<td>" + data.ClassName + "</td>";
  251. // html += "</tr>";
  252. // html += "<tr>";
  253. // html += "<td style='background-color: #F0F0F0'>毕业时间</td>";
  254. // html += "<td>" + (data.PlanningGraduateDate == null ? "" : ChangeDateFormat(data.PlanningGraduateDate)) + "</td>";
  255. // html += "<td style='background-color: #F0F0F0'>门数</td>";
  256. // html += "<td>" + data.CoursematerialCount + "</td>";
  257. // html += "<td style='background-color: #F0F0F0'>平均成绩</td>";
  258. // html += "<td>" + (data.AVGScore == null ? 0 : data.AVGScore.toFixed(1)) + "</td>";
  259. // html += "</tr>";
  260. // html += "<tr>";
  261. // html += "<td style='background-color: #F0F0F0'>总 学 分</td>";
  262. // html += "<td>" + (data.TotalCredit == null ? 0 : data.TotalCredit.toFixed(1)) + "</td>";
  263. // html += "<td style='background-color: #F0F0F0'></td>";
  264. // html += "<td></td>";
  265. // html += "<td style='background-color: #F0F0F0'></td>";
  266. // html += "<td></td>";
  267. // html += "</tr>";
  268. $("#Studenttable").html(html);
  269. $("#StudentCoursematerialtable").html(html1);
  270. }
  271. else {
  272. $("#Studenttable").html("");
  273. $("#StudentCoursematerialtable").html("");
  274. }
  275. }
  276. function LoadScore(CoursematerialID, SchoolyearID, UserID, StarttermID) {
  277. $("#display_search_list").css('display', 'block');
  278. $("#hid_SchoolyearID").val(SchoolyearID);
  279. $("#hid_CoursematerialID").val(CoursematerialID);
  280. $("#hid_UserID").val(UserID);
  281. $("#hid_StarttermID").val(StarttermID)
  282. $("#dgCourseScheduleSettingList").cmsXDataTable("load", { CoursematerialID: CoursematerialID, StarttermID: StarttermID, UserID: UserID });
  283. }
  284. //转化json数据的日期
  285. function ChangeDateFormat(jsondate) {
  286. jsondate = jsondate.replace("/Date(", "").replace(")/", "");
  287. if (jsondate.indexOf("+") > 0) {
  288. jsondate = jsondate.substring(0, jsondate.indexOf("+"));
  289. } else if (jsondate.indexOf("-") > 0) {
  290. jsondate = jsondate.substring(0, jsondate.indexOf("-"));
  291. }
  292. //alert(jsondate);
  293. var date = new Date(parseInt(jsondate, 10));
  294. //alert(date.getHours());
  295. var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
  296. var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
  297. //+ " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); 时分秒就不需要了~~
  298. return date.getFullYear() + "-" + month + "-" + currentDate;
  299. }
  300. function PersonScore_Add() {
  301. var d = validChoose();
  302. var SchoolyearID = $("#hid_SchoolyearID").val();
  303. var CoursematerialID = $("#hid_CoursematerialID").val();
  304. var UserID = $("#hid_UserID").val();
  305. var StarttermID = $("#hid_StarttermID").val();
  306. if (d.length > 0) {
  307. if (d.length > 1) {
  308. $.messager.alert("系统提示", "只能选择单个记录进行复制。");
  309. return;
  310. }
  311. var redirectTo = url + "?SubmitedScoreID=" + d + "&SchoolyearID=" + SchoolyearID + "&CoursematerialID=" + CoursematerialID + "&UserID=" + UserID + "&StarttermID=" + StarttermID + "&atype=1&MNU=" + mnu + "&SaveType=Add";
  312. $.popupTopWindow('学生成绩复制新增', redirectTo, 800, 480, AlertA);
  313. } else {
  314. var redirectTo = url + "?SubmitedScoreID=" + d + "&SchoolyearID=" + SchoolyearID + "&CoursematerialID=" + CoursematerialID + "&UserID=" + UserID + "&StarttermID=" + StarttermID + "&atype=1&MNU=" + mnu;
  315. $.popupTopWindow('学生成绩新增', redirectTo, 800, 480, null, null);
  316. }
  317. }
  318. function AlertA(data) {
  319. var changeUserID = data;
  320. if (changeUserID != null && changeUserID != "") {
  321. window.location.href = '/PersonalScore/NewList?MNU=' + mnu + "&UserID=" + changeUserID;
  322. }
  323. }
  324. function PersonScore_Update() {
  325. var d = validChoose();
  326. var SchoolyearID = $("#hid_SchoolyearID").val();
  327. var CoursematerialID = $("#hid_CoursematerialID").val();
  328. var UserID = $("#hid_UserID").val();
  329. var StarttermID = $("#hid_StarttermID").val();
  330. if (d == "") {
  331. $.messager.alert("系统提示", "请选择您要修改的成绩基本信息。");
  332. return;
  333. }
  334. if (d.length > 1) {
  335. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  336. return;
  337. }
  338. var redirectTo = url + "?SubmitedScoreID=" + d + "&SchoolyearID=" + SchoolyearID + "&CoursematerialID=" + CoursematerialID + "&UserID=" + UserID + "&StarttermID=" + StarttermID + "&atype=2&MNU=" + mnu;
  339. $.popupTopWindow('学生成绩修改', redirectTo, 800, 480, null, null);
  340. }
  341. function PersonScore_Delete() {
  342. // var d = validChoose().join(',');
  343. // if (d == "") {
  344. // $.messager.alert("系统提示", "请选择您要删除的成绩基本信息!");
  345. // return;
  346. // }
  347. // var schoolyearID = $("#hid_SchoolyearID").val();
  348. // var coursematerialID = $("#hid_CoursematerialID").val();
  349. // var userID = $("#hid_UserID").val();
  350. // var starttermID = $("#hid_StarttermID").val();
  351. // $.messager.confirm("系统提示", "您确定要删除该成绩基本信息?", function (r) {
  352. // if (r) {
  353. // $.post(CMS_SystemConfig.VirtualDirectoryPath + '/PersonalScore/Delete', { submitedScoreIDs: d, schoolyearID: schoolyearID, coursematerialID: coursematerialID, starttermID: starttermID, userID: userID }, function (data) {
  354. // if (data == "删除成功") {
  355. // $.messager.alert("系统提示", "删除成功!");
  356. // $("#dgCourseScheduleSettingList").cmsXDataTable("load", { CoursematerialID: coursematerialID, SchoolyearID: schoolyearID, UserID: userID });
  357. // reload(); //load页面
  358. // } else {
  359. // $.messager.alert("系统提示", data);
  360. // }
  361. // });
  362. // }
  363. // });
  364. var d = validChoose().join(',');
  365. if (d == "") {
  366. $.messager.alert("系统提示", "请选择您要删除的学生成绩信息!");
  367. return;
  368. }
  369. var schoolyearID = $("#hid_SchoolyearID").val();
  370. var coursematerialID = $("#hid_CoursematerialID").val();
  371. var userID = $("#hid_UserID").val();
  372. var starttermID = $("#hid_StarttermID").val();
  373. $.messager.confirm("系统提示", "您确定要删除该学生成绩信息?", function (r) {
  374. if (r) {
  375. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentScore/Delete', { submitedScoreIDs: d }, function (data) {
  376. if (data == "删除成功") {
  377. $.messager.alert("系统提示", "删除成功!");
  378. $("#dgCourseScheduleSettingList").cmsXDataTable("load", { CoursematerialID: coursematerialID, SchoolyearID: schoolyearID, UserID: userID });
  379. reload(); //load页面
  380. } else {
  381. $.messager.alert("系统提示", data);
  382. }
  383. });
  384. }
  385. });
  386. }
  387. function StudentScore_Report() {
  388. var UserID;
  389. if ($("#StudentsComboGrid").combogridX("getValue") != null && $("#StudentsComboGrid").combogridX("getValue") != "" && $("#StudentsComboGrid").combogridX("getValue") != nonSelect)
  390. UserID = $("#StudentsComboGrid").combogridX("getValue");
  391. else if ($("#StudentsByNameComboGrid").combogridX("getValue") != null && $("#StudentsByNameComboGrid").combogridX("getValue") != "" && $("#StudentsByNameComboGrid").combogridX("getValue") != nonSelect)
  392. UserID = $("#StudentsByNameComboGrid").combogridX("getValue");
  393. if (UserID == null) {
  394. $.messager.alert("系统提示", "请选择要查看成绩报表的学生学号或者姓名。");
  395. return;
  396. }
  397. // if (($("#StudentsComboGrid").combogridX("getValue") == null || $("#StudentsComboGrid").combogridX("getValue") == "") && ($("#StudentsByNameComboGrid").combogridX("getValue") == null || $("#StudentsByNameComboGrid").combogridX("getValue")=="")) {
  398. // $.messager.alert("系统提示", "请选择要查看成绩报表的学生学号或者姓名。");
  399. // return;
  400. // }
  401. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/PersonalScore/StudentScoreReport?UserID=" + UserID;
  402. //$.System.addTab('学生个人成绩报表', redirectTo, 'StudentScore', false);
  403. //addTab('学生个人成绩报表', redirectTo);
  404. $.popupTopWindow('学生个人成绩报表', redirectTo, 850, 550, null, null);
  405. //var redirectTo = '/StudentScore/StudentScoreReport?MNU=' + "" + "&CollegeID="
  406. //+ "&Years=&GrademajorID=&ClassmajorID=&Attribute=LoginID&Condition==&Value=" + $("#LoginID").val();
  407. //$.popupTopWindow('学生个人成绩报表', redirectTo, 1100, 550, null, null);
  408. }
  409. function addTab(title, url) {
  410. if ($('#index_center').tabs('exists', title)) {
  411. $('#index_center').tabs('select', title);
  412. } else {
  413. var content = '<iframe scrolling="auto" frameborder="0" src="' + url + '" style="width:100%;height:100%;"></iframe>';
  414. $('#index_center').tabs('add', {
  415. title: title,
  416. content: content,
  417. closable: true
  418. });
  419. }
  420. }
  421. //列表字体颜色设置为红色
  422. function SetRedColumn(index, row, value) {
  423. return " <span style=\"color: red;\">" + value + "</span>";
  424. }