EducationMissionOpenControl.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/EducationMissionOpenControl/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgEducationMissionOpenControlList").cmsXDataTable("load", $.getDataGridParams("dgEducationMissionOpenControlList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgEducationMissionOpenControlList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.EducationMissionOpenControlID);
  16. });
  17. return d;
  18. }
  19. //新增
  20. function EduOpenControl_Add() {
  21. var d = validChoose();
  22. if (d.length > 0) {
  23. $.popupTopWindow('教学控制复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionOpenControl/CopyAdd?educationMissionOpenControlID=' + d[0] + '&MNU=' + mnu, 750, 280, null, null);
  24. } else {
  25. //var redirectTo = url + "?MNU=" + mnu;
  26. //$.popupTopWindow('教学控制新增', redirectTo, 750, 280, null, null);
  27. //采用以下方式新增
  28. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EducationMissionOpenControl/EducationMissionOpenControlBatchAdd" + "?MNU=" + mnu;
  29. $.popupTopWindow('教学控制新增', redirectTo, 800, 530, reload, null);
  30. }
  31. }
  32. //修改按钮
  33. function EduOpenControl_Edit() {
  34. var d = validChoose();
  35. if (d.length == 0) {
  36. $.messager.alert("系统信息", "请选择您要修改的信息。");
  37. return;
  38. }
  39. if (d.length > 1) {
  40. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  41. return;
  42. }
  43. var redirectTo = url + "?educationMissionOpenControlID=" + d + "&MNU=" + mnu + "&type=edit";
  44. $.popupTopWindow('教学控制修改', redirectTo, 750, 280, null, null);
  45. }
  46. //查看明细
  47. function edit(rowindex, rowdata) {
  48. var redirectTo = url + "?educationMissionOpenControlID=" + rowdata.EducationMissionOpenControlID + "&MNU=" + mnu + "&type=detail";
  49. $.popupTopWindow('教学控制明细', redirectTo, 750, 280, null, null);
  50. }
  51. //删除
  52. function EduOpenControl_Delete() {
  53. var d = validChoose().join(',');
  54. if (d == "") {
  55. $.messager.alert("系统提示", "请选择您要删除的信息。");
  56. return;
  57. }
  58. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  59. if (r) {
  60. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EducationMissionOpenControl/Delete', { educationMissionOpenControlIDs: d }, function (data) {
  61. if (data.IsSuccess) {
  62. $.messager.alert("系统提示", data.Message);
  63. $("#dgEducationMissionOpenControlList").cmsXDataTable('load');
  64. } else {
  65. $.messager.alert("系统提示", data.Message);
  66. }
  67. });
  68. }
  69. });
  70. }
  71. //设置列颜色为红色
  72. function SetRedColumn(index, row, value) {
  73. return " <span style=\"color: red;\">" + value + "</span>";
  74. }
  75. //导出Excel
  76. function EduOpenControl_Export() {
  77. $("#formQuery").submit();
  78. }
  79. //联动查询
  80. function queryCampus(data) {
  81. var campusID = $("#CampusDropdown").combogridX("getValue");
  82. if (campusID != nonSelect) {
  83. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  84. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  85. }
  86. else {
  87. $("#CollegeDropdown").combogridX("reload");
  88. }
  89. reload();
  90. }