createWorkLog.jsp 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  10. <link href="${ pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  11. <script type="text/javascript" src="/shares/js/jquery-1.3.2.min.js"></script>
  12. <script type="text/javascript" src="/shares/js/constant.js"></script>
  13. <script type="text/javascript" src="/shares/js/common.js"></script>
  14. <script type="text/javascript" src="/shares/js/yw/oa/scheduleManager.js"></script>
  15. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  16. <script type="text/javascript">
  17. function checkForm(){
  18. $("#worktime_msg").empty();
  19. $("#progress_msg").empty();
  20. var rs = $.validate({
  21. name : "worktime",
  22. model : [ {
  23. type : "require",
  24. msg : "工时不能为空!"
  25. },{
  26. type : "isNumber",
  27. msg : "请输入数字!"
  28. },{
  29. type : "len",
  30. max : 10,
  31. msg : "工时长度输入超过10个字符!"
  32. }
  33. ]
  34. });
  35. rs = $.validate({
  36. name : "progress",
  37. model : [ {
  38. type : "require",
  39. msg : "请填写进度!"
  40. },{
  41. type : "isNumber",
  42. msg : "请输入数字!"
  43. } ]
  44. }) && rs;
  45. rs = $.validate({
  46. name : "logdtaile",
  47. model : [ {
  48. type : "len",
  49. min:0,
  50. max:300,
  51. msg : "详细描述300个字!"
  52. },{
  53. type : "require",
  54. msg : "请填写详细描述!"
  55. } ]
  56. }) && rs;
  57. rs = $.validate({
  58. name : "remark",
  59. model : [ {
  60. type : "len",
  61. min:0,
  62. max:200,
  63. msg : "备注200个字!"
  64. } ]
  65. }) && rs;
  66. if (rs) {
  67. var temp = 100 - parseInt($("#progress_count").val());
  68. if ($("#worktime").val() > 24){
  69. $("#worktime_msg").append("<font color=\"red\"> 工时不能大于24小时!</font>");
  70. document.all.worktime.focus();
  71. return false;
  72. } else if ($("#worktime").val() < 0.5){
  73. $("#worktime_msg").append("<font color=\"red\"> 工时不能小于0.5小时!</font>");
  74. document.all.worktime.focus();
  75. return false;
  76. }else if(parseInt($("#progress").val()) > temp){
  77. $("#progress_msg").append("<font color=\"red\"> 进度最多填写" + temp +"%!</font>");
  78. document.all.progress.focus();
  79. return false;
  80. }else if ($("#progress").val().match(/^[1-9]\d*$/) == null && $("#progress").val().replace(/(^\s*)|(\s*$)/g, "") != ""){
  81. $("#progress_msg").append("<font color=\"red\"> 进度应为正整数!</font>");
  82. document.all.progress.focus();
  83. return false;
  84. }else if ((24 - $("#today_worktime").val() - $("#worktime").val()) < 0){
  85. alert("一天的总工时不能超过24个小时!");
  86. return false;
  87. }else {
  88. var t = 7.5 - $("#today_worktime").val() - $("#worktime").val();
  89. if (t < 0){
  90. if (!confirm("您本日的报工已超过7.5个小时,您确定要提交吗?")){
  91. return false;
  92. }
  93. }
  94. window.parent.infoDialog.hidden();
  95. window.parent.window.showWaittingDialog();
  96. return true;
  97. }
  98. } else {
  99. return false;
  100. }
  101. }
  102. function refresh(type,userId){
  103. //alert(type + "==" + userId);
  104. if(type == "1"){
  105. if(userId != null && userId != ""){
  106. window.parent.window.$('#calendar').empty();
  107. window.parent.window.loadSelect(userId,"text");
  108. window.parent.dialog3.hidden();
  109. } else {
  110. window.parent.window.grid.loadData();
  111. /* window.parent.window.emptyCalendar();
  112. window.parent.window.loadCalendar("${session.loginID}"); */
  113. window.parent.window.calendar.fullCalendar('refetchEvents');
  114. window.parent.window.closeWaittingDialog();
  115. window.parent.window.infoDialog.close();
  116. //parent.location.reload();
  117. }
  118. }
  119. }
  120. </script>
  121. </head>
  122. <body onload="refresh('${type}', '${userId}');">
  123. <form action="mtTaskCenterMgr.do" method="post" onsubmit="return checkForm();" >
  124. <div id="title" class="form-button">
  125. <input type="submit" class="l-button" value="提交"/>
  126. <input type="hidden" id="today_worktime" name="today_worktime" value="${requestScope.task.today_worktime }"/>
  127. <input type="hidden" id="progress_count" name="progress_count" value="${requestScope.task.progress_count }"/>
  128. </div>
  129. <div >
  130. <div class="container-layout">
  131. <div class="forum-container">
  132. <center>
  133. <table class="l-table-edit line" >
  134. <tr>
  135. <th colspan="2">新增任务日志</th>
  136. </tr>
  137. <tr height="25" align="left">
  138. <td width="30%" ><b>日期<FONT COLOR="red">*</FONT>:</b></td>
  139. <td align="left" height="30">
  140. ${requestScope.task.dateTime }
  141. <input type="hidden" id="dateTime" name="dateTime" value="${requestScope.task.dateTime }">
  142. </td>
  143. </tr>
  144. <tr height="25" align="left">
  145. <td width="30%" ><b>任务名称<FONT COLOR="red">*</FONT>:</b></td>
  146. <td align="left" height="30">
  147. ${requestScope.task.tasktitle }&nbsp;&nbsp;
  148. <font color="red">(已完成:${requestScope.task.progress_count }%)</font>
  149. <input type="hidden" id="tasktitle" name="tasktitle" value="${requestScope.task.tasktitle }">
  150. </td>
  151. </tr>
  152. <tr height="25" align="left">
  153. <td width="30%" ><b>工时<FONT COLOR="red">*</FONT>:</b></td>
  154. <td align="left" >
  155. <input type="text" style="width:40px;" name="worktime" id="worktime" value="${requestScope.task.worktime }">&nbsp;小时
  156. &nbsp;<font color="blue">[本日已报工${requestScope.task.today_worktime }个小时]</font>
  157. <div id="worktime_msg" style="display: inline;"></div>
  158. </td>
  159. </tr>
  160. <tr height="25" align="left">
  161. <td width="30%" ><b>进度<FONT COLOR="red">*</FONT>:</b></td>
  162. <td align="left" >
  163. <input type="text" style="width:40px;" name="progress" id="progress" value="${requestScope.task.progress }">&nbsp;%
  164. <div id="progress_msg" style="display: inline;"></div>
  165. </td>
  166. </tr>
  167. <tr height="25" align="left">
  168. <td width="30%" ><b>详细描述<FONT COLOR="red">*</FONT>:</b></td>
  169. <td align="left" height="30">
  170. <textarea rows="5" cols="50" name="logdtaile" id="logdtaile">${requestScope.task.logdtaile }</textarea>
  171. <div id="logdtaile_msg" style="display: inline;"></div>
  172. </td>
  173. </tr>
  174. <tr height="25" align="left">
  175. <td width="30%" ><b>备注:</b></td>
  176. <td align="left" height="30">
  177. <textarea rows="5" cols="50" name="remark" id="remark">${requestScope.task.remark }</textarea>
  178. <div id="logdtaile_msg" style="display: inline;"></div>
  179. </td>
  180. </tr>
  181. </table>
  182. <input type="hidden" id="task" name="task" value="createWorkLog">
  183. <input type="hidden" id="taskId" name="taskId" value="${requestScope.task.taskId }">
  184. <input type="hidden" id="userId" name="userId" value="${requestScope.task.userId }">
  185. </center>
  186. </div>
  187. </div>
  188. </div>
  189. </form>
  190. <%@ include file="/include/message.jsp"%>
  191. </body>
  192. </html>