EvaluationStudentSetting.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationStudentSetting/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgEvaluationStudentSettingList").cmsXDataTable("load", $.getDataGridParams("dgEvaluationStudentSettingList"));
  10. }
  11. //获取选中的数据All
  12. function validChooseAll() {
  13. var d = [];
  14. $.each($("#dgEvaluationStudentSettingList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this);
  16. });
  17. return d;
  18. }
  19. //获取选中的数据
  20. function validChoose() {
  21. var d = [];
  22. $.each($("#dgEvaluationStudentSettingList").cmsXDataTable("getSelections"), function (index) {
  23. d.push(this.EvaluationStudentSettingID);
  24. });
  25. return d;
  26. }
  27. //查看
  28. function edit(rowindex, rowdata) {
  29. var redirectTo = url + "?evaluationStudentSettingID=" + rowdata.EvaluationStudentSettingID + "&MNU=" + mnu + "&type=detail";
  30. $.popupTopWindow('学评设定信息', redirectTo, 720, 500, null, null);
  31. }
  32. //参评人数明细
  33. function editParticipateCount(rowindex, rowdata) {
  34. var d = [];
  35. d.push(rowdata.EvaluationStudentSettingID);
  36. redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationStudentSetting/EvaluationStudentList?evaluationStudentSettingID=" + rowdata.EvaluationStudentSettingID + "&MNU=" + mnu;
  37. $.popupTopWindow('参评人数明细', redirectTo, 1350, 550, reload, d);
  38. }
  39. //评价生成
  40. function EvaluationStudentSetting_Create() {
  41. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationStudentSetting/Create?MNU=" + mnu;
  42. $.popupTopWindow('评价生成', redirectTo, 750, 325, reload);
  43. }
  44. //新增
  45. function EvaluationStudentSetting_Add() {
  46. //var d = validChoose();
  47. //if (d.length > 0) {
  48. // $.popupTopWindow('学评设定复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationStudentSetting/CopyAdd?evaluationStudentSettingID=' + d[0] + '&MNU=' + mnu, 720, 500, null, null);
  49. //}
  50. //else {
  51. // var redirectTo = url + "?MNU=" + mnu;
  52. // $.popupTopWindow('学评设定新增', redirectTo, 720, 500, null, null);
  53. //}
  54. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationStudentSetting/EvaluationStudentSettingBatchAdd" + "?MNU=" + mnu;
  55. $.popupTopWindow('学评设定新增', redirectTo, 1250, 550, reload, null);
  56. }
  57. //修改
  58. function EvaluationStudentSetting_Edit() {
  59. var d = validChoose();
  60. if (d.length == 0) {
  61. $.messager.alert("系统信息", "请选择您要修改的信息。");
  62. return;
  63. }
  64. if (d.length > 1) {
  65. $.messager.alert("系统提示", "只能选择单个记录进行修改。");
  66. return;
  67. }
  68. var id = validChooseAll();
  69. if ($.grep(id, function (v, i) { return v.OpenState == true; }).length > 0) {
  70. $.messager.alert("系统提示", "只能对未开放状态的信息进行修改。");
  71. return;
  72. }
  73. var redirectTo = url + "?evaluationStudentSettingID=" + d + "&MNU=" + mnu + "&type=edit";
  74. $.popupTopWindow('学评设定修改', redirectTo, 720, 500, null, null);
  75. }
  76. //删除
  77. function EvaluationStudentSetting_Delete() {
  78. var d = validChoose().join(',');
  79. if (d == "") {
  80. $.messager.alert("系统提示", "请选择您要删除的信息。");
  81. return;
  82. }
  83. var id = validChooseAll();
  84. if ($.grep(id, function (v, i) { return v.OpenState == true; }).length > 0) {
  85. $.messager.alert("系统提示", "只能对未开放状态的信息进行删除。");
  86. return;
  87. }
  88. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  89. if (r) {
  90. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationStudentSetting/Delete', { evaluationStudentSettingIDs: d }, function (data) {
  91. if (data.IsSuccess) {
  92. $.messager.alert("系统提示", data.Message);
  93. $("#dgEvaluationStudentSettingList").cmsXDataTable('load');
  94. } else {
  95. $.messager.alert("系统提示", data.Message);
  96. }
  97. });
  98. }
  99. });
  100. }
  101. //学生明细
  102. function EvaluationStudentSetting_Detail() {
  103. var d = validChoose();
  104. if (d.length == 0) {
  105. $.messager.alert("系统信息", "请选择您要修改学生的信息。");
  106. return;
  107. }
  108. if (d.length > 1) {
  109. $.messager.alert("系统提示", "只能选择单个记录进行修改学生。");
  110. return;
  111. }
  112. var redirectTo = CMS_SystemConfig.VirtualDirectoryPath + "/EvaluationStudentSetting/EvaluationStudentList?evaluationStudentSettingID=" + d + "&MNU=" + mnu;
  113. $.popupTopWindow('学生明细', redirectTo, 1350, 550, reload, d);
  114. }
  115. //取消
  116. function EvaluationStudentSetting_Cancel() {
  117. var d = validChoose().join(',');
  118. if (d == "") {
  119. $.messager.alert("系统提示", "请选择您要取消评价的信息。");
  120. return;
  121. }
  122. var id = validChooseAll();
  123. if ($.grep(id, function (v, i) { return v.OpenState != true; }).length > 0) {
  124. $.messager.alert("系统提示", "只能对已开放状态的信息进行取消。");
  125. return;
  126. }
  127. $.messager.confirm("系统提示", "您确定要对选择的信息进行取消评价?", function (r) {
  128. if (r) {
  129. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationStudentSetting/Cancel', { evaluationStudentSettingIDs: d }, function (data) {
  130. if (data.IsSuccess = true) {
  131. $.messager.alert("系统提示", data.Message);
  132. $("#dgEvaluationStudentSettingList").cmsXDataTable('load');
  133. }
  134. else {
  135. $.messager.alert("系统提示", data.Message);
  136. }
  137. });
  138. }
  139. });
  140. }
  141. //开放
  142. function EvaluationStudentSetting_Open() {
  143. var d = validChoose().join(',');
  144. if (d == "") {
  145. $.messager.alert("系统提示", "请选择您要开放评价的信息。");
  146. return;
  147. }
  148. var id = validChooseAll();
  149. if ($.grep(id, function (v, i) { return v.OpenState == true; }).length > 0) {
  150. $.messager.alert("系统提示", "只能对未开放状态的信息进行开放。");
  151. return;
  152. }
  153. $.messager.confirm("系统提示", "您确定要对选择的信息进行开放评价?", function (r) {
  154. if (r) {
  155. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/EvaluationStudentSetting/Open', { evaluationStudentSettingIDs: d }, function (data) {
  156. if (data.IsSuccess = true) {
  157. $.messager.alert("系统提示", data.Message);
  158. $("#dgEvaluationStudentSettingList").cmsXDataTable('load');
  159. }
  160. else {
  161. $.messager.alert("系统提示", data.Message);
  162. }
  163. });
  164. }
  165. });
  166. }
  167. //设置列颜色为红色
  168. function SetRedColumn(index, row, value) {
  169. return " <span style=\"color: red;\">" + value + "</span>";
  170. }
  171. //设置列颜色为红色(预警)
  172. function SetRedWarningColumn(index, row, value) {
  173. if (value > 0) {
  174. return " <span style=\"color: red;\">" + value + "</span>";
  175. } else {
  176. return " <span>" + value + "</span>";
  177. }
  178. }
  179. //设置相应的行颜色为红色
  180. function SetRedGrid(rowIndex, rowData) {
  181. if (rowData.OpenState != true) {
  182. return "color: red;";
  183. }
  184. else {
  185. return "";
  186. }
  187. }
  188. //导出Excel
  189. function EvaluationStudentSetting_Export() {
  190. $("#formQuery").submit();
  191. }
  192. //联动查询
  193. function queryCampus(data) {
  194. var campusID = $("#CampusDropdown").combogridX("getValue");
  195. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|'})";
  196. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  197. reload();
  198. }
  199. function queryCollege(data) {
  200. reload();
  201. }
  202. function queryDepartment(data) {
  203. var departmentID = $("#DepartmentDropdown").combogridX("getValue"); //combobox
  204. var jsonString = "({'QueryParamsDatas':'DepartmentDropdown|*|" + departmentID + "|@|'})";
  205. $("#StaffComboGrid").combogridX("reload", eval(jsonString));
  206. reload();
  207. }