LessonRecordEdit.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. })
  6. function LessonRecord_Save() {
  7. var nowDate = new Date().format('yyyy-MM-dd');
  8. var LessonDate= $("#LessonDate").val();
  9. if (LessonDate > nowDate)
  10. {
  11. $.messager.alert("系统信息", "只能选择当前时间和之前时间的督导时间。");
  12. return;
  13. }
  14. //只留提示实际不限制
  15. // if ($("[name='Content']").val().replace(/[\r\n\s]/g, "").length < 100) {
  16. // $.messager.alert("系统信息", "教学评价内容字数不够。");
  17. // return;
  18. // }
  19. // if ($("[name='Record']").val().replace(/[\r\n\s]/g, "").length < 60) {
  20. // $.messager.alert("系统信息", "督导情况记录字数不够。");
  21. // return;
  22. // }
  23. $(document.forms[0]).submit();
  24. }
  25. function LessonDateChange(dp) {
  26. var week = new Date(dp.cal.newdate.y, dp.cal.newdate.M - 1, dp.cal.newdate.d).getDay();
  27. $("[comboname='Weekday']").combobox('setValue', week);
  28. GetClassmajorAndCourse(dp.cal.getNewDateStr());
  29. }
  30. function GetClassmajorAndCourse(date) {
  31. var schoolyearID = $("#SchoolyearID").combobox('getValue');
  32. var coursesTimeID = $("[comboname='CoursesTimeID']").combobox('getValue');
  33. var teacherUserID = $("[comboname='UserID']").combogridX('getValue');
  34. if (!date || !((typeof date == 'string') && date.constructor == String)) {
  35. date = $("[name='LessonDate']").val();
  36. }
  37. if (date == '') {
  38. return;
  39. }
  40. if (coursesTimeID == '' || coursesTimeID == nonSelect) {
  41. return;
  42. }
  43. if (teacherUserID == '' || teacherUserID == nonSelect) {
  44. return;
  45. }
  46. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationSchedule/GetEducationMissionClassViewBySchedule',
  47. { schoolyearID:schoolyearID, date: date, coursesTimeID: coursesTimeID, teacherUserID: teacherUserID },
  48. function (data) {
  49. if (data) {
  50. $("[comboname='ClassmajorID']").combogridX('setValue', data.MainScheduleClassID);
  51. $("[comboname='CoursematerialID']").combogridX('setValue', data.CoursematerialID);
  52. }
  53. });
  54. }
  55. function LessonRecord_SeletcRecord() {
  56. $.popupTopWindow('评价建议', CMS_SystemConfig.VirtualDirectoryPath + '/ProjectRecord/SelectAdvise?FromMNU=' + mnu, 900, 500, AddRecord);
  57. }
  58. function AddRecord(data) {
  59. var advise = $("#Record").val();
  60. data = advise + ";" + data;
  61. if (advise == "" || advise == null) {
  62. data = data.substr(1, (data.length - 1));
  63. }
  64. $("#Record").val(data);
  65. }