editWorkLog.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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 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/ligerDialog.js" type="text/javascript"></script>
  15. <script type="text/javascript" src="/shares/js/common.js"></script>
  16. <script type="text/javascript" src="/shares/js/file.js"></script>
  17. <style type="text/css">
  18. .file-style input[type='file'] {
  19. width:385px ;
  20. height:24px;
  21. line-height:22px;
  22. vertical-align: bottom;
  23. background-color: #fff;
  24. border: 1px solid #cccccc;
  25. margin-top: 2px;
  26. margin-bottom: 2px;
  27. }
  28. </style>
  29. <script type="text/javascript">
  30. $(function () {
  31. });
  32. function refresh(type,userId){
  33. //alert(type + "==" + userId);
  34. if(type == "1"){
  35. if(userId != null && userId != ""){
  36. window.parent.window.$('#calendar').empty();
  37. window.parent.window.loadSelect(userId,"text");
  38. window.parent.dialog3.hidden();
  39. } else {
  40. window.parent.window.grid.loadData();
  41. /* window.parent.window.emptyCalendar();
  42. window.parent.window.loadCalendar("${session.loginID}");; */
  43. window.parent.window.calendar.fullCalendar('refetchEvents');
  44. window.parent.window.closeWaittingDialog();
  45. window.parent.window.infoDialog.close();
  46. }
  47. }
  48. }
  49. function deleteWorkLog(){
  50. var universalid = $("#universalid").val();
  51. var taskId = $("#taskId").val();
  52. if(confirm("您确定要删除该任务日志吗?")){
  53. window.parent.infoDialog.hidden();
  54. window.parent.window.showWaittingDialog();
  55. $.ajax({
  56. type: "POST", //使用post方法访问后台
  57. url: "mtTaskCenterMgr.do?task=del&universalid="+universalid + "&taskId="+taskId, //要访问的后台地址
  58. success: function (data) {
  59. window.parent.window.showSuccessDialog();
  60. window.parent.window.grid.loadData();
  61. /* window.parent.window.emptyCalendar();
  62. window.parent.window.loadCalendar("${session.loginID}");; */
  63. window.parent.window.calendar.fullCalendar('refetchEvents');
  64. window.parent.window.closeWaittingDialog();
  65. window.parent.window.infoDialog.close();
  66. }
  67. });
  68. }
  69. }
  70. function checkForm(){
  71. $("#task_isfinished_").val($("#task_isfinished").val());
  72. $("#worktime_msg").empty();
  73. $("#cost_msg").empty();
  74. $("#remark_msg").empty();
  75. /* $("#progress_msg").empty(); */
  76. var rs = $.validate({
  77. name : "worktime",
  78. model : [ {
  79. type : "require",
  80. msg : "工时不能为空!"
  81. },{
  82. type : "isNumber",
  83. msg : "请输入数字!"
  84. } ]
  85. });
  86. /* rs = $.validate({
  87. name : "progress",
  88. model : [ {
  89. type : "require",
  90. msg : "请填写进度!"
  91. },{
  92. type : "isNumber",
  93. msg : "请输入数字!"
  94. } ]
  95. }) && rs; */
  96. rs = $.validate({
  97. name : "logdtaile",
  98. model : [ {
  99. type : "len",
  100. min:0,
  101. max:300,
  102. msg : "详细描述300个字!"
  103. },{
  104. type : "require",
  105. msg : "请填写详细描述!"
  106. } ]
  107. }) && rs;
  108. rs = $.validate({
  109. name : "remark",
  110. model : [ {
  111. type : "len",
  112. min:0,
  113. max:200,
  114. msg : "备注200个字!"
  115. } ]
  116. }) && rs;
  117. rs = $.validate({
  118. name : "cost",
  119. model : [ {
  120. type : "isNumber",
  121. msg : "请输入数字!"
  122. } ]
  123. }) && rs;
  124. if (rs) {
  125. var pattern =/^[0-9]+([.]\d{1,2})?$/;
  126. if(!pattern.test($("#cost").val()) && $("#cost").val().replace(/(^\s*)|(\s*$)/g, "") != ""){
  127. $("#cost_msg").append("<font color='red'>最多保留两位小数</font>");
  128. document.all.cost.focus();
  129. return;
  130. }
  131. if ($("#cost").val().replace(/(^\s*)|(\s*$)/g, "") > 0 &&
  132. $("#remark").val().replace(/(^\s*)|(\s*$)/g, "") == "") {
  133. $("#remark_msg").append("<font color='red'>请填写费用说明!</font>");
  134. document.all.remark.focus();
  135. return false;
  136. }
  137. var temp = 100 - parseInt($("#progress_count").val()) + parseInt($("#progress_").val());
  138. if ($("#worktime").val() > 24){
  139. $("#worktime_msg").append("<font color=\"red\"> 工时不能大于24小时!</font>");
  140. document.all.worktime.focus();
  141. return false;
  142. } else if ($("#worktime").val() < 0.5){
  143. $("#worktime_msg").append("<font color=\"red\"> 工时不能小于0.5小时!</font>");
  144. document.all.worktime.focus();
  145. return false;
  146. }else if ((24 - ($("#today_worktime").val() - $("#worktime_").val())) < $("#worktime").val()){
  147. alert("一天的总工时不能超过24个小时!");
  148. return false;
  149. } else {
  150. var t = 7.5 - ($("#today_worktime").val() - $("#worktime_").val());
  151. if ($("#worktime").val() > t){
  152. if (!confirm("您本日的报工已超过7.5个小时,您确定要提交吗?")){
  153. return false;
  154. }
  155. }
  156. var sfz = document.getElementsByName("task_affix_id_edit");
  157. var sfzEvalue = "";
  158. for(var i=0;i<sfz.length;i++){
  159. if(""!=sfz[i].value){
  160. sfzEvalue=sfzEvalue + sfz[i].value +",";
  161. }
  162. }
  163. $("#log_affix").val(sfzEvalue);
  164. window.parent.infoDialog.hidden();
  165. window.parent.window.showWaittingDialog();
  166. return true;
  167. }
  168. } else {
  169. return false;
  170. }
  171. }
  172. </script>
  173. </head>
  174. <body onload="refresh('${type}', '${userId}');">
  175. <form action="mtTaskCenterMgr.do" method="post" onsubmit="return checkForm();" >
  176. <div id="title" class="form-button">
  177. <input type="submit" id="defineLog" class="l-button" value="确定"/>
  178. <input type="button" id="deleteLog" class="l-button" value="删除" onclick="deleteWorkLog();" />
  179. <input type="hidden" id="today_worktime" name="today_worktime" value="${requestScope.workLog.today_worktime }"/>
  180. <input type="hidden" id="worktime_" name="worktime_" value="${requestScope.workLog.worktime }"/>
  181. <input type="hidden" id="progress_" name="progress_" value="${requestScope.workLog.progress }"/>
  182. <input type="hidden" id="progress_count" name="progress_count" value="${requestScope.workLog.progress_count }"/>
  183. </div>
  184. <div >
  185. <div class="container-layout">
  186. <div class="forum-container">
  187. <center>
  188. <table class="l-table-edit line" >
  189. <tr>
  190. <th colspan="2">修改任务日志</th>
  191. </tr>
  192. <tr height="25" align="left">
  193. <td width="30%" ><b>日期<FONT COLOR="red">*</FONT>:</b></td>
  194. <td align="left" height="30">
  195. ${requestScope.workLog.logdate }
  196. <input type="hidden" id="dateTime" name="dateTime" value="${requestScope.workLog.logdate }">
  197. </td>
  198. </tr>
  199. <tr height="25" align="left">
  200. <td width="30%" ><b>任务名称<FONT COLOR="red">*</FONT>:</b></td>
  201. <td align="left" height="30">
  202. ${requestScope.workLog.tasktitle }&nbsp;&nbsp;
  203. <font color="red">(已完成:${requestScope.workLog.progress_count }%)</font>
  204. <input type="hidden" id="tasktitle" name="tasktitle" value="${requestScope.workLog.tasktitle }">
  205. </td>
  206. </tr>
  207. <tr height="25" align="left">
  208. <td width="30%" ><b>工时<FONT COLOR="red">*</FONT>:</b></td>
  209. <td align="left" height="30">
  210. <input type="text" autocomplete="off" style="width:40px;height:15px;" name="worktime" id="worktime" value="${requestScope.workLog.worktime }">&nbsp;h
  211. &nbsp;<font color="blue">[本日已报工${requestScope.workLog.today_worktime }个小时]</font>
  212. <div id="worktime_msg" style="display: inline;"></div>
  213. </td>
  214. </tr>
  215. <tr height="25" align="left">
  216. <td width="30%" ><b>进度<FONT COLOR="red">*</FONT>:</b></td>
  217. <td align="left" height="30">
  218. <select id="task_isfinished">
  219. <option value="0" selected="selected">进行中</option>
  220. <option value="1">已完成</option>
  221. </select>
  222. </td>
  223. </tr>
  224. <%-- <tr height="25" align="left">
  225. <td width="30%" ><b>进度<FONT COLOR="red">*</FONT>:</b></td>
  226. <td align="left" height="30">
  227. <input type="text" style="width:40px;height:15px;" name="progress" id="progress" value="${requestScope.workLog.progress }">&nbsp;%
  228. <div id="progress_msg" style="display: inline;"></div>
  229. </td>
  230. </tr> --%>
  231. <tr height="25" align="left">
  232. <td width="30%" ><b>详细描述<FONT COLOR="red">*</FONT>:</b></td>
  233. <td align="left" height="30">
  234. <textarea rows="5" cols="50" name="logdtaile" id="logdtaile">${requestScope.workLog.logdtaile }</textarea>
  235. </td>
  236. </tr>
  237. <tr height="25" align="left">
  238. <td width="30%" ><b>费用总计:</b></td>
  239. <td align="left" height="30">
  240. <input type="text" autocomplete="off" style="width:40px;height:15px;" name="cost" id="cost" value="${requestScope.workLog.cost }">&nbsp;元
  241. <div id="cost_msg" style="display: inline;"></div>
  242. </td>
  243. </tr>
  244. <tr height="25" align="left">
  245. <td width="30%" ><b>费用说明:</b></td>
  246. <td align="left" height="30">
  247. <textarea rows="5" cols="50" name="remark" id="remark">${requestScope.workLog.remark }</textarea>
  248. <div id="remark_msg" style="display: inline;"></div>
  249. </td>
  250. </tr>
  251. <tr>
  252. <td width="30%" ><b>附件:</b></td>
  253. <td>
  254. <jsp:include page="/include/file.jsp">
  255. <jsp:param name="fieldName" value="task_affix_id_edit" />
  256. <jsp:param name="folder" value="pm/bug" />
  257. <jsp:param name="documentId" value="${requestScope.workLog.log_affix }" />
  258. <jsp:param name="size" value="15" />
  259. <jsp:param name="isView" value="1" />
  260. <jsp:param name="isDelFile" value="1" />
  261. <jsp:param name="definedCss" value="file-style" />
  262. </jsp:include>
  263. <input type="hidden" id="log_affix" name="log_affix" />
  264. </td>
  265. </tr>
  266. </table>
  267. <input type="hidden" id="task" name="task" value="ceditWorkLog">
  268. <input type="hidden" id="task_isfinished_" name="task_isfinished_">
  269. <input type="hidden" id="taskId" name="taskId" value="${requestScope.workLog.taskid }"> <!-- 任务id -->
  270. <input type="hidden" id="universalid" name="universalid" value="${requestScope.workLog.id }"> <!-- 任务日志id -->
  271. </center>
  272. </div>
  273. </div>
  274. </div>
  275. </form>
  276. <%@ include file="/include/message.jsp"%>
  277. </body>
  278. </html>