123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292 |
- 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();
- }
|