customerReportUD.jsp 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <%@page import="java.net.URLDecoder"%>
  2. <%@ page language="java" contentType="text/html; charset=UTF-8"
  3. pageEncoding="UTF-8"%>
  4. <%@page import="com.uas.cr.util.FileUtil" %>
  5. <%@page import="java.util.Enumeration" %>
  6. <%
  7. String path = request.getContextPath();
  8. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  9. %>
  10. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  11. <html>
  12. <head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  14. <title>报表上传</title>
  15. <link rel="shortcut icon" type="image/x-icon" href="img/u.png" />
  16. <script type="text/javascript" src="jquery/jquery.min.js"></script>
  17. <style type="text/css">
  18. .button {
  19. display: inline-block;
  20. outline: none;
  21. cursor: pointer;
  22. text-align: center;
  23. text-decoration: none;
  24. font: 14px/100% Arial, Helvetica, sans-serif;
  25. padding: .5em 2em .55em;
  26. text-shadow: 0 1px 1px rgba(0,0,0,.3);
  27. -webkit-border-radius: .5em;
  28. -moz-border-radius: .5em;
  29. border-radius: .5em;
  30. -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
  31. -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
  32. box-shadow: 0 1px 2px rgba(0,0,0,.2);
  33. }
  34. .button:hover {
  35. text-decoration: none;
  36. }
  37. .button:active {
  38. position: relative;
  39. top: 1px;
  40. }
  41. .white {
  42. color: #606060;
  43. border: solid 1px #b7b7b7;
  44. background: #fff;
  45. background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
  46. background: -moz-linear-gradient(top, #fff, #ededed);
  47. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
  48. }
  49. .white:hover {
  50. background: #ededed;
  51. background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc));
  52. background: -moz-linear-gradient(top, #fff, #dcdcdc);
  53. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc');
  54. }
  55. .white:active {
  56. color: #999;
  57. background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
  58. background: -moz-linear-gradient(top, #ededed, #fff);
  59. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff');
  60. }
  61. .medium {
  62. font-size: 12px;
  63. }
  64. .div1{
  65. float: left;
  66. height: 41px;
  67. background: #f5696c;
  68. width: 144px;
  69. position:relative;
  70. }
  71. .div2{
  72. text-align:center;
  73. padding-top:12px;
  74. font-size:15px;
  75. font-weight:800
  76. }
  77. .inputstyle{
  78. width: 144px;
  79. height: 41px;
  80. cursor: pointer;
  81. font-size: 30px;
  82. outline: medium none;
  83. position: absolute;
  84. filter:alpha(opacity=0);
  85. -moz-opacity:0;
  86. opacity:0;
  87. left:0px;
  88. top: 0px;
  89. font-size
  90. }
  91. .fileinput {
  92. }
  93. .fileinput:HOVER {
  94. border-color: #0BECEC;
  95. }
  96. .fileinput:FOCUS {
  97. border-color: #0BECEC;
  98. }
  99. .container {
  100. margin: 10px;
  101. padding: 10px;
  102. }
  103. .inputStyle {
  104. border-radius : 4px;
  105. line-height: 1.6;
  106. box-shadow: none;
  107. width: 200px;
  108. font-size: 14px;
  109. }
  110. label {
  111. font:宋体;
  112. }
  113. h3 {
  114. margin-bottom: 5px;
  115. margin-top: 5px;
  116. }
  117. }
  118. </style>
  119. </head>
  120. <body class="container">
  121. <%
  122. String enuu = URLDecoder.decode(request.getParameter("enuu"), "UTF-8");
  123. String reportName = URLDecoder.decode(request.getParameter("reportName"), "UTF-8");
  124. String fileName = URLDecoder.decode(request.getParameter("fileName"), "UTF-8");
  125. String title = URLDecoder.decode(URLDecoder.decode(URLDecoder.decode(request.getParameter("title"), "UTF-8"), "UTF-8"),"UTF-8");
  126. String name = URLDecoder.decode(request.getParameter("userName"), "UTF-8");
  127. %>
  128. <head><h3>上传文件</h3></head>
  129. <hr>
  130. <form action="do_upload.jsp" method="post" enctype="multipart/form-data" onsubmit = "beforUp()" >
  131. <br>
  132. <label style="word-spacing : 17px;">企 业 UU:</label>
  133. <input type="text" class="inputStyle" name="uu" value="<%=enuu %>" required="required"/> <br><br>
  134. <label style="word-spacing : 3px;">报 表 业 务:</label>
  135. <input type="text" class="inputStyle" name="reportBusi" value="<%=reportName%>" required="required"/> <br><br>
  136. <label style="word-spacing : 3px;">报 表 描 述:</label>
  137. <input type="text" class="inputStyle" name="description" value="<%=title%>" required="required"/><br><br>
  138. <label>报表页面名称:</label>
  139. <input type="text" class="inputStyle" name="reportPageName" placeholder="make、purchase等类型" required="required"/><br><br>
  140. <input type="hidden" name="userName" value="<%=name %>">
  141. <div class="fileinput">
  142. <input type="file" name="fileforload" accept=".rpt" style="font-size: 15px;"/>
  143. </div>
  144. <hr style="margin-top: 15px;">
  145. <input type="submit" value="commit" name="submit" class="button white" style="float: right; margin-top: 5px;">
  146. </form>
  147. </body>
  148. <script type="text/javascript">
  149. var beforUp = function() {
  150. var enuu = document.getElementsByName("uu")[0].value;
  151. var file = document.getElementsByName("fileforload")[0].value;
  152. if(!file) {
  153. alert("请选择需要上传的文件! ");
  154. window.event.returnValue=false;
  155. return ;
  156. }
  157. var files = file.split("/");
  158. file = files[files.length-1];
  159. $.ajax({
  160. url: "upFileIsExist",
  161. data: {"enuu": enuu, "file":file},
  162. async:false,
  163. success: function(result, status, xhr) {
  164. var str = result;
  165. if(str == "yes") {
  166. var choose = confirm("文件已经存在,确定要覆盖? ");
  167. if(!choose) {
  168. window.event.returnValue=false;
  169. }
  170. }
  171. },
  172. error: function(result, status, xhr) {
  173. var str = result.responseText;
  174. alert(str);
  175. }
  176. });
  177. }
  178. </script>
  179. </html>