leaveApplyAudit.jsp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/webpage/include/taglib.jsp"%>
  3. <html>
  4. <head>
  5. <title>请假管理</title>
  6. <meta name="decorator" content="default"/>
  7. <script type="text/javascript">
  8. function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
  9. /* var status=${leaveApply.status};
  10. if(status==6){
  11. $("#inputForm").attr("action","${ctx}/leaveapply/leaveApply/saveBackAudit");
  12. }else if(status==2){
  13. $("#inputForm").attr("action","${ctx}/leaveapply/leaveApply/saveAudit");
  14. }else if(status==10){
  15. $("#inputForm").attr("action","${ctx}/leaveapply/leaveApply/saveExtendAudit");
  16. }*/
  17. if(validateForm.form()){
  18. if(obj == 1){
  19. $('#flag').val('yes');
  20. }else{
  21. $('#flag').val('no');
  22. }
  23. $("#inputForm").submit();
  24. return true;
  25. }
  26. return false;
  27. }
  28. var validateForm;
  29. var count = 0;
  30. $(document).ready(function() {
  31. if($("#applyTime").val()==null || $("#applyTime").val()==''){
  32. $("#applyTime").val(getNowFormatDate());
  33. }
  34. $("#attachment_btn").click(function () {
  35. $("#attachment_file").click();
  36. });
  37. validateForm = $("#inputForm").validate({
  38. submitHandler: function(form){
  39. loading('正在提交,请稍等...');
  40. form.submit();
  41. },
  42. rules:{
  43. },
  44. messages:{
  45. },
  46. errorContainer: "#messageBox",
  47. errorPlacement: function(error, element) {
  48. $("#messageBox").text("输入有误,请先更正。");
  49. if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
  50. error.appendTo(element.parent().parent());
  51. } else {
  52. error.insertAfter(element);
  53. }
  54. }
  55. });
  56. });
  57. function insertTitle(tValue){
  58. var list = "${leaveApply.workAttachments}";
  59. var size = (list.split('url')).length-1;
  60. var files = $("#attachment_file")[0].files; for(var i = 0;i<files.length;i++) { var file = files[i];
  61. var attachmentId = "";
  62. var attachmentFlag = "114";
  63. console.log(file);
  64. var timestamp=new Date().getTime();
  65. var storeAs = "attachment-file/leaveApply/"+timestamp+"/"+file['name'];
  66. var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
  67. var divId = "_attachment";
  68. $("#addFile"+divId).show();
  69. multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
  70. }
  71. </script>
  72. <style>
  73. /*超过5个汉字,调整label的长度,以下是配套的*/
  74. .layui-item .layui-form-label{
  75. width:90px;
  76. }
  77. .form-group .layui-item .layui-input-block,
  78. .query .layui-input-block {
  79. margin-left: 116px;
  80. }
  81. </style>
  82. </head>
  83. <body>
  84. <div class="single-form">
  85. <div class="container view-form">
  86. <form:form id="inputForm" modelAttribute="leaveApply" action="${ctx}/leaveapply/leaveApply/saveAudit" method="post" class="form-horizontal" >
  87. <form:hidden path="id"/>
  88. <form:hidden path="basicInfo.id"/>
  89. <form:hidden path="home"/>
  90. <form:hidden path="act.taskId"/>
  91. <form:hidden path="act.taskName"/>
  92. <form:hidden path="act.taskDefKey"/>
  93. <form:hidden path="act.procInsId"/>
  94. <form:hidden path="act.procDefId"/>
  95. <form:hidden id="flag" path="act.flag"/>
  96. <div class="form-group layui-row first">
  97. <div class="form-group-label"><h2>基础信息</h2></div>
  98. <div class="layui-item layui-col-sm6">
  99. <label class="layui-form-label"><span class="require-item">*</span>姓名:</label>
  100. <div class="layui-input-block">
  101. <form:input id="name" path="basicInfo.name" htmlEscape="false" readonly="true" class="form-control layui-input" />
  102. </div>
  103. </div>
  104. <div class="layui-item layui-col-sm6">
  105. <label class="layui-form-label"><span class="require-item">*</span>请假编号:</label>
  106. <div class="layui-input-block">
  107. <div class="input-group">
  108. <form:input id="no" path="no" htmlEscape="false" readonly="true" class="form-control layui-input"/>
  109. <span class="input-group-btn">
  110. <label class="form-status"><c:choose><c:when test="${not empty leaveApply.status}">${fns:getDictLabel(leaveApply.status, 'leave_audit', '')}</c:when><c:otherwise>新增</c:otherwise></c:choose></label>
  111. </span>
  112. </div>
  113. </div>
  114. </div>
  115. <div class="layui-item layui-col-sm6">
  116. <label class="layui-form-label"><span class="require-item">*</span>工号:</label>
  117. <div class="layui-input-block">
  118. <form:input readonly="true" path="basicInfo.no" htmlEscape="false" class="form-control layui-input"/>
  119. </div>
  120. </div>
  121. <div class="layui-item layui-col-sm6">
  122. <label class="layui-form-label"><span class="require-item">*</span>员工状态:</label>
  123. <div class="layui-input-block">
  124. <form:input path="basicInfo.status" htmlEscape="false" readonly="true" class="form-control layui-input"/>
  125. </div>
  126. </div>
  127. <div class="layui-item layui-col-sm6">
  128. <label class="layui-form-label"><span class="require-item">*</span>部门:</label>
  129. <div class="layui-input-block">
  130. <form:input readonly="true" path="basicInfo.office.name" htmlEscape="false" class="form-control layui-input"/>
  131. </div>
  132. </div>
  133. <div class="layui-item layui-col-sm6">
  134. <label class="layui-form-label"><span class="require-item">*</span>职级:</label>
  135. <div class="layui-input-block">
  136. <form:input readonly="true" path="basicInfo.jobGrade.name" htmlEscape="false" class="form-control layui-input"/>
  137. </div>
  138. </div>
  139. <div class="layui-item layui-col-sm6">
  140. <label class="layui-form-label"><span class="require-item">*</span>申请日期:</label>
  141. <div class="layui-input-block">
  142. <input id="applyTime" name="applyTime" readonly="true" type="text" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon"
  143. value="<fmt:formatDate value="${leaveApply.applyTime}" pattern="yyyy-MM-dd"/>"/>
  144. </div>
  145. </div>
  146. <c:choose><c:when test="${leaveApply.status == 6 or leaveApply.status ==7 or leaveApply.status == 9 }">
  147. <div class="layui-item layui-col-sm6 status" >
  148. <label class="layui-form-label"><span class="require-item">*</span>销假日期:</label>
  149. <div class="layui-input-block">
  150. <input id="backTime" name="backTime" readonly="true" type="text" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
  151. value="<fmt:formatDate value="${leaveApply.backTime}" pattern="yyyy-MM-dd"/>"/>
  152. <span class="group-sep">-</span>
  153. <input htmlEscape="false" readonly="true" class="form-control layui-input query-group" value="${fns:getDictLabel(leaveApply.backStartType, 'date_type', '')}"/>
  154. <form:select cssStyle="display: none" path="backStartType" class="form-control simple-select query-group">
  155. <form:options items="${fns:getDictList('date_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
  156. </form:select>
  157. </div>
  158. </div>
  159. <div class="layui-item layui-col-sm6 status">
  160. <label class="layui-form-label"><span class="require-item">*</span>销假对比:</label>
  161. <div class="layui-input-block">
  162. <form:input id="contrast" readonly="true" path="contrast" htmlEscape="false" class="form-control layui-input"/>
  163. </div>
  164. </div>
  165. </c:when>
  166. <c:otherwise>
  167. </c:otherwise>
  168. </c:choose>
  169. <div class="layui-item layui-col-sm12 with-textarea">
  170. <label class="layui-form-label">请假原因:</label>
  171. <div class="layui-input-block">
  172. <form:textarea path="reason" htmlEscape="false" rows="3" readonly="true" maxlength="127" class="form-control "/>
  173. </div>
  174. </div>
  175. </div>
  176. <div class="form-group layui-row">
  177. <div class="form-group-label"><h2>假期详情</h2></div>
  178. <%--<div class="layui-item nav-btns ">
  179. <sys:treeselectlea id="exampleInfo" name="" value="" labelName="" labelValue="" title="假期类型" url="/leaveapply/leaveApply/treeDataTypeInfo" cssClass="form-control "
  180. allowClear="true" notAllowSelectParent="true"/>
  181. </div>--%>
  182. <div class="layui-item layui-col-xs12 form-table-container" >
  183. <table id="contentTable" class="table table-bordered table-condensed can-edit no-bottom-margin">
  184. <thead>
  185. <tr>
  186. <th width="150px">假期名称</th>
  187. <th width="150px">计假模式</th>
  188. <th width="150px" colspan="2" >开始时间</th>
  189. <th width="150px" colspan="2">结束时间</th>
  190. <th width="100px">请假天数</th>
  191. </tr>
  192. </thead>
  193. <tbody id="leaveDetailList">
  194. <c:if test="${not empty leaveApply.leaveDetailList}">
  195. <c:forEach items="${leaveApply.leaveDetailList}" var="leaveDetail" varStatus="index">
  196. <tr id="leaveDetailList${index.index}">
  197. <td class="hide">
  198. <input id="leaveDetailList${index.index}_id" name="leaveDetailList[${index.index}].id" type="hidden" value="${leaveDetail.id}"/>
  199. <input id="leaveDetailList${index.index}_leaveType" name="leaveDetailList[${index.index}].leaveType.id" type="hidden" value="${leaveDetail.leaveType.id}"/>
  200. <input id="leaveDetailList${index.index}_delFlag" name="leaveDetailList[${index.index}].delFlag" type="hidden" value="0"/>
  201. <input id="leaveDetailList${index.index}_flag" name="leaveDetailList[${index.index}].flag" type="hidden" value="${leaveDetail.flat}"/>
  202. </td>
  203. <td>
  204. <input id="leaveDetailList${index.index}_1" readonly="true" type="text" value="${leaveDetail.leaveType.name}" class="form-control "/>
  205. </td>
  206. <td>
  207. <input id="leaveDetailList${index.index}_2" readonly="true" type="text" value="${fns:getDictLabel(leaveDetail.leaveType.model, 'fake_model', '')}" class="form-control "/>
  208. </td>
  209. <td>
  210. <input idx="${index.index}" style="width: 150px" readonly="true" id="leaveDetailList${index.index}_3" name="leaveDetailList[${index.index}].startTime" type="text" maxlength="20" class=" form-control layui-input "
  211. value="<fmt:formatDate value="${leaveDetail.startTime}" pattern="yyyy-MM-dd"/>"/>
  212. </input>
  213. </td>
  214. <td>
  215. <input id="leaveDetailList${index.index}_4" style="width: 150px" readonly="true" type="text" value="${fns:getDictLabel(leaveDetail.startType, 'date_type', '')}" class="form-control "/>
  216. </td>
  217. <td>
  218. <input idx="${index.index}" style="width: 150px" readonly="true" id="leaveDetailList${index.index}_5" name="leaveDetailList[${index.index}].endTime"type="text" maxlength="20" class=" form-control layui-input "
  219. value="<fmt:formatDate value="${leaveDetail.endTime}" pattern="yyyy-MM-dd"/>"/>
  220. </input>
  221. </td>
  222. <td>
  223. <input id="leaveDetailList${index.index}_6" style="width: 150px" readonly="true" type="text" value="${fns:getDictLabel(leaveDetail.endType, 'date_type', '')}" class="form-control "/>
  224. </td>
  225. <td>
  226. <input id="leaveDetailList${index.index}_7" onchange="getMoney(this.value)" name="leaveDetailList[${index.index}].days" type="text" value="${leaveDetail.days}" readonly="true" class="form-control number "/>
  227. </td>
  228. </tr>
  229. </c:forEach>
  230. </c:if>
  231. </tbody>
  232. </table>
  233. <table id="contentMoneys" class="table table-bordered table-condensed can-edit summary">
  234. <tr>
  235. <td style="vertical-align:middle;width:300px;text-align: center;"><label><font color="red">*</font>请假时长:</label></td>
  236. <td >
  237. <input htmlEscape="false" id="longTime" name="longTime" value="${leaveApply.longTime}" readonly="true" class="form-control layui-input" />
  238. </td>
  239. </tr>
  240. </table>
  241. </div>
  242. </div>
  243. <div class="form-group layui-row">
  244. <div class="form-group-label"><h2>历史详情</h2></div>
  245. <div class="layui-item layui-col-xs12 form-table-container" >
  246. <table id="hisContentTable" class="table table-bordered table-condensed can-edit no-bottom-margin">
  247. <thead>
  248. <tr>
  249. <th width="200px">假期名称</th>
  250. <th width="200px">累计天数</th>
  251. <th width="200px">累计次数</th>
  252. <th width="200px">上限天数</th>
  253. </tr>
  254. </thead>
  255. <tbody id="hisLeaveDetailList">
  256. <c:if test="${not empty leaveApply.hisLeaveDetailList}">
  257. <c:forEach items="${leaveApply.hisLeaveDetailList}" var="leaveDetail" varStatus="index">
  258. <tr id="hisLeaveDetailList${index.index}">
  259. <td>
  260. <input id="hisLeaveDetailList${index.index}_1" readonly="true" type="text" value="${leaveDetail.name}" class="form-control "/>
  261. </td>
  262. <td>
  263. <input id="hisLeaveDetailList${index.index}_2" readonly="true" type="text" value="${leaveDetail.sumDays}" class="form-control "/>
  264. </td>
  265. <td>
  266. <input id="hisLeaveDetailList${index.index}_3" readonly="true" type="text" value="${leaveDetail.counts}" class="form-control require"/>
  267. </td>
  268. <td>
  269. <input id="hisLeaveDetailList${index.index}_4" readonly="true" type="text" value="${leaveDetail.days}" class="form-control require"/>
  270. </td>
  271. </tr>
  272. </c:forEach>
  273. </c:if>
  274. </tbody>
  275. </table>
  276. </div>
  277. </div>
  278. <div class="form-group layui-row">
  279. <div class="form-group-label"><h2>附件信息</h2></div>
  280. <div id="addFile_attachment" style="display: none" class="upload-progress">
  281. <span id="fileName_attachment" ></span>
  282. <b><span id="baifenbi_attachment" ></span></b>
  283. <div class="progress">
  284. <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
  285. </div>
  286. </div>
  287. </div>
  288. <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
  289. <span id="attachment_title"></span>
  290. <div class="layui-item layui-col-xs12" style="padding:0 16px;">
  291. <table id="upTable" class="table table-bordered table-condensed details">
  292. <thead>
  293. <tr>
  294. <%-- <th>序号</th>--%>
  295. <th>文件预览</th>
  296. <th>上传人</th>
  297. <th>上传时间</th>
  298. <th width="150px">操作</th>
  299. </tr>
  300. </thead>
  301. <tbody id="file_attachment">
  302. <c:forEach items="${leaveApply.workAttachments}" var = "workClientAttachment" varStatus="status">
  303. <tr>
  304. <%-- <td>${status.index + 1}</td>--%>
  305. <c:choose>
  306. <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
  307. or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
  308. or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
  309. or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
  310. or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
  311. <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
  312. </c:when>
  313. <c:otherwise>
  314. <c:choose>
  315. <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
  316. <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
  317. </c:when>
  318. <c:otherwise>
  319. <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
  320. </c:otherwise>
  321. </c:choose>
  322. </c:otherwise>
  323. </c:choose>
  324. <td>${workClientAttachment.createBy.name}</td>
  325. <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
  326. <td class="op-td">
  327. <div class="op-btn-box" >
  328. <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
  329. </div>
  330. </td>
  331. </tr>
  332. </c:forEach>
  333. </tbody>
  334. </table>
  335. </div>
  336. </div>
  337. <div class="form-group layui-row">
  338. <div class="form-group-label"><h2>审批意见</h2></div>
  339. <div class="layui-item layui-col-xs12 with-textarea" >
  340. <label class="layui-form-label">审批意见:</label>
  341. <div class="layui-input-block">
  342. <form:textarea path="act.comment" class="form-control" rows="4" maxlength="127" />
  343. </div>
  344. </div>
  345. </div>
  346. <div class="form-group layui-row">
  347. <div class="form-group-label"><h2>审批流程</h2></div>
  348. <div class="layui-item layui-col-xs12 form-table-container" >
  349. <act:flowChart procInsId="${leaveApply.act.procInsId}"/>
  350. <act:histoicFlow procInsId="${leaveApply.act.procInsId}"/>
  351. </div>
  352. </div>
  353. <div class="form-group layui-row page-end"></div>
  354. </form:form>
  355. </div>
  356. </div>
  357. </body>
  358. </html>