GraduationConditionPackageEdit.js 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. var mnu = "";
  2. //加载
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. })
  6. //获取选中的列表数据(All)
  7. function validChoose() {
  8. var d = [];
  9. $.each($("#dgGraduationConditionList").cmsXDataTable("getSelections"), function (index) {
  10. d.push(this);
  11. });
  12. return d;
  13. }
  14. //获取列表数据(列表中的所有行数据)
  15. function validChooseID() {
  16. var d = [];
  17. $.each($("#dgGraduationConditionList").cmsXDataTable("getRows"), function (index) {
  18. d.push(this.GraduationConditionID);
  19. });
  20. return d;
  21. }
  22. //保存
  23. function GraduationConditionPackage_Save() {
  24. var d = validChooseID();
  25. if (d == "") {
  26. $.messager.alert("系统提示", "请添加毕业条件。");
  27. return
  28. }
  29. $(document.forms[0]).submit();
  30. }
  31. //添加页面(毕业条件添加)
  32. function GraduationConditionAdd() {
  33. var graduationConditionPackageID = document.getElementById("GraduationConditionPackageID").value;
  34. $.popupTopWindow('毕业条件添加', CMS_SystemConfig.VirtualDirectoryPath
  35. + '/GraduationConditionPackage/GraduationConditionList?GraduationConditionPackageID='
  36. + graduationConditionPackageID + '&FromMNU=' + mnu, 600, 420, AddGraduationCondition_Confirm);
  37. }
  38. //加载选中的信息(毕业条件)
  39. function AddGraduationCondition_Confirm(GraduationConditionList) {
  40. if (GraduationConditionList == undefined || GraduationConditionList.length < 1) {
  41. return;
  42. }
  43. var GraduationConditionViewList = $("#dgGraduationConditionList").cmsXDataTable("getRows");
  44. $.each(GraduationConditionList, function (index, value) {
  45. if ($.grep(GraduationConditionViewList, function (row, index) {
  46. return value.GraduationConditionID == row.GraduationConditionID;
  47. }).length == 0) {
  48. GraduationConditionViewList.push({
  49. GraduationConditionID: value.GraduationConditionID,
  50. OrderNo: value.OrderNo,
  51. Title: value.Title,
  52. IsEnable: value.IsEnable
  53. });
  54. }
  55. });
  56. $("#dgGraduationConditionList").cmsXDataTable("loadData", {
  57. rows: GraduationConditionViewList,
  58. total: GraduationConditionViewList.length
  59. });
  60. }
  61. //删除(毕业条件删除)
  62. function GraduationConditionDelete() {
  63. var d = validChoose();
  64. if (d == "") {
  65. $.messager.alert("系统提示", "请选择您要删除的信息。");
  66. return;
  67. }
  68. var graduationConditionViewList = $("#dgGraduationConditionList").cmsXDataTable("getRows");
  69. var i, j;
  70. var len = graduationConditionViewList.length;
  71. for (i = len - 1; i >= 0; i--) {
  72. for (j = 0; j < d.length; j++) {
  73. if (graduationConditionViewList[i].GraduationConditionID == d[j].GraduationConditionID) {
  74. graduationConditionViewList.splice(i, 1);
  75. break;
  76. }
  77. }
  78. }
  79. $("#dgGraduationConditionList").cmsXDataTable("loadData", {
  80. rows: graduationConditionViewList,
  81. total: graduationConditionViewList.length
  82. });
  83. }