statForTimeCostOfPersonal.jsp 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <%@ page language="java" contentType="text/html;charset=GBK"
  2. pageEncoding="GBK"%>
  3. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  8. <title>流程办理耗时统计</title>
  9. <script src="/shares/js/jquery-1.8.2.js" type="text/javascript"></script>
  10. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css"
  11. rel="stylesheet" type="text/css" />
  12. <link href="/shares/Zebra_Datepicker-master/public/css/bootstrap.css"
  13. rel="stylesheet" type="text/css" />
  14. <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  15. <script type="text/javascript" src="/shares/js/constant.js"></script>
  16. <script type="text/javascript" src="/shares/js/common.js"></script>
  17. <script type="text/javascript" src="/shares/js/yw/bpm/oa.js"></script>
  18. <script type="text/javascript" src="/shares/Zebra_Datepicker-master/public/javascript/zebra_datepicker.js"></script>
  19. <script type="text/javascript" src="/shares/js/yw/bpm/promptDefine.js"></script>
  20. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
  21. <script type="text/javascript">
  22. $(document).ready(function(){
  23. loadTypeTree("userButton",{type:"user", tab:"1", backId:"users", backName:"usersName"});
  24. $("#starttime0").Zebra_DatePicker({
  25. format: 'Y',
  26. days: ['日', '一', '二', '三', '四', '五', '六'],
  27. months: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
  28. lang_clear_date: '清除',
  29. show_select_today: '今天'
  30. });
  31. $("#starttime1").Zebra_DatePicker({
  32. format: 'Y-m',
  33. days: ['日', '一', '二', '三', '四', '五', '六'],
  34. months: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
  35. lang_clear_date: '清除',
  36. show_select_today: '今天'
  37. });
  38. $("#starttime2").Zebra_DatePicker({
  39. format: 'Y-m-d',
  40. days: ['日', '一', '二', '三', '四', '五', '六'],
  41. months: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
  42. lang_clear_date: '清除',
  43. show_select_today: '今天'
  44. });
  45. $("#starttime3").Zebra_DatePicker({
  46. format: 'Y-m-d',
  47. days: ['日', '一', '二', '三', '四', '五', '六'],
  48. months: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
  49. lang_clear_date: '清除',
  50. show_select_today: '今天',
  51. pair : $("#endtime3")
  52. });
  53. $("#endtime3").Zebra_DatePicker({
  54. format: 'Y-m-d',
  55. days: ['日', '一', '二', '三', '四', '五', '六'],
  56. months: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
  57. lang_clear_date: '清除',
  58. show_select_today: '今天'
  59. });
  60. changeTimer();
  61. });
  62. function changeTimer(){
  63. var dtype = $("#dtype").val();
  64. $("[id*='timer']").hide();
  65. if(dtype == 0){
  66. $("#timer0").show();
  67. } else if (dtype == 1){
  68. $("#timer1").show();
  69. } else if (dtype == 2){
  70. $("#timer2").show();
  71. } else if (dtype == 3){
  72. $("#timer3").show();
  73. }
  74. }
  75. function submitForm(submitType){
  76. var rs = true;
  77. var target = null;
  78. var starttime = null;
  79. var endtime = null;
  80. rs = $.validate({
  81. name : "users",
  82. model : [ {
  83. type : "require",
  84. msg : "请选择人员!"
  85. }]
  86. }) && rs;
  87. target = $("#users").val();
  88. var dtype = $("#dtype").val();
  89. if(dtype == 0){
  90. rs = $.validate({
  91. name : "starttime0",
  92. model : [ {
  93. type : "require",
  94. msg : "请选择年份!"
  95. }]
  96. }) && rs;
  97. starttime = $("#starttime0").val();
  98. } else if (dtype == 1){
  99. rs = $.validate({
  100. name : "starttime1",
  101. model : [ {
  102. type : "require",
  103. msg : "请选择月份!"
  104. }]
  105. }) && rs;
  106. starttime = $("#starttime1").val();
  107. } else if (dtype == 2){
  108. rs = $.validate({
  109. name : "starttime2",
  110. model : [ {
  111. type : "require",
  112. msg : "请选择日期!"
  113. }]
  114. }) && rs;
  115. starttime = $("#starttime2").val();
  116. } else if (dtype == 3){
  117. rs = $.validate({
  118. name : "starttime3",
  119. model : [ {
  120. type : "require",
  121. msg : "请选择起始日期!"
  122. }]
  123. }) && rs;
  124. rs = $.validate({
  125. name : "endtime3",
  126. model : [ {
  127. type : "require",
  128. msg : "请选择结束日期!"
  129. }]
  130. }) && rs;
  131. starttime = $("#starttime3").val();
  132. endtime = $("#endtime3").val();
  133. }
  134. if(rs){
  135. if(submitType == 'timeOfCost'){
  136. window.open("${pageContext.request.contextPath}/StatAction.do?task=timeOfCost&target="
  137. + target + "&dtype=" + dtype + "&starttime=" + starttime +
  138. "&endtime=" + endtime, "流程办理耗时统计", 'location=no, resizable=yes,scrollbars=yes');
  139. return true;
  140. }else if(submitType == 'exportTimeOfCostExcel'){
  141. document.cform.action="StatAction.do?task=exportTimeOfCostExcel&target="
  142. + target + "&dtype=" + dtype + "&starttime=" + starttime + "&endtime=" + endtime;
  143. document.cform.submit();
  144. }else if(submitType == 'timeOfCostList'){
  145. $("#maingrid4").ligerGrid({
  146. columns: [
  147. { display: '姓名', name: 'name', width: 150 },
  148. { display: '平均办理时间(单位:小时)', name: 'avgcost', width: 250,
  149. render: function (row){
  150. var html = '';
  151. if(row.avgcost != '' && row.avgcost != null){
  152. html = row.avgcost;
  153. }else{
  154. html = '0';
  155. }
  156. return html;
  157. }},
  158. { display: '最少办理时间(单位:小时)', name: 'mincost', width: 250 ,
  159. render: function (row){
  160. var html = '';
  161. if(row.mincost != '' && row.mincost != null){
  162. html = row.mincost;
  163. }else{
  164. html = '0';
  165. }
  166. return html;
  167. }},
  168. { display: '最长办理时间(单位:小时)', name: 'maxcost', width: 250,
  169. render: function (row){
  170. var html = '';
  171. if(row.maxcost != '' && row.maxcost != null){
  172. html = row.maxcost;
  173. }else{
  174. html = '0';
  175. }
  176. return html;
  177. }},
  178. { display: '办理环节数量', name: 'counts', width: 150,render: function (row){
  179. var html = '';
  180. if(row.counts != '' && row.counts != null){
  181. html = row.counts;
  182. }else{
  183. html = '0';
  184. }
  185. return html;
  186. }}
  187. ],
  188. pageSize:20,
  189. url: '${pageContext.request.contextPath}/StatAction.do?task=timeOfCostList&target=' + target + '&dtype=' + dtype + '&starttime=' + starttime +
  190. '&endtime=' + endtime+'&time=' + new Date().getTime(),
  191. pageParmName: 'p', //页索引参数名,(提交给服务器)
  192. pagesizeParmName: 'pSize', //页记录数参数名,(提交给服务器)
  193. width: '99.9%',
  194. height: '99%',
  195. enabledSort : true,
  196. onError: function(){alert("数据加载失败,请刷新页面!");}
  197. });
  198. }
  199. }
  200. return false;
  201. }
  202. </script>
  203. </head>
  204. <body>
  205. <form action="StatAction.do" method="post" id="cform" name="cform" >
  206. <div class="container-layout">
  207. <div id="title" class="form-button" style="width: 100%;">
  208. <input onclick="closeTabUseInOA();" type="button" value="关闭" class="l-button">
  209. </div>
  210. <div class="default_search" style="margin: 0; width: 100%;">
  211. <ul class="list_search" style="width:600px;">
  212. <li class="title">统计对象:</li>
  213. <li class="text">
  214. <select id="stype" name="stype" style="width : 100px;" onchange="changeTree()">
  215. <option value="1">员工</option>
  216. </select>
  217. </li>
  218. <li class="text" style="width : 300px;" id="userTree">
  219. <input type="text" style="width : 200px;" id="usersName" name="usersName" value="">
  220. <input type="button" class="l-button" id="userButton" name="userButton" value="选择人员">
  221. <input type="hidden" id="users" name="users" value="">
  222. </li>
  223. </ul>
  224. </div>
  225. <div class="default_search" style="margin: 0; width: 100%;">
  226. <ul class="list_search" style="width:700px;">
  227. <li class="title">统计时间:</li>
  228. <li class="text">
  229. <select id="dtype" name="dtype" style="width : 100px;" onchange="changeTimer()">
  230. <option value="0" selected="selected">年</option>
  231. <option value="1">月</option>
  232. <!-- <option value="2">日</option> -->
  233. <option value="3">区间</option>
  234. </select>
  235. </li>
  236. <li id="timer0" class="text" style="width : 300px; " >
  237. <input type="text" id="starttime0" name="starttime0" style="width: 100px;">
  238. </li>
  239. <li id="timer1" class="text" style="width : 300px; " >
  240. <input type="text" id="starttime1" name="starttime1" style="width: 100px;">
  241. </li>
  242. <li id="timer2" class="text" style="width : 300px;" >
  243. <input type="text" id="starttime2" name="starttime2" style="width: 100px;">
  244. </li>
  245. <li id="timer3" class="text" style="width : 450px; " >
  246. <input type="text" id="starttime3" name="starttime3" style="width: 100px;">
  247. &nbsp;至
  248. <input type="text" id="endtime3" name="endtime3" style="width: 100px;">
  249. </li>
  250. </ul>
  251. </div>
  252. <div class="default_search" style="margin: 0; width: 100%; padding:0;">
  253. <ul class="list_search" style="width:600px;">
  254. <li class="title">&nbsp;
  255. <input type="hidden" id="task" name="task" value="countOfSend">
  256. </li>
  257. <li class="text">
  258. <input type="button" class="l-button" value="打印" onclick="submitForm('timeOfCost')">
  259. </li>
  260. <li class="text">
  261. <input type="button" class="l-button" value="导出EXCEL" onclick="submitForm('exportTimeOfCostExcel')">
  262. </li>
  263. <li class="text">
  264. <input type="button" class="l-button" value="开始统计" onclick="submitForm('timeOfCostList')">
  265. </li>
  266. </ul>
  267. </div>
  268. <div style="clear: both;">
  269. <div id="maingrid4" style="margin:0; padding:0"></div>
  270. </div>
  271. </div>
  272. </form>
  273. </body>
  274. </html>