Import.cshtml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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", "Student", 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. 注:更新学生信息时,班级信息、在校状态、学籍状态不会更改,如需更改请使用异动功能。
  27. </span>
  28. </td>
  29. </tr>
  30. <tr>
  31. <td colspan="2" style="text-align: center;">
  32. <span style="color: Red;font-weight:bolder;">模板:
  33. <a id="importExcel" style="color: Red;" href="~/Content/TemplateFile/批量导入学生信息模板.xls" target="_blank">
  34. 点击下载...
  35. </a>
  36. </span>
  37. <span id="error" style="display: none; color:red">
  38. &nbsp;&nbsp;
  39. <a style="color: Red;" href="@ViewBag.ErrorFile" target="_blank">
  40. @ViewBag.operationTips
  41. </a>
  42. </span>
  43. </td>
  44. </tr>
  45. </table>
  46. </div>
  47. }
  48. </div>
  49. <script>
  50. //保存数据
  51. function Student_ImportSave() {
  52. var filepath = $("input[name='file']").val();
  53. if (filepath == "") {
  54. $.messager.alert("系统提示", "请选择你要导入的Excel文件");
  55. return;
  56. }
  57. //加载中。。。
  58. $(document.forms[0]).submitWithLoading();
  59. }
  60. $(function () {
  61. var errorFile = '@ViewBag.ErrorFile';
  62. if (errorFile != '') {
  63. $('#error').show();
  64. }
  65. //批量导入学生信息模板配置(StudentImport),Excel表列名相同无需在Site.xml文件中配置
  66. var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='StudentImport']");
  67. if (customerUrl.attr("value")) {
  68. $("#importExcel").attr("href", customerUrl.attr("value"))
  69. }
  70. });
  71. </script>