ArrearsList.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ArrearsList/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgArrearsListList").cmsXDataTable("load", $.getDataGridParams("dgArrearsListList"));
  10. }
  11. //获取选中的数据All
  12. function validChooseAll() {
  13. var d = [];
  14. $.each($("#dgArrearsListList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this);
  16. });
  17. return d;
  18. }
  19. //获取选中的数据
  20. function validChoose() {
  21. var d = [];
  22. $.each($("#dgArrearsListList").cmsXDataTable("getSelections"), function (index) {
  23. d.push(this.UserID);
  24. });
  25. return d;
  26. }
  27. //放行
  28. function ArrearsList_Pass() {
  29. var userIDs = validChoose().join(',');
  30. if (userIDs == "") {
  31. $.messager.alert("系统提示", "请选择您要放行的信息。");
  32. return;
  33. }
  34. var d = validChooseAll();
  35. if ($.grep(d, function (v, i) { return v.IsControl != isControlStatusID; }).length > 0) {
  36. $.messager.alert("系统提示", "只能对控制状态的信息进行放行。");
  37. return;
  38. }
  39. $.messager.confirm("系统提示", "您确定要对选择的信息进行放行(允许登录)?", function (r) {
  40. if (r) {
  41. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ArrearsList/Pass', { userIDs: userIDs }, function (data) {
  42. if (data.IsSuccess == true) {
  43. $.messager.alert("系统提示", data.Message);
  44. $("#dgArrearsListList").cmsXDataTable('load');
  45. } else {
  46. $.messager.alert("系统提示", data.Message);
  47. }
  48. });
  49. }
  50. });
  51. }
  52. //控制
  53. function ArrearsList_Control() {
  54. var userIDs = validChoose().join(',');
  55. if (userIDs == "") {
  56. $.messager.alert("系统提示", "请选择您要控制的信息。");
  57. return;
  58. }
  59. var d = validChooseAll();
  60. if ($.grep(d, function (v, i) { return v.IsControl == isControlStatusID; }).length > 0) {
  61. $.messager.alert("系统提示", "只能对未控制状态的信息进行控制。");
  62. return;
  63. }
  64. $.messager.confirm("系统提示", "您确定要对选择的信息进行控制(控制登录)?", function (r) {
  65. if (r) {
  66. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ArrearsList/Control', { userIDs: userIDs }, function (data) {
  67. if (data.IsSuccess == true) {
  68. $.messager.alert("系统提示", data.Message);
  69. $("#dgArrearsListList").cmsXDataTable('load');
  70. } else {
  71. $.messager.alert("系统提示", data.Message);
  72. }
  73. });
  74. }
  75. });
  76. }
  77. //设置列颜色为红色
  78. function SetRedColumn(index, row, value) {
  79. return " <span style=\"color: red;\">" + value + "</span>";
  80. }
  81. //设置相应的行颜色为红色
  82. function SetRedGrid(rowIndex, rowData) {
  83. if (rowData.IsArrear == 1) {
  84. return "color: red;";
  85. } else {
  86. return "";
  87. }
  88. }
  89. //Excel导出
  90. function ArrearsList_Export() {
  91. $("#formQuery").submit();
  92. }
  93. //联动查询
  94. function queryStandard(data) {
  95. queryClass();
  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. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  105. queryClass();
  106. reload();
  107. }
  108. function queryClass() {
  109. var jsonString = "";
  110. var parameterString = "";
  111. var campusID = $("#CampusDropdown").combogridX("getValue");
  112. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  113. var educationID = $("#DictionaryEducation").combobox("getValue");
  114. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  115. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  116. var learningFormID = $("#DictionaryLearningform").combobox("getValue");
  117. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  118. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  119. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  120. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  121. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  122. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  123. if (parameterString != "") {
  124. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  125. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  126. } else {
  127. $("#StandardDictionaryDropDown").combogridX("reload");
  128. }
  129. reload();
  130. }