123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- var mnu = "";
- //加载
- $(function () {
- mnu = $.SystemGeneral.getUrlParam("MNU");
- })
- //刷新
- function reload() {
- $("#dgRetakePlanResultTaskList").cmsXDataTable("load", $.getDataGridParams("dgRetakePlanResultTaskList"));
- }
- //获取选中的数据
- function validChoose() {
- var d = [];
- $.each($("#dgRetakePlanResultTaskList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.RetakePlanID);
- });
- return d;
- }
- //获取选中的重修任务状态
- function validChooseStatus() {
- var d = [];
- $.each($("#dgRetakePlanResultTaskList").cmsXDataTable("getSelections"), function (index) {
- d.push(this.RecordStatus);
- });
- return d;
- }
- //修改
- function RetakePlanResultTask_Update() {
- var d = validChoose();
- var r = validChooseStatus();
- if (d.length == 0) {
- $.messager.alert("系统信息", "请选择您要修改的信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统信息", "只能选择单个记录进行修改。");
- return;
- }
- if (r[0] == CreatedStatus) {
- $.messager.alert("系统提示", "无法对已开班状态的信息进行修改。");
- return;
- }
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/RetakePlanResultTask/Edit?RetakePlanID=" + d[0] + '&MNU=' + mnu;
- $.popupTopWindow('重修班级修改', redirectTo, 750, 550, null, null);
- }
- //查看重修班级信息
- function retakeDetail(rowindex, rowdata) {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/RetakePlanResultTask/Edit?RetakePlanID=" + rowdata.RetakePlanID
- + "&MNU=" + mnu + "&Status=" + rowdata.RecordStatus + "&Isdisplay=true";
- $.popupTopWindow('重修班级信息', redirectTo, 750, 550, null, null);
- }
- //重修报名
- function RetakePlanResultTask_Student() {
- var d = validChoose();
- var r = validChooseStatus();
- if (d.length == 0) {
- $.messager.alert("系统信息", "请选择您要报名的信息。");
- return;
- }
- if (d.length > 1) {
- $.messager.alert("系统信息", "只能选择单个记录进行报名。");
- return;
- }
- if (r[0] == CreatedStatus) {
- $.messager.alert("系统提示", "已开班状态的信息无法报名。");
- return;
- }
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/RetakePlanResultTask/StudentDetail?RetakePlanID=" + d[0] + "&MNU=" + mnu;
- $.popupTopWindow('重修报名', redirectTo, 900, 540, reload, null);
- }
- //查看重修报名
- function studentDetail(rowindex, rowdata) {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/RetakePlanResultTask/StudentDetail?RetakePlanID=" + rowdata.RetakePlanID
- + "&MNU=" + mnu + "&Status=" + rowdata.RecordStatus;
- $.popupTopWindow('重修报名', redirectTo, 900, 540, reload);
- }
- //开班(重修计划)
- function RetakePlanResultTask_AddMission() {
- var RetakePlanIDs = validChoose().join(',');
- if (RetakePlanIDs.length == 0) {
- $.messager.alert("系统提示", "请选择您要开班的信息。");
- return;
- }
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/RetakePlanResultTask/IsOverRange', { retakePlanIDs: RetakePlanIDs }, function (data) {
- if (data.IsSuccess) {
- if (data.Data) {
- $.messager.defaults = { ok: "继续开班", cancel: "取消" };
- $.messager.confirm("选择提示", "检测到选择开班的信息中报名人数未达到人数下限或超过人数上限,是否继续开班?", function (r) {
- if (r) {
- Generate(RetakePlanIDs);
- }
- else {
- return;
- }
- });
- $.messager.defaults = { ok: "确定", cancel: "取消" };
- }
- else {
- Generate(RetakePlanIDs);
- }
- }
- else {
- $.messager.alert("系统提示", data.Message);
- }
- });
- }
- //确定开班(重修计划)
- function Generate(RetakePlanIDs) {
- $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/RetakePlanResultTask/Generate', { RetakePlanIDs: RetakePlanIDs }, function (data) {
- $.messager.alert("系统提示", data.Message);
- if (data.IsSuccess) {
- $("#dgRetakePlanResultTaskList").cmsXDataTable('load');
- }
- });
- }
- //重修计划名单
- function studentPlanDetail(rowindex, rowdata) {
- var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/RetakePlanResultTask/StudentPlanDetail?RetakePlanID=" + rowdata.RetakePlanID
- + "&MNU=" + mnu + "&Status=" + rowdata.RecordStatus;
- $.popupTopWindow('重修计划名单', redirectTo, 900, 540, reload);
- }
- //列颜色设置为红色
- function SetRedtColumn(index, row, value) {
- return " <span style=\"color: red;\">" + value + "</span>";
- }
- //导出Excel
- function RetakePlanResultTask_Export() {
- $("#formQuery").submit();
- }
- //联动查询
- function queryCourseCollege(data) {
- var collegeID = $("#CollegeDropdown").combogridX("getValue");
- var departmentID = $("#DepartmentComboGrid").combogridX("getValue");
- var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID + "|@|";
- jsonString += "DepartmentComboGrid|*|" + departmentID + "|@|'})";
- $("#DepartmentComboGrid").combogridX("reload", eval(jsonString));
- reload();
- }
|