SOC.js 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/SOC/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. function reload() {
  8. $("#dgSOCList").cmsXDataTable("load", $.getDataGridParams("dgSOCList"));
  9. }
  10. //获取选中的数据
  11. function validChoose() {
  12. var d = [];
  13. $.each($("#dgSOCList").cmsXDataTable("getSelections"), function (index) {
  14. d.push(this.SOCID);
  15. });
  16. return d;
  17. }
  18. function chooseCourse() {
  19. var d = [];
  20. $.each($("#dgSOCList").cmsXDataTable("getSelections"), function (index) {
  21. d.push(this.CoursematerialID);
  22. });
  23. return d;
  24. }
  25. function SOC_Generate() {
  26. $.messager.confirm("系统提示", "您确定要生成课程SOC?", function (r) {
  27. if (r) {
  28. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/SOC/Generate', { pararms: "" }, function (data) {
  29. if (data.IsSuccess) {
  30. $.messager.alert("系统提示", "生成成功!");
  31. reload();
  32. } else {
  33. $.messager.alert("系统提示", data.Message);
  34. }
  35. });
  36. }
  37. });
  38. // var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/SOC/Generate?MNU=" + mnu;
  39. // $.popupTopWindow('生成课程信息', redirectTo, 600, 300, null, null);
  40. }
  41. function SOC_Setting() {
  42. var d = validChoose();
  43. var course = chooseCourse();
  44. if (d.length == 0) {
  45. $.messager.alert("系统信息", "请选择您要进行设置的信息。");
  46. return;
  47. }
  48. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/SOC/CheckCanSetting', {}, function (data) {
  49. if (!data.IsSuccess) {
  50. $.messager.alert("系统提示", data.Message);
  51. }
  52. else {
  53. if (d.length > 1) {
  54. for (var i = 0; i < course.length - 1; i++) {
  55. if (course[i] != course[i + 1]) {
  56. $.messager.alert("系统信息", "只能选择相同课程的信息进行设置。");
  57. return;
  58. }
  59. }
  60. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/SOC/SOCCheck', { SOCIDs: d.join(',') }, function (data) {
  61. if (!data.IsSuccess) {
  62. $.messager.confirm("系统提示", data.Message, function (r) {
  63. if (r) {
  64. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/SOC/Edit?SOCIDList=" + d.join(',') + "&MNU=" + mnu;
  65. $.popupTopWindow('课程SOC设置', redirectTo, 1200, 700, null, null);
  66. } else {
  67. return;
  68. }
  69. });
  70. } else {
  71. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/SOC/Edit?SOCIDList=" + d.join(',') + "&MNU=" + mnu;
  72. $.popupTopWindow('课程SOC设置', redirectTo, 1200, 700, null, null);
  73. }
  74. });
  75. }
  76. else {
  77. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/SOC/Edit?SOCIDList=" + d.join(',') + "&MNU=" + mnu;
  78. $.popupTopWindow('课程SOC设置', redirectTo, 1200, 700, null, null);
  79. }
  80. }
  81. });
  82. }
  83. function detail(rowindex, rowdata) {
  84. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/SOC/SOCDetail?SOCID=" + rowdata.SOCID + "&MNU=" + mnu;
  85. $.popupTopWindow('课程SOC成果', redirectTo, 1200, 700, null, null);
  86. }
  87. function student(rowindex, rowdata) {
  88. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/SOC/SOCStudentList?SOCID=" + rowdata.SOCID + "&MNU=" + mnu;
  89. $.popupTopWindow('SOC学生', redirectTo, 800, 600, null, null);
  90. }