var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); reload(); }) function reload() { $("#display_search_list").css('display', 'none'); $.post(CMS_SystemConfig.VirtualDirectoryPath + '/SOCDetailScore/StudentCoursematerialList', null, 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).toString() + "%"; width = 100 / count + "%"; } $("#search_list").html(""); StudentCoursematerialtable(data[0]); var html = "
"; for (var i = 0; i < data[0].ListStarttermID.length; i++) { //PS:同一课程、可能开课学期不同~ var socStudentScoreItemViewList = $.grep(data[0].SOCStudentScoreItemViewList, function (x) { return (x.StarttermID == data[0].ListStarttermID[i]); }); html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; for (var j = 0; j < socStudentScoreItemViewList.length; j++) { html += ""; html += ""; if (socStudentScoreItemViewList[j].TotalScore < 60 || socStudentScoreItemViewList[j].TotalScore == "") html += ""; else html += ""; html += ""; html += ""; } html += "
" + socStudentScoreItemViewList[0].StarttermName + "
课程名称总成绩学分
" + socStudentScoreItemViewList[j].CourseName + "" + socStudentScoreItemViewList[j].TotalScore.toFixed(scoreDigitCount) + "" + socStudentScoreItemViewList[j].TotalScore.toFixed(scoreDigitCount) + "" + isEmpty(socStudentScoreItemViewList[j].ScoreCredit) + "
"; } html += "
"; $("#search_list").html(html); } else { StudentCoursematerialtable(data[0]); var html = "

选择的学生成绩库中无成绩,请检查。

" $("#search_list").html(html); } }); } //验证是否为空。 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 StudentCoursematerialtable(data) { if (data != null) { //$("#StudentCoursematerialtable").find("tr.row").remove(); var html = ""; html += ""; html += " "; html += "  "; html += " "; html += "  "; html += " "; html += "  "; html += ""; $("#StudentCoursematerialtable").html(html); } else { $("#StudentCoursematerialtable").html(""); } } function LoadScore(CoursematerialID, SchoolyearID, StarttermID) { $("#display_search_list").css('display', 'block'); $("#dgStudentDetailScoreList").cmsXDataTable("load", { coursematerialID: CoursematerialID, starttermID: StarttermID }); } //转化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 SetRedColumn(index, row, value) { return " " + value + ""; }