123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentScore/Edit";
- var urlAdd = CMS_SystemConfig.VirtualDirectoryPath + "/StudentScore/Add";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- SystemBatchModifyControl.OnComplete = function (columnName, modifyValue, batch) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + "/StudentScore/RefreshFinallyScoreForBatchUpdate", {
- submitedScoreIDString: batch.join(',')
- });
- };
- })
- //新增
- function StudentScore_Add() {
- var d = validChoose();
- var SchoolyearID = "";
- var CoursematerialID = "";
- var UserID = "";
- var StarttermID = "";
- if (d.length > 0) {
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择单个记录进行复制。");
- return;
- }
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/PersonalScore/Edit?SubmitedScoreID=" + d + "&SchoolyearID=" + SchoolyearID + "&CoursematerialID=" + CoursematerialID + "&UserID=" + UserID + "&StarttermID=" + StarttermID + "&atype=1&MNU=" + mnu + "&SaveType=Add";
- $.popupTopWindow('学生成绩复制新增', redirectTo, 800, 480, null, null);
- } else {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/PersonalScore/Edit?SubmitedScoreID=" + d + "&SchoolyearID=" + SchoolyearID + "&CoursematerialID=" + CoursematerialID + "&UserID=" + UserID + "&StarttermID=" + StarttermID + "&atype=1&MNU=" + mnu;
- $.popupTopWindow('学生成绩新增', redirectTo, 800, 480, null, null);
- }
- }
- function reload() {
- $("#dgStudentScoreList").cmsXDataTable("load", $.getDataGridParams("dgStudentScoreList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgStudentScoreList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.SubmitedScoreID);
- });
- return d;
- }
- //获取列表字段查询对应比较符
- function GetDynamicCondition() {
- var reg = "/(^/s*)|(/s*$)/g";
- var attribute = eval('(' + $("[name='Attribute']").val() + ')').Value;
- var conditionString = $("[name='Condition']").val();
- var value = $("[name='Condition']").parent().parent().next().find("[name^=" + attribute + "]").val();
- value = $.trim(value);
- var sql = "";
- if (conditionString == "=" || conditionString == ">" || conditionString == "<" || conditionString == "<>") {
- sql = attribute + conditionString + value;
- } else if (conditionString == "左") {
- sql = attribute + " like '" + value + "%'";
- } else if (conditionString == "右") {
- sql = attribute + " like '%" + value + "'";
- } else if (conditionString == "中") {
- sql = attribute + " like '%" + value + "%'";
- }
- return sql;
- }
- function StudentScore_Report() {
- var d = [];
- $.each($("#dgStudentScoreList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.UserID);
- });
- var ReportName = $(CMS_SystemConfig.GetConfig()).find("configuration>reportServer>customReportName[name='StudentScoreView']").attr("customName");
- if (ReportName == "GzzyStudentScoreReport")
- {
- var sql = GetDynamicCondition();
- var schoolYearID = $("#SchoolyearDropdown").combobox("getValue");
- var collegeID = $("#CollegeComboGrid").combogridX("getValue");
- var yearID = $("#DictionaryGrade").combobox("getValue");
- var standardID = $("#StandardID").combogridX("getValue");
- var education = $("#DictionaryEducation").combobox("getValue");
- var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
- var learnSystem = $("#DictionaryLearnSystem").combogridX("getValue");
- var classmajorID = $("#ClassmajorDropdown").combogridX("getValue");
- var coursematerialID = $("#CoursematerialComboGrid").combogridX("getValue");
- var courseType = $("#DictionaryCourseType").combobox("getValue");
- var examsCategory = $("#DictionaryExamsCategory").combobox("getValue");
- var starttermBegin = $("#DictionaryStarttermBegin").combobox("getValue");
- var starttermEnd = $("#DictionaryStarttermEnd").combobox("getValue");
- var conditionString = sql;
- var ids = d.join(',');
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/StudentScore/GzzyStudentScoreReport?MNU=' + mnu;
- $.popupTopWindow('学生成绩报表', redirectTo, 1100, 550, null, {
- CollegeID: collegeID,
- YearID: yearID,
- ClassmajorID: classmajorID,
- SchoolYearID: schoolYearID,
- StandardID: standardID,
- Education: education,
- LearningFormID: learningFormID,
- LearnSystem: learnSystem,
- CoursematerialID: coursematerialID,
- CourseTypeID: courseType,
- ExamsCategoryID: examsCategory,
- StarttermBegin: starttermBegin,
- StarttermEnd: starttermEnd,
- ConditionString: conditionString,
- Ids: ids
- });
- }
- else if (ReportName == "HBKDStudentFinallyScoreView")
- {
- var sql = GetDynamicCondition();
- var schoolYearID = $("#SchoolyearDropdown").combobox("getValue");
- var collegeID = $("#CollegeComboGrid").combogridX("getValue");
- var yearID = $("#DictionaryGrade").combobox("getValue");
- var standardID = $("#StandardID").combogridX("getValue");
- var education = $("#DictionaryEducation").combobox("getValue");
- var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
- var learnSystem = $("#DictionaryLearnSystem").combogridX("getValue");
- var classmajorID = $("#ClassmajorDropdown").combogridX("getValue");
- var coursematerialID = $("#CoursematerialComboGrid").combogridX("getValue");
- var courseType = $("#DictionaryCourseType").combobox("getValue");
- var examsCategory = $("#DictionaryExamsCategory").combobox("getValue");
- var starttermBegin = $("#DictionaryStarttermBegin").combobox("getValue");
- var starttermEnd = $("#DictionaryStarttermEnd").combobox("getValue");
- var conditionString = sql;
- var ids = d.join(',');
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/StudentScore/HBKDStudentScoreReport?MNU=' + mnu;
- $.popupTopWindow('学生成绩报表', redirectTo, 1100, 550, null, {
- CollegeID: collegeID,
- YearID: yearID,
- ClassmajorID: classmajorID,
- SchoolYearID: schoolYearID,
- StandardID: standardID,
- Education: education,
- LearningFormID: learningFormID,
- LearnSystem: learnSystem,
- CoursematerialID: coursematerialID,
- CourseTypeID: courseType,
- ExamsCategoryID: examsCategory,
- StarttermBegin: starttermBegin,
- StarttermEnd: starttermEnd,
- ConditionString: conditionString,
- Ids: ids
- });
- }
- else {
- var Attribute = document.getElementsByName("Attribute")[0].value.split("\"Value\":\"")[1].split("\"")[0]; //获取当前的字段
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/StudentScore/StudentScoreReport?MNU=' + mnu;
- if (d.length > 0) {
- redirectTo = redirectTo + "&UserIDs=" + d.join(",");
- }
- else {
- redirectTo = redirectTo + "&CollegeID=" + $("#CollegeComboGrid").combogridX("getValue")
- + "&Years=" + $("#DictionaryGrade").combobox("getValue")
- //+ "&GrademajorID=" + $("#GrademajorComboGrid").combogridX("getValue")
- + "&ClassmajorID=" + $("#ClassmajorDropdown").combogridX("getValue")
- + "&CoursematerialID=" + $("#CoursematerialComboGrid").combogridX("getValue")
- + "&CourseTypeID=" + $("#DictionaryCourseType").combobox("getValue")
- + "&SchoolYearID=" + $("#SchoolyearDropdown").combobox("getValue")
- + "&ExamsCategoryID=" + $("#DictionaryExamsCategory").combobox("getValue")
- + "&StandardID=" + $("#StandardID").combogridX("getValue")
- + "&EducationID=" + $("#DictionaryEducation").combobox("getValue")
- + "&LearningformID=" + $("#LearningformDictionaryDropDown").combobox("getValue")
- + "&LearnSystem=" + $("#DictionaryLearnSystem").combogridX("getValue")
- + "&StarttermBegin=" + $("#DictionaryStarttermBegin").combobox("getValue")
- + "&StarttermEnd=" + $("#DictionaryStarttermEnd").combobox("getValue")
- + "&UserIDs="
- + "&Attribute=" + Attribute
- + "&Condition=" + document.getElementsByName("Condition")[0].value + "&Value=" + document.getElementsByName(Attribute + "_QueryTextBox")[0].value;
- }
- $.popupTopWindow('学生成绩表', redirectTo, 1100, 550, null, null);
- }
-
- }
- //点击列表更新
- function edit(rowindex, rowdata) {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/PersonalScore/Edit" + "?submitedScoreID=" + rowdata.SubmitedScoreID + "&MNU=" + mnu + '&isView=1';
- $.popupTopWindow('学生成绩信息详情', redirectTo, 800, 420, null, null);
- }
- //修改按钮
- function StudentScore_Update() {
- // var d = validChoose();
- // if (d == "") {
- // $.messager.alert("系统提示", "请选择您要修改的学生成绩信息。");
- // return;
- // }
- // if (d.length > 1) {
- // $.messager.alert("系统提示", "只能选择单个记录进行修改。");
- // return;
- // }
- // var redirectTo = url + "?submitedScoreID=" + d + "&MNU=" + mnu;
- // $.popupTopWindow('学生成绩信息修改', redirectTo, 800, 420, null, null);
- var d = validChoose();
- var SchoolyearID = $("#hid_SchoolyearID").val();
- var CoursematerialID = $("#hid_CoursematerialID").val();
- var UserID = $("#hid_UserID").val();
- var StarttermID = $("#hid_StarttermID").val();
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要修改的成绩基本信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择单个记录进行修改。");
- return;
- }
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/PersonalScore/Edit?SubmitedScoreID=" + d + "&SchoolyearID=" + SchoolyearID + "&CoursematerialID=" + CoursematerialID + "&UserID=" + UserID + "&StarttermID=" + StarttermID + "&atype=2&MNU=" + mnu;
- $.popupTopWindow('学生成绩修改', redirectTo, 800, 480, null, null);
- }
- //删除
- function StudentScore_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除的学生成绩信息!");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除该学生成绩信息?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentScore/Delete', { submitedScoreIDs: d }, function (data) {
- if (data == "删除成功") {
- $.messager.alert("系统提示", "删除成功!");
- $("#dgStudentScoreList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data);
- }
- });
- }
- });
- }
- function queryStandard(data) {
- queryClass();
- reload();
- }
- function queryCollege(data) {
- var campusID = $("#CampusDropdown").combogridX("getValue");
- var collegeID = $("#CollegeComboGrid").combogridX("getValue");
- var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
- jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
- // if (campusID != nonSelect) {
- // var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
- // $("#CollegeDropdown").combogridX("reload", eval(jsonString));
- // }
- queryClass();
- reload();
- }
- function queryClass() {
- var jsonString = "";
- var parameterString = "";
- var campusID = $("#CampusDropdown").combogridX("getValue");
- var collegeID = $("#CollegeComboGrid").combogridX("getValue");
- var schoolYearID = $("#DictionaryGrade").combobox("getValue");
- var standardID = $("#StandardID").combogridX("getValue");
- var educationID = $("#DictionaryEducation").combobox("getValue");
- var LearnSystem = $("#DictionaryLearnSystem").combogridX("getValue");
- var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
- if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
- if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
- if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
- if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
- if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
- if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
- if (LearnSystem != nonSelect) parameterString += "DictionaryLearnSystem|*|" + LearnSystem + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#StandardID").combogridX("reload", eval(jsonString));
- $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
- } else {
- $("#StandardID").combogridX("reload", eval(jsonString));
- $("#ClassmajorDropdown").combogridX("reload");
- }
- reload();
- }
- //function SelectCollegeComboGrid(data) {
- // if (data != null) {
- // reloadStandard();
- // }
- //}
- //function SelectDictionaryGrade(data) {
- // if (data.Value != "-1") {
- // selectClass();
- // }
- //}
- //function reloadStandard() {
- // var url = CMS_SystemConfig.VirtualDirectoryPath + "/Facultymajor/BindStandardDropDownList?bindType=0";
- // var collegeID = $("#CollegeComboGrid").combogridX("getValue");
- // if (collegeID != nonSelect) url += "&collegeID=" + collegeID;
- // $("#StandardID").combobox("reload", url);
- //}
- //function SelectStandard(data) {
- // if (data != null) {
- // selectClass();
- // }
- // reload();
- //}
- function selectClass() {
- var collegeID = $("#CollegeComboGrid").combogridX("getValue");
- var year = $("#DictionaryGrade").combobox("getValue");
- var standard = $("#StandardID").combobox("getValue");
- var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID + "|@|DictionaryGrade|*|" + year
- + "|@|DictionaryStandard|*|" + standard + "|@|'})";
- $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
- reload();
- }
- //导出Excel
- function StudentScore_Excel() {
- var d = validChoose().join(',')
- if (d != "") {
- document.getElementById("SubmitedScoreID").value = d;
- }
- else {
- document.getElementById("SubmitedScoreID").value = "";
- }
- $("#formQuery").submit();
- }
|