function reload() { $("#dgCollegePriorityList").cmsXDataTable("load", $.getDataGridParams("dgCollegePriorityList")); } //获取选中的数据 function validChoose() { var d = []; $.each($("#dgCollegePriorityList").cmsXDataTable("getSelections"), function (index) { d.push(this); }); return d; } //function validChooseStatus() { // var d = []; // $.each($("#dgCollegePriorityList").cmsXDataTable("getSelections"), function (index) { // d.push(this.RecordStatus); // }); // return d; //} function validChooseCollege() { var d = []; $.each($("#dgCollegePriorityList").cmsXDataTable("getSelections"), function (index) { d.push(this.CollegeID); }); return d; } function CollegeScheduleApproval_submit() { var d = validChoose(); // var status = validChooseStatus(); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要提交的" + EMIS_CollegeLabel + "课表。"); return; } for (var i = 0; i < d.length; i++) { if (d[i].RecordStatus != startStatus) { $.messager.alert("系统提示", "部分选中的" + EMIS_CollegeLabel + "课表已经提交,请不要重复提交。"); return; } } $.messager.confirm("系统提示", "您确定要提交该" + EMIS_CollegeLabel + "课表?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/CollegeScheduleApproval/Submit', { collegeScheduleStatusIDs: $.map(d, function (x) { return x.CollegeScheduleStatusID; }).join(","), collegeIDs: $.map(d, function (x) { return x.CollegeID; }).join(","), schoolYearID: $("#SchoolyearDropdownList").combobox("getValue") }, function (data) { if (data == "提交成功") { $.messager.alert("系统提示", "提交成功!"); $("#dgCollegePriorityList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function CollegeScheduleApproval_approve() { var d = validChoose(); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要审核的" + EMIS_CollegeLabel + "课表。"); return; } for (var i = 0; i < d.length; i++) { if (d[i].RecordStatus == startStatus) { $.messager.alert("系统提示", "部分选中的" + EMIS_CollegeLabel + "课表仍未提交,请提交后再进行审核。"); return; } } $.messager.confirm("系统提示", "您确定要审核该" + EMIS_CollegeLabel + "课表?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/CollegeScheduleApproval/Approve', { collegeScheduleStatusIDs: $.map(d, function (x) { return x.CollegeScheduleStatusID; }).join(",") }, function (data) { if (data == "审核成功") { $.messager.alert("系统提示", "审核成功!"); $("#dgCollegePriorityList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); } function CollegeScheduleApproval_returnback() { var d = validChoose(); // var status = validChooseStatus(); if (d.length == 0) { $.messager.alert("系统信息", "请选择您要撤回的" + EMIS_CollegeLabel + "课表。"); return; } for (var i = 0; i < d.length; i++) { if (d[i].RecordStatus == startStatus) { $.messager.alert("系统提示", "部分选中的" + EMIS_CollegeLabel + "课表仍未提交,请提交后再进行撤回。"); return; } } $.messager.confirm("系统提示", "您确定要撤回该" + EMIS_CollegeLabel + "课表?", function (r) { if (r) { $.post(CMS_SystemConfig.VirtualDirectoryPath + '/CollegeScheduleApproval/ReturnBack', { collegeScheduleStatusIDs: $.map(d, function (x) { return x.CollegeScheduleStatusID; }).join(",") }, function (data) { if (data == "撤回成功") { $.messager.alert("系统提示", "撤回成功!"); $("#dgCollegePriorityList").cmsXDataTable('load'); } else { $.messager.alert("系统提示", data); } }); } }); }