Import.cshtml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. @using EMIS.Web.Controls;
  2. @using Bowin.Web.Controls.Mvc;
  3. @{
  4. ViewBag.Title = "批量导入辅修课程";
  5. }
  6. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  7. @using (Html.BeginForm("Import", "MinorSpecialtyCourse", 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 id="importExcel" style="color: Red;" href="~/Content/TemplateFile/批量导入辅修课程模板.xlsx" 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 MinorSpecialtyCourse_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. var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='MinorSpecialtyCourse']");
  49. if (customerUrl.attr("value")) {
  50. $("#importExcel").attr("href", customerUrl.attr("value"))
  51. }
  52. });
  53. </script>