123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- var url = CMS_SystemConfig.VirtualDirectoryPath + "/Classmajor/Edit";
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //刷新
- function reload() {
- $("#dgClassmajorList").cmsXDataTable("load", $.getDataGridParams("dgClassmajorList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgClassmajorList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.ClassmajorID);
- });
- return d;
- }
- //班级复制(批量新增)
- function Classmajor_BatchAdd() {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Classmajor/BatchAdd?MNU=" + mnu;
- $.popupTopWindow('班级复制', redirectTo, 650, 320, null, null);
- }
- //新增
- function Classmajor_Add() {
- var d = validChoose();
- if (d.length > 0) {
- $.popupTopWindow('班级信息复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/Classmajor/CopyAdd?classmajorID=' + d[0] + '&MNU=' + mnu, 720, 480, null, null);
- } else {
- var redirectTo = url + "?MNU=" + mnu;
- $.popupTopWindow('班级信息新增', redirectTo, 720, 480, null, null);
- }
- }
- //修改按钮
- function Classmajor_Update() {
- var d = validChoose();
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要修改的信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统提示", "只能选择单个记录进行修改。");
- return;
- }
- var redirectTo = url + "?classmajorID=" + d + "&MNU=" + mnu + "&type=edit";
- $.popupTopWindow('班级信息修改', redirectTo, 720, 480, null, null);
- }
- //查看
- function edit(rowindex, rowdata) {
- var redirectTo = url + "?classmajorID=" + rowdata.ClassmajorID + "&MNU=" + mnu + "&type=detail";
- $.popupTopWindow('班级信息', redirectTo, 720, 480, null, null);
- }
- //删除
- function Classmajor_Delete() {
- var d = validChoose().join(',');
- if (d == "") {
- $.messager.alert("系统提示", "请选择您要删除的信息。");
- return;
- }
- $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
- if (r) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Classmajor/Delete', { classmajorIDs: d }, function (data) {
- if (data.IsSuccess) {
- $.messager.alert("系统提示", data.Message);
- $("#dgClassmajorList").cmsXDataTable('load');
- } else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- });
- }
- //Excel导出
- function Classmajor_Export() {
- $("#formQuery").submit();
- }
- //Excel导入
- function Classmajor_Import() {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/Classmajor/Import?MNU=' + mnu;
- $.popupTopWindow('班级信息导入', redirectTo, 420, 300, reload);
- }
- //班级信息学生明细
- function editStudentCount(rowindex, rowdata) {
- var inSchoolStatus = $("#DictionaryInschoolStatus").combobox("getValue");
- redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/Classmajor/ClassStudentListView?inSchoolStatus=" + inSchoolStatus + "&classmajorID=" + rowdata.ClassmajorID + "&MNU=" + mnu;
- $.popupTopWindow('班级信息学生明细', redirectTo, 850, 540, null, null);
- }
- //联动查询
- function queryCampus(data) {
- var campusID = $("#CampusDropdown").combogridX("getValue");
- var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
- $("#CollegeDropdown").combogridX("reload", eval(jsonString));
- queryClass();
- }
- 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));
- $("#DictionaryStandard").combogridX("reload", eval(jsonString));
- queryClass();
- }
- function queryGrade(data) {
- queryClass();
- }
- function queryStandard(data) {
- queryClass();
- }
- function queryGrademajor(data) {
- queryClass();
- }
- function queryClass() {
- var jsonString = "";
- var parameterString = "";
- var campusID = $("#CampusDropdown").combogridX("getValue");
- var collegeID = $("#CollegeDropdown").combogridX("getValue");
- var gradeID = $("#DictionaryGrade").combogridX("getValue"); //combobox
- var standardID = $("#DictionaryStandard").combogridX("getValue");
- var educationID = $("#DictionaryEducation").combogridX("getValue");
- var learningformID = $("#DictionaryLearningform").combogridX("getValue");
- if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
- if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
- if (gradeID != nonSelect) parameterString += "DictionaryGrade|*|" + gradeID + "|@|";
- if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
- if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
- if (learningformID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningformID + "|@|";
- if (parameterString != "") {
- jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
- $("#DictionaryStandard").combogridX("reload", eval(jsonString));
- $("#GrademajorComboGrid").combogridX("reload", eval(jsonString));
- }
- else {
- $("#DictionaryStandard").combogridX("reload");
- $("#GrademajorComboGrid").combogridX("reload");
- }
- reload();
- }
|