123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383 |
- 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);
- }
- });
- }
|