var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentDistribute/CreatePlan"; var ViewUrl = CMS_SystemConfig.VirtualDirectoryPath + "/StudentDistribute/Edit"; var mnu = ""; //加载 $(function () { mnu = $.SystemGeneral.getUrlParam("MNU"); }) //新增(发放计划生成) function StudentDistribute_Refresh() { url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentDistribute/CreatePlan"; var redirectTo = url + '?MNU=' + mnu; $.popupTopWindow('发放计划生成', redirectTo, 400, 300, null, null); } function reload() { $("#dgStudentDistributeList").cmsXDataTable("load", $.getDataGridParams("dgStudentDistributeList")); ////如果该课程没有教材、那么将颜色以红色警示 //$("#dgStudentDistributeList").datagrid({ // rowStyler: function (index, row) { // if (row.TeachingMaterialName =="") { // return 'background-color:#6293BB;color:#fff;'; // } // } //}); } //获取选中的数据 function validChooseID() { var d = []; $.each($("#dgStudentDistributeList").cmsXDataTable("getSelections"), function (index) { d.push(this.StudentDistributeID); }); return d; } //获取选中的数据 function validDate() { var d = []; $.each($("#dgStudentDistributeList").cmsXDataTable("getSelections"), function (index) { d.push(this); }); return d; } //删除 function StudentDistribute_Delete() { var d = validChooseID().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要删除的信息。"); return; } $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StudentDistribute/Delete', { studentDistributeIDs: d }, function (data) { if (data == "删除成功。") { $.messager.alert("系统提示", data); $("#dgStudentDistributeList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } //提交 function StudentDistribute_Submit() { var IsNext = false; var d = validChooseID().join(','); var dateobj = validDate(); if (d == "") { $.messager.alert("系统提示", "请选择您要提交的信息。"); return; } //if (dateobj.length > 1) { // $.messager.alert("系统提示", "只能选择单个记录进行提交。"); // return; //} $.messager.confirm("系统提示", "您确定您要提交选择的信息?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StudentDistribute/ComfirmOrder', { studentDistributeIDs: d }, function (data) { if (data == "提交成功。") { if (dateobj[0].DistributeQty > dateobj[0].PresentInventory) { $.messager.alert("系统提示", "库存不足,发放数量大于当前库存量!"); return; } url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentDistribute/SubmitStudentDistribute"; var redirectTo = url + '?MNU=' + mnu + '&studentDistributeID=' + d; $.popupTopWindow('发放提交确认', redirectTo, 650, 240, null, null); } else { $.messager.alert("系统提示", data); return } }); } }); //$.messager.alert("系统提示", "提交成功。"); //$.messager.confirm("系统提示", "您确定您要提交选择的信息?", function (r) { // if (r) { // $.post(CMS_SystemConfig.VirtualDirectoryPath + '/StudentDistribute/ComfirmOrder', { studentDistributeIDs: d }, function (data) { // if (data == "提交成功。") { // $.messager.alert("系统提示", data); // $("#dgStudentDistributeList").cmsXDataTable('load'); // } else { // $.messager.alert("系统提示", data); // } // }); // } //}); } //计划生成 function StudentDistribute_Create() { var schoolyearIDStr = $("#SchoolyearDropdown").combobox("getValue"); if (schoolyearIDStr == "-1") { $.messager.alert("系统提示", "请选择要生成的学年学期。"); return; } $.messager.confirm("系统提示", "您确定要对选择的学年学期生成?", function (r) { if (r) { $(document.forms[0]).submit(); //提交表单 } }); } //获取选中的课程ID function validChooseCoursematerialID() { var d = []; $.each($("#dgStudentDistributeList").cmsXDataTable("getSelections"), function (index) { d.push(this.CoursematerialID); }); return d; } //指定教材 function StudentDistribute_Add() { var d = validChooseID().join(','); if (d == "") { $.messager.alert("系统提示", "请选择您要指定教材的信息。"); return; } var coursematerialIDArray = validChooseCoursematerialID(); for (var i = 0; i < coursematerialIDArray.length; i++) { if (coursematerialIDArray[0] != coursematerialIDArray[i]) { $.messager.alert("系统提示", "必须是同一课程的专业计划才能指定教材。"); return; } } paramsModel = { StudentsOrderIDs: d, CoursematerialID: coursematerialIDArray[0] } $.popupTopWindow('指定教材', CMS_SystemConfig.VirtualDirectoryPath + '/StudentsOrder/EditTeachingMaterialPool?MNU=' + mnu, 750, 550, null, paramsModel); } //查看未发放学生信息 function StudentDistributeView(rowindex, rowdata) { paramsModel = { studentDistributeID: rowdata.StudentDistributeID, GrademajorID: rowdata.GrademajorID } $.popupTopWindow('未发放学生信息', CMS_SystemConfig.VirtualDirectoryPath + '/StudentDistribute/Edit?MNU=' + mnu + '&studentDistributeID=' + rowdata.StudentDistributeID + '&studentQty=' + rowdata.StudentQty, 850, 550, null, paramsModel); } //查看发放学生信息 function StudentDistributeDetail(rowindex, rowdata) { paramsModel = { studentDistributeID: rowdata.StudentDistributeID, } $.popupTopWindow('发放学生信息', CMS_SystemConfig.VirtualDirectoryPath + '/StudentDistribute/StudentDistributeDetail?MNU=' + mnu + '&studentDistributeID=' + rowdata.StudentDistributeID, 850, 550, null, paramsModel); } function StudentDistribute_Export() { $("#formQuery").submit(); } function queryStandard(){ } //选中专业 function reloadClassmajor(data){ if (data != null) { selectClass(); } // var StandardID = $("#ddlStandard").combobox("getValue"); // $("#ComboGridGrademajor").combogridX("reload", CMS_SystemConfig.VirtualDirectoryPath + "/Grademajor/BindDropdownListByCollege?standardID=" + StandardID + ""); reload(); } //选中年级 function QuerySchoolyearDictionaryList(data) { if (data != null) { selectClass(); } reload(); } function selectClass() { var collegeID = $("#CollegeDropdown").combogridX("getValue"); var standard = $("#ddlStandard").combobox("getValue"); var year = $("#DictionarySchoolyear").combobox("getValue"); var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID + "|@|DictionaryGrade|*|" + year + "|@|DictionaryStandard|*|" + standard + "|@|'})"; $("#ComboGridGrademajor").combogridX("reload", eval(jsonString)); reload(); } function QueryCampusComboGridList() { var campusID = $("#CampusDropdown").combogridX("getValue"); if (campusID != nonSelect) { var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})"; $("#CollegeDropdown").combogridX("reload", eval(jsonString)); } reload(); } function QueryCollegeComboGridList() { var url = "/Facultymajor/BindStandardDropDownList?bindType=0"; var collegeID = $("#CollegeDropdown").combogridX("getValue"); if (collegeID != nonSelect) url += "&collegeID=" + collegeID; $("#ddlStandard").combobox("reload", url); reload(); } function QueryComboGridList(data) { reload(); } function QueryOrderedDropdownList(data) { reload(); } function QueryTeachingMaterialDropdownList(data) { reload(); } function QueryCourseDropdownList(data) { reload(); } function queryCollege(data) { queryClass(); } function queryStandard(data) { queryClass(); } function queryClass() { var jsonString = ""; var parameterString = ""; //var campusID = $("#CampusDropdown").combogridX("getValue"); var collegeID = $("#CollegeDropdown").combogridX("getValue"); //var educationID = $("#Education").combobox("getValue"); var schoolYearID = $("#DictionarySchoolyear").combobox("getValue"); var standardID = $("#ddlStandard").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 (parameterString != "") { jsonString = "({'QueryParamsDatas':'" + parameterString + "'})"; $("#ComboGridGrademajor").combogridX("reload", eval(jsonString)); $("#ddlStandard").combogridX("reload", eval(jsonString)); } else { $("#ComboGridGrademajor").combogridX("reload"); $("#ddlStandard").combogridX("reload"); } reload(); }