leaveApplyBackModifyApply.jsp 21 KB

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