@@ -47,6 +47,7 @@ var bootstrap = function ($, learun) { | |||||
{ label: "座位行数", name: "SeatRows", width: 100, align: "left" }, | { label: "座位行数", name: "SeatRows", width: 100, align: "left" }, | ||||
{ label: "座位列数", name: "SeatColumns", width: 100, align: "left" }, | { label: "座位列数", name: "SeatColumns", width: 100, align: "left" }, | ||||
{ label: "考场座位数", name: "SeatCount", width: 100, align: "left" }, | { label: "考场座位数", name: "SeatCount", width: 100, align: "left" }, | ||||
{ label: "可用座位数", name: "ActualNum", width: 100, align: "left" }, | |||||
//{ | //{ | ||||
// label: "是否启用", name: "EREnabled", width: 100, align: "left", | // label: "是否启用", name: "EREnabled", width: 100, align: "left", | ||||
// formatter: function (cellvalue) { | // formatter: function (cellvalue) { | ||||
@@ -14,7 +14,7 @@ | |||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamPlanRoom"> | <div class="col-xs-12 lr-form-item" data-table="Exam_ExamPlanRoom"> | ||||
<div class="lr-form-item-title">考场座位数</div> | <div class="lr-form-item-title">考场座位数</div> | ||||
<input id="SeatCount" readonly="readonly" type="text" class="form-control"> | |||||
<input id="ActualNum" readonly="readonly" type="text" class="form-control"> | |||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item"> | <div class="col-xs-12 lr-form-item"> | ||||
<div class="lr-form-item-title">监考老师</div> | <div class="lr-form-item-title">监考老师</div> | ||||
@@ -134,7 +134,7 @@ var bootstrap = function ($, learun) { | |||||
} else { | } else { | ||||
$("#ClassroomName").val(temprow.ClassroomName); | $("#ClassroomName").val(temprow.ClassroomName); | ||||
$('#ClassroomNo').val(temprow.ClassroomNo); | $('#ClassroomNo').val(temprow.ClassroomNo); | ||||
$('#SeatCount').val(temprow.SeatCount); | |||||
$('#ActualNum').val(temprow.ActualNum); | |||||
} | } | ||||
}); | }); | ||||
}; | }; | ||||
@@ -225,6 +225,7 @@ var bootstrap = function ($, learun) { | |||||
{ label: "考场名称", name: "ClassroomName", width: 100, align: "left" }, | { label: "考场名称", name: "ClassroomName", width: 100, align: "left" }, | ||||
{ label: "考场编号", name: "ClassroomNo", width: 100, align: "left" }, | { label: "考场编号", name: "ClassroomNo", width: 100, align: "left" }, | ||||
{ label: "考场座位数", name: "SeatCount", width: 100, align: "left" }, | { label: "考场座位数", name: "SeatCount", width: 100, align: "left" }, | ||||
{ label: "可用座位数", name: "ActualNum", width: 100, align: "left" }, | |||||
{ label: "监考老师编号", name: "EmpNo", width: 150, align: "left" }, | { label: "监考老师编号", name: "EmpNo", width: 150, align: "left" }, | ||||
{ label: "监考老师姓名", name: "EmpName", width: 100, align: "left" }, | { label: "监考老师姓名", name: "EmpName", width: 100, align: "left" }, | ||||
], | ], | ||||
@@ -173,23 +173,32 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
$('#lr_seat').on('click', function () { | $('#lr_seat').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ERId'); | |||||
var IsEdit = $('#gridtable').jfGridValue('IsEdit'); | |||||
if (IsEdit.indexOf('false') != -1) { | |||||
learun.alert.warning("选中记录中包含不可编辑项目!"); | |||||
return; | |||||
} | |||||
if (learun.checkrow(keyValue)) { | |||||
var AcademicYearNo = $('#gridtable').jfGridValue('AcademicYearNo'); | |||||
var Semester = $('#gridtable').jfGridValue('Semester'); | |||||
var classroomNo = $('#gridtable').jfGridValue('ClassroomNo'); | |||||
learun.layerForm({ | |||||
id: 'form_seat', | |||||
title: '座位', | |||||
width: 1200, | |||||
height: 800, | |||||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/FormSeat?keyValue=' + keyValue + '&AcademicYearNo=' + AcademicYearNo + '&Semester=' + Semester + '&ClassRoomNo=' + classroomNo, | |||||
}); | |||||
var AcademicYearNo = $('#gridtable').jfGridValue('AcademicYearNo'); | |||||
var Semester = $('#gridtable').jfGridValue('Semester'); | |||||
var classroomNo = $('#gridtable').jfGridValue('ClassroomNo'); | |||||
if (learun.checkrow(classroomNo)) { | |||||
$.ajax({ | |||||
url: '/EducationalAdministration/Exam_ExamRoom/GetClassRoomDetailData', | |||||
data: { | |||||
AcademicYearNo, Semester, classroomNo | |||||
}, | |||||
type: "Post", | |||||
dataType: "json", | |||||
async: true, | |||||
cache: false, | |||||
success: (res) => { } | |||||
}) | |||||
//learun.layerForm({ | |||||
// id: 'SeatForm', | |||||
// title: '排考座位表', | |||||
// url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/GetClassRoomDetailData?' + $.param({ | |||||
// AcademicYearNo, Semester, classroomNo | |||||
// }), | |||||
// width: 1200, | |||||
// height: 800, | |||||
// btn: null | |||||
//}) | |||||
} | } | ||||
}); | }); | ||||
}, | }, | ||||
@@ -56,6 +56,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <returns></returns> | /// <returns></returns> | ||||
[Column("EMPNAME")] | [Column("EMPNAME")] | ||||
public string EmpName { get; set; } | public string EmpName { get; set; } | ||||
/// <summary> | |||||
/// ActualNum | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[Column("ACTUALNUM")] | |||||
public string ActualNum { get; set; } | |||||
#endregion | #endregion | ||||
#region 扩展操作 | #region 扩展操作 | ||||
@@ -367,12 +367,13 @@ where l.EPLId='{EPLId}'"; | |||||
EPRoom.SeatCount = room.ActualNum; | EPRoom.SeatCount = room.ActualNum; | ||||
db.Insert(EPRoom); | db.Insert(EPRoom); | ||||
seatCount += room.ActualNum; | seatCount += room.ActualNum; | ||||
room.IsEdit = false; | |||||
if (seatCount >= examLesson.RealStuCount) | if (seatCount >= examLesson.RealStuCount) | ||||
{ | { | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
db.Update(examRoomList); | |||||
db.ExecuteBySql( | db.ExecuteBySql( | ||||
$"update Exam_ExamPlanLesson set SeatCount='{seatCount}' where EPLId='{examLesson.EPLId}'"); | $"update Exam_ExamPlanLesson set SeatCount='{seatCount}' where EPLId='{examLesson.EPLId}'"); | ||||
} | } | ||||
@@ -298,8 +298,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
,[EROrder] | ,[EROrder] | ||||
,[EREnabled] | ,[EREnabled] | ||||
,[IsEdit] | ,[IsEdit] | ||||
,[ActualNum] | |||||
) | ) | ||||
select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{SeatRows},{SeatColumns},{SeatRows}*{SeatColumns},0,1,1 from ClassroomInfo where CheckMark=1 | |||||
select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{SeatRows},{SeatColumns},{SeatRows}*{SeatColumns},0,1,1,{SeatRows}*{SeatColumns} from ClassroomInfo where CheckMark=1 | |||||
and [ClassroomNo] not in (select [ClassroomNo] from Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' ) | and [ClassroomNo] not in (select [ClassroomNo] from Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' ) | ||||
"; | "; | ||||
return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | ||||
@@ -327,7 +328,7 @@ select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{Seat | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
string sql = $"delete Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and IsEdit = 'true';delete Exam_ExamRoomdetail where AcademicYearNo ='" + AcademicYearNo + "' and Semester='" + Semester + "' and IsEdit = 1 ;"; | |||||
string sql = $"delete Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and IsEdit = 'true';delete Exam_ExamRoomdetail where AcademicYearNo ='" + AcademicYearNo + "' and Semester='" + Semester + "' and EcEnabled = 1 ;"; | |||||
return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
@@ -236,7 +236,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
try | try | ||||
{ | { | ||||
var del = db.FindList<Exam_ExamRoomDetailEntity>(x => x.ClassRoomNo == ClassroomNo && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester); | var del = db.FindList<Exam_ExamRoomDetailEntity>(x => x.ClassRoomNo == ClassroomNo && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester); | ||||
db.Delete(del); | |||||
foreach (var item in del) | |||||
{ | |||||
db.Delete(item); | |||||
} | |||||
List<Exam_ExamRoomDetailEntity> enList = new List<Exam_ExamRoomDetailEntity>(); | List<Exam_ExamRoomDetailEntity> enList = new List<Exam_ExamRoomDetailEntity>(); | ||||
if (entity.Count() > 0) | if (entity.Count() > 0) | ||||
{ | { | ||||