CollegeSchedulingApproval.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. function reload() {
  2. $("#dgCollegePriorityList").cmsXDataTable("load", $.getDataGridParams("dgCollegePriorityList"));
  3. }
  4. //获取选中的数据
  5. function validChoose() {
  6. var d = [];
  7. $.each($("#dgCollegePriorityList").cmsXDataTable("getSelections"), function (index) {
  8. d.push(this);
  9. });
  10. return d;
  11. }
  12. //function validChooseStatus() {
  13. // var d = [];
  14. // $.each($("#dgCollegePriorityList").cmsXDataTable("getSelections"), function (index) {
  15. // d.push(this.RecordStatus);
  16. // });
  17. // return d;
  18. //}
  19. function validChooseCollege() {
  20. var d = [];
  21. $.each($("#dgCollegePriorityList").cmsXDataTable("getSelections"), function (index) {
  22. d.push(this.CollegeID);
  23. });
  24. return d;
  25. }
  26. function CollegeScheduleApproval_submit() {
  27. var d = validChoose();
  28. // var status = validChooseStatus();
  29. if (d.length == 0) {
  30. $.messager.alert("系统信息", "请选择您要提交的" + EMIS_CollegeLabel + "课表。");
  31. return;
  32. }
  33. for (var i = 0; i < d.length; i++) {
  34. if (d[i].RecordStatus != startStatus) {
  35. $.messager.alert("系统提示", "部分选中的" + EMIS_CollegeLabel + "课表已经提交,请不要重复提交。");
  36. return;
  37. }
  38. }
  39. $.messager.confirm("系统提示", "您确定要提交该" + EMIS_CollegeLabel + "课表?", function (r) {
  40. if (r) {
  41. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/CollegeScheduleApproval/Submit', { collegeScheduleStatusIDs: $.map(d, function (x) { return x.CollegeScheduleStatusID; }).join(","), collegeIDs: $.map(d, function (x) { return x.CollegeID; }).join(","), schoolYearID: $("#SchoolyearDropdownList").combobox("getValue") }, function (data) {
  42. if (data == "提交成功") {
  43. $.messager.alert("系统提示", "提交成功!");
  44. $("#dgCollegePriorityList").cmsXDataTable('load');
  45. } else {
  46. $.messager.alert("系统提示", data);
  47. }
  48. });
  49. }
  50. });
  51. }
  52. function CollegeScheduleApproval_approve() {
  53. var d = validChoose();
  54. if (d.length == 0) {
  55. $.messager.alert("系统信息", "请选择您要审核的" + EMIS_CollegeLabel + "课表。");
  56. return;
  57. }
  58. for (var i = 0; i < d.length; i++) {
  59. if (d[i].RecordStatus == startStatus) {
  60. $.messager.alert("系统提示", "部分选中的" + EMIS_CollegeLabel + "课表仍未提交,请提交后再进行审核。");
  61. return;
  62. }
  63. }
  64. $.messager.confirm("系统提示", "您确定要审核该" + EMIS_CollegeLabel + "课表?", function (r) {
  65. if (r) {
  66. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/CollegeScheduleApproval/Approve', { collegeScheduleStatusIDs: $.map(d, function (x) { return x.CollegeScheduleStatusID; }).join(",") }, function (data) {
  67. if (data == "审核成功") {
  68. $.messager.alert("系统提示", "审核成功!");
  69. $("#dgCollegePriorityList").cmsXDataTable('load');
  70. } else {
  71. $.messager.alert("系统提示", data);
  72. }
  73. });
  74. }
  75. });
  76. }
  77. function CollegeScheduleApproval_returnback() {
  78. var d = validChoose();
  79. // var status = validChooseStatus();
  80. if (d.length == 0) {
  81. $.messager.alert("系统信息", "请选择您要撤回的" + EMIS_CollegeLabel + "课表。");
  82. return;
  83. }
  84. for (var i = 0; i < d.length; i++) {
  85. if (d[i].RecordStatus == startStatus) {
  86. $.messager.alert("系统提示", "部分选中的" + EMIS_CollegeLabel + "课表仍未提交,请提交后再进行撤回。");
  87. return;
  88. }
  89. }
  90. $.messager.confirm("系统提示", "您确定要撤回该" + EMIS_CollegeLabel + "课表?", function (r) {
  91. if (r) {
  92. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/CollegeScheduleApproval/ReturnBack', { collegeScheduleStatusIDs: $.map(d, function (x) { return x.CollegeScheduleStatusID; }).join(",") }, function (data) {
  93. if (data == "撤回成功") {
  94. $.messager.alert("系统提示", "撤回成功!");
  95. $("#dgCollegePriorityList").cmsXDataTable('load');
  96. } else {
  97. $.messager.alert("系统提示", data);
  98. }
  99. });
  100. }
  101. });
  102. }