NewStudent.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/NewStudent/Edit";
  2. var mnu = "";
  3. //url个性化配置
  4. var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='NewStudentEdit']");
  5. if (customerUrl.attr("value")) {
  6. url = CMS_SystemConfig.VirtualDirectoryPath + customerUrl.attr("value");
  7. }
  8. //加载
  9. $(function () {
  10. mnu = $.SystemGeneral.getUrlParam("MNU");
  11. })
  12. //刷新
  13. function reload() {
  14. $("#dgNewStudentList").cmsXDataTable("load", $.getDataGridParams("dgNewStudentList"));
  15. }
  16. //获取选中的数据
  17. function validChoose() {
  18. var d = [];
  19. $.each($("#dgNewStudentList").cmsXDataTable("getSelections"), function (index) {
  20. d.push(this.NewStudentID);
  21. });
  22. return d;
  23. }
  24. //新增
  25. function NewStudent_Add() {
  26. var d = validChoose();
  27. if (d.length > 0) {
  28. $.popupTopWindow('新生名单复制新增', url + '?newNewStudentID=' + d[0] + '&MNU=' + mnu + '&type=copyAdd', 650, 540, null, null);
  29. } else {
  30. var redirectTo = url + "?MNU=" + mnu + "&type=add";
  31. $.popupTopWindow('新生名单新增', redirectTo, 650, 540, null, null);
  32. }
  33. }
  34. //修改
  35. function NewStudent_Edit() {
  36. var d = validChoose();
  37. if (d == "") {
  38. $.messager.alert("系统提示", "请选择您要修改的信息。");
  39. return;
  40. }
  41. if (d.length > 1) {
  42. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  43. return;
  44. }
  45. var redirectTo = url + "?newNewStudentID=" + d + "&MNU=" + mnu + "&type=edit";
  46. $.popupTopWindow('新生名单修改', redirectTo, 650, 540, null, null);
  47. }
  48. //查看
  49. function detail(rowindex, rowdata) {
  50. var redirectTo = url + "?newNewStudentID=" + rowdata.NewStudentID + "&MNU=" + mnu + "&type=detail";
  51. $.popupTopWindow('新生名单信息', redirectTo, 650, 540, null, null);
  52. }
  53. //删除
  54. function NewStudent_Delete() {
  55. var d = validChoose().join(',');
  56. if (d == "") {
  57. $.messager.alert("系统提示", "请选择您要删除的信息。");
  58. return;
  59. }
  60. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  61. if (r) {
  62. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudent/Delete', { newStudentIDs: d }, function (data) {
  63. if (data.IsSuccess = true) {
  64. $.messager.alert("系统提示", data.Message);
  65. $("#dgNewStudentList").cmsXDataTable('load');
  66. }
  67. else {
  68. $.messager.alert("系统提示", data.Message);
  69. }
  70. });
  71. }
  72. });
  73. }
  74. //删除照片
  75. function NewStudent_PicDelete() {
  76. var d = validChoose().join(',');
  77. if (d == "") {
  78. $.messager.alert("系统提示", "请选择您要删除照片的信息。");
  79. return;
  80. }
  81. $.messager.confirm("系统提示", "您确定要删除选择的信息对应的照片?", function (r) {
  82. if (r) {
  83. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/NewStudent/PicDelete', { newStudentIDs: d }, function (data) {
  84. if (data.IsSuccess) {
  85. $.messager.alert("系统提示", data.Message);
  86. $("#dgNewStudentList").cmsXDataTable('load');
  87. } else {
  88. $.messager.alert("系统提示", data.Message);
  89. }
  90. });
  91. }
  92. });
  93. }
  94. //设置列颜色为红色
  95. function SetRedColumn(index, row, value) {
  96. return " <span style=\"color: red;\">" + value + "</span>";
  97. }
  98. //Excel导出
  99. function NewStudent_Export() {
  100. $("#formQuery").submit();
  101. }
  102. //导入照片(个性化配置,默认照片以考生号或“F”或“Z”+考生号命名)
  103. function NewStudent_PicImport() {
  104. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/NewStudent/PicImport?MNU=' + mnu;
  105. $.popupTopWindow('导入照片', redirectTo, 420, 300, reload);
  106. }
  107. //Excel导入
  108. function NewStudent_Import() {
  109. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + '/NewStudent/Import?MNU=' + mnu;
  110. $.popupTopWindow('新生信息导入', redirectTo, 420, 300, reload);
  111. }
  112. //联动查询
  113. function queryGrade(data) {
  114. reload();
  115. }
  116. function queryStandard(data) {
  117. reload();
  118. }