TeachersOrderExamine.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/TeachersOrderExamine/ApprovalHandle";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. function reload() {
  8. $("#dgTeachersOrderExamineList").cmsXDataTable("load", $.getDataGridParams("dgTeachersOrderExamineList"));
  9. }
  10. //页面提交审核
  11. function TeachersOrder_Add() {
  12. var d = validChoose();
  13. var names = validChoosetatusName();
  14. if (d.length == 0) {
  15. $.messager.alert("系统提示", "请选择您要审核的信息!");
  16. return;
  17. }
  18. if (unique(names).length > 1) {
  19. $.messager.alert("系统提示", "选中的审核数据中包含其他状态值!");
  20. return;
  21. }
  22. var firstID = d[0];
  23. $.popupTopWindow('审核信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ApproveHandler?TableName=ET_TeachersOrder&FormID=' + firstID,
  24. 400, 300, TeachersOrder_Approve_Confirm);
  25. }
  26. function TeachersOrder_Approve_Confirm(action) {
  27. if (!action) return;
  28. if (action.ActionID == "") return;
  29. var d = validChoose().join(',');
  30. $.post(CMS_SystemConfig.VirtualDirectoryPath + "/TeachersOrderExamine/Approve", { teachersOrderIDs: d, actionID: action.Action, comment: action.Comment },
  31. function (data) {
  32. $.messager.alert("系统提示", data.Message);
  33. if (data.IsSuccess) {
  34. reload();
  35. }
  36. }, 'json');
  37. }
  38. //点击查看流程状态
  39. function edit(rowindex, rowdata) {
  40. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/TeachersOrderExamine/Edit?teachersOrderID=' + rowdata.TeachersOrderID + '&MNU=' + mnu;
  41. $.popupTopWindow('计划审核信息', redirectTo, 800, 600, null, null);
  42. }
  43. //点击查看审核记录
  44. function ShowHistoryLog(rowindex, rowdata) {
  45. var redirectTo = url + '?TeachersOrderID=' + rowdata.TeachersOrderID + '&MNU=' + mnu;
  46. $.popupTopWindow('审批记录', redirectTo, 800, 600, null, null);
  47. }
  48. //获取选中的数据
  49. function validChoose() {
  50. var d = [];
  51. $.each($("#dgTeachersOrderExamineList").cmsXDataTable("getSelections"), function (index) {
  52. d.push(this.TeachersOrderID);
  53. });
  54. return d;
  55. }
  56. //获取选中的数据状态值
  57. function validChoosetatusName() {
  58. var d = [];
  59. $.each($("#dgTeachersOrderExamineList").cmsXDataTable("getSelections"), function (index) {
  60. d.push(this.ApproveStatusName);
  61. });
  62. return d;
  63. }
  64. //去除数组中重复数据、以达到验证状态是否一致效果、
  65. function unique(arr) {
  66. var result = [], hash = {};
  67. for (var i = 0, elem; (elem = arr[i]) != null; i++) {
  68. if (!hash[elem]) {
  69. result.push(elem);
  70. hash[elem] = true;
  71. }
  72. }
  73. return result;
  74. }
  75. function TeachersOrder_Export() {
  76. $("#formQuery").submit();
  77. }
  78. function QueryPublishDropdownList(data) {
  79. reload();
  80. }
  81. function QueryCourseDropdownList(data) {
  82. reload();
  83. }
  84. function QuerySchoolYearDropdownList(data) {
  85. reload();
  86. }
  87. function QueryCollegeDropdownList(data) {
  88. reload();
  89. }
  90. function QueryStatusDropdownList(data) {
  91. reload();
  92. }