CourseProcess.js 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. function CourseProcess_Save() {
  2. // if (isSubmited) {
  3. var isError = false;
  4. var courseProcessTimes = 0;
  5. var rows = $("#dgCourseProcessList").cmsXDataTable("getRows");
  6. $.each(rows, function (i, x) {
  7. if (isNaN(x.Times)) {
  8. $.messager.alert('系统信息', "学时必须为整数,请检查数据。");
  9. isError = true;
  10. return false;
  11. }
  12. courseProcessTimes += parseInt(x.Times);
  13. });
  14. if (isError) {
  15. return;
  16. }
  17. if (courseProcessTimes > totalTimes) {
  18. $.messager.alert('系统信息', "学时的总和必须小于或等于总学时,请检查数据。");
  19. return;
  20. }
  21. // }
  22. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CheckEducationMissionClassOpenControl', { educationMissionClassIDs: $.SystemGeneral.getUrlParam("educationMissionClassID") }, function (data) {
  23. if (data.IsSuccess) {
  24. $(document.forms[0]).submit();
  25. } else {
  26. $.messager.alert("系统提示", data.Message);
  27. return;
  28. }
  29. });
  30. }
  31. function SetTotalView() {
  32. var courseProcessTimes = 0;
  33. var rows = $("#dgCourseProcessList").cmsXDataTable("getRows");
  34. $.each(rows, function (i, x) {
  35. courseProcessTimes += parseInt(x.Times);
  36. });
  37. $("#totalView").html("学时:" + courseProcessTimes.toString() + " 总学时:" + totalTimes.toString());
  38. if (courseProcessTimes != totalTimes) {
  39. $("#totalView").css("color", "#FF0000");
  40. } else {
  41. $("#totalView").css("color", "#000000");
  42. }
  43. }
  44. //var selectedRowIndex = null;
  45. //var selectedRowData = null;
  46. var trigger = null;
  47. var mnu = "";
  48. //加载
  49. $(function () {
  50. mnu = $.SystemGeneral.getUrlParam("MNU");
  51. })
  52. function selectClassroom() {
  53. trigger = $(this);
  54. var dataRowIndex = parseInt(trigger.parents('tr').attr('xRowIndex'));
  55. var dataRow = $("#dgCourseProcessList").cmsXDataTable('getRows')[dataRowIndex];
  56. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/GetStudentCount', { educationMissionClassID: dataRow.EducationMissionClassID },
  57. function (studentCount) {
  58. var ddlClassroomType = trigger.parents('tr').find('[name*=ClassroomTypeID]');
  59. if (ddlClassroomType.val() != '-1') {
  60. $.popupTopWindow('选择教室', CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CourseProcessClassroomList?MaxSelect=1&MinSeatCount=' + studentCount + '&CollegeID=' + dataRow.CollegeID + '&ClassroomTypeID=' + ddlClassroomType.val() + '&FromMNU=' + mnu, 900, 500, ClassroomSelect_Close, null);
  61. } else {
  62. $.popupTopWindow('选择教室', CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CourseProcessClassroomList?MaxSelect=1&MinSeatCount=' + studentCount + '&CollegeID=' + dataRow.CollegeID + '&FromMNU=' + mnu, 900, 500, ClassroomSelect_Close, null);
  63. }
  64. })
  65. }
  66. function ClassroomSelect_Close(classroomList) {
  67. if (!classroomList) return;
  68. if (classroomList.length == 0) return;
  69. trigger.triggerbox("setValue", classroomList);
  70. trigger = null;
  71. }
  72. function selectTeacher(rowIndex, rowData) {
  73. trigger = $(this);
  74. var dataRowIndex = parseInt(trigger.parents('tr').attr('xRowIndex'));
  75. var dataRow = $("#dgCourseProcessList").cmsXDataTable('getRows')[dataRowIndex];
  76. $.popupTopWindow('教师信息', CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionClass/CourseProcessTeacherEdit?MNU=' + mnu + '&CourseProcessID=' + dataRow.CourseProcessID, 770, 420, TeacherSelect_Close);
  77. }
  78. function TeacherSelect_Close(teacherList) {
  79. if (!teacherList) return;
  80. if (teacherList.length == 0) return;
  81. trigger.triggerbox("setValue", teacherList);
  82. trigger = null;
  83. }