ExaminationScoreImport.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. var mnu = "";
  2. var windowID = "";
  3. //保存数据
  4. $(function () {
  5. mnu = $.SystemGeneral.getUrlParam("MNU");
  6. windowID = $.SystemGeneral.getUrlParam("WindowID");
  7. var errorFile = '@ViewBag.ErrorFile';
  8. if (errorFile != '') {
  9. $('#error').show();
  10. }
  11. });
  12. function ExaminationScore_ImportSave() {
  13. var filepath = $("input[name='file']").val();
  14. if (filepath == "") {
  15. $.messager.alert("系统提示", "请选择你要导入的Excel文件");
  16. return;
  17. }
  18. var schoolyearID = $("#ddlSchoolyear").combobox('getValue');
  19. var examinationBatchID = $("#ddlExaminationBatch").combobox('getValue');
  20. var examinationTypeID = $("#ddlExaminationType").combobox('getValue');
  21. var examinationProjectID = $("#ddlExaminationProject").combobox('getValue');
  22. if (schoolyearID == nonSelect || examinationBatchID == nonSelect || examinationTypeID == nonSelect || examinationProjectID == nonSelect) {
  23. $.messager.alert("系统提示", "请选择需要导入模板对应的项目");
  24. return;
  25. } else {
  26. //加载中。。。
  27. //$(document.forms[0]).attr("action", "Import?MNU=" + mnu + "&WindowID=" + windowID + "&schoolyearID=" + schoolyearID + "&examinationBatchID=" + examinationBatchID + "&examinationTypeID=" + examinationTypeID + "&examinationProjectID=" + examinationProjectID);
  28. $(document.forms[0]).submitWithLoading();
  29. //$(document.forms[0]).attr("action", "GetTemplateByProject?schoolyearID=" + schoolyearID + "&examinationBatchID=" + examinationBatchID + "&examinationTypeID=" + examinationTypeID + "&examinationProjectID=" + examinationProjectID);
  30. //$(document.forms[0]).submit();
  31. }
  32. }
  33. function ExaminationScore_TemplateExport() {
  34. var schoolyearID = $("#ddlSchoolyear").combobox('getValue');
  35. var examinationBatchID = $("#ddlExaminationBatch").combobox('getValue');
  36. var examinationTypeID = $("#ddlExaminationType").combobox('getValue');
  37. var examinationProjectID = $("#ddlExaminationProject").combobox('getValue');
  38. //$.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationScore/GetTemplateByProject', { schoolyearID: schoolyearID,
  39. // examinationBatchID: examinationBatchID, examinationTypeID: examinationTypeID, examinationProjectID: examinationProjectID
  40. //},function (data) {
  41. // if (data.IsSuccess) {
  42. // $.messager.alert("系统提示", data.Message);
  43. // } else {
  44. // $.messager.alert("系统提示", data.Message);
  45. // }
  46. //});
  47. if (schoolyearID == nonSelect || examinationBatchID == nonSelect || examinationTypeID == nonSelect || examinationProjectID == nonSelect) {
  48. $.messager.alert("系统提示", "请选择需要导出模板的项目");
  49. return;
  50. } else {
  51. $(document.forms[0]).attr("action", "GetTemplateByProject?MNU=" + mnu + "&schoolyearID=" + schoolyearID + "&examinationBatchID=" + examinationBatchID + "&examinationTypeID=" + examinationTypeID + "&examinationProjectID=" + examinationProjectID);
  52. $(document.forms[0]).submit();
  53. }
  54. }
  55. function schoolyearChange() {
  56. try {
  57. var examinationBatchUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExaminationBatch/DropDownList?bindType=0';
  58. var schoolyearID = $("#ddlSchoolyear").combobox('getValue');
  59. if (schoolyearID != nonSelect) {
  60. examinationBatchUrl += "&schoolyearID=" + schoolyearID;
  61. }
  62. $("#ddlExaminationBatch").combobox('reload', examinationBatchUrl);
  63. reload();
  64. } catch (e) {
  65. }
  66. }
  67. function examinationBatchChange() {
  68. try {
  69. var examinationTypeUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExamBatchProject/TypeDropDownList?bindType=0';
  70. var examinationBatchID = $("#ddlExaminationBatch").combobox('getValue');
  71. if (examinationBatchID != nonSelect) {
  72. examinationTypeUrl += "&examinationBatchID=" + examinationBatchID;
  73. }
  74. $("#ddlExaminationType").combobox('reload', examinationTypeUrl);
  75. reload();
  76. } catch (e) {
  77. }
  78. }
  79. function examinationTypeChange() {
  80. try {
  81. var examinationProjectUrl = CMS_SystemConfig.VirtualDirectoryPath + '/ExamBatchProject/DropDownList?bindType=0';
  82. var examinationBatchID = $("#ddlExaminationBatch").combobox('getValue');
  83. var examinationTypeID = $("#ddlExaminationType").combobox('getValue');
  84. if (examinationBatchID != nonSelect) {
  85. examinationProjectUrl += "&examinationBatchID=" + examinationBatchID;
  86. }
  87. if (examinationTypeID != nonSelect) {
  88. examinationProjectUrl += "&examinationTypeID=" + examinationTypeID;
  89. }
  90. $("#ddlExaminationProject").combobox('reload', examinationProjectUrl);
  91. reload();
  92. } catch (e) {
  93. }
  94. }