ImportScore.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ImportScore/Edit";
  2. var mnu = "";
  3. //加载
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. })
  7. //刷新
  8. function reload() {
  9. $("#dgImportScoreList").cmsXDataTable("load", $.getDataGridParams("dgImportScoreList"));
  10. }
  11. //获取选中的数据
  12. function validChoose() {
  13. var d = [];
  14. $.each($("#dgImportScoreList").cmsXDataTable("getSelections"), function (index) {
  15. d.push(this.ImportScoreID);
  16. });
  17. return d;
  18. }
  19. //Excel导入
  20. function ImportScoreList_Import() {
  21. var url = CMS_SystemConfig.VirtualDirectoryPath + "/ImportScore/Import?MNU=" + mnu;
  22. $.popupTopWindow('平时成绩导入', url, 420, 300, reload);
  23. }
  24. //新增
  25. function ImportScoreList_Add() {
  26. var d = validChoose();
  27. if (d.length > 0) {
  28. $.popupTopWindow('平时成绩复制新增', CMS_SystemConfig.VirtualDirectoryPath + '/ImportScore/CopyAdd?ImportScoreID=' + d[0] + '&MNU=' + mnu, 680, 280, null, null);
  29. } else {
  30. var redirectTo = url + "?MNU=" + mnu;
  31. $.popupTopWindow('平时成绩新增', redirectTo, 680, 280, null, null);
  32. }
  33. }
  34. //修改
  35. function ImportScoreList_Edit() {
  36. var d = validChoose();
  37. if (d.length == 0) {
  38. $.messager.alert("系统信息", "请选择您要修改的信息。");
  39. return;
  40. }
  41. if (d.length > 1) {
  42. $.messager.alert("系统信息", "只能选择单个记录进行修改。");
  43. return;
  44. }
  45. var redirectTo = url + "?ImportScoreID=" + d + "&MNU=" + mnu;
  46. $.popupTopWindow('平时成绩修改', redirectTo, 680, 280, null, null);
  47. }
  48. //删除
  49. function ImportScoreList_Delete() {
  50. var d = validChoose().join(',');
  51. if (d == "") {
  52. $.messager.alert("系统提示", "请选择您要删除的信息。");
  53. return;
  54. }
  55. $.messager.confirm("系统提示", "您确定要删除选择的信息?", function (r) {
  56. if (r) {
  57. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ImportScore/Delete', { importScoreIDs: d }, function (data) {
  58. if (data == "删除成功。") {
  59. $.messager.alert("系统提示", data);
  60. $("#dgImportScoreList").cmsXDataTable('load');
  61. } else {
  62. $.messager.alert("系统提示", data);
  63. }
  64. });
  65. }
  66. });
  67. }
  68. //设置列颜色为红色
  69. function SetRedColumn(index, row, value) {
  70. return " <span style=\"color: red;\">" + value + "</span>";
  71. }
  72. //Excel导出
  73. function ImportScoreList_Export() {
  74. $("#formQuery").submit();
  75. }
  76. //联动查询
  77. function queryStandard(data) {
  78. queryClass();
  79. reload();
  80. }
  81. function queryCollege(data) {
  82. var campusID = $("#CampusDropdown").combogridX("getValue");
  83. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  84. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  85. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  86. $("#CollegeDropdown").combogridX("reload", eval(jsonString));
  87. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  88. queryClass();
  89. reload();
  90. }
  91. function queryClass() {
  92. var jsonString = "";
  93. var parameterString = "";
  94. var campusID = $("#CampusDropdown").combogridX("getValue");
  95. var collegeID = $("#CollegeDropdown").combogridX("getValue");
  96. var educationID = $("#DictionaryEducation").combogridX("getValue");
  97. var schoolYearID = $("#SchoolyearDictionaryDropDown").combobox("getValue");
  98. var standardID = $("#StandardDictionaryDropDown").combogridX("getValue");
  99. var learningFormID = $("#DictionaryLearningform").combogridX("getValue");
  100. if (campusID != nonSelect) parameterString += "CampusDropdown|*|" + campusID + "|@|";
  101. if (collegeID != nonSelect) parameterString += "CollegeDropdown|*|" + collegeID + "|@|";
  102. if (educationID != nonSelect) parameterString += "DictionaryEducation|*|" + educationID + "|@|";
  103. if (schoolYearID != nonSelect) parameterString += "DictionaryGrade|*|" + schoolYearID + "|@|";
  104. if (standardID != nonSelect) parameterString += "DictionaryStandard|*|" + standardID + "|@|";
  105. if (learningFormID != nonSelect) parameterString += "DictionaryLearningform|*|" + learningFormID + "|@|";
  106. if (parameterString != "") {
  107. jsonString = "({'QueryParamsDatas':'" + parameterString + "'})";
  108. $("#StandardDictionaryDropDown").combogridX("reload", eval(jsonString));
  109. } else {
  110. $("#StandardDictionaryDropDown").combogridX("reload");
  111. }
  112. reload();
  113. }