EvaluationStaffScore.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationStaffScore/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgEvaluationStaffScoreList").cmsXDataTable("load", $.getDataGridParams("dgEvaluationStaffScoreList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgEvaluationStaffScoreList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.EvaluationStaffScoreID);
  16. });
  17. return d;
  18. }
  19. //查看
  20. function edit(rowindex, rowdata) {
  21. var redirectTo = url + "?evaluationStaffScoreID=" + rowdata.EvaluationStaffScoreID + "&MNU=" + mnu + "&type=detail";
  22. $.popupTopWindow('教师评分信息', redirectTo, 680, 385, null, null);
  23. }
  24. //评分生成
  25. function EvaluationStaffScore_Create() {
  26. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationStaffScore/Create?MNU=" + mnu;
  27. $.popupTopWindow('评分生成', redirectTo, 750, 285, reload);
  28. }
  29. //新增
  30. function EvaluationStaffScore_Add() {
  31. var d = validChoose();
  32. if (d.length > 0) {
  33. $.popupTopWindow('教师评分复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationStaffScore/CopyAdd?evaluationStaffScoreID=' + d[0] + '&MNU=' + mnu, 680, 385, null, null);
  34. }
  35. else {
  36. var redirectTo = url + "?MNU=" + mnu;
  37. $.popupTopWindow('教师评分新增', redirectTo, 680, 385, null, null);
  38. }
  39. }
  40. //修改
  41. function EvaluationStaffScore_Edit() {
  42. var d = validChoose();
  43. if (d.length == 0) {
  44. $.messager.alert("系统信息", "请选择您要修改的信息。");
  45. return;
  46. }
  47. if (d.length > 1) {
  48. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  49. return;
  50. }
  51. var redirectTo = url + "?evaluationStaffScoreID=" + d + "&MNU=" + mnu + "&type=edit";
  52. $.popupTopWindow('教师评分修改', redirectTo, 680, 385, null, null);
  53. }
  54. //删除
  55. function EvaluationStaffScore_Delete() {
  56. var d = validChoose().join(',');
  57. if (d == "") {
  58. $.messager.alert("系统提示", "请选择您要删除的信息。");
  59. return;
  60. }
  61. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  62. if (r) {
  63. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationStaffScore/Delete', { evaluationStaffScoreIDs: d }, function (data) {
  64. if (data.IsSuccess) {
  65. $.messager.alert("系统提示", data.Message);
  66. $("#dgEvaluationStaffScoreList").cmsXDataTable('load');
  67. } else {
  68. $.messager.alert("系统提示", data.Message);
  69. }
  70. });
  71. }
  72. });
  73. }
  74. //设置列颜色为红色
  75. function SetRedColumn(index, row, value) {
  76. return " <span style=\"color: red;\">" + value + "</span>";
  77. }
  78. //导出Excel
  79. function EvaluationStaffScore_Export() {
  80. $("#formQuery").submit();
  81. }
  82. //联动查询
  83. function queryCampus(data) {
  84. var campusID = $("#CampusDropdown").combogridX("getValue");
  85. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  86. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  87. $("#DepartmentDropdown").combogridX("reload", eval(jsonString));
  88. queryStaff();
  89. }
  90. function queryCollege(data) {
  91. var campusID = $("#CampusDropdown").combogridX("getValue");
  92. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  93. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  94. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  95. $("#DepartmentDropdown").combogridX("reload", eval(jsonString));
  96. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  97. queryStaff();
  98. }
  99. function queryDepartment(data) {
  100. var campusID = $("#CampusDropdown").combogridX("getValue");
  101. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  102. var departmentID = $("#DepartmentDropdown").combogridX("getValue"); //combobox
  103. var jsonString = "({'QueryParamsDatas':'DepartmentDropdown|*|" + departmentID + "|@|'})";
  104. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  105. $("#DepartmentDropdown").combogridX("reload", eval(jsonString));
  106. queryStaff();
  107. }
  108. function queryStaff() {
  109. var jsonString = "";
  110. var parameterString = "";
  111. var campusID = $("#CampusDropdown").combogridX("getValue");
  112. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  113. var departmentID = $("#DepartmentDropdown").combogridX("getValue");
  114. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  115. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  116. if (departmentID != nonSelect) parameterString += "DepartmentDropdown|*|" + departmentID + "|@|";
  117. if (parameterString != "") {
  118. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  119. $("#StaffComboGrid").combogridX("reload", eval(jsonString));
  120. }
  121. else {
  122. $("#StaffComboGrid").combogridX("reload");
  123. }
  124. reload();
  125. }