Import.cshtml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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", "Publisher", 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; color:red">&nbsp;&nbsp;<a style="color: Red;" href="@ViewBag.ErrorFile" target="_blank">@ViewBag.operationTips</a></span>
  27. </td>
  28. </tr>
  29. </table>
  30. </div>
  31. }
  32. </div>
  33. <script>
  34. //保存数据
  35. function Publish_ImportSave() {
  36. var filepath = $("input[name='file']").val();
  37. if (filepath == "") {
  38. $.messager.alert("系统提示", "请选择你要上传的文件。");
  39. return;
  40. }
  41. $(document.forms[0]).submit();
  42. }
  43. $(function () {
  44. var errorFile = '@ViewBag.ErrorFile';
  45. if (errorFile != '') {
  46. $('#error').show();
  47. }
  48. });
  49. </script>