Import.cshtml 2.5 KB

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