var url = CMS_SystemConfig.VirtualDirectoryPath + "/Students/Edit"; var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='StudentEdit']"); if (customerUrl.attr("value")) { url = CMS_SystemConfig.VirtualDirectoryPath + customerUrl.attr("value"); } var bathval = ""; var mnu; var WindowID; $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); WindowID = $.SystemGeneral.getUrlParam("WindowID"); }); function reload() { $("#dgStudentList").cmsXDataTable("load", $.getDataGridParams("dgStudentList")); } function User_Export() { $('#loading').show(); $(document.forms[0]).attr("action", CMS_SystemConfig.VirtualDirectoryPath + "/Students/Excel"); $(document.forms[0]).submit(); $('#loading').hide(); } function Student_InfoExport() { var selectedIDs = validChoose().join(','); selectedIDs = selectedIDs.toString(); var StudentSelect = $.getDataGridParams("dgStudentList"); var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Students/InfoExport?MNU=' + mnu + '&selectedIDs=' + selectedIDs; $.popupTopWindow('上报导出', redirectTo, 900, 600, null, StudentSelect); } //新增 function Student_Add() { var d = validChoose(); if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行复制新增。"); return; } var redirectTo = url + '?MNU=' + mnu; if (d.length != 0) { redirectTo = url + '?userIds=' + d + '&type=copyAdd' + '&MNU=' + mnu; $.popupTopWindow('学生信息复制新增', redirectTo, 700, 550, null, null); } else { $.popupTopWindow('学生信息新增', redirectTo, 700, 550, null, null); } } //修改按钮 function Student_Edit() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要修改的学生信息。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择单个记录进行修改。"); return; } var redirectTo = url + '?userIds=' + d + '&type=copyEdit' + '&MNU=' + mnu; $.popupTopWindow('学生信息修改', redirectTo, 700, 500, null, null); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) { d.push(this.UserID); }); return d; } function validChooseLoginID() { var d = []; $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) { d.push(this.LoginID); }); return d; } //点击列表更新 function edit(rowindex, rowdata) { var redirectTo = url + '?userIds=' + rowdata.UserID + '&type=copyEdit' + '&isView=1&MNU=' + mnu; $.popupTopWindow('学生信息', redirectTo, 700, 500, null, null); } //删除 function Student_Delete() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的学生信息。"); return; } $.messager.confirm("系统提示", "您确定要删除该学生信息?", function (r) { if (r) { $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Students/Delete', { userIDs: d }, function (data) { if (data == "删除成功!") { $.messager.alert("系统提示", data); reload(); } else { $.messager.alert("系统提示", data); } }); } }); } //导出Excel function Student_Export() { var d = validChoose().join(',') if (d != "") { document.getElementById("UserIDs").value = d; } else { document.getElementById("UserIDs").value = ""; } $("#formQuery").attr("action", CMS_SystemConfig.VirtualDirectoryPath + "/Students/Excel"); $("#formQuery").submit(); } function Student_Import() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Students/Import?MNU=' + mnu; $.popupTopWindow('导入学生', redirectTo, 400, 300, null, null); } function Student_PicImport() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Students/PicImport?MNU=' + mnu; $.popupTopWindow('导入学籍照片', redirectTo, 400, 300, null, null); } function Student_GraduatePicImport() { var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Students/GraduatePicImport?MNU=' + mnu; $.popupTopWindow('导入学历照片', redirectTo, 400, 300, null, null); } //获取列表字段查询对应比较符 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 Student_Report() { var d = []; $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) { d.push(this.LoginID); }); var s = []; $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) { s.push(this.UserID); }); var sql = GetDynamicCondition(); var attribute = document.getElementsByName("Attribute")[0].value.split("\"Value\":\"")[1].split("\"")[0]; //获取自定义查询的当前字段 var campusID = $("#CampusDropdown").combogridX("getValue"); var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var standardID = $("#StandardDictionaryDropDown").combogridX("getValue"); var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue"); var classmajorID = $("#ClassmajorDropdown").combogridX("getValue"); var inSchoolStatus = $("#InSchoolStatusDictionaryDropDown").combobox("getValue"); var isGraduation = $("#GeneralPurposeDictionaryDropDown").combobox("getValue"); var isPhotos = $("#YesOrNoStatusDictionaryDropDown").combobox("getValue"); var reportStatusID = $("#ReportStatusDictionaryDropDown").combobox("getValue"); var education = $("#DictionaryEducation").combobox("getValue"); var learnSystem = $("#DictionaryLearnSystem").combogridX("getValue"); var loginID = d; var conditionString = sql; var condition = document.getElementsByName("Condition")[0].value; var value = (document.getElementsByName(attribute + "_QueryTextBox")[0] != null ? document.getElementsByName(attribute + "_QueryTextBox")[0].value : document.getElementsByName(attribute + "_QueryDictionaryDropDownList")[0].value) var ids = s.join(','); var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Students/ClassStudentReport?MNU=' + mnu; var StudentCardName = $(CMS_SystemConfig.GetConfig()).find("configuration>reportServer>customReportName[name='StudentCardView']").attr("customName"); if (StudentCardName == "HBGDStudentCardView") { $.popupTopWindow('学生信息报表', redirectTo, 700, 550, null, { Attribute: attribute, CampusID: campusID, SchoolYearID: schoolYearID, CollegeID: collegeID, StandardID: standardID, LearningFormID: learningFormID, ClassmajorID: classmajorID, InSchoolStatus: inSchoolStatus, IsGraduation: isGraduation, IsPhotos: isPhotos, LoginID: loginID, ConditionString: conditionString, Condition: condition, Value: value, ReportStatusID: reportStatusID, Education: education, LearnSystem:learnSystem, Ids: ids }); } else { $.popupTopWindow('学生信息报表', redirectTo, 1100, 550, null, { Attribute: attribute, CampusID: campusID, SchoolYearID: schoolYearID, CollegeID: collegeID, StandardID: standardID, LearningFormID: learningFormID, ClassmajorID: classmajorID, InSchoolStatus: inSchoolStatus, IsGraduation: isGraduation, IsPhotos: isPhotos, LoginID: loginID, ConditionString: conditionString, Condition: condition, Value: value, ReportStatusID: reportStatusID, Education: education, Ids: ids }); } } function queryCollege(data) { // var campusID = $("#CampusDropdown").combogridX("getValue"); // var collegeID = $("#CollegeDropdown").combogridX("getValue"); // var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|"; // jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})"; // $("#CollegeDropdown").combogridX("reload", eval(jsonString)); // $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString)); // if (campusID != nonSelect) { // var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})"; // $("#CollegeDropdown").combogridX("reload", eval(jsonString)); // } queryClass(); reload(); } function QueryPhotoUrltmentDropdownList(data) { reload(); } function QuerygraduationtmentDropdownList(date) { reload(); } function queryStandard(data) { queryClass(); } function queryClass() { var jsonString = ""; var parameterString = ""; var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var educationID = $("#DictionaryEducation").combobox("getValue"); var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue"); var standardID = $("#StandardDictionaryDropDown").combogridX("getValue"); var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue"); var LearnSystem = $("#DictionaryLearnSystem").combogridX("getValue"); if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|"; if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|"; if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|"; if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|"; if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|"; if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|"; if (LearnSystem != nonSelect) parameterString += "DictionaryLearnSystem|*|" + LearnSystem + "|@|"; if (parameterString != "") { jsonString = "({'QueryParamsDatas':'" + parameterString + "'})"; $("#ClassmajorDropdown").combogridX("reload", eval(jsonString)); $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString)); } else { $("#ClassmajorDropdown").combogridX("reload"); $("#StandardDictionaryDropDown").combogridX("reload"); } reload(); } function Student_PictureExport() { var selectedIDs = validChoose().join(','); //$("[name='SelectedIDs']").val(validChoose().join(',')); selectedIDs = selectedIDs.toString(); // $("#formQuery").attr("action", CMS_SystemConfig.VirtualDirectoryPath + "/Students/ExportPictures?MNU=" + mnu); // $("#formQuery").submit(); var StudentSelect = $.getDataGridParams("dgStudentList"); var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Students/ExportPictures?selectedIDs=" + selectedIDs + "&MNU=" + mnu; $.popupTopWindow('照片命名方式', redirectTo, 400, 200, null, StudentSelect); } function Student_SimulateLogin() { var d = validChooseLoginID(); if (d.length == 0) { $.messager.alert("系统提示", "请选择您要登录的学生。"); return; } if (d.length > 1) { $.messager.alert("系统提示", "只能选择一个学生进行登录。"); return; } $.messager.confirm("系统提示", "您确定要进行模拟登录?", function (r) { if (r) { var loginID = d.toString(); $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/SimulateLogin/Login', { LoginID: loginID }, function (data) { parent.location.reload(); }); } }); } function Student_ProofReport() { var d = []; $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) { d.push(this.LoginID); }); var s = []; $.each($("#dgStudentList").cmsXDataTable("getSelections"), function (index) { s.push(this.UserID); }); var sql = GetDynamicCondition(); var attribute = document.getElementsByName("Attribute")[0].value.split("\"Value\":\"")[1].split("\"")[0]; //获取自定义查询的当前字段 var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Students/StudentProofReport?MNU=' + mnu; var campusID = $("#CampusDropdown").combogridX("getValue"); var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); var standardID = $("#StandardDictionaryDropDown").combogridX("getValue"); var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue"); var education = $("#DictionaryEducation").combobox("getValue"); var classmajorID = $("#ClassmajorDropdown").combogridX("getValue"); var inSchoolStatus = $("#InSchoolStatusDictionaryDropDown").combobox("getValue"); var isGraduation = $("#GeneralPurposeDictionaryDropDown").combobox("getValue"); var isPhotos = $("#YesOrNoStatusDictionaryDropDown").combobox("getValue"); var reportStatusID = $("#ReportStatusDictionaryDropDown").combobox("getValue"); var loginID = d; var conditionString = sql; var condition = document.getElementsByName("Condition")[0].value; var value = (document.getElementsByName(attribute + "_QueryTextBox")[0] != null ? document.getElementsByName(attribute + "_QueryTextBox")[0].value : document.getElementsByName(attribute + "_QueryDictionaryDropDownList")[0].value) var ids = s.join(','); $.popupTopWindow('学生证明报表', redirectTo, 700, 550, null, { Attribute: attribute, CampusID: campusID, SchoolYearID: schoolYearID, CollegeID: collegeID, StandardID: standardID, LearningFormID: learningFormID, ClassmajorID: classmajorID, InSchoolStatus: inSchoolStatus, IsGraduation: isGraduation, IsPhotos: isPhotos, LoginID: loginID, ConditionString: conditionString, Condition: condition, Value: value, ReportStatusID: reportStatusID, Ids: ids }); } function StudentCardReport() { var d = validChoose().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要打印学籍卡的学生信息。"); return; } $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Students/StudentCardReport', { userIDList: d }, function (data) { if (data.IsSuccess) { var redirectTo = "../../Scripts/pdf.js/web/viewer.html?file=" + data.Message; $.popupTopWindow('学籍卡', redirectTo, 850, 480, reload); } else { $.messager.alert("系统提示", data); } }); } //上报导出 function Student_ReportExport() { var userIDs = validChoose().join(','); var dgStudentList = $.getDataGridParams("dgStudentList"); var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Student/ReportExport?userIDs=" + userIDs + "&MNU=" + mnu; $.popupTopWindow('上报导出', redirectTo, 880, 580, null, dgStudentList); }