StopApprove.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. })
  6. function validChoose() {
  7. var d = [];
  8. $.each($("#dgEducationSchedulingStopList").cmsXDataTable("getSelections"), function (index) {
  9. d.push(this);
  10. });
  11. return d;
  12. }
  13. function reload() {
  14. $("#dgEducationSchedulingStopList").cmsXDataTable("load", $.getDataGridParams("dgEducationSchedulingStopList"));
  15. }
  16. function queryTeacher(data) {
  17. if (((data.length && data.length > 0) || data)
  18. && $("#cgbTeacher").length > 0 && $.data($("#cgbTeacher")[0], "combogridX")) {
  19. var jsonString = "({'QueryParamsDatas':'";
  20. var collegeID = $("#ddlCollege").combobox("getValue");
  21. if (collegeID != nonSelect) {
  22. jsonString += "CollegeDropdown|*|" + collegeID + "|@|";
  23. }
  24. jsonString += "'})";
  25. $("#cgbTeacher").combogridX("reload", eval(jsonString));
  26. }
  27. }
  28. function EducationSchedulingStop_Approve() {
  29. var d = validChoose();
  30. if (d.length == 0) {
  31. $.messager.alert("系统提示", "请选择要审核的记录。");
  32. return;
  33. }
  34. var firstStatus = d[0].RecordStatus;
  35. if ($.grep(d, function (x) { return x.RecordStatus != firstStatus }).length > 0) {
  36. $.messager.alert("系统提示", "请选择相同状态的记录进行审核。");
  37. return;
  38. }
  39. var firstID = d[0].EducationSchedulingStopID;
  40. $.popupTopWindow('审核信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/ApproveHandler?TableName=ES_EducationSchedulingStop&FormID=' + firstID,
  41. 400, 300, EducationSchedulingStop_Approve_Confirm);
  42. }
  43. function EducationSchedulingStop_Approve_Confirm(action) {
  44. if (!action) return;
  45. if (action.ActionID == "") return;
  46. var d = $.map(validChoose(), function (x) { return x.EducationSchedulingStopID; }).join(',');
  47. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + "/EducationSchedule/StopApprove", { educationSchedulingStopIDs: d, actionID: action.Action, comment: action.Comment },
  48. function (data) {
  49. $.messager.alert("系统提示", data.Message);
  50. if (data.IsSuccess) {
  51. reload();
  52. }
  53. }, 'json');
  54. }
  55. function EducationSchedulingStop_Excel() {
  56. var d = validChoose();
  57. if (d.length == 0) {
  58. $("[name='hidEducationSchedulingStopID']").val("");
  59. } else {
  60. $("[name='hidEducationSchedulingStopID']").val($.map(d, function (x) { return x.EducationSchedulingStopID; }).join(','))
  61. }
  62. $("#formQuery").submit();
  63. }