StudentPunish.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. //var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/add";
  2. var AuthenizationUrl = CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/Authenization";
  3. var url = CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/Edit";
  4. var CancelUrl = CMS_SystemConfig.VirtualDirectoryPath + "/StudentPunish/Cancel";
  5. var bathval = "";
  6. var mnu;
  7. //联动查询
  8. function queryStandard(data) {
  9. queryClass();
  10. reload();
  11. }
  12. $(function () {
  13. mnu = $.SystemGeneral.getUrlParam("MNU");
  14. })
  15. function queryCollege(data) {
  16. var campusID = $("#CampusDropdown").combogridX("getValue");
  17. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  18. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  19. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  20. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  21. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  22. // if (campusID != nonSelect) {
  23. // var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  24. // $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  25. // }
  26. queryClass();
  27. reload();
  28. }
  29. function queryClass() {
  30. var jsonString = "";
  31. var parameterString = "";
  32. var campusID = $("#CampusDropdown").combogridX("getValue");
  33. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  34. //var educationID = $("#Education").combobox("getValue");
  35. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  36. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  37. //var learningFormID = $("#LearningformDictionaryDropDown").combobox("getValue");
  38. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  39. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  40. //if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  41. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  42. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  43. //if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  44. if (parameterString != "") {
  45. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  46. $("#ClassmajorDropdown").combogridX("reload", eval(jsonString));
  47. } else {
  48. $("#ClassmajorDropdown").combogridX("reload");
  49. }
  50. reload();
  51. }
  52. function reload() {
  53. $("#dgPunishList").cmsXDataTable("load", $.getDataGridParams("dgPunishList"));
  54. }
  55. //新增
  56. function StudentPunish_Add() {
  57. var redirectTo = url + '?MNU=' + mnu;
  58. $.popupTopWindow('学生处分填写', redirectTo, 600, 200, null, null);
  59. }
  60. //获取选中的数据
  61. function validChoose() {
  62. var d = [];
  63. $.each($("#dgPunishList").cmsXDataTable("getSelections"), function (index) {
  64. d.push(this.StudentPunishID);
  65. });
  66. return d;
  67. }
  68. //获取选中撤销日期
  69. function validChooseCancelDate() {
  70. var d = [];
  71. $.each($("#dgPunishList").cmsXDataTable("getSelections"), function (index) {
  72. d.push(this.CancelDate);
  73. });
  74. return d;
  75. }
  76. //获取选中撤销文号
  77. function validChooseCancelNo() {
  78. var d = [];
  79. $.each($("#dgPunishList").cmsXDataTable("getSelections"), function (index) {
  80. d.push(this.CancelNo);
  81. });
  82. return d;
  83. }
  84. //获取选中状态
  85. function validChoosePunishStatus() {
  86. var d = [];
  87. $.each($("#dgPunishList").cmsXDataTable("getSelections"), function (index) {
  88. d.push(this.PunishStatusID);
  89. });
  90. return d;
  91. }
  92. //批量修改
  93. SystemBatchModifyControl.OnSubmit = function (a) {
  94. //处理撤销日期
  95. if (document.getElementById("CancelDateTextBoxDate_div").style.display != "none") {
  96. var StartDate = $("#CancelDate_TextBoxDate").val();
  97. var d = validChooseCancelDate();
  98. for (var i = 0; i < d.length; i++) {
  99. var time = new Date(d[i]);
  100. if (d[i] == null) {
  101. $.messager.alert("系统提示", "只有撤销状态的数据才能执行批量修改撤销日期");
  102. return false;
  103. }
  104. if (d[i].toDateString("yyyy-MM-dd") > StartDate) {
  105. $.messager.alert("系统提示", "撤销日期不能小于处分日期");
  106. return false;
  107. }
  108. }
  109. }
  110. if (document.getElementById("CancelDocNoTextBox_div").style.display != "none") {
  111. var StartDate = $("#CancelDocNo_TextBox").val();
  112. var d = validChooseCancelDate();
  113. for (var i = 0; i < d.length; i++) {
  114. if (d[i] == null) {
  115. $.messager.alert("系统提示", "只有撤销状态的数据才能执行批量修改撤销文号");
  116. return false;
  117. }
  118. }
  119. }
  120. var s = validChoosePunishStatus();
  121. for (var i = 0; i < s.length; i++) {
  122. if (s[i] == 3) {
  123. if (document.getElementById("SchoolyearIDDropdownList_div").style.display != "none") {
  124. $.messager.alert("系统提示", "撤销状态不能批量修改学年学期");
  125. return false;
  126. }
  127. if (document.getElementById("PunishTypeIDDictionaryDropDownList_div").style.display != "none") {
  128. $.messager.alert("系统提示", "撤销状态不能批量修改处分类型");
  129. return false;
  130. }
  131. if (document.getElementById("PunishLevelIDDictionaryDropDownList_div").style.display != "none") {
  132. $.messager.alert("系统提示", "撤销状态不能批量修改处分级别");
  133. return false;
  134. }
  135. if (document.getElementById("ReasonTextBox_div").style.display != "none") {
  136. $.messager.alert("系统提示", "撤销状态不能批量修改处分原因");
  137. return false;
  138. }
  139. if (document.getElementById("DocNoTextBox_div").style.display != "none") {
  140. $.messager.alert("系统提示", "撤销状态不能批量修改处分文号");
  141. return false;
  142. }
  143. if (document.getElementById("PunishDateTextBoxDate_div").style.display != "none") {
  144. $.messager.alert("系统提示", "撤销状态不能批量修改处分日期");
  145. return false;
  146. }
  147. }
  148. }
  149. }
  150. //查看
  151. function Authenization(rowindex, rowdata) {
  152. var redirectTo = AuthenizationUrl;
  153. redirectTo = AuthenizationUrl + '?id=' + rowdata.StudentPunishID;
  154. redirectTo = redirectTo + '&MNU=' + mnu + '&isView=1';
  155. $.popupTopWindow('学生处分查看', redirectTo, 600, 200, null, null);
  156. }
  157. //修改
  158. function StudentPunish_Update() {
  159. var selected = $("#dgPunishList").cmsXDataTable("getSelections");
  160. if (selected.length == 0) {
  161. $.messager.alert("系统提示", "请选择您要修改的处分信息!");
  162. return;
  163. }
  164. if (selected.length > 1) {
  165. $.messager.alert("系统提示", "一次只能修改一条处分信息!");
  166. return;
  167. }
  168. if (selected[0].PunishStatusID != 1) {
  169. $.messager.alert("系统提示", "只能修改待处理的处分信息!");
  170. return;
  171. }
  172. var redirectTo = url;
  173. var a = selected[0].StudentPunishID;
  174. if (a) {
  175. redirectTo = url + '?id=' + a;
  176. }
  177. redirectTo = redirectTo + '&MNU=' + mnu;
  178. $.popupTopWindow('学生处分修改', redirectTo, 600, 200, null, null);
  179. }
  180. //审核
  181. //function StudentPunish_Authenization() {
  182. // var selected = $("#dgList").cmsXDataTable("getSelections");
  183. // if (selected.length == 0) {
  184. // $.messager.alert("系统提示", "请选择您要审核的处分信息!");
  185. // return;
  186. // }
  187. // if (selected.length > 1) {
  188. // $.messager.alert("系统提示", "一次只能审核一条处分信息!");
  189. // return;
  190. // }
  191. // if (selected[0].PunishStatusID != 1) {
  192. // $.messager.alert("系统提示", "只能审核待处理的处分信息!");
  193. // return;
  194. // }
  195. // var redirectTo = AuthenizationUrl;
  196. // var a = selected[0].StudentPunishID;
  197. // if (a) {
  198. // redirectTo = AuthenizationUrl + '?id=' + a;
  199. // }
  200. // redirectTo = redirectTo + '&MNU=' + mnu;
  201. // $.popupTopWindow('学生处分审核', redirectTo, 800, 400, null, null);
  202. //}
  203. //审核
  204. function StudentPunish_Authenization() {
  205. var selected = $("#dgPunishList").cmsXDataTable("getSelections");
  206. if (selected.length == 0) {
  207. $.messager.alert("系统提示", "请选择您要审核的处分信息!");
  208. return;
  209. }
  210. var ids = [];
  211. for (var i = 0; i < selected.length; i++) {
  212. if (selected[i].PunishStatusID != 1) {
  213. $.messager.alert("系统提示", "只能审核待处理的处分信息!");
  214. return;
  215. }
  216. ids.push(selected[i].StudentPunishID);
  217. }
  218. $.messager.confirm("系统提示", "您确定要审核该处分申请信息?", function (r) {
  219. if (r) {
  220. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentPunish/Authenization', { ids: ids.join(',') }, function (data) {
  221. if (data == "审核成功") {
  222. $.messager.alert("系统提示", "审核成功!");
  223. $("#dgPunishList").cmsXDataTable('load');
  224. } else {
  225. $.messager.alert("系统提示", data);
  226. }
  227. });
  228. }
  229. });
  230. }
  231. //删除
  232. function StudentPunish_Delete() {
  233. var selected = $("#dgPunishList").cmsXDataTable("getSelections");
  234. if (selected.length == 0) {
  235. $.messager.alert("系统提示", "请选择您要删除的处分信息!");
  236. return;
  237. }
  238. var ids = [];
  239. for (var i = 0; i < selected.length; i++) {
  240. if (selected[i].PunishStatusID != 1) {
  241. $.messager.alert("系统提示", "只能删除待处理的处分信息!");
  242. return;
  243. }
  244. ids.push(selected[i].StudentPunishID);
  245. }
  246. $.messager.confirm("系统提示", "您确定要删除该处分申请信息?", function (r) {
  247. if (r) {
  248. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/StudentPunish/Delete', { ids: ids.join(',') }, function (data) {
  249. if (data == "删除成功") {
  250. $.messager.alert("系统提示", "删除成功!");
  251. $("#dgPunishList").cmsXDataTable('load');
  252. } else {
  253. $.messager.alert("系统提示", data);
  254. }
  255. });
  256. }
  257. });
  258. }
  259. //导出
  260. function StudentPunish_Export() {
  261. $("#formQuery").submit();
  262. }
  263. //撤销
  264. function StudentPunish_Cancel() {
  265. var selected = $("#dgPunishList").cmsXDataTable("getSelections");
  266. if (selected.length == 0) {
  267. $.messager.alert("系统提示", "请选择您要撤销的处分信息!");
  268. return;
  269. }
  270. if (selected.length > 1) {
  271. $.messager.alert("系统提示", "一次只能撤销一条处分信息!");
  272. return;
  273. }
  274. if (selected[0].PunishStatusID != 2) {
  275. $.messager.alert("系统提示", "只能撤销已审核的处分信息!");
  276. return;
  277. }
  278. var redirectTo = AuthenizationUrl;
  279. var a = selected[0].StudentPunishID;
  280. if (a) {
  281. redirectTo = CancelUrl + '?id=' + a;
  282. }
  283. redirectTo = redirectTo + '&MNU=' + mnu+'&isView=2';;
  284. $.popupTopWindow('学生处分撤销', redirectTo, 600, 200, null, null);
  285. }