SOCDetail.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/SOCDetail/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. function reload() {
  8. $("#dgSOCDetailList").cmsXDataTable("load", $.getDataGridParams("dgSOCDetailList"));
  9. }
  10. //获取选中的数据
  11. function validChoose() {
  12. var d = [];
  13. $.each($("#dgSOCDetailList").cmsXDataTable("getSelections"), function (index) {
  14. d.push(this.SOCDetailID);
  15. });
  16. return d;
  17. }
  18. function SOCDetail_Update() {
  19. var d = validChoose();
  20. if (d.length == 0) {
  21. $.messager.alert("系统信息", "请选择您要进行修改的信息。");
  22. return;
  23. }
  24. if (d.length > 1) {
  25. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  26. return;
  27. }
  28. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/SOC/CheckCanSetting', {}, function (data) {
  29. if (!data.IsSuccess) {
  30. $.messager.alert("系统提示", "只有教师角色才能修改");
  31. }else{
  32. var redirectTo = url + "?SOCDetailID=" + d + "&MNU=" + mnu;
  33. $.popupTopWindow('SOC明细修改', redirectTo, 800, 600, null, null);
  34. }
  35. });
  36. }
  37. function SOCDetail_Delete() {
  38. var d = validChoose().join(',');
  39. if (d == "") {
  40. $.messager.alert("系统提示", "请选择您要删除的信息。");
  41. return;
  42. }
  43. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/SOC/CheckCanSetting', {}, function (data) {
  44. if (!data.IsSuccess) {
  45. $.messager.alert("系统提示", "只有教师角色才能删除");
  46. } else {
  47. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  48. if (r) {
  49. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/SOCDetail/Delete', { SOCDetailIDs: d }, function (data) {
  50. if (data == "删除成功!") {
  51. $.messager.alert("系统提示", data);
  52. $("#dgSOCDetailList").cmsXDataTable('load');
  53. } else {
  54. $.messager.alert("系统提示", data);
  55. }
  56. });
  57. }
  58. });
  59. }
  60. });
  61. }
  62. function SOCDetail_Export() {
  63. var d = validChoose().join(',');
  64. $("[name='SelectedID']").val(d);
  65. $("#formQuery").submit();
  66. }