StudentImport.cshtml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. @model EMIS.ViewModel.ExcelImportResult
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Common.JSON;
  4. @using Bowin.Web.Controls.Mvc;
  5. @{
  6. ViewBag.Title = "Import";
  7. }
  8. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  9. @using (Html.BeginForm("Import", "Score", FormMethod.Post, new { enctype = "multipart/form-data" }))
  10. {
  11. @Html.Hidden("importData", Model.Data.ToJson())
  12. <div class="p_title">
  13. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  14. 学生导入
  15. </div>
  16. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("StudentImport")</div>
  17. </div>
  18. <div class="search_list">
  19. <table cellpadding="0" cellspacing="1">
  20. <tr>
  21. <td>
  22. <label>
  23. 导入文件:
  24. </label>
  25. </td>
  26. <td>
  27. <input type="file" name="file" id="file" accept="*.xls" value=" " />
  28. </td>
  29. </tr>
  30. <tr>
  31. <td colspan="2" style="text-align: center;">
  32. <span style="color: Red">注:<a style="color: Red;" href="~/Content/TemplateFile/报考名单学生导入模板.xls" target="_blank">模板下载</a>。</span>
  33. <span id="error" style="display: none;color:red">&nbsp;&nbsp;<a id="errorExcel" style="color: Red;" href="@ViewBag.ErrorFile" target="_blank">@ViewBag.operationTips </a></span>
  34. @*<span id="error" style="@(Model.IsAllSuccess ? "display: none; " : "")color: red">&nbsp;&nbsp;<a style="color: Red;" href="@Model.ErrorFilePath" target="_blank">@Model.Message</a></span>*@
  35. </td>
  36. </tr>
  37. </table>
  38. </div>
  39. }
  40. </div>
  41. @section scripts{
  42. <script src="~/Scripts/Business/ExaminationApply/StudentImport.js" type="text/javascript"></script>
  43. @if (Model.IsAllSuccess && Model.Data != null)
  44. {
  45. <script type="text/javascript">
  46. (function ($) {
  47. $.messager.alert("系统提示", "导入成功。");
  48. top.$("#@Request["WindowID"]").data("resultData", eval("(" + $("[name='importData']").val() + ")"));
  49. top.$("#@Request["WindowID"]").dialog("close");
  50. })(jQuery);
  51. </script>
  52. }
  53. else if(!Model.IsAllSuccess && Model.Data != null)
  54. {
  55. <script type="text/javascript">
  56. (function ($) {
  57. $.messager.alert("系统提示", "导入失败。");
  58. $("#errorExcel").attr("href", "@Model.ErrorFilePath");
  59. $("#errorExcel").text("@Model.Message");
  60. top.$("#@Request["WindowID"]").data("resultData", eval("(" + $("[name='importData']").val() + ")"));
  61. })(jQuery);
  62. </script>
  63. }
  64. }