123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- var isFirstLoadGradeYear = true;
- var isFirstLoadClassmajor = true;
- var isPageLoad = true;
- function SpecialityScoreSumTable() {
- var collegeID = $("#CollegeDropdown").combobox("getValue");
- var standardID = $("#DictionaryStandard").combogridX("getValue");
- var classmajorID = $("#ClassmajorDropdown").combogridX("getValue");
- var yearID = $("#DictionarySchoolyear").combobox("getValue");
- var schoolyearNumID = $("#DictionarySchoolyearNum").combobox("getValue");
- var schoolcodeID = $("#DictionarySchoolcode").combobox("getValue");
- var InSchoolStatus = $("#InSchoolStatusDictionaryDropDown").combobox("getValue");
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/SpecialityScoreSum/SpecialityScoreSumList', { collegeID: collegeID, standardID: standardID, classmajorID: classmajorID, yearID: yearID, schoolyearNumID: schoolyearNumID, schoolcodeID: schoolcodeID, InSchoolStatus: InSchoolStatus },
- function (data) {
- $("#SpecialityScoreSumtable").find("tr.row").remove();
- if (data) {
- var d = [];
- var firstRow = [];
- var secondRow = [];
- var thirdRow = [];
- var forthRow = [];
- var detailRow = [];
- //生成第一、二、三行表头,学年和学期和课程
- //第一行开头
- firstRow.push("<tr style='background-color:#f0f0f0'>");
- firstRow.push("<td colspan='3' rowspan='2'>学期</td>");
- //第二行开头
- secondRow.push("<tr style='background-color:#f0f0f0'>");
- //第三行开头
- thirdRow.push("<tr style='background-color:#f0f0f0'>");
- thirdRow.push("<td width='20'>次序</td>");
- thirdRow.push("<td width='120'>学号</td>");
- thirdRow.push("<td width='60'>姓名</td>");
- for (var i = 0; i < data.StudentList.length; i++) {
- var student = data.StudentList[i];
- forthRow[i] = [];
- forthRow[i].push("<tr>");
- forthRow[i].push("<td width='20'>" + (i + 1).toString() + "</td>");
- forthRow[i].push("<td width='120'>" + student.LoginID + "</td>");
- forthRow[i].push("<td width='60'>" + student.UserName + "</td>");
- }
- var totalWidth = 206;
- //前三行明细
- for (var i = 0; i < data.SchoolyearNums.length; i++) {
- var schoolyearWidth = data.SchoolyearNums[i].CoursematerialNum * 22;
- totalWidth += schoolyearWidth + 2;
- firstRow.push("<td width='" + (schoolyearWidth - 2).toString() + "' colspan='" + data.SchoolyearNums[i].CoursematerialNum + "'>" + data.SchoolyearNums[i].Title + "</td>");
- var schoolyearNum = data.SchoolyearNums[i];
- for (var j = 0; j < schoolyearNum.SchoolCodeView.length; j++) {
- var schoolcode = schoolyearNum.SchoolCodeView[j];
- var schoolcodeWidth = schoolcode.CoursematerialList.length * 22;
- secondRow.push("<td width='" + (schoolcodeWidth - 2).toString() + "' colspan='" + schoolcode.CoursematerialList.length + "'>" + schoolcode.Title + "</td>");
- for (var k = 0; k < schoolcode.CoursematerialList.length; k++) {
- var coursematerial = schoolcode.CoursematerialList[k];
- //thirdRow.push("<td width='20' style='word-break: break-all;'>" + coursematerial.Title.substring(0, 12).split('').join('<br/>') + "</td>");
- if (coursematerial.Title.length <= 12) {
- thirdRow.push("<td width='20' style='word-break: break-all;'>" + coursematerial.Title.split('').join('<br/>') + "</td>");
- } else {
- var str = coursematerial.Title.substring(0, 12) + "...";
- thirdRow.push("<td width='20' style='word-break: break-all;'>" + str.split('').join('<br/>') + "</td>");
- }
- for (var l = 0; l < coursematerial.ScoreList.length; l++) {
- var score = coursematerial.ScoreList[l];
- var index = -1;
- for (var m = 0; m < data.StudentList.length; m++) {
- if (data.StudentList[m].UserID == score.UserID) {
- index = m;
- }
- }
- if (index < 0) continue;
- if (score.Score != null && score.Score != "") {
- if (score.Score >= 60)
- forthRow[index].push("<td width='20' style='word-break: break-all;'>" + score.Score + "</td>");
- else
- forthRow[index].push("<td width='20' style='color:red;word-break: break-all;'>" + score.Score + "</td>");
- }
- else if (score.Score == 0) {
- forthRow[index].push("<td width='20' style='color:red;word-break: break-all;'>" + score.Score + "</td>");
- //forthRow[index].push("<td style='width:20px;'> </td>");
- }
- else {
- forthRow[index].push("<td width='20' style='color:red;word-break: break-all;'> </td>");
- //forthRow[index].push("<td style='width:20px;'> </td>");
- }
- }
- }
- }
- }
- //第一行结尾
- firstRow.push("</tr>");
- //第二行结尾
- secondRow.push("</tr>");
- //第三行结尾
- thirdRow.push("</tr>");
- totalWidth += 16;
- d.push("<div style='overflow-x: hidden;width: " + totalWidth.toString() + "px;'><table cellpadding='0' cellspacing='0'>");
- d.push(firstRow.join(""));
- d.push(secondRow.join(""));
- d.push(thirdRow.join(""));
- d.push("</table></div>");
- d.push("<div id='divScore' style='height: 300px; overflow-x: auto; overflow-y: auto;width: " + totalWidth.toString() + "px;'><table cellpadding='0' cellspacing='0'>");
- for (var i = 0; i < data.StudentList.length; i++) {
- d.push(forthRow[i].join(""));
- d.push("</tr>");
- }
- d.push("</table></div>");
- $("#SpecialityScoreSumtable").html(d.join(""));
- resizeDiv();
- } else {
- $.messager.alert("系统提示", "对不起,未找到数据!");
- }
- });
- }
- function resizeDiv() {
- var scoreDiv = $("#divScore");
- var contentHeight = $(window).height() - $("#divScore").offset().top - 2;
- scoreDiv.height(contentHeight);
- }
- //个人成绩报表(松山、工大、科大等)
- function StudentScore_Report() {
- var classmajorID = $("#ClassmajorDropdown").combogridX("getValue");
- if (classmajorID == "") {
- $.messager.alert("系统提示", "请选择班级!");
- return;
- }
- var InSchoolStatus = $("#InSchoolStatusDictionaryDropDown").combobox("getValue");
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/SpecialityScoreSum/StudentScoreReport?MNU=' + mnu
- + "&ClassmajorID=" + classmajorID + "&InSchoolStatus=" + InSchoolStatus;
- $.popupTopWindow('学生成绩表', redirectTo, 1100, 550, null, null);
- }
- //个人成绩报表(广体等)
- function StudentScore_NewReport() {
- var collegeID = $("#CollegeDropdown").combobox("getValue");
- var standardID = $("#DictionaryStandard").combogridX("getValue");
-
- var yearID = $("#DictionarySchoolyear").combobox("getValue");
- var schoolyearNumID = $("#DictionarySchoolyearNum").combobox("getValue");
- var schoolcodeID = $("#DictionarySchoolcode").combobox("getValue");
- var classmajorID = $("#ClassmajorDropdown").combogridX("getValue");
- if (classmajorID == "") {
- $.messager.alert("系统提示", "请选择班级!");
- return;
- }
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/SpecialityScoreSum/StudentScoreNewReport?MNU=' + mnu
- + "&CollegeID=" + collegeID + "&StandardID=" + standardID + "&YearID=" + yearID
- + "&SchoolyearNumID=" + schoolyearNumID + "&SchoolcodeID=" + schoolcodeID + "&ClassmajorID=" + classmajorID;
- $.popupTopWindow('学生个人成绩报表', redirectTo, 850, 550, null, null);
- }
- function QueryCollegeDropdownList(data) {
- if (((data.length && data.length > 0) || data)
- && $("#DictionarySchoolyear").length > 0 && $.data($("#DictionarySchoolyear")[0], "combobox")) {
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/Common/SchoolYearDropDown?bindType=2";
- $("#DictionarySchoolyear").combobox("reload", url);
- }
- }
- function QueryYearDropdownList(data) {
- if (((data.length && data.length > 0) || data)
- && $("#DictionaryStandard").length > 0 && $.data($("#DictionaryStandard")[0], "combogridX")) {
- reloadStandard();
- }
- }
- function reloadStandard() {
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/Facultymajor/BindStandardDropDownList?bindType=0";
- var collegeID = $("#CollegeDropdown").combobox("getValue");
- if (collegeID != nonSelect) url += "&collegeID=" + collegeID;
- $("#DictionaryStandard").combobox("reload", url);
- }
- function QueryStandardComboGrid(data) {
- if (((data.length && data.length > 0) || data)
- && $("#ClassmajorDropdown").length > 0 && $.data($("#ClassmajorDropdown")[0], "combobox")) {
- reloadClassmajor();
- }
- }
- //function reloadClassmajor() {
- // var url = CMS_SystemConfig.VirtualDirectoryPath + "/Classmajor/BindDropdownList?bindType=2";
- // var college = $("#CollegeDropdown").combobox("getValue");
- // var year = $("#DictionarySchoolyear").combobox("getValue");
- // var standard = $("#DictionaryStandard").combobox("getValue");
- // if (college != nonSelect) url += "&collegeID=" + college;
- // if (year != nonSelect) url += "&schoolYear=" + year;
- // if (standard != nonSelect) url += "&standardID=" + standard;
- // $("#ClassmajorDropdown").combobox("clear");
- // $("#ClassmajorDropdown").combobox("reload", url);
- //}
- //function QueryClassmajorDropdownList(data) {
- // if (((data.length && data.length > 0) || data)) {
- // if (isFirstLoadClassmajor) {
- // isFirstLoadClassmajor = false;
- // } else if (!isPageLoad) {
- // if (data.length > 0) {
- // $("#ClassmajorDropdown").combobox("setValue", data[0].Value);
- // } else {
- // $("#ClassmajorDropdown").combobox("clear");
- // }
- // }
- // }
- //}
- function reload() {
- // var collegeID = $("#CollegeDropdown").combobox("getValue");
- // var classmajorID = $("#ClassmajorDropdown").combogridX("getValue");
- // var specialtyID = $("#DictionaryStandard").combogridX("getValue");
- // var schoolyear = $("#DictionarySchoolyear").combobox("getValue");
- // if (collegeID == "") {
- // $.messager.alert("系统提示", "请选择" + EMIS_CollegeLabel + "!");
- // return;
- // }
- // if (schoolyear == "-1") {
- // $.messager.alert("系统提示", "请选择年级!");
- // return;
- // }
- // if (specialtyID == "") {
- // $.messager.alert("系统提示", "请选择专业!");
- // return;
- // }
- // if (classmajorID == "") {
- // $.messager.alert("系统提示", "请选择班级!");
- // return;
- // }
- SpecialityScoreSumTable();
- }
- function getExcel() {
- var collegeID = $("#CollegeDropdown").combobox("getValue");
- var classmajorID = $("#ClassmajorDropdown").combogridX("getValue");
- var specialtyID = $("#DictionaryStandard").combogridX("getValue");
- var schoolyear = $("#DictionarySchoolyear").combobox("getValue");
- if (collegeID == "") {
- $.messager.alert("系统提示", "请选择" + EMIS_CollegeLabel + "!");
- return;
- }
- if (schoolyear == "-1") {
- $.messager.alert("系统提示", "请选择年级!");
- return;
- }
- if (specialtyID == "") {
- $.messager.alert("系统提示", "请选择专业!");
- return;
- }
- if (classmajorID == "") {
- $.messager.alert("系统提示", "请选择班级!");
- return;
- }
- $("#formQuery").submit();
- }
- function queryStandard(data) {
- queryClass();
-
- }
- function queryClass() {
- var jsonString = "";
- var parameterString = "";
- //var campusID = $("#CampusDropdown").combogridX("getValue");
- var collegeID = $("#CollegeDropdown").combobox("getValue");
- var standardID = $("#DictionaryStandard").combogridX("getValue");
- var schoolyearID = $("#DictionarySchoolyear").combobox("getValue");
- if (schoolyearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolyearID + "|@|";
- //if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
- if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
- if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
- $("#DictionaryStandard").combogridX("reload", eval(jsonString));
- } else {
- $("#ClassmajorDropdown").combogridX("reload");
- $("#DictionaryStandard").combogridX("reload", eval(jsonString));
- }
- //reload();
- }
|