imeiImport.jsp 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <%@ page contentType="text/html;charset=UTF-8"%>
  2. <%@ include file="/WEB-INF/include/taglibs.jsp"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title></title>
  7. <%@ include file="/WEB-INF/include/common.jsp"%>
  8. <script type="text/javascript">
  9. $(function() {
  10. var ajaxFileUrl = new AjaxUpload('#fileToUpload',{
  11. action : WEBROOT +"/ShelvesTask/fileUpload.action",
  12. name : 'upFile',
  13. data : {
  14. shelvesTaskDetailId : $("#shelvesTaskDetailId").val()
  15. },
  16. // 选择后自动开始上传
  17. autoSubmit : true,
  18. // 返回Text格式数据
  19. responseType : false,
  20. // 上传的时候按钮不可用
  21. onSubmit : function(filename, ext)
  22. {
  23. $("#showUrl").val(filename);
  24. return true;
  25. },
  26. // 上传完成后取得文件名filename为本地取得的文件名,msg为服务器返回的信息
  27. onComplete : function(filename, response)
  28. {
  29. var reg = JSON.parse(response);
  30. $.messager.show({
  31. title : '提示',
  32. msg : reg.result
  33. });
  34. }
  35. });
  36. $("#btnUpload").click( function(){
  37. ajaxFileUrl.submit();
  38. });
  39. $("#btnDownload").click(function(){
  40. var url = WEBROOT + "/ShelvesTask/templateDownload.action?fileType=3612";
  41. $("#btnDownload").attr('href',url);
  42. });
  43. });
  44. </script>
  45. </head>
  46. <body style="overflow-y: hidden" fit="true" scroll="no">
  47. <div id="tabs" class="easyui-tabs" fit="true">
  48. <div title="IMEI库存导入">
  49. <form id="attachForm" enctype="multipart/form-data" method="post"
  50. action="fileUpload.action" target="hidden_frame">
  51. <input type="hidden" id="fileType" name="fileType" value="3612">
  52. <input type="hidden" id="shelvesTaskDetailId"
  53. name="shelvesTaskDetailId"
  54. value="${requestScope.shelvesTaskDetailId }"> <input
  55. type="hidden" id="extraConfig" name="extraConfig">
  56. <table style="width: 70% ;">
  57. <tr align="center">
  58. <td>导入文件:</td>
  59. <td width="200px;" align="right" >
  60. <input class="easyui-validatebox" style="width: 100px; " disabled="disabled" id="showUrl" maxlength="50"></input>
  61. </td>
  62. <td align="left">
  63. <input type="file" id="fileToUpload" style="width: 70px;" id="upFile" name="upFile" maxLength="300" />
  64. </td>
  65. <!--
  66. <input type="file" id="fileToUpload" required="true" name="upFile"></input>
  67. <td align="left"><a id="btnUpload" href="#"
  68. class="easyui-linkbutton" data-options="iconCls:'icon-search'">提交</a>
  69. </td>
  70. -->
  71. <td><a id="btnDownload" class="easyui-linkbutton l-btn"
  72. data-options="plain:false" href="#">模版下载</a></td>
  73. </tr>
  74. </table>
  75. </form>
  76. </div>
  77. </div>
  78. <iframe name='hidden_frame' id="hidden_frame" style='display: none;'></iframe>
  79. </body>
  80. </html>