Import.cshtml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. @using EMIS.Web.Controls;
  2. @using Bowin.Web.Controls.Mvc;
  3. @{
  4. ViewBag.Title = "Import";
  5. }
  6. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  7. @using (Html.BeginForm("Import", "Students", new { MNU = Request["MNU"], WindowID = Request["WindowID"] }, FormMethod.Post, new { enctype = "multipart/form-data" }))
  8. {
  9. <div class="p_title">
  10. <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  11. 学生信息导入</div>
  12. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Import")</div>
  13. </div>
  14. <div class="search_list">
  15. <table cellpadding="0" cellspacing="1">
  16. <tr>
  17. <td>
  18. <label>
  19. 导入文件:</label>
  20. </td>
  21. <td>
  22. <input type="file" name="file" accept="*.xls" value=" " />
  23. </td>
  24. </tr>
  25. <tr>
  26. <td colspan="2">
  27. <span style="color: Red">注:如果使用导入功能用来更新学生信息,学生的班级不会更改,如需更改请使用异动功能!</span>
  28. </td>
  29. </tr>
  30. <tr>
  31. <td colspan="2" style="text-align: center;">
  32. <span style="color: Red">注:<a id="importExcel" style="color: Red;" href="~/Content/TemplateFile/批量导入学生信息模板.xls" target="_blank">模板下载</a>。</span>
  33. <span id="error" style="display: none;">&nbsp;&nbsp;<a href="@ViewBag.ErrorFile" target="_blank">错误数据下载</a></span>
  34. </td>
  35. </tr>
  36. </table>
  37. </div>
  38. }
  39. </div>
  40. <script>
  41. function Student_EditImport() {
  42. var filepath = $("input[name='file']").val();
  43. if (filepath == "") {
  44. $.messager.alert("系统提示", "请选择你要上传的文件。");
  45. return;
  46. }
  47. $(document.forms[0]).submitWithLoading();
  48. }
  49. $(function () {
  50. var errorFile = '@ViewBag.ErrorFile';
  51. if (errorFile != '') {
  52. $('#error').show();
  53. }
  54. var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='StudentsImport']");
  55. if (customerUrl.attr("value")) {
  56. $("#importExcel").attr("href", customerUrl.attr("value"))
  57. }
  58. });
  59. </script>