User.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/User/Edit";
  2. var bathval = "";
  3. var mnu;
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. });
  7. function User_Export() {
  8. $(document.forms[0]).submit();
  9. }
  10. function reload() {
  11. $("#dgUserList").cmsXDataTable("load", $.getDataGridParams("dgUserList"));
  12. }
  13. //获取选中的数据
  14. function validChoose() {
  15. var d = [];
  16. $.each($("#dgUserList").cmsXDataTable("getSelections"), function (index) {
  17. d.push(this.UserID);
  18. });
  19. return d;
  20. }
  21. //修改角色
  22. function User_ModifyRole() {
  23. var d = validChoose();
  24. if (d.length == 0) {
  25. $.messager.alert("系统提示", "请选择您要修改角色的用户信息。");
  26. return;
  27. }
  28. if (d.length > 1) {
  29. $.messager.alert("系统提示", "只能选择单个用户进行修改角色。");
  30. return;
  31. }
  32. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/User/ModifyRole?UserID=' + d + '&MNU=' + mnu;
  33. $.popupTopWindow('修改角色', redirectTo, 650, 350, null, null);
  34. }
  35. //数据范围设置
  36. function User_DataRange() {
  37. var d = validChoose();
  38. if (d.length == 0) {
  39. $.messager.alert("系统提示", "请选择您要设置的用户信息。");
  40. return;
  41. }
  42. if (d.length > 1) {
  43. $.messager.alert("系统提示", "只能选择单个记录进行设置。");
  44. return;
  45. }
  46. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/User/DataRange?UserID=' + d + '&MNU=' + mnu;
  47. $.popupTopWindow('数据范围设置', redirectTo, 650, 500, null, null);
  48. }
  49. //修改密码
  50. function User_BatchInitPassword() {
  51. var d = validChoose().join(',');
  52. if (d == "") {
  53. $.messager.alert("系统提示", "请选择您要修改密码的用户。");
  54. return;
  55. }
  56. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/User/BatchInitPassword?userID=+' + d + '&type=0&MNU=' + mnu + '&isView=1';
  57. $.popupTopWindow('修改密码', redirectTo, 450, 200, null, null);
  58. }
  59. //密码规则
  60. function User_BatchSetPassword() {
  61. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/User/BatchInitPassword?userID=staff&type=0&MNU=' + mnu + '&isView=2';
  62. $.popupTopWindow('密码规则', redirectTo, 450, 200, null, null);
  63. }
  64. //启用
  65. function User_USABLE() {
  66. var d = validChoose().join(',');
  67. if (d == "") {
  68. $.messager.alert("系统提示", "请选择您要启用的用户。");
  69. return;
  70. }
  71. $.messager.confirm("系统提示", "您确定对选择的用户启用?", function (r) {
  72. if (r) {
  73. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/User/Usable', { userIDList: d }, function (data) {
  74. $.messager.alert("系统提示", data.Message, 'info', function () {
  75. if (data.IsSuccess) {
  76. $("#dgUserList").cmsXDataTable('load');
  77. }
  78. });
  79. });
  80. }
  81. });
  82. }
  83. //禁用
  84. function User_UNUSABLE() {
  85. var d = validChoose().join(',');
  86. if (d == "") {
  87. $.messager.alert("系统提示", "请选择您要禁用的用户。");
  88. return;
  89. }
  90. $.messager.confirm("系统提示", "您确定对选择的用户禁用?", function (r) {
  91. if (r) {
  92. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/User/UnUsable', { userIDList: d }, function (data) {
  93. $.messager.alert("系统提示", data.Message, 'info', function () {
  94. if (data.IsSuccess) {
  95. $("#dgUserList").cmsXDataTable('load');
  96. }
  97. });
  98. });
  99. }
  100. });
  101. }
  102. function QueryCampusDropdownList(data) {
  103. //$("#CollegeDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/College/CollegeDropdownListBanid?campusID=" + data.Value + "");
  104. var campusID = $("#CampusDropdown").combogridX("getValue");
  105. if (campusID != nonSelect) {
  106. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  107. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  108. }
  109. reload();
  110. }
  111. function QueryCollegeDropdownList(data) {
  112. //$("#DepartmentDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/Department/DepartmentDropdownListBanid?collegeID=" + data.Value + "");
  113. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  114. if (collegeID != nonSelect) {
  115. var jsonString = "({'QueryParamsDatas':'CollegeDropdown|*|" + collegeID + "|@|'})";
  116. $("#DepartmentDropdown").combogridX("reload", eval(jsonString));
  117. }
  118. reload();
  119. }
  120. function QueryCollegeDropdownListLoad(data) {
  121. if (data.length > 0 && $("#DepartmentDropdown").length > 0 && $.data($("#DepartmentDropdown")[0], "combobox")) {
  122. $("#DepartmentDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/Department/DepartmentDropdownListBanid?collegeID=" + data[0].Value + "");
  123. }
  124. }
  125. function QueryDepartmentDropdownList(data) {
  126. reload();
  127. }
  128. function QueryDepartmentDropdownListLoad(data) {
  129. if (data.length > 0 && $("#dgUserList").length > 0 && $.data($("#dgUserList")[0], "cmsXDataTable")) {
  130. reload();
  131. }
  132. }