Import.cshtml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. @model EMIS.ViewModel.EducationManage.EducationMissionImportClassView
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Web.Controls.Mvc;
  4. @{
  5. ViewBag.Title = "Import";
  6. }
  7. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  8. @using (Html.BeginForm("Import", "ExaminationPlan", new { MNU = Request["MNU"], WindowID = Request["WindowID"] }, FormMethod.Post, new { enctype = "multipart/form-data" }))
  9. {
  10. @Html.Hidden("QueryParamsDatas")
  11. @Html.Hidden("selectedIDs")
  12. <div class="p_title">
  13. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Import")</div>
  14. </div>
  15. <div class="search_list">
  16. <table cellpadding="0" cellspacing="1">
  17. <tr>
  18. <td>
  19. <label>
  20. 导入文件:</label>
  21. </td>
  22. <td>
  23. <input type="file" name="file" accept="*.xls" value=" " />
  24. </td>
  25. </tr>
  26. <tr>
  27. <td colspan="2" style="text-align: center;">
  28. <span style="color: Red">注:<a id="importExcel" style="color: Red;" href = "javascript:void(0);" onclick ="ExaminationPlan_AdultExcel()">模板下载</a>。</span>
  29. <span id="error" style="display: none; color: red">&nbsp;&nbsp;<a style="color: Red;" href="@ViewBag.ErrorFile" target="_blank">@ViewBag.operationTips </a></span>
  30. </td>
  31. </tr>
  32. </table>
  33. </div>
  34. }
  35. </div>
  36. <script>
  37. var mnu = "";
  38. var windowID;
  39. //保存数据
  40. function ExaminationPlan_AdultImportSave() {
  41. var filepath = $("input[name='file']").val();
  42. if (filepath == "") {
  43. $.messager.alert("系统提示", "请选择你要上传的文件。");
  44. return;
  45. }
  46. //$(document.forms[0]).attr("action", CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationPlan/Import?MNU="+mnu);
  47. $(document.forms[0]).submitWithLoading();
  48. }
  49. $(function () {
  50. windowID = $.SystemGeneral.getUrlParam("WindowID");
  51. mnu = $.SystemGeneral.getUrlParam("MNU");
  52. var errorFile = '@ViewBag.ErrorFile';
  53. if (errorFile != '') {
  54. $('#error').show();
  55. }
  56. });
  57. function GetRequest() {
  58. var url = location.search; //获取url中"?"符后的字串
  59. var theRequest = new Object();
  60. if (url.indexOf("?") != -1) {
  61. var str = url.substr(1);
  62. strs = str.split("&");
  63. for (var i = 0; i < strs.length; i++) {
  64. theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
  65. }
  66. }
  67. return theRequest;
  68. }
  69. function ExaminationPlan_AdultExcel() {
  70. var Request = new Object();
  71. Request = GetRequest();
  72. var Studentselect = top.$("#" + windowID).data("inputData");
  73. $("[name='QueryParamsDatas']").val(Studentselect.QueryParamsDatas);
  74. Studentselect.selectedIDs = Request["selectedIDs"];
  75. $("[name='selectedIDs']").val(Studentselect.selectedIDs);
  76. $(document.forms[0]).attr("action", CMS_SystemConfig.VirtualDirectoryPath + "/ExaminationPlan/AdultImportExcel");
  77. $(document.forms[0]).submit();
  78. }
  79. </script>