SpecialtyApply.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/SpecialtyApply/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgSpecialtyApplyList").cmsXDataTable("load", $.getDataGridParams("dgSpecialtyApplyList"));
  10. }
  11. //获取选中的数据All
  12. function validChooseAll() {
  13. var d = [];
  14. $.each($("#dgSpecialtyApplyList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this);
  16. });
  17. return d;
  18. }
  19. //获取选中的数据
  20. function validChoose() {
  21. var d = [];
  22. $.each($("#dgSpecialtyApplyList").cmsXDataTable("getSelections"), function (index) {
  23. d.push(this.SpecialtyApplyID);
  24. });
  25. return d;
  26. }
  27. //查看
  28. function edit(rowindex, rowdata) {
  29. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/SpecialtyApply/Edit?specialtyApplyID=" + rowdata.SpecialtyApplyID + "&MNU=" + mnu + "&type=detail";
  30. $.popupTopWindow('专业申请信息', redirectTo, 680, 365, null, null);
  31. }
  32. //申请
  33. function SpecialtyApply_Add() {
  34. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/SpecialtyApply/SpecialtyApplyBatchAdd" + "?MNU=" + mnu;
  35. $.popupTopWindow('专业信息申请', redirectTo, 950, 540, reload, null);
  36. }
  37. //删除
  38. function SpecialtyApply_Delete() {
  39. var id = validChoose().join(',');
  40. if (id == "") {
  41. $.messager.alert("系统提示", "请选择您要删除的信息。");
  42. return;
  43. }
  44. //var d = validChooseAll();
  45. //if ($.grep(d, function (v, i) { return v.ApprovalStatus != startStatusID; }).length > 0) {
  46. // $.messager.alert("系统提示", "只能对未提交状态的信息进行删除。");
  47. // return;
  48. //}
  49. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  50. if (r) {
  51. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/SpecialtyApply/Delete', { specialtyApplyIDs: id }, function (data) {
  52. if (data.IsSuccess) {
  53. $.messager.alert("系统提示", data.Message);
  54. $("#dgSpecialtyApplyList").cmsXDataTable('load');
  55. } else {
  56. $.messager.alert("系统提示", data.Message);
  57. }
  58. });
  59. }
  60. });
  61. }
  62. //提交
  63. function SpecialtyApply_Submit() {
  64. var id = validChoose().join(',');
  65. if (id.length == 0) {
  66. $.messager.alert("系统提示", "请选择您要提交的信息。");
  67. return;
  68. }
  69. var d = validChooseAll();
  70. if ($.grep(d, function (v, i) { return v.ApprovalStatus == endStatusID; }).length > 0) {
  71. $.messager.alert("系统提示", "只能对未提交、已退回状态的信息进行提交。");
  72. return;
  73. }
  74. $.messager.confirm("系统提示", "您确定要对选择的信息进行提交?", function (r) {
  75. if (r) {
  76. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/SpecialtyApply/Submit', { specialtyApplyIDs: id }, function (data) {
  77. if (data.IsSuccess == true) {
  78. $.messager.alert("系统提示", data.Message);
  79. $("#dgSpecialtyApplyList").cmsXDataTable('load');
  80. } else {
  81. $.messager.alert("系统提示", data.Message);
  82. }
  83. });
  84. }
  85. });
  86. }
  87. //Excel导出
  88. function SpecialtyApply_Export() {
  89. $("#formQuery").submit();
  90. }
  91. //联动查询
  92. function queryCampus(data) {
  93. var campusID = $("#CampusDropdown").combogridX("getValue");
  94. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  95. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  96. reload();
  97. }
  98. function queryCollege(data) {
  99. var campusID = $("#CampusDropdown").combogridX("getValue");
  100. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  101. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  102. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  103. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  104. reload();
  105. }
  106. function queryGrade(data) {
  107. reload();
  108. }
  109. function queryStandard(data) {
  110. reload();
  111. }