Import.cshtml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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", "ImportScore", 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 ImportScore_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. var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='ImportScoreImport']");
  58. if (customerUrl.attr("value")) {
  59. $("#importExcel").attr("href", customerUrl.attr("value"))
  60. }
  61. });
  62. </script>