@@ -9,6 +9,7 @@ var refreshGirdData;
var EPId = request('EPId');
//安排课程表Id
var EPLId;
var ELCheckMark;
var bootstrap = function ($, learun) {
"use strict";
var page = {
@@ -23,8 +24,11 @@ var bootstrap = function ($, learun) {
nodeClick: function (item) {
//安排课程表ID(Exam_ExamPlanLesson)
EPLId = item.id;
//显示考试时间
page.show(EPLId);
page.search({ EPLId: item.id });
$('#titleinfo').html(item.text);
}
});
// 刷新
@@ -48,9 +52,43 @@ var bootstrap = function ($, learun) {
return learun.alert.warning("请选择考试课程!");
}
});
//审核
$('#lr_check').on('click', function () {
if (!!EPLId) {
if (ELCheckMark == 1) {
return learun.alert.warning('该项已审核!');
}
learun.layerConfirm('是否确认审核!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Check', { keyValue: EPLId, ELCheckMark: 1 }, function () {
refreshGirdData();
});
}
});
} else {
return learun.alert.warning("请选择考试课程!");
}
});
//去审核
$('#lr_nocheck').on('click', function () {
if (!!EPLId) {
learun.layerConfirm('是否确认去审核!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Check', { keyValue: EPLId, ELCheckMark: 0 }, function () {
refreshGirdData();
});
}
});
} else {
return learun.alert.warning("请选择考试课程!");
}
});
//班级 新增
$('#lr_add_Class').on('click', function () {
if (!!EPLId) {
if (ELCheckMark == 1) {
return learun.alert.warning("该项已审核!");
}
learun.layerForm({
id: 'formclass',
title: '新增班级',
@@ -69,6 +107,9 @@ var bootstrap = function ($, learun) {
$('#lr_delete_Class').on('click', function () {
var keyValue = $('#gridtable_Class').jfGridValue('EPCId');
if (learun.checkrow(keyValue)) {
if (ELCheckMark == 1) {
return learun.alert.warning("该项已审核!");
}
learun.layerConfirm('是否确认删除选中记录!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/DeleteClass', { keyValue: keyValue }, function () {
@@ -78,10 +119,13 @@ var bootstrap = function ($, learun) {
});
}
});
//考场 新增
$('#lr_add_Room').on('click', function () {
if (!!EPLId) {
if (ELCheckMark == 1) {
return learun.alert.warning("该项已审核!");
}
learun.layerForm({
id: 'formroom',
title: '新增考场',
@@ -101,6 +145,9 @@ var bootstrap = function ($, learun) {
$('#lr_delete_Room').on('click', function () {
var keyValue = $('#gridtable_Room').jfGridValue('EPRId');
if (learun.checkrow(keyValue)) {
if (ELCheckMark == 1) {
return learun.alert.warning("该项已审核!");
}
learun.layerConfirm('是否确认删除选中记录!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/DeleteRoom', { keyValue: keyValue }, function () {
@@ -158,8 +205,33 @@ var bootstrap = function ($, learun) {
var res = learun.httpGet(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetFormData?keyValue=' + EPLId);
var data = res.data.Exam_ExamPlanLesson;
$('#examDate').html(learun.formatDate(data.ExamDate, 'yyyy-MM-dd'));
$('#examTime').html(data.ExamTime);
ELCheckMark = data.ELCheckMark;
if (!!data.ExamDate) {
$('#examDate').html(learun.formatDate(data.ExamDate, 'yyyy-MM-dd'));
$('#examTime').html(data.ExamTime);
} else {
$('#examDate').html('');
$('#examTime').html('');
//未设置考试时间
learun.layerConfirm('请先设置考试时间!', function (res) {
if (res) {
if (!!EPLId) {
learun.layerForm({
id: 'form',
title: '设置考试时间',
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Form?keyValue=' + EPLId,
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
} else {
return learun.alert.warning("请选择考试课程!");
}
}
});
}
}
}
};