tmsProjectSaturation.jsp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. <%@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"%>
  2. <%@ page language="java" import="java.util.*,com.yw.tms.common.util.TmsDataDictionaryManager,com.yw.tms.report.model.TmsTaskWorkDiaryReport,com.yw.tms.report.model.TmsSaturationReport" contentType="text/html;charset=GBK"
  3. pageEncoding="GBK"%>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  5. <%@ taglib prefix="tms" uri="http://fzywtx.com/jsp/yw/tms" %>
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9. <title>施工工作饱和度统计</title>
  10. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  11. <link href="${pageContext.request.contextPath }/main.css" rel="stylesheet" type="text/css"/>
  12. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  13. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  14. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  15. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
  16. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
  17. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerTab.js" type="text/javascript"></script>
  18. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>
  19. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
  20. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
  21. <script type="text/javascript" src="/shares/js/constant.js"></script>
  22. <script type="text/javascript" src="/shares/js/common.js"></script>
  23. <script type="text/javascript" src="/shares/js/yw/tms/tms-common.js"></script>
  24. <script type="text/javascript" src="/shares/js/yw/tms/tmsProjectSaturation.js"></script>
  25. <script type="text/javascript">
  26. $(function() {
  27. $("#year").ligerComboBox({
  28. slide:false,
  29. width : 60
  30. });
  31. $("#month").ligerComboBox({
  32. slide:false,
  33. width : 40
  34. });
  35. $("#projId").ligerComboBox({
  36. slide:false,
  37. width : 148
  38. });
  39. $('#projId').change(function(){
  40. userTree();
  41. });
  42. firstUserTree();
  43. var height = $(window).height() - 233;
  44. $("#changecolor").css("height", height);
  45. $("#changecolor").css("overflow", "auto");
  46. senfe("changecolor","#f8fbfc","#e5f1f4","#ecfbd4","#bce774");
  47. });
  48. $(document).ready(function(){
  49. $(window).resize(function (){
  50. var height = $(window).height() - 233;
  51. $("#changecolor").css("height", height);
  52. $("#changecolor").css("overflow", "auto");
  53. });
  54. });
  55. </script>
  56. <style type="text/css">
  57. .l-text-wrapper{width: 100px;}
  58. .default_search li input[type='text']{height:28px; line-height:28px}
  59. .tdSix {border: #A3C0E8 1px solid;text-align:center;width: 2.9%;height: 24px;background-color: #F5F5F5;}
  60. .td{border: #A3C0E8 1px solid;text-align:center;width: 2.9%;height: 24px;background-color: #FFFFFF;}
  61. </style>
  62. <%
  63. String userAgent = request.getHeader("User-Agent");
  64. %>
  65. </head>
  66. <body >
  67. <div class="">
  68. <div class="default_search" style="margin-bottom: 0px;">
  69. <ul class="list_search" >
  70. <li class="title">选择施工:</li>
  71. <li class="text">
  72. <select style="width:150px;" name="projId" id="projId" >
  73. <c:forEach items="${requestScope.projList}" var="proj" >
  74. <option value="${proj.universalid }">${proj.proj_name }</option>
  75. </c:forEach>
  76. </select>
  77. </li>
  78. </ul>
  79. <ul class="list_search" style="width:600px;">
  80. <li class="title">选择月份:</li>
  81. <li class="text" style="width: 80px">
  82. <select id="year" name="year" style="">
  83. <option value="${currentYear-1}">${currentYear-1}</option>
  84. <option value="${currentYear}">${currentYear}</option>
  85. <option value="${currentYear+1}">${currentYear+1}</option>
  86. </select>
  87. </li>
  88. <li class="text" style="width: 60px">
  89. <select id="month" name="month" style="">
  90. <option value="1" >1</option>
  91. <option value="2">2</option>
  92. <option value="3">3</option>
  93. <option value="4">4</option>
  94. <option value="5">5</option>
  95. <option value="6">6</option>
  96. <option value="7">7</option>
  97. <option value="8">8</option>
  98. <option value="9">9</option>
  99. <option value="10">10</option>
  100. <option value="11">11</option>
  101. <option value="12">12</option>
  102. </select>
  103. </li>
  104. </ul>
  105. <ul class="list_search" style="width:500px;">
  106. <li class="title">选择人员:</li>
  107. <li class="text" style="">
  108. <input type="text" id="userName" name="userName" style="width: 150px" readonly="readonly" />
  109. <input type="hidden" id="userId" name="userId" />
  110. </li>
  111. <li class="text" style="width: 90px;padding-left:10px;">
  112. &nbsp;<input type="button" value="请选择" class="l-button" id="userBtn" />
  113. </li>
  114. </ul>
  115. <ul style="width: 220px;">
  116. <li class="title" style="">
  117. <input type="button" class='l-button' name="search" onclick="serarch()" value="开始统计"/>
  118. </li>
  119. <li class="title" style="">
  120. <input type="button" class='l-button' name="search" onclick="openRemark('<%=TmsDataDictionaryManager.getValueByCode("DEFAULT_DAY_NORMAL_MAN_HOUR")%>')" value="统计说明"/>
  121. </li>
  122. </ul>
  123. </div>
  124. <%
  125. int monthDay = (Integer)request.getAttribute("monthDay");
  126. int monthDayDiWeek = (Integer)request.getAttribute("monthDayDiWeek");
  127. int count = (Integer)request.getAttribute("count");
  128. int dayInt = (Integer)request.getAttribute("dayInt");
  129. %>
  130. <div id="projectSaturationTab" >
  131. <div style="width:100%;overflow-y: scroll;overflow-x:hidden;">
  132. <%if(userAgent.indexOf("compatible; MSIE 7.0;")>0){ %>
  133. <table style="width: 98%;" >
  134. <%}else{ %>
  135. <table style="width: 100%;" >
  136. <%} %>
  137. <tr>
  138. <td style="width: 8%;border: #A3C0E8 1px solid; text-align: center;" rowspan="3">平均工时</td>
  139. <td style="width: 92%;border: #A3C0E8 1px solid;height: 24px;padding-left: 8px;" colspan="<%=monthDay%>">
  140. <%if(dayInt == -1){ %>
  141. ${yearInt}年${monthInt}月份(无数据统计)
  142. <% }else{%>
  143. ${yearInt}年${monthInt}月份(<span style="color:#2A00E1; ">统计数据截止到本月<%=dayInt %>日</span>)
  144. <%} %>
  145. </td>
  146. </tr>
  147. <tr>
  148. <% for(int i = 1;i<=monthDay;i++){
  149. if((i+(monthDayDiWeek-1))%7 == 0 || ((i-1)+(monthDayDiWeek-1))%7== 0){
  150. %>
  151. <td class="tdSix"><%=i %></td>
  152. <% }else{ %>
  153. <td class="td"><%=i %></td>
  154. <% }
  155. }
  156. %>
  157. </tr>
  158. <tr>
  159. <%
  160. LinkedHashMap daySumtask = (LinkedHashMap)request.getAttribute("daySumtask");
  161. for(int i = 1;i<=monthDay;i++){
  162. if(daySumtask == null){
  163. if((i+(monthDayDiWeek-1))%7 == 0 || ((i-1)+(monthDayDiWeek-1))%7== 0){
  164. %>
  165. <td class="tdSix">0</td>
  166. <%}else{ %>
  167. <td class="td">0</td>
  168. <%}
  169. }else{
  170. String iString = "";
  171. if( (i) < 10){
  172. iString = "0"+(i);
  173. }else{
  174. iString = ""+(i);
  175. }
  176. TmsTaskWorkDiaryReport tmsWorkDiary1 = (TmsTaskWorkDiaryReport)daySumtask.get(iString);
  177. if(tmsWorkDiary1 == null){
  178. if((i+(monthDayDiWeek-1))%7 == 0 || ((i-1)+(monthDayDiWeek-1))%7== 0){
  179. %>
  180. <td class="tdSix" >0</td>
  181. <%}else{ %>
  182. <td class="td" >0</td>
  183. <%}
  184. }else{
  185. float avgS = tmsWorkDiary1.getManHour()/count;
  186. float avg = (float)(Math.round(avgS*10))/10;
  187. if((i+(monthDayDiWeek-1))%7 == 0 || ((i-1)+(monthDayDiWeek-1))%7== 0){
  188. %>
  189. <td class="tdSix"><%=avg %></td>
  190. <%}else{ %>
  191. <td class="td"><%=avg %></td>
  192. <%}
  193. }
  194. }
  195. } %>
  196. </tr>
  197. <tr>
  198. <td style="border: #A3C0E8 1px solid;text-align: center;" rowspan="2">员工列表<br/>(饱和度)</td>
  199. <td style="border: #A3C0E8 1px solid;height: 24px;padding-left: 8px;" colspan="<%=monthDay%>">${yearInt}年${monthInt}月份</td>
  200. </tr>
  201. <tr>
  202. <% for(int i = 1;i<=monthDay;i++){
  203. if((i+(monthDayDiWeek-1))%7 == 0 || ((i-1)+(monthDayDiWeek-1))%7== 0){
  204. %>
  205. <td class="tdSix"><%=i %></td>
  206. <% }else{ %>
  207. <td class="td"><%=i %></td>
  208. <% }
  209. %>
  210. <% } %>
  211. </tr>
  212. </table>
  213. </div>
  214. <div style="width:100%; overflow-y: scroll; overflow-x:hidden">
  215. <%if(userAgent.indexOf("compatible; MSIE 7.0;")>0){ %>
  216. <table style="width: 98%;" id="changecolor">
  217. <%}else{ %>
  218. <table style="width: 100%;" id="changecolor">
  219. <%} %>
  220. <% List<TmsSaturationReport> list = (List)request.getAttribute("list");
  221. for(TmsSaturationReport projectUser : list ){
  222. %>
  223. <tr>
  224. <td style="width: 8%;border: #A3C0E8 1px solid;border-top-width:0px;text-align:center;height: 24px;"><%=projectUser.getUserName() %>(<font style="color: <%=projectUser.getColor()%>;"><%=projectUser.getSumDec() %>%</font>)</td>
  225. <% for(int j=1; j<=monthDay;j++){
  226. String jString = "";
  227. if( j < 10){
  228. jString = "0"+j;
  229. }else{
  230. jString = ""+j;
  231. }
  232. if((j+(monthDayDiWeek-1))%7 == 0 || ((j-1)+(monthDayDiWeek-1))%7== 0){
  233. %>
  234. <td class="tdSix" style="border-top-width:0px;" title="${yearInt}-${monthInt}-<%=jString%>">
  235. <%}else{ %>
  236. <td class="td" style="border-top-width:0px;" title="${yearInt}-${monthInt}-<%=jString%>">
  237. <%}
  238. if(projectUser.getWorkDiaryDayMap().get(""+projectUser.getUserId()+jString) == null){
  239. %><span class="info" style="" >
  240. &nbsp;
  241. </span><%
  242. }else{
  243. TmsTaskWorkDiaryReport tmsWorkDiary = (TmsTaskWorkDiaryReport)projectUser.getWorkDiaryDayMap().get(""+projectUser.getUserId()+jString);
  244. %><%-- <span style="" onclick="f_open(<%=""+projectUser.getUserId()+jString%>,'<%=projectUser.getUserName()%>','<%=jString%>');"><%=tmsWorkDiary.getManHour() %></span>--%>
  245. <span style="cursor: pointer;color: <%=tmsWorkDiary.getColor()%>" onclick="getWorkDiaryList(<%=""+projectUser.getUserId()%>,'<%=jString%>','<%=projectUser.getUserName()%>','${yearInt}','${monthInt}');"><%=tmsWorkDiary.getManHour() %></span>
  246. <%} %>
  247. </td>
  248. <%} %>
  249. </tr>
  250. <%} %>
  251. </table>
  252. </div>
  253. <div class="l-panel-bar">
  254. <div class="l-panel-bbar-inner">
  255. <div class="l-bar-group l-bar-message">
  256. <c:if test="${(curPage)*pageSize < count }">
  257. <span class="l-bar-text">显示从${(curPage-1)*pageSize+1 }到${(curPage)*pageSize },总 ${count} 条 。每页显示:${pageSize}</span>
  258. </c:if>
  259. <c:if test="${(curPage)*pageSize >= count }">
  260. <span class="l-bar-text">显示从${(curPage-1)*pageSize+1 }到${count},总 ${count} 条 。每页显示:${pageSize}</span>
  261. </c:if>
  262. </div>
  263. <div class="l-bar-group l-bar-selectpagesize">
  264. <select name="rp" id="rp">
  265. <option value="10">10</option>
  266. <option value="20">20</option>
  267. <option value="30">30</option>
  268. <option value="40">40</option>
  269. <option value="50">50</option>
  270. </select>
  271. </div>
  272. <div class="l-bar-separator"></div>
  273. <div class="l-bar-group">
  274. <c:if test="${curPage eq '1' }">
  275. <div class="l-bar-button l-bar-btnfirst" >
  276. <span class="l-disabled" ></span>
  277. </div>
  278. <div class="l-bar-button l-bar-btnprev" >
  279. <span class="l-disabled"></span>
  280. </div>
  281. </c:if>
  282. <c:if test="${curPage ne '1' }">
  283. <div class="l-bar-button l-bar-btnfirst" onclick='javascript:go(1);return false;'>
  284. <span class="" onclick='javascript:go(1);return false;'></span>
  285. </div>
  286. <div class="l-bar-button l-bar-btnprev" onclick='javascript:go(${curPage-1});return false;'>
  287. <span class="" onclick='javascript:go(${curPage-1});return false;'></span>
  288. </div>
  289. </c:if>
  290. </div>
  291. <div class="l-bar-separator"></div>
  292. <div class="l-bar-group">
  293. <span class="pcontrol"><input name="pagenav" id="pagenav" style="width: 20px;" maxLength="3" value="${curPage}" size="4" type="text" onkeypress="javaScript:if(event.keyCode==13){go(this.value);}"> / <span>${maxPage}</span></span>
  294. </div>
  295. <div class="l-bar-separator"></div>
  296. <div class="l-bar-group">
  297. <c:if test="${curPage eq maxPage }">
  298. <div class="l-bar-button l-bar-btnnext" >
  299. <span class="l-disabled" ></span>
  300. </div>
  301. <div class="l-bar-button l-bar-btnlast">
  302. <span class="l-disabled" ></span>
  303. </div>
  304. </c:if>
  305. <c:if test="${curPage ne maxPage }">
  306. <div class="l-bar-button l-bar-btnnext" onclick='javascript:go(${curPage+1});return false;'>
  307. <span class="" onclick='javascript:go(${curPage+1});return false;'></span>
  308. </div>
  309. <div class="l-bar-button l-bar-btnlast" onclick='javascript:go(${maxPage});return false;'>
  310. <span class="" onclick='javascript:go(${maxPage});return false;'></span>
  311. </div>
  312. </c:if>
  313. </div>
  314. <div class="l-bar-separator"></div>
  315. <div class="l-bar-group">
  316. <div class="l-bar-button l-bar-btnload" onclick="javascript:go(document.getElementById('pagenav').value);return false;"></div>
  317. </div>
  318. <div class="l-bar-separator"></div>
  319. <div class="l-clear"></div>
  320. </div>
  321. </div>
  322. <script language="JavaScript">
  323. var docUrl = document.location.href;
  324. var maxPage = ${maxPage};//#maxpage#;
  325. var curPage = ${curPage};//#currentpage#;
  326. var end = docUrl.lastIndexOf("/");
  327. var u=docUrl.substring(0,end);
  328. if(isNaN(curPage)){
  329. curPage = 1;
  330. }
  331. function go(page){
  332. try{
  333. var projId = $("#projId").val();
  334. var year = $("#year").val();
  335. var month = $("#month").val();
  336. var userId = $("#userId").val();
  337. var userName = $("#userName").val();
  338. var baseUrl = u+'/TmsSaturationAction.do?task=tmsProjectSaturation&projId='+projId+'&year='+year+'&month='+month+'&userId='+userId+'&userName='+userName;
  339. var url = '';
  340. if (page >0){
  341. if(page >= maxPage){
  342. url = baseUrl+'&curPage='+(maxPage)+'&pageSize='+$("#rp").val();
  343. document.location.href=url;
  344. return true;
  345. }else{
  346. url = baseUrl+'&curPage='+page+'&pageSize='+$("#rp").val();
  347. document.location.href=url;
  348. return true;
  349. }
  350. }else{
  351. return false;
  352. }
  353. }catch(e){
  354. alert("Sorry:"+e);
  355. }
  356. return false;
  357. }
  358. </script>
  359. </div>
  360. <%@ include file="/include/message.jsp"%>
  361. </div>
  362. </body>
  363. <script type="text/javascript">
  364. <!--
  365. $("#year").val('${yearInt}');
  366. $("#month").val('${monthInt}');
  367. $("#projId").val('${projId}');
  368. $("#rp").val('${pageSize}');
  369. $("#userName").val('${userName}');
  370. $("#userId").val('${userId}');
  371. //-->
  372. function serarch(){
  373. var projId = $("#projId").val();
  374. if(!projId){
  375. $.ligerDialog.warn("请选择施工!");
  376. return;
  377. }
  378. go(1);
  379. }
  380. function firstUserTree(){
  381. var projId = document.getElementById("projId").value;
  382. if(!projId){
  383. return;
  384. }
  385. loadTypeTree("userBtn",{type:"user",backId:"userId",tab:"7",backName:"userName",tabParam:[{tab:"7",root:projId}]});
  386. }
  387. function userTree(){
  388. var projId = document.getElementById("projId").value;
  389. if(!projId){
  390. $.ligerDialog.warn("请选择施工!");
  391. return;
  392. }
  393. loadTypeTree("userBtn",{type:"user",backId:"userId",tab:"7",backName:"userName",tabParam:[{tab:"7",root:projId}]});
  394. }
  395. </script>
  396. </html>