Import.cshtml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Import")</div>
  11. </div>
  12. <div class="search_list">
  13. <table cellpadding="0" cellspacing="1">
  14. <tr>
  15. <td>
  16. <label>
  17. 导入文件:</label>
  18. </td>
  19. <td>
  20. <input type="file" name="file" accept="*.xls" value=" " />
  21. </td>
  22. </tr>
  23. <tr>
  24. <td colspan="2" style="text-align: center;">
  25. @* <span style="color: Red">注:<a style="color: Red;" href="~/Content/TemplateFile/入库信息导入模板.xls" target="_blank">模板下载</a>。</span>*@
  26. @* <span id="error" style="display: none;">&nbsp;&nbsp;<a href="@ViewBag.ErrorFile" target="_blank">错误数据下载</a></span>*@
  27. </td>
  28. </tr>
  29. </table>
  30. </div>
  31. }
  32. </div>
  33. <script>
  34. function StockIn_EditImport() {
  35. var filepath = $("input[name='file']").val();
  36. if (filepath == "") {
  37. $.messager.alert("系统提示", "请选择你要上传的文件。");
  38. return;
  39. }
  40. $(document.forms[0]).submit();
  41. }
  42. $(function () {
  43. var errorFile = '@ViewBag.ErrorFile';
  44. if (errorFile != '') {
  45. $('#error').show();
  46. }
  47. });
  48. </script>