Import.cshtml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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", "RecruitSpecialty", 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">模板:
  26. <a id="importExcel" style="color: Red;" href="~/Content/TemplateFile/批量导入招生专业模板.xls" target="_blank">
  27. 点击下载...
  28. </a>
  29. </span>
  30. <span id="error" style="display: none; color:red">
  31. &nbsp;&nbsp;
  32. <a style="color: Red;" href="@ViewBag.ErrorFile" target="_blank">
  33. @ViewBag.operationTips
  34. </a>
  35. </span>
  36. </td>
  37. </tr>
  38. </table>
  39. </div>
  40. }
  41. </div>
  42. <script>
  43. //保存数据
  44. function RecruitSpecialty_ImportSave() {
  45. var filepath = $("input[name='file']").val();
  46. if (filepath == "") {
  47. $.messager.alert("系统提示", "请选择你要导入的Excel文件");
  48. return;
  49. }
  50. $(document.forms[0]).submitWithLoading();
  51. }
  52. $(function () {
  53. var errorFile = '@ViewBag.ErrorFile';
  54. if (errorFile != '') {
  55. $('#error').show();
  56. }
  57. //批量导入招生专业信息模板配置(RecruitSpecialtyImport),Excel表列名相同无需在Site.xml文件中配置
  58. var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='RecruitSpecialtyImport']");
  59. if (customerUrl.attr("value")) {
  60. $("#importExcel").attr("href", customerUrl.attr("value"))
  61. }
  62. });
  63. </script>