SupEvaluationList.js 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. var mnu;
  2. var WindowID;
  3. $(function () {
  4. mnu = $.SystemGeneral.getUrlParam("MNU");
  5. WindowID = $.SystemGeneral.getUrlParam("WindowID");
  6. });
  7. //获取选中的数据
  8. function validChooseLessonRecordID() {
  9. var d = [];
  10. $.each($("#dgSupEvaluationList").cmsXDataTable("getSelections"), function (index) {
  11. if (this.LessonRecordID!=null) {
  12. d.push(this.LessonRecordID);
  13. }
  14. });
  15. return d;
  16. }
  17. //获取选中的数据
  18. function validChooseProjectRecordID() {
  19. var d = [];
  20. $.each($("#dgSupEvaluationList").cmsXDataTable("getSelections"), function (index) {
  21. if (this.ProjectRecordID != null) {
  22. d.push(this.ProjectRecordID);
  23. }
  24. });
  25. return d;
  26. }
  27. //导出Excel
  28. function SupEvaluation_Export() {
  29. var d = validChooseLessonRecordID().join(',');
  30. var p = validChooseProjectRecordID().join(',');
  31. if (d != "") {
  32. document.getElementById("LessonRecordIDs").value = d;
  33. }
  34. else {
  35. document.getElementById("LessonRecordIDs").value = "";
  36. }
  37. if (p != "") {
  38. document.getElementById("ProjectRecordIDs").value = d;
  39. }
  40. else {
  41. document.getElementById("ProjectRecordIDs").value = "";
  42. }
  43. $("#formQuery").attr("action", CMS_SystemConfig.VirtualDirectoryPath + "/SupEvaluation/Excel");
  44. $("#formQuery").submit();
  45. }
  46. //获取列表字段查询对应比较符
  47. function GetDynamicCondition() {
  48. var reg = "/(^/s*)|(/s*$)/g";
  49. var attribute = eval('(' + $("[name='Attribute']").val() + ')').Value;
  50. var conditionString = $("[name='Condition']").val();
  51. var value = $("[name='Condition']").parent().parent().next().find("[name^=" + attribute + "]").val();
  52. value = $.trim(value);
  53. var sql = "";
  54. if (conditionString == "=" || conditionString == ">" || conditionString == "<" || conditionString == "<>") {
  55. sql = attribute + conditionString + value;
  56. } else if (conditionString == "左") {
  57. sql = attribute + " like '" + value + "%'";
  58. } else if (conditionString == "右") {
  59. sql = attribute + " like '%" + value + "'";
  60. } else if (conditionString == "中") {
  61. sql = attribute + " like '%" + value + "%'";
  62. }
  63. return sql;
  64. }
  65. function SupEvaluation_Report() {
  66. var lid = validChooseLessonRecordID().join(',');
  67. var pid = validChooseProjectRecordID().join(',');
  68. var ids = lid + "," + pid;
  69. var sql = GetDynamicCondition();
  70. var collegeID = $("#DDCollegeDropdown").combogridX("getValue");
  71. var schoolyearID = $("#SchoolyearDropdown").combobox("getValue");
  72. var starDate = document.getElementById("txtStartDate").value;
  73. var endDate = document.getElementById("txtEndDate").value;
  74. var supervisionType = $("#SupervisionType").combobox("getValue");
  75. var conditionString = sql;
  76. $.popupTopWindow('督导评价报表', CMS_SystemConfig.VirtualDirectoryPath + '/SupEvaluation/SupEvaluationReport?MNU=' + mnu, 900, 650, null, {
  77. CollegeID: collegeID,
  78. StarDate: starDate,
  79. EndDate: endDate,
  80. SchoolyearID: schoolyearID,
  81. SupervisionType: supervisionType,
  82. ConditionString: conditionString,
  83. Ids: ids
  84. });
  85. }
  86. function reload() {
  87. $("#dgSupEvaluationList").cmsXDataTable("load", $.getDataGridParams("dgSupEvaluationList"));
  88. }