123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- function reload() {
- $("#display_search_list").css('display', 'none');
- var userID = $("#UserID").val();
- $.post(CMS_SystemConfig.VirtualDirectoryPath + '/PersonalScore/NewCoursematerialList', { userID: userID }, function (data) {
- if (data.length > 0) {
- var count = data[0].ListStarttermID.length;
- var width = " 20%";
- var a = "100%";
- if (count > 5) {
- var height = 0;
- a = 100 + (count - 5) * 20;
- width = 100 / count + "%";
- }
- $("#search_list").html("");
- StudentCoursematerialtable(data[0]);
- var html = "<div id='divScroll' style='width: " + a + "%'>";
- for (var i = 0; i < data[0].ListStarttermID.length; i++) {
- //PS:同一课程、可能开课学期不同~
- var listCourseGradeView = $.grep(data[0].ListCourseGradeView, function (x) { return (x.StarttermID == data[0].ListStarttermID[i]); });
- html += "<table cellpadding='0' cellspacing='0' style='width: " + width + "; margin-bottom: 5px; float:left;' class='Coursematerialtable'>";
- html += "<tr>";
- html += "<td align='center' colspan='3' style='background-color: #F0F0F0'>" + listCourseGradeView[0].StarttermName + "</td>";
- html += "</tr>";
- html += "<tr>";
- html += "<td align='center' style='background-color: #F0F0F0'>课程名称</td>";
- html += "<td align='center' style='background-color: #F0F0F0'>总成绩</td>";
- html += "<td align='center' style='background-color: #F0F0F0'>学分</td>";
- html += "</tr>";
- for (var j = 0; j < listCourseGradeView.length; j++) {
- var color = "'" + listCourseGradeView[j].CourseTypeColour + "'"
- html += "<tr>";
- if (listCourseGradeView[j].Club == null) {
- html += "<td style='background-color:" + listCourseGradeView[j].CourseTypeColour + "'" + " align=\"center\"><a href=\"#this\" onclick=\"return LoadScore('" + listCourseGradeView[j].CoursematerialID + "','" + data[0].ListStarttermID[i] + "','" + listCourseGradeView[j].UserID + "');\"><font color=blue>" + listCourseGradeView[j].CourseName + "</font></a></td>";
- } else {
- 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>";
- }
- if (listCourseGradeView[j].TotalScore < 60 || listCourseGradeView[j].TotalScore == "")
- html += "<td align='center' style='color:Red'>" + listCourseGradeView[j].TotalScoreStr + "</td>";
- else
- html += "<td align='center' >" + listCourseGradeView[j].TotalScoreStr + "</td>";
- html += "<td align='center'>" + isEmpty(listCourseGradeView[j].ScoreCredit) + "</td>";
- html += "</tr>";
- }
- html += "</table>";
- }
- html += "</div>";
- $("#search_list").html(html);
- }
- else {
- StudentCoursematerialtable(data[0]);
- var html = " <p style='color:Red;'>选择的学生成绩库中无成绩,请检查。</p>"
- $("#search_list").html(html);
- }
- });
- }
- function StudentCoursematerialtable(data) {
- if (data != null) {
- //$("#StudentCoursematerialtable").find("tr.row").remove();
- var html = "";
- html += "<label><b>姓名:</b></label>";
- html += " <label><b>" + data.UserName + "</b></label>";
- html += "  <label><b>院系所:</b></label>";
- html += " <label><b>" + data.CollegeName + "</b></label>";
- html += "  <label><b>班级名称:</b></label>";
- html += " <label><b>" + data.ClassName + "</b></label>";
- html += "  <label><b>毕业时间:</b></label>";
- html += "<label><b>" + (data.PlanningGraduateDate == null ? "" : ChangeDateFormat(data.PlanningGraduateDate)) + "</b></label>";
- var html1 = "";
- html1 += "<label><b>门数:</b></label>";
- html1 += " <label><b>" + data.CoursematerialCount + "</b></label>";
- html1 += "  <label'><b>平均成绩:</b></label>";
- html1 += " <label><b>" + (data.AVGScore == null ? 0 : data.AVGScore.toFixed(1)) + "</b></label>";
- html1 += "  <label><b>总学分:</b></label>";
- html1 += " <label><b>" + (data.TotalCredit == null ? 0 : data.TotalCredit.toFixed(1)) + "</b></label>";
- html1 += "  <label><b>必修:</b></label>";
- html1 += " <label><b>" + (data.RequiredCredit == null ? 0 : data.RequiredCredit.toFixed(1)) + "</b></label>";
- html1 += "  <label><b>限选(含通识教育):</b></label>";
- html1 += " <label><b>" + (data.OptionalCourseCredit == null ? 0 : data.OptionalCourseCredit.toFixed(1)) + "</b></label>";
- html1 += "  <label><b>任选:</b></label>";
- html1 += " <label><b>" + (data.FreeSelectionCourseCredit == null ? 0 : data.FreeSelectionCourseCredit.toFixed(1)) + "</b></label>";
- html1 += "  <label><b>方向选修:</b></label>";
- html1 += " <label><b>" + (data.ElectiveCredit == null ? 0 : data.ElectiveCredit.toFixed(1)) + "</b></label>";
- html1 += "  <label><b>公共选修:</b></label>";
- html1 += " <label><b>" + (data.ElectivePublicCredit == null ? 0 : data.ElectivePublicCredit.toFixed(1)) + "</b></label>";
- html1 += "  <label><b>实践环节:</b></label>";
- html1 += " <label><b>" + (data.PractiseNotCredit == null ? 0 : data.PractiseNotCredit.toFixed(1)) + "</b></label>";
- html1 += "  <label><b>俱乐部(含校本):</b></label>";
- html1 += " <label><b>" + (data.ClubWithSchoolbasedCredit == null ? 0 : data.ClubWithSchoolbasedCredit.toFixed(1)) + "</b></label>";
- $("#Studenttable").html(html);
- $("#StudentCoursematerialtable").html(html1);
- }
- else {
- $("#Studenttable").html("");
- $("#StudentCoursematerialtable").html("");
- }
- }
- //转化json数据的日期
- function ChangeDateFormat(jsondate) {
- jsondate = jsondate.replace("/Date(", "").replace(")/", "");
- if (jsondate.indexOf("+") > 0) {
- jsondate = jsondate.substring(0, jsondate.indexOf("+"));
- } else if (jsondate.indexOf("-") > 0) {
- jsondate = jsondate.substring(0, jsondate.indexOf("-"));
- }
- //alert(jsondate);
- var date = new Date(parseInt(jsondate, 10));
- //alert(date.getHours());
- var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
- var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
- //+ " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); 时分秒就不需要了~~
- return date.getFullYear() + "-" + month + "-" + currentDate;
- }
- //验证是否为空。
- function isEmpty(val) {
- switch (typeof (val)) {
- case 'string':
- return trim(val).length == 0 ? 0 : val;
- break;
- case 'number':
- return val == 0 ? 0 : val;
- break;
- case 'object':
- return val == null ? 0 : val;
- break;
- case 'array':
- return val.length == 0 ? 0 : val;
- break;
- default:
- return true;
- }
- };
- //列表字体颜色设置为红色
- function SetRedColumn(index, row, value) {
- return " <span style=\"color: red;\">" + value + "</span>";
- }
|