Import.cshtml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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", "CustomStandardSetting", new
  8. {
  9. MNU = Request["MNU"],
  10. WindowID = Request["WindowID"]
  11. },
  12. FormMethod.Post, new { enctype = "multipart/form-data" }))
  13. {
  14. <div class="p_title">
  15. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Import")</div>
  16. </div>
  17. <div class="search_list">
  18. <table cellpadding="0" cellspacing="1">
  19. <tr>
  20. <td>
  21. <label>
  22. 文件:</label>
  23. </td>
  24. <td>
  25. <input type="file" name="file" accept="*.xls" value="" />
  26. </td>
  27. </tr>
  28. <tr>
  29. <td colspan="2" style="text-align: center;">
  30. <span style="color: Red">模板:
  31. <a id="importExcel" style="color: Red;" href="~/Content/TemplateFile/批量导入省招专业模板.xls" target="_blank">
  32. 点击下载...
  33. </a>
  34. </span>
  35. <span id="error" style="display: none; color:red">
  36. &nbsp;&nbsp;
  37. <a style="color: Red;" href="@ViewBag.ErrorFile" target="_blank">
  38. @ViewBag.operationTips
  39. </a>
  40. </span>
  41. </td>
  42. </tr>
  43. </table>
  44. </div>
  45. }
  46. </div>
  47. <script>
  48. //保存数据
  49. function CustomStandardSetting_EditImport() {
  50. var filepath = $("input[name='file']").val();
  51. if (filepath == "") {
  52. $.messager.alert("系统提示", "请选择你要导入的Excel文件");
  53. return;
  54. }
  55. //加载中。。。
  56. $(document.forms[0]).submitWithLoading();
  57. }
  58. $(function () {
  59. var errorFile = '@ViewBag.ErrorFile';
  60. if (errorFile != '') {
  61. $('#error').show();
  62. }
  63. //批量导入省招专业模板配置(CustomStandardSettingImport),Excel表列名相同无需在Site.xml文件中配置
  64. var customerUrl = $(CMS_SystemConfig.GetConfig()).find("configuration>customUrls>add[key='CustomStandardSettingImport']");
  65. if (customerUrl.attr("value")) {
  66. $("#importExcel").attr("href", customerUrl.attr("value"))
  67. }
  68. });
  69. </script>