EvaluationStudentSettingDetail.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationStudentSettingDetail/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgEvaluationStudentSettingDetailList").cmsXDataTable("load", $.getDataGridParams("dgEvaluationStudentSettingDetailList"));
  10. }
  11. //获取选中的数据All
  12. function validChooseAll() {
  13. var d = [];
  14. $.each($("#dgEvaluationStudentSettingDetailList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this);
  16. });
  17. return d;
  18. }
  19. //获取选中的数据
  20. function validChoose() {
  21. var d = [];
  22. $.each($("#dgEvaluationStudentSettingDetailList").cmsXDataTable("getSelections"), function (index) {
  23. d.push(this.UserID);
  24. });
  25. return d;
  26. }
  27. //删除(暂时无效)
  28. function EvaluationStudentSettingDetail_Delete() {
  29. var d = validChoose().join(',');
  30. if (d == "") {
  31. $.messager.alert("系统提示", "请选择您要删除的信息。");
  32. return;
  33. }
  34. var id = validChooseAll();
  35. if ($.grep(id, function (v, i) { return v.OpenState == true; }).length > 0) {
  36. $.messager.alert("系统提示", "只能对未开放状态的信息进行删除。");
  37. return;
  38. }
  39. if ($.grep(id, function (v, i) { return v.IsEvaluation == true; }).length > 0) {
  40. $.messager.alert("系统提示", "只能对未评状态的信息进行删除。");
  41. return;
  42. }
  43. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  44. if (r) {
  45. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationStudentSettingDetail/Delete', { evaluationStudentSettingIDs: d, userIDs: d }, function (data) {
  46. if (data.IsSuccess) {
  47. $.messager.alert("系统提示", data.Message);
  48. $("#dgEvaluationStudentSettingDetailList").cmsXDataTable('load');
  49. } else {
  50. $.messager.alert("系统提示", data.Message);
  51. }
  52. });
  53. }
  54. });
  55. }
  56. //设置列颜色为红色
  57. function SetRedColumn(index, row, value) {
  58. return " <span style=\"color: red;\">" + value + "</span>";
  59. }
  60. //设置相应的行颜色为红色
  61. function SetRedGrid(rowIndex, rowData) {
  62. if (rowData.OpenState != true) {
  63. return "color: red;";
  64. }
  65. else {
  66. return "";
  67. }
  68. }
  69. //导出Excel
  70. function EvaluationStudentSettingDetail_Export() {
  71. $("#formQuery").submit();
  72. }
  73. //联动查询
  74. function queryCampus(data) {
  75. var campusID = $("#CampusDropdown").combogridX("getValue");
  76. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  77. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  78. reload();
  79. }
  80. function queryCollege(data) {
  81. reload();
  82. }
  83. function queryDepartment(data) {
  84. var departmentID = $("#DepartmentDropdown").combogridX("getValue"); //combobox
  85. var jsonString = "({'QueryParamsDatas':'DepartmentDropdown|*|" + departmentID + "|@|'})";
  86. $("#StaffComboGrid").combogridX("reload", eval(jsonString));
  87. reload();
  88. }