Import.cshtml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. @model EMIS.ViewModel.EducationManage.EducationMissionImportClassView
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Web.Controls.Mvc;
  4. @{
  5. ViewBag.Title = "Import";
  6. }
  7. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  8. @using (Html.BeginForm("Import", "EducationMissionClassScheduleAdult", new { MNU = Request["MNU"], WindowID = Request["WindowID"] }, FormMethod.Post, new { enctype = "multipart/form-data" }))
  9. {
  10. <div class="p_title">
  11. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Import")</div>
  12. </div>
  13. <div class="search_list">
  14. <table cellpadding="0" cellspacing="1">
  15. <tr>
  16. <td>@Html.LabelFor(x=>x.SchoolyearCode)
  17. </td>
  18. <td>
  19. @Html.DropdownListFor(x => x.SchoolyearID, new DropdownListOptions { ItemSourceUrl = "~/SchoolYear/DropDown", TextField = "Text", ValueField = "Value", })
  20. </td>
  21. </tr>
  22. <tr>
  23. <td>
  24. <label>
  25. 导入文件:</label>
  26. </td>
  27. <td>
  28. <input type="file" name="file" accept="*.xls" value=" " />
  29. </td>
  30. </tr>
  31. <tr>
  32. <td colspan="2" style=" text-align: center;">
  33. @*<a id="importExcel" style="color: Red;" href="~/Content/TemplateFile/批量导入教学任务模板.xls" target="_blank">模板下载</a>。*@
  34. <span id="remake" style="display:block;color: Red">注:先进行排课导出,获取模板及信息后再进行导入!</span>
  35. <span id="error" style="display: none; color: red">&nbsp;&nbsp;<a style="color: Red;" href="@ViewBag.ErrorFile" target="_blank">@ViewBag.operationTips </a></span>
  36. </td>
  37. </tr>
  38. </table>
  39. </div>
  40. }
  41. </div>
  42. <script>
  43. //保存数据
  44. function EducationMissionClassScheduleAudlt_ImportSave() {
  45. var nonSelect = "@DropdownList.SELECT_ALL";
  46. var schoolYearID = $("#SchoolyearID").combobox("getValue");
  47. if (schoolYearID == nonSelect) {
  48. $.messager.alert("系统提示", "请选择你要排课的学年学期。");
  49. return;
  50. }
  51. var filepath = $("input[name='file']").val();
  52. if (filepath == "") {
  53. $.messager.alert("系统提示", "请选择你要上传的文件。");
  54. return;
  55. }
  56. $(document.forms[0]).submitWithLoading();
  57. }
  58. $(function () {
  59. var errorFile = '@ViewBag.ErrorFile';
  60. if (errorFile != '') {
  61. $('#error').show();
  62. $('#remake').hide();
  63. }
  64. var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='EducationMissionImport']");
  65. if (customerUrl.attr("value")) {
  66. $("#importExcel").attr("href", customerUrl.attr("value"))
  67. }
  68. });
  69. </script>