ExaminationTeacher.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. function ExaminationTeacher_Export() {
  2. $(document.forms[0]).submit();
  3. }
  4. var mnu = "";
  5. //加载
  6. $(function () {
  7. mnu = $.SystemGeneral.getUrlParam("MNU");
  8. })
  9. function ExaminationTeacher_Add() {
  10. $.popupTopWindow('监考员信息', CMS_SystemConfig.VirtualDirectoryPath + '/Common/TeacherSelect?FromMNU=' + mnu, 900, 500, TeacherSelect_Close, null);
  11. }
  12. function TeacherSelect_Close(teacherList) {
  13. if (!teacherList) return;
  14. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationTeacher/Add', { userIDs: $.map(teacherList, function (x) { return x.UserID; }).join(',') }, function (data) {
  15. if (data == "添加成功") {
  16. $.messager.alert("系统提示", "添加成功!");
  17. $("#dgExaminationTeacherList").cmsXDataTable('load');
  18. } else {
  19. $.messager.alert("系统提示", data);
  20. }
  21. });
  22. }
  23. function reload() {
  24. $("#dgExaminationTeacherList").cmsXDataTable("load", $.getDataGridParams("dgExaminationTeacherList"));
  25. }
  26. //获取选中的数据
  27. function validChoose() {
  28. var d = [];
  29. $.each($("#dgExaminationTeacherList").cmsXDataTable("getSelections"), function (index) {
  30. d.push(this.UserID);
  31. });
  32. return d;
  33. }
  34. //删除
  35. function ExaminationTeacher_Delete() {
  36. var d = validChoose().join(',');
  37. if (d == "") {
  38. $.messager.alert("系统提示", "请选择您要删除的监考员。");
  39. return;
  40. }
  41. $.messager.confirm("系统提示", "您确定要删除该监考员?", function (r) {
  42. if (r) {
  43. $.post(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationTeacher/Delete', { userIDs: d }, function (data) {
  44. if (data == "删除成功") {
  45. $.messager.alert("系统提示", "删除成功!");
  46. $("#dgExaminationTeacherList").cmsXDataTable('load');
  47. } else {
  48. $.messager.alert("系统提示", data);
  49. }
  50. });
  51. }
  52. });
  53. }
  54. function QueryCampusDropdownList(data) {
  55. $("#CollegeDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/College/CollegeDropdownListBanid?campusID=" + data.Value + "");
  56. reload();
  57. }
  58. function QueryCollegeDropdownList(data) {
  59. $("#DepartmentDropdown").combobox("reload", CMS_SystemConfig.VirtualDirectoryPath + "/Department/DepartmentDropdownListBanid?collegeID=" + data.Value + "");
  60. reload();
  61. }
  62. function QueryDepartmentDropdownList(data) {
  63. reload();
  64. }
  65. function QueryPhotoUrltmentDropdownList(data) {
  66. reload();
  67. }